Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. ; ModuleID = 'pow.cc'
  2. source_filename = "pow.cc"
  3. target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
  4. target triple = "x86_64-pc-windows-msvc18.0.21005"
  5.  
  6. ; Function Attrs: noinline nounwind uwtable
  7. define i32 @"\01?pow@@YAJJI@Z"(i32 %x, i32 %n) #0 {
  8. entry:
  9. %n.addr = alloca i32, align 4
  10. %x.addr = alloca i32, align 4
  11. %a = alloca i32, align 4
  12. %p = alloca i32, align 4
  13. store i32 %n, i32* %n.addr, align 4
  14. store i32 %x, i32* %x.addr, align 4
  15. %0 = load i32, i32* %x.addr, align 4
  16. store i32 %0, i32* %a, align 4
  17. store i32 1, i32* %p, align 4
  18. br label %while.cond
  19.  
  20. while.cond: ; preds = %if.end, %entry
  21. %1 = load i32, i32* %n.addr, align 4
  22. %cmp = icmp ugt i32 %1, 0
  23. br i1 %cmp, label %while.body, label %while.end
  24.  
  25. while.body: ; preds = %while.cond
  26. %2 = load i32, i32* %n.addr, align 4
  27. %and = and i32 %2, 1
  28. %cmp1 = icmp ne i32 %and, 0
  29. br i1 %cmp1, label %if.then, label %if.end
  30.  
  31. if.then: ; preds = %while.body
  32. %3 = load i32, i32* %a, align 4
  33. %4 = load i32, i32* %p, align 4
  34. %mul = mul nsw i32 %4, %3
  35. store i32 %mul, i32* %p, align 4
  36. br label %if.end
  37.  
  38. if.end: ; preds = %if.then, %while.body
  39. %5 = load i32, i32* %a, align 4
  40. %6 = load i32, i32* %a, align 4
  41. %mul2 = mul nsw i32 %6, %5
  42. store i32 %mul2, i32* %a, align 4
  43. %7 = load i32, i32* %n.addr, align 4
  44. %shr = lshr i32 %7, 1
  45. store i32 %shr, i32* %n.addr, align 4
  46. br label %while.cond
  47.  
  48. while.end: ; preds = %while.cond
  49. %8 = load i32, i32* %p, align 4
  50. ret i32 %8
  51. }
  52.  
  53. ; Function Attrs: noinline norecurse nounwind uwtable
  54. define i32 @main() #1 {
  55. entry:
  56. %retval = alloca i32, align 4
  57. store i32 0, i32* %retval, align 4
  58. %call = call i32 @"\01?pow@@YAJJI@Z"(i32 2, i32 3)
  59. %call1 = call i32 @"\01?pow@@YAJJI@Z"(i32 2, i32 5)
  60. %call2 = call i32 @"\01?pow@@YAJJI@Z"(i32 2, i32 10)
  61. ret i32 0
  62. }
  63.  
  64. attributes #0 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  65. attributes #1 = { noinline norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  66.  
  67. !llvm.module.flags = !{!0}
  68. !llvm.ident = !{!1}
  69.  
  70. !0 = !{i32 1, !"PIC Level", i32 2}
  71. !1 = !{!"clang version 4.0.0 (tags/RELEASE_400/final)"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement