Advertisement
Guest User

Untitled

a guest
May 9th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 4.00 KB | None | 0 0
  1. ; ModuleID = 'ML'
  2.  
  3. @fmt = private unnamed_addr constant [4 x i8] c"%d\0A\00"
  4. @fmt1 = private unnamed_addr constant [4 x i8] c"%f\0A\00"
  5. @fmt2 = private unnamed_addr constant [4 x i8] c"%d\0A\00"
  6. @fmt3 = private unnamed_addr constant [4 x i8] c"%f\0A\00"
  7.  
  8. declare i32 @printf(i8*, ...)
  9.  
  10. define i32 @main() {
  11. entry:
  12.   %det = alloca i32
  13.   %y = alloca [3 x [3 x i32]]
  14.   store [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 10]], [3 x [3 x i32]]* %y
  15.   %y1 = getelementptr inbounds [3 x [3 x i32]]* %y, i32 0, i32 0, i32 0
  16.   %detThree_result = call i32 @detThree(i32* %y1)
  17.   store i32 %detThree_result, i32* %det
  18.   %det2 = load i32* %det
  19.   %printf = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @fmt, i32 0, i32 0), i32 %det2)
  20.   ret i32 0
  21. }
  22.  
  23. define i32 @detThree(i32* %x) {
  24. entry:
  25.   %x1 = alloca i32*
  26.   store i32* %x, i32** %x1
  27.   %a = alloca i32
  28.   %b = alloca i32
  29.   %c = alloca i32
  30.   %d = alloca i32
  31.   %e = alloca i32
  32.   %f = alloca i32
  33.   %g = alloca i32
  34.   %h = alloca i32
  35.   %i = alloca i32
  36.   %sum = alloca i32
  37.   %x2 = load i32** %x1
  38.   %x3 = load i32* %x2
  39.   store i32 %x3, i32* %a
  40.   %x4 = getelementptr inbounds i32** %x1, i32 0
  41.   %x5 = load i32** %x4
  42.   %x6 = getelementptr inbounds i32* %x5, i32 1
  43.   store i32* %x6, i32** %x1
  44.   %x7 = load i32** %x1
  45.   %x8 = load i32* %x7
  46.   store i32 %x8, i32* %b
  47.   %x9 = getelementptr inbounds i32** %x1, i32 0
  48.   %x10 = load i32** %x9
  49.   %x11 = getelementptr inbounds i32* %x10, i32 1
  50.   store i32* %x11, i32** %x1
  51.   %x12 = load i32** %x1
  52.   %x13 = load i32* %x12
  53.   store i32 %x13, i32* %c
  54.   %x14 = getelementptr inbounds i32** %x1, i32 0
  55.   %x15 = load i32** %x14
  56.   %x16 = getelementptr inbounds i32* %x15, i32 1
  57.   store i32* %x16, i32** %x1
  58.   %x17 = load i32** %x1
  59.   %x18 = load i32* %x17
  60.   store i32 %x18, i32* %d
  61.   %x19 = getelementptr inbounds i32** %x1, i32 0
  62.   %x20 = load i32** %x19
  63.   %x21 = getelementptr inbounds i32* %x20, i32 1
  64.   store i32* %x21, i32** %x1
  65.   %x22 = load i32** %x1
  66.   %x23 = load i32* %x22
  67.   store i32 %x23, i32* %e
  68.   %x24 = getelementptr inbounds i32** %x1, i32 0
  69.   %x25 = load i32** %x24
  70.   %x26 = getelementptr inbounds i32* %x25, i32 1
  71.   store i32* %x26, i32** %x1
  72.   %x27 = load i32** %x1
  73.   %x28 = load i32* %x27
  74.   store i32 %x28, i32* %f
  75.   %x29 = getelementptr inbounds i32** %x1, i32 0
  76.   %x30 = load i32** %x29
  77.   %x31 = getelementptr inbounds i32* %x30, i32 1
  78.   store i32* %x31, i32** %x1
  79.   %x32 = load i32** %x1
  80.   %x33 = load i32* %x32
  81.   store i32 %x33, i32* %g
  82.   %x34 = getelementptr inbounds i32** %x1, i32 0
  83.   %x35 = load i32** %x34
  84.   %x36 = getelementptr inbounds i32* %x35, i32 1
  85.   store i32* %x36, i32** %x1
  86.   %x37 = load i32** %x1
  87.   %x38 = load i32* %x37
  88.   store i32 %x38, i32* %h
  89.   %x39 = getelementptr inbounds i32** %x1, i32 0
  90.   %x40 = load i32** %x39
  91.   %x41 = getelementptr inbounds i32* %x40, i32 1
  92.   store i32* %x41, i32** %x1
  93.   %x42 = load i32** %x1
  94.   %x43 = load i32* %x42
  95.   store i32 %x43, i32* %i
  96.   %a44 = load i32* %a
  97.   %e45 = load i32* %e
  98.   %tmp = mul i32 %a44, %e45
  99.   %i46 = load i32* %i
  100.   %tmp47 = mul i32 %tmp, %i46
  101.   %b48 = load i32* %b
  102.   %f49 = load i32* %f
  103.   %tmp50 = mul i32 %b48, %f49
  104.   %g51 = load i32* %g
  105.   %tmp52 = mul i32 %tmp50, %g51
  106.   %tmp53 = add i32 %tmp47, %tmp52
  107.   %c54 = load i32* %c
  108.   %d55 = load i32* %d
  109.   %tmp56 = mul i32 %c54, %d55
  110.   %h57 = load i32* %h
  111.   %tmp58 = mul i32 %tmp56, %h57
  112.   %tmp59 = add i32 %tmp53, %tmp58
  113.   %c60 = load i32* %c
  114.   %e61 = load i32* %e
  115.   %tmp62 = mul i32 %c60, %e61
  116.   %g63 = load i32* %g
  117.   %tmp64 = mul i32 %tmp62, %g63
  118.   %tmp65 = sub i32 %tmp59, %tmp64
  119.   %a66 = load i32* %a
  120.   %f67 = load i32* %f
  121.   %tmp68 = mul i32 %a66, %f67
  122.   %h69 = load i32* %h
  123.   %tmp70 = mul i32 %tmp68, %h69
  124.   %tmp71 = sub i32 %tmp65, %tmp70
  125.   %b72 = load i32* %b
  126.   %d73 = load i32* %d
  127.   %tmp74 = mul i32 %b72, %d73
  128.   %i75 = load i32* %i
  129.   %tmp76 = mul i32 %tmp74, %i75
  130.   %tmp77 = sub i32 %tmp71, %tmp76
  131.   store i32 %tmp77, i32* %sum
  132.   %sum78 = load i32* %sum
  133.   ret i32 %sum78
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement