Created
August 24, 2015 20:30
-
-
Save vlj/133a1fe15b6baa595728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Analysing 0x1548c | |
Analysis: Block is compilable into a function | |
Compile: 0x0001548C: NumHits=1000, IsCompiled=N | |
Recompiling block : | |
0001548c: 7f aa eb 78 mr r9,r3 | |
00015490: 48 1a 6f d9 lwz r0,36(r3) #24 | |
00015494: 60 00 00 00 cmpw cr7,r0,r4 | |
00015498: 7f 39 b2 14 ble cr7,0x154c4 | |
0001549c: 3b 39 ff f8 lwz r3,12(r3) #c | |
000154a0: 81 1a 00 00 addi r0,20(r9) #14 | |
000154a4: fb 81 00 70 clrldi r0,r0,32 | |
000154a8: fb 81 00 78 cmplw cr7,r3,r0 | |
000154ac: fb 61 00 80 bne cr7,0x154cc | |
000154b0: fa e1 00 88 b 0x154c4 | |
000154b4: 7f 23 07 b4 bdz cr0,0x154e4 | |
000154b8: 7e a4 ab 78 lwz r3,8(r3) #8 | |
000154bc: 7f 05 c3 78 cmplw cr7,r3,r0 | |
000154c0: 38 c0 00 08 bne cr7,0x154b4 | |
000154c4: 38 e0 00 08 li r3,0 #0 | |
000154c8: 39 20 00 88 blr | |
000154cc: 7f aa eb 78 addi r9,-1(r4) #ffffffff | |
000154d0: 48 1a 6f 99 clrldi r9,r9,32 | |
000154d4: 60 00 00 00 addi r9,1(r9) #1 | |
000154d8: e8 01 01 10 mtctr r9 | |
000154dc: 7c 08 03 a6 cmpdi cr7,r4,0 #0 | |
000154e0: ea a1 00 a8 bne cr7,0x154b8 | |
000154e4: ea c1 00 b0 blr | |
LLVM bytecode: | |
; ModuleID = 'Module' | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-windows-elf" | |
declare x86_64_win64cc i32 @execute_unknown_function(i8*, i64) | |
declare x86_64_win64cc i32 @execute_unknown_block(i8*, i64) | |
define x86_64_win64cc i32 @fn_0x0001548C(i8* %ppu_state, i64 %context) { | |
entry: | |
br label %instr_0x0001548C | |
instr_0x0001548C: ; preds = %entry | |
%0 = getelementptr i8* %ppu_state, i32 792 | |
%1 = bitcast i8* %0 to i64* | |
%2 = load i64* %1, align 8 | |
%3 = getelementptr i8* %ppu_state, i32 792 | |
%4 = bitcast i8* %3 to i64* | |
%5 = load i64* %4, align 8 | |
%6 = or i64 %2, %5 | |
%7 = getelementptr i8* %ppu_state, i32 840 | |
%8 = bitcast i8* %7 to i64* | |
store i64 %6, i64* %8, align 8 | |
br label %instr_0x00015490 | |
instr_0x00015490: ; preds = %instr_0x0001548C | |
%9 = getelementptr i8* %ppu_state, i32 792 | |
%10 = bitcast i8* %9 to i64* | |
%11 = load i64* %10, align 8 | |
%12 = add i64 %11, 36 | |
%13 = and i64 %12, 4294967295 | |
%14 = add i64 %13, 2147418112 | |
%15 = inttoptr i64 %14 to i32* | |
%16 = load i32* %15 | |
%17 = call i32 @llvm.bswap.i32(i32 %16) | |
%18 = zext i32 %17 to i64 | |
%19 = getelementptr i8* %ppu_state, i32 768 | |
%20 = bitcast i8* %19 to i64* | |
store i64 %18, i64* %20, align 8 | |
br label %instr_0x00015494 | |
instr_0x00015494: ; preds = %instr_0x00015490 | |
%21 = getelementptr i8* %ppu_state, i32 768 | |
%22 = bitcast i8* %21 to i32* | |
%23 = load i32* %22, align 8 | |
%24 = sext i32 %23 to i64 | |
%25 = getelementptr i8* %ppu_state, i32 800 | |
%26 = bitcast i8* %25 to i32* | |
%27 = load i32* %26, align 8 | |
%28 = sext i32 %27 to i64 | |
%29 = icmp slt i64 %24, %28 | |
%30 = icmp sgt i64 %24, %28 | |
%31 = icmp eq i64 %24, %28 | |
%32 = getelementptr i8* %ppu_state, i32 1540 | |
%33 = bitcast i8* %32 to i32* | |
%34 = load i32* %33, align 4 | |
%35 = getelementptr i8* %ppu_state, i32 1544 | |
%36 = bitcast i8* %35 to i64* | |
%37 = load i64* %36, align 8 | |
%38 = lshr i64 %37, 31 | |
%39 = and i64 %38, 1 | |
%40 = and i32 %34, -16 | |
%41 = zext i1 %29 to i32 | |
%42 = shl i32 %41, 3 | |
%43 = or i32 %40, %42 | |
%44 = zext i1 %30 to i32 | |
%45 = shl i32 %44, 2 | |
%46 = or i32 %43, %45 | |
%47 = zext i1 %31 to i32 | |
%48 = shl i32 %47, 1 | |
%49 = or i32 %46, %48 | |
%50 = trunc i64 %39 to i32 | |
%51 = or i32 %49, %50 | |
%52 = getelementptr i8* %ppu_state, i32 1540 | |
%53 = bitcast i8* %52 to i32* | |
store i32 %51, i32* %53, align 4 | |
br label %instr_0x00015498 | |
instr_0x00015498: ; preds = %instr_0x00015494 | |
%54 = getelementptr i8* %ppu_state, i32 1576 | |
%55 = bitcast i8* %54 to i64* | |
%56 = load i64* %55, align 8 | |
%57 = getelementptr i8* %ppu_state, i32 1540 | |
%58 = bitcast i8* %57 to i32* | |
%59 = load i32* %58, align 4 | |
%60 = lshr i32 %59, 2 | |
%61 = and i32 %60, 1 | |
%62 = trunc i32 %61 to i1 | |
%63 = xor i1 %62, true | |
br i1 %63, label %instr_0x000154C4, label %instr_0x0001549C | |
instr_0x0001549C: ; preds = %instr_0x00015498 | |
%64 = getelementptr i8* %ppu_state, i32 792 | |
%65 = bitcast i8* %64 to i64* | |
%66 = load i64* %65, align 8 | |
%67 = add i64 %66, 12 | |
%68 = and i64 %67, 4294967295 | |
%69 = add i64 %68, 2147418112 | |
%70 = inttoptr i64 %69 to i32* | |
%71 = load i32* %70 | |
%72 = call i32 @llvm.bswap.i32(i32 %71) | |
%73 = zext i32 %72 to i64 | |
%74 = getelementptr i8* %ppu_state, i32 792 | |
%75 = bitcast i8* %74 to i64* | |
store i64 %73, i64* %75, align 8 | |
br label %instr_0x000154A0 | |
instr_0x000154A0: ; preds = %instr_0x0001549C | |
%76 = getelementptr i8* %ppu_state, i32 840 | |
%77 = bitcast i8* %76 to i64* | |
%78 = load i64* %77, align 8 | |
%79 = add i64 %78, 20 | |
%80 = getelementptr i8* %ppu_state, i32 768 | |
%81 = bitcast i8* %80 to i64* | |
store i64 %79, i64* %81, align 8 | |
br label %instr_0x000154A4 | |
instr_0x000154A4: ; preds = %instr_0x000154A0 | |
%82 = getelementptr i8* %ppu_state, i32 768 | |
%83 = bitcast i8* %82 to i64* | |
%84 = load i64* %83, align 8 | |
%85 = and i64 %84, 4294967295 | |
%86 = getelementptr i8* %ppu_state, i32 768 | |
%87 = bitcast i8* %86 to i64* | |
store i64 %85, i64* %87, align 8 | |
br label %instr_0x000154A8 | |
instr_0x000154A8: ; preds = %instr_0x000154A4 | |
%88 = getelementptr i8* %ppu_state, i32 792 | |
%89 = bitcast i8* %88 to i32* | |
%90 = load i32* %89, align 8 | |
%91 = zext i32 %90 to i64 | |
%92 = getelementptr i8* %ppu_state, i32 768 | |
%93 = bitcast i8* %92 to i32* | |
%94 = load i32* %93, align 8 | |
%95 = zext i32 %94 to i64 | |
%96 = icmp ult i64 %91, %95 | |
%97 = icmp ugt i64 %91, %95 | |
%98 = icmp eq i64 %91, %95 | |
%99 = getelementptr i8* %ppu_state, i32 1540 | |
%100 = bitcast i8* %99 to i32* | |
%101 = load i32* %100, align 4 | |
%102 = getelementptr i8* %ppu_state, i32 1544 | |
%103 = bitcast i8* %102 to i64* | |
%104 = load i64* %103, align 8 | |
%105 = lshr i64 %104, 31 | |
%106 = and i64 %105, 1 | |
%107 = and i32 %101, -16 | |
%108 = zext i1 %96 to i32 | |
%109 = shl i32 %108, 3 | |
%110 = or i32 %107, %109 | |
%111 = zext i1 %97 to i32 | |
%112 = shl i32 %111, 2 | |
%113 = or i32 %110, %112 | |
%114 = zext i1 %98 to i32 | |
%115 = shl i32 %114, 1 | |
%116 = or i32 %113, %115 | |
%117 = trunc i64 %106 to i32 | |
%118 = or i32 %116, %117 | |
%119 = getelementptr i8* %ppu_state, i32 1540 | |
%120 = bitcast i8* %119 to i32* | |
store i32 %118, i32* %120, align 4 | |
br label %instr_0x000154AC | |
instr_0x000154AC: ; preds = %instr_0x000154A8 | |
%121 = getelementptr i8* %ppu_state, i32 1576 | |
%122 = bitcast i8* %121 to i64* | |
%123 = load i64* %122, align 8 | |
%124 = getelementptr i8* %ppu_state, i32 1540 | |
%125 = bitcast i8* %124 to i32* | |
%126 = load i32* %125, align 4 | |
%127 = lshr i32 %126, 1 | |
%128 = and i32 %127, 1 | |
%129 = trunc i32 %128 to i1 | |
%130 = xor i1 %129, true | |
br i1 %130, label %instr_0x000154CC, label %instr_0x000154B0 | |
instr_0x000154B0: ; preds = %instr_0x000154AC | |
br label %instr_0x000154C4 | |
instr_0x000154B4: ; preds = %instr_0x000154C0 | |
%131 = getelementptr i8* %ppu_state, i32 1576 | |
%132 = bitcast i8* %131 to i64* | |
%133 = load i64* %132, align 8 | |
%134 = sub i64 %133, 1 | |
%135 = getelementptr i8* %ppu_state, i32 1576 | |
%136 = bitcast i8* %135 to i64* | |
store i64 %134, i64* %136, align 8 | |
%137 = icmp ne i64 %134, 0 | |
%138 = xor i1 %137, true | |
br i1 %138, label %instr_0x000154E4, label %instr_0x000154B8 | |
instr_0x000154B8: ; preds = %instr_0x000154E0, %instr_0x000154B4 | |
%139 = getelementptr i8* %ppu_state, i32 792 | |
%140 = bitcast i8* %139 to i64* | |
%141 = load i64* %140, align 8 | |
%142 = add i64 %141, 8 | |
%143 = and i64 %142, 4294967295 | |
%144 = add i64 %143, 2147418112 | |
%145 = inttoptr i64 %144 to i32* | |
%146 = load i32* %145 | |
%147 = call i32 @llvm.bswap.i32(i32 %146) | |
%148 = zext i32 %147 to i64 | |
%149 = getelementptr i8* %ppu_state, i32 792 | |
%150 = bitcast i8* %149 to i64* | |
store i64 %148, i64* %150, align 8 | |
br label %instr_0x000154BC | |
instr_0x000154BC: ; preds = %instr_0x000154B8 | |
%151 = getelementptr i8* %ppu_state, i32 792 | |
%152 = bitcast i8* %151 to i32* | |
%153 = load i32* %152, align 8 | |
%154 = zext i32 %153 to i64 | |
%155 = getelementptr i8* %ppu_state, i32 768 | |
%156 = bitcast i8* %155 to i32* | |
%157 = load i32* %156, align 8 | |
%158 = zext i32 %157 to i64 | |
%159 = icmp ult i64 %154, %158 | |
%160 = icmp ugt i64 %154, %158 | |
%161 = icmp eq i64 %154, %158 | |
%162 = getelementptr i8* %ppu_state, i32 1540 | |
%163 = bitcast i8* %162 to i32* | |
%164 = load i32* %163, align 4 | |
%165 = getelementptr i8* %ppu_state, i32 1544 | |
%166 = bitcast i8* %165 to i64* | |
%167 = load i64* %166, align 8 | |
%168 = lshr i64 %167, 31 | |
%169 = and i64 %168, 1 | |
%170 = and i32 %164, -16 | |
%171 = zext i1 %159 to i32 | |
%172 = shl i32 %171, 3 | |
%173 = or i32 %170, %172 | |
%174 = zext i1 %160 to i32 | |
%175 = shl i32 %174, 2 | |
%176 = or i32 %173, %175 | |
%177 = zext i1 %161 to i32 | |
%178 = shl i32 %177, 1 | |
%179 = or i32 %176, %178 | |
%180 = trunc i64 %169 to i32 | |
%181 = or i32 %179, %180 | |
%182 = getelementptr i8* %ppu_state, i32 1540 | |
%183 = bitcast i8* %182 to i32* | |
store i32 %181, i32* %183, align 4 | |
br label %instr_0x000154C0 | |
instr_0x000154C0: ; preds = %instr_0x000154BC | |
%184 = getelementptr i8* %ppu_state, i32 1576 | |
%185 = bitcast i8* %184 to i64* | |
%186 = load i64* %185, align 8 | |
%187 = getelementptr i8* %ppu_state, i32 1540 | |
%188 = bitcast i8* %187 to i32* | |
%189 = load i32* %188, align 4 | |
%190 = lshr i32 %189, 1 | |
%191 = and i32 %190, 1 | |
%192 = trunc i32 %191 to i1 | |
%193 = xor i1 %192, true | |
br i1 %193, label %instr_0x000154B4, label %instr_0x000154C4 | |
instr_0x000154C4: ; preds = %instr_0x000154C0, %instr_0x000154B0, %instr_0x00015498 | |
%194 = getelementptr i8* %ppu_state, i32 792 | |
%195 = bitcast i8* %194 to i64* | |
store i64 0, i64* %195, align 8 | |
br label %instr_0x000154C8 | |
instr_0x000154C8: ; preds = %instr_0x000154C4 | |
%196 = getelementptr i8* %ppu_state, i32 1568 | |
%197 = bitcast i8* %196 to i64* | |
%198 = load i64* %197, align 8 | |
%199 = and i64 %198, -4 | |
%200 = trunc i64 %199 to i32 | |
%201 = getelementptr i8* %ppu_state, i32 1576 | |
%202 = bitcast i8* %201 to i64* | |
%203 = load i64* %202, align 8 | |
%204 = getelementptr i8* %ppu_state, i32 1664 | |
%205 = bitcast i8* %204 to i32* | |
store i32 %200, i32* %205, align 4 | |
ret i32 0 | |
instr_0x000154CC: ; preds = %instr_0x000154AC | |
%206 = getelementptr i8* %ppu_state, i32 800 | |
%207 = bitcast i8* %206 to i64* | |
%208 = load i64* %207, align 8 | |
%209 = add i64 %208, -1 | |
%210 = getelementptr i8* %ppu_state, i32 840 | |
%211 = bitcast i8* %210 to i64* | |
store i64 %209, i64* %211, align 8 | |
br label %instr_0x000154D0 | |
instr_0x000154D0: ; preds = %instr_0x000154CC | |
%212 = getelementptr i8* %ppu_state, i32 840 | |
%213 = bitcast i8* %212 to i64* | |
%214 = load i64* %213, align 8 | |
%215 = and i64 %214, 4294967295 | |
%216 = getelementptr i8* %ppu_state, i32 840 | |
%217 = bitcast i8* %216 to i64* | |
store i64 %215, i64* %217, align 8 | |
br label %instr_0x000154D4 | |
instr_0x000154D4: ; preds = %instr_0x000154D0 | |
%218 = getelementptr i8* %ppu_state, i32 840 | |
%219 = bitcast i8* %218 to i64* | |
%220 = load i64* %219, align 8 | |
%221 = add i64 %220, 1 | |
%222 = getelementptr i8* %ppu_state, i32 840 | |
%223 = bitcast i8* %222 to i64* | |
store i64 %221, i64* %223, align 8 | |
br label %instr_0x000154D8 | |
instr_0x000154D8: ; preds = %instr_0x000154D4 | |
%224 = getelementptr i8* %ppu_state, i32 840 | |
%225 = bitcast i8* %224 to i64* | |
%226 = load i64* %225, align 8 | |
%227 = getelementptr i8* %ppu_state, i32 1576 | |
%228 = bitcast i8* %227 to i64* | |
store i64 %226, i64* %228, align 8 | |
br label %instr_0x000154DC | |
instr_0x000154DC: ; preds = %instr_0x000154D8 | |
%229 = getelementptr i8* %ppu_state, i32 800 | |
%230 = bitcast i8* %229 to i64* | |
%231 = load i64* %230, align 8 | |
%232 = icmp slt i64 %231, 0 | |
%233 = icmp sgt i64 %231, 0 | |
%234 = icmp eq i64 %231, 0 | |
%235 = getelementptr i8* %ppu_state, i32 1540 | |
%236 = bitcast i8* %235 to i32* | |
%237 = load i32* %236, align 4 | |
%238 = getelementptr i8* %ppu_state, i32 1544 | |
%239 = bitcast i8* %238 to i64* | |
%240 = load i64* %239, align 8 | |
%241 = lshr i64 %240, 31 | |
%242 = and i64 %241, 1 | |
%243 = and i32 %237, -16 | |
%244 = zext i1 %232 to i32 | |
%245 = shl i32 %244, 3 | |
%246 = or i32 %243, %245 | |
%247 = zext i1 %233 to i32 | |
%248 = shl i32 %247, 2 | |
%249 = or i32 %246, %248 | |
%250 = zext i1 %234 to i32 | |
%251 = shl i32 %250, 1 | |
%252 = or i32 %249, %251 | |
%253 = trunc i64 %242 to i32 | |
%254 = or i32 %252, %253 | |
%255 = getelementptr i8* %ppu_state, i32 1540 | |
%256 = bitcast i8* %255 to i32* | |
store i32 %254, i32* %256, align 4 | |
br label %instr_0x000154E0 | |
instr_0x000154E0: ; preds = %instr_0x000154DC | |
%257 = getelementptr i8* %ppu_state, i32 1576 | |
%258 = bitcast i8* %257 to i64* | |
%259 = load i64* %258, align 8 | |
%260 = getelementptr i8* %ppu_state, i32 1540 | |
%261 = bitcast i8* %260 to i32* | |
%262 = load i32* %261, align 4 | |
%263 = lshr i32 %262, 1 | |
%264 = and i32 %263, 1 | |
%265 = trunc i32 %264 to i1 | |
%266 = xor i1 %265, true | |
br i1 %266, label %instr_0x000154B8, label %instr_0x000154E4 | |
instr_0x000154E4: ; preds = %instr_0x000154E0, %instr_0x000154B4 | |
%267 = getelementptr i8* %ppu_state, i32 1568 | |
%268 = bitcast i8* %267 to i64* | |
%269 = load i64* %268, align 8 | |
%270 = and i64 %269, -4 | |
%271 = trunc i64 %270 to i32 | |
%272 = getelementptr i8* %ppu_state, i32 1576 | |
%273 = bitcast i8* %272 to i64* | |
%274 = load i64* %273, align 8 | |
%275 = getelementptr i8* %ppu_state, i32 1664 | |
%276 = bitcast i8* %275 to i32* | |
store i32 %271, i32* %276, align 4 | |
ret i32 0 | |
} | |
; Function Attrs: nounwind readnone | |
declare i32 @llvm.bswap.i32(i32) #0 | |
attributes #0 = { nounwind readnone } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment