Skip to content

Instantly share code, notes, and snippets.

@huonw

huonw/c.ll Secret

Created September 25, 2013 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huonw/348081acb4a42bc0adbb to your computer and use it in GitHub Desktop.
Save huonw/348081acb4a42bc0adbb to your computer and use it in GitHub Desktop.
; ModuleID = 'no_std.c'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Vec = type { float, float, float }
@G = global [9 x i32] [i32 301252, i32 336932, i32 402628, i32 468255, i32 304324, i32 458756, i32 0, i32 0, i32 0], align 16
@main.buf = private unnamed_addr constant [16 x i8] c"P6 512 512 255 \00", align 16
; Function Attrs: nounwind readnone uwtable
define { <2 x float>, float } @V(float %x, float %y, float %z) #0 {
%1 = insertelement <2 x float> undef, float %x, i32 0
%2 = insertelement <2 x float> %1, float %y, i32 1
%3 = insertvalue { <2 x float>, float } undef, <2 x float> %2, 0
%4 = insertvalue { <2 x float>, float } %3, float %z, 1
ret { <2 x float>, float } %4
}
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #1
; Function Attrs: nounwind readnone uwtable
define { <2 x float>, float } @add(<2 x float> %v.coerce0, float %v.coerce1, <2 x float> %w.coerce0, float %w.coerce1) #0 {
%1 = extractelement <2 x float> %v.coerce0, i32 0
%2 = extractelement <2 x float> %w.coerce0, i32 0
%3 = fadd float %1, %2
%4 = extractelement <2 x float> %v.coerce0, i32 1
%5 = extractelement <2 x float> %w.coerce0, i32 1
%6 = fadd float %4, %5
%7 = fadd float %v.coerce1, %w.coerce1
%8 = insertelement <2 x float> undef, float %3, i32 0
%9 = insertelement <2 x float> %8, float %6, i32 1
%10 = insertvalue { <2 x float>, float } undef, <2 x float> %9, 0
%11 = insertvalue { <2 x float>, float } %10, float %7, 1
ret { <2 x float>, float } %11
}
; Function Attrs: nounwind readnone uwtable
define { <2 x float>, float } @mul(<2 x float> %v.coerce0, float %v.coerce1, float %scale) #0 {
%1 = extractelement <2 x float> %v.coerce0, i32 0
%2 = fmul float %1, %scale
%3 = extractelement <2 x float> %v.coerce0, i32 1
%4 = fmul float %3, %scale
%5 = fmul float %v.coerce1, %scale
%6 = insertelement <2 x float> undef, float %2, i32 0
%7 = insertelement <2 x float> %6, float %4, i32 1
%8 = insertvalue { <2 x float>, float } undef, <2 x float> %7, 0
%9 = insertvalue { <2 x float>, float } %8, float %5, 1
ret { <2 x float>, float } %9
}
; Function Attrs: nounwind readnone uwtable
define float @dot(<2 x float> %v.coerce0, float %v.coerce1, <2 x float> %w.coerce0, float %w.coerce1) #0 {
%1 = extractelement <2 x float> %v.coerce0, i32 0
%2 = extractelement <2 x float> %w.coerce0, i32 0
%3 = fmul float %1, %2
%4 = extractelement <2 x float> %v.coerce0, i32 1
%5 = extractelement <2 x float> %w.coerce0, i32 1
%6 = fmul float %4, %5
%7 = fadd float %3, %6
%8 = fmul float %v.coerce1, %w.coerce1
%9 = fadd float %8, %7
ret float %9
}
; Function Attrs: nounwind readnone uwtable
define { <2 x float>, float } @cross(<2 x float> %v.coerce0, float %v.coerce1, <2 x float> %w.coerce0, float %w.coerce1) #0 {
%1 = extractelement <2 x float> %v.coerce0, i32 1
%2 = fmul float %1, %w.coerce1
%3 = extractelement <2 x float> %w.coerce0, i32 1
%4 = fmul float %3, %v.coerce1
%5 = fsub float %2, %4
%6 = extractelement <2 x float> %w.coerce0, i32 0
%7 = fmul float %6, %v.coerce1
%8 = extractelement <2 x float> %v.coerce0, i32 0
%9 = fmul float %8, %w.coerce1
%10 = fsub float %7, %9
%11 = fmul float %8, %3
%12 = fmul float %1, %6
%13 = fsub float %11, %12
%14 = insertelement <2 x float> undef, float %5, i32 0
%15 = insertelement <2 x float> %14, float %10, i32 1
%16 = insertvalue { <2 x float>, float } undef, <2 x float> %15, 0
%17 = insertvalue { <2 x float>, float } %16, float %13, 1
ret { <2 x float>, float } %17
}
; Function Attrs: nounwind uwtable
define { <2 x float>, float } @normalise(<2 x float> %v.coerce0, float %v.coerce1) #2 {
%1 = extractelement <2 x float> %v.coerce0, i32 0
%2 = fmul float %1, %1
%3 = extractelement <2 x float> %v.coerce0, i32 1
%4 = fmul float %3, %3
%5 = fadd float %2, %4
%6 = fmul float %v.coerce1, %v.coerce1
%7 = fadd float %6, %5
%8 = tail call float @sqrtf(float %7) #1
%9 = fdiv float 1.000000e+00, %8
%10 = fmul float %1, %9
%11 = fmul float %3, %9
%12 = fmul float %9, %v.coerce1
%13 = insertelement <2 x float> undef, float %10, i32 0
%14 = insertelement <2 x float> %13, float %11, i32 1
%15 = insertvalue { <2 x float>, float } undef, <2 x float> %14, 0
%16 = insertvalue { <2 x float>, float } %15, float %12, 1
ret { <2 x float>, float } %16
}
; Function Attrs: nounwind
declare float @sqrtf(float) #3
; Function Attrs: nounwind uwtable
define void @print(i8* nocapture %vec, i32 %len) #2 {
%1 = sext i32 %len to i64
%2 = tail call i64 @write(i32 1, i8* %vec, i64 %1) #1
ret void
}
declare i64 @write(i32, i8* nocapture, i64) #4
; Function Attrs: nounwind uwtable
define float @R() #2 {
%1 = tail call i32 @rand() #1
%2 = sitofp i32 %1 to float
%3 = fmul float %2, 0x3E00000000000000
ret float %3
}
; Function Attrs: nounwind
declare i32 @rand() #3
; Function Attrs: nounwind uwtable
define i32 @T(<2 x float> %o.coerce0, float %o.coerce1, <2 x float> %d.coerce0, float %d.coerce1, float* nocapture %t, %struct.Vec* nocapture %n) #2 {
store float 1.000000e+09, float* %t, align 4, !tbaa !0
%1 = fsub float -0.000000e+00, %o.coerce1
%2 = fdiv float %1, %d.coerce1
%3 = fpext float %2 to double
%4 = fcmp ogt double %3, 1.000000e-02
br i1 %4, label %5, label %..preheader70_crit_edge
..preheader70_crit_edge: ; preds = %0
%.pre = bitcast %struct.Vec* %n to <2 x float>*
%.pre86 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 2
br label %.preheader70
; <label>:5 ; preds = %0
store float %2, float* %t, align 4, !tbaa !0
%6 = bitcast %struct.Vec* %n to <2 x float>*
store <2 x float> zeroinitializer, <2 x float>* %6, align 4
%7 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 2
store float 1.000000e+00, float* %7, align 4
br label %.preheader70
.preheader70: ; preds = %..preheader70_crit_edge, %5
%.pre-phi87 = phi float* [ %.pre86, %..preheader70_crit_edge ], [ %7, %5 ]
%.pre-phi = phi <2 x float>* [ %.pre, %..preheader70_crit_edge ], [ %6, %5 ]
%m.1.ph = phi i32 [ 0, %..preheader70_crit_edge ], [ 1, %5 ]
%8 = extractelement <2 x float> %o.coerce0, i32 0
%9 = extractelement <2 x float> %o.coerce0, i32 1
%10 = fadd float %9, 3.000000e+00
%11 = extractelement <2 x float> %d.coerce0, i32 0
%12 = extractelement <2 x float> %d.coerce0, i32 1
%13 = fmul float %10, %12
%14 = fmul float %10, %10
br label %.preheader
.loopexit: ; preds = %27
%15 = add nsw i32 %17, -1
%16 = icmp eq i32 %17, 0
br i1 %16, label %78, label %.preheader
.preheader: ; preds = %.preheader70, %.loopexit
%17 = phi i32 [ 18, %.preheader70 ], [ %15, %.loopexit ]
%m.180 = phi i32 [ %m.1.ph, %.preheader70 ], [ %m.2.ph, %.loopexit ]
%k.078 = phi i32 [ 19, %.preheader70 ], [ %17, %.loopexit ]
%18 = shl i32 1, %17
%19 = sub i32 1, %k.078
%20 = sitofp i32 %19 to float
%21 = fadd float %8, %20
%22 = fmul float %11, %21
%23 = fadd float %13, %22
%24 = fmul float %21, %21
%25 = fadd float %14, %24
br label %.outer
.outer: ; preds = %.preheader, %59
%j.0.ph = phi i32 [ %28, %59 ], [ 9, %.preheader ]
%m.2.ph = phi i32 [ 2, %59 ], [ %m.180, %.preheader ]
br label %.outer46
.outer46: ; preds = %36, %50, %56, %.outer
%j.0.ph52 = phi i32 [ %j.0.ph, %.outer ], [ %28, %56 ], [ %28, %50 ], [ %28, %36 ]
%26 = sext i32 %j.0.ph52 to i64
br label %27
; <label>:27 ; preds = %.outer46, %31
%indvars.iv = phi i64 [ %26, %.outer46 ], [ %indvars.iv.next, %31 ]
%j.0 = phi i32 [ %j.0.ph52, %.outer46 ], [ %28, %31 ]
%indvars.iv.next = add i64 %indvars.iv, -1
%28 = add nsw i32 %j.0, -1
%29 = trunc i64 %indvars.iv to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %.loopexit, label %31
; <label>:31 ; preds = %27
%32 = getelementptr inbounds [9 x i32]* @G, i64 0, i64 %indvars.iv.next
%33 = load i32* %32, align 4, !tbaa !3
%34 = and i32 %33, %18
%35 = icmp eq i32 %34, 0
br i1 %35, label %27, label %36
; <label>:36 ; preds = %31
%37 = sub i32 1, %j.0
%38 = sitofp i32 %37 to double
%39 = fadd double %38, -4.000000e+00
%40 = fptrunc double %39 to float
%41 = fadd float %40, %o.coerce1
%42 = fmul float %41, %d.coerce1
%43 = fadd float %23, %42
%44 = fmul float %41, %41
%45 = fadd float %25, %44
%46 = fadd float %45, -1.000000e+00
%47 = fmul float %43, %43
%48 = fsub float %47, %46
%49 = fcmp ogt float %48, 0.000000e+00
br i1 %49, label %50, label %.outer46
; <label>:50 ; preds = %36
%51 = fsub float -0.000000e+00, %43
%52 = tail call float @sqrtf(float %48) #1
%53 = fsub float %51, %52
%54 = fpext float %53 to double
%55 = fcmp ogt double %54, 1.000000e-02
br i1 %55, label %56, label %.outer46
; <label>:56 ; preds = %50
%57 = load float* %t, align 4, !tbaa !0
%58 = fcmp olt float %53, %57
br i1 %58, label %59, label %.outer46
; <label>:59 ; preds = %56
store float %53, float* %t, align 4, !tbaa !0
%60 = fmul float %11, %53
%61 = fmul float %12, %53
%62 = fmul float %53, %d.coerce1
%63 = fadd float %21, %60
%64 = fadd float %10, %61
%65 = fadd float %41, %62
%66 = fmul float %63, %63
%67 = fmul float %64, %64
%68 = fadd float %66, %67
%69 = fmul float %65, %65
%70 = fadd float %69, %68
%71 = tail call float @sqrtf(float %70) #1
%72 = fdiv float 1.000000e+00, %71
%73 = fmul float %63, %72
%74 = fmul float %64, %72
%75 = fmul float %65, %72
%76 = insertelement <2 x float> undef, float %73, i32 0
%77 = insertelement <2 x float> %76, float %74, i32 1
store <2 x float> %77, <2 x float>* %.pre-phi, align 4
store float %75, float* %.pre-phi87, align 4
br label %.outer
; <label>:78 ; preds = %.loopexit
ret i32 %m.2.ph
}
; Function Attrs: nounwind uwtable
define { <2 x float>, float } @S(<2 x float> %o.coerce0, float %o.coerce1, <2 x float> %d.coerce0, float %d.coerce1) #2 {
%t = alloca float, align 4
%n = alloca %struct.Vec, align 8
%1 = bitcast %struct.Vec* %n to <2 x float>*
store <2 x float> zeroinitializer, <2 x float>* %1, align 8
%2 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 2
store float 0.000000e+00, float* %2, align 8
%3 = call i32 @T(<2 x float> %o.coerce0, float %o.coerce1, <2 x float> %d.coerce0, float %d.coerce1, float* %t, %struct.Vec* %n)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
; <label>:5 ; preds = %0
%6 = fsub float 1.000000e+00, %d.coerce1
%7 = call float @powf(float %6, float 4.000000e+00) #1
%8 = fmul float %7, 0x3FE6666660000000
%9 = fmul float %7, 0x3FE3333340000000
%10 = insertelement <2 x float> undef, float %8, i32 0
%11 = insertelement <2 x float> %10, float %9, i32 1
br label %127
; <label>:12 ; preds = %0
%13 = load float* %t, align 4, !tbaa !0
%14 = extractelement <2 x float> %d.coerce0, i32 0
%15 = fmul float %14, %13
%16 = extractelement <2 x float> %d.coerce0, i32 1
%17 = fmul float %16, %13
%18 = fmul float %13, %d.coerce1
%19 = extractelement <2 x float> %o.coerce0, i32 0
%20 = fadd float %19, %15
%21 = extractelement <2 x float> %o.coerce0, i32 1
%22 = fadd float %21, %17
%23 = fadd float %18, %o.coerce1
%24 = insertelement <2 x float> undef, float %20, i32 0
%25 = insertelement <2 x float> %24, float %22, i32 1
%26 = call i32 @rand() #1
%27 = sitofp i32 %26 to float
%28 = fmul float %27, 0x3E00000000000000
%29 = fadd float %28, 9.000000e+00
%30 = call i32 @rand() #1
%31 = sitofp i32 %30 to float
%32 = fmul float %31, 0x3E00000000000000
%33 = fadd float %32, 9.000000e+00
%34 = fmul float %20, -1.000000e+00
%35 = fmul float %22, -1.000000e+00
%36 = fmul float %23, -1.000000e+00
%37 = fadd float %34, %29
%38 = fadd float %35, %33
%39 = fadd float %36, 1.600000e+01
%40 = fmul float %37, %37
%41 = fmul float %38, %38
%42 = fadd float %40, %41
%43 = fmul float %39, %39
%44 = fadd float %43, %42
%45 = call float @sqrtf(float %44) #1
%46 = fdiv float 1.000000e+00, %45
%47 = fmul float %46, %37
%48 = fmul float %46, %38
%49 = fmul float %46, %39
%50 = load <2 x float>* %1, align 8
%51 = load float* %2, align 8
%52 = extractelement <2 x float> %50, i32 0
%53 = fmul float %14, %52
%54 = extractelement <2 x float> %50, i32 1
%55 = fmul float %16, %54
%56 = fadd float %53, %55
%57 = fmul float %51, %d.coerce1
%58 = fadd float %57, %56
%59 = fmul float %58, -2.000000e+00
%60 = fmul float %52, %59
%61 = fmul float %54, %59
%62 = fmul float %51, %59
%63 = fadd float %14, %60
%64 = fadd float %16, %61
%65 = fadd float %62, %d.coerce1
%66 = insertelement <2 x float> undef, float %63, i32 0
%67 = insertelement <2 x float> %66, float %64, i32 1
%68 = fmul float %47, %52
%69 = fmul float %54, %48
%70 = fadd float %68, %69
%71 = fmul float %49, %51
%72 = fadd float %71, %70
%73 = fcmp olt float %72, 0.000000e+00
br i1 %73, label %79, label %74
; <label>:74 ; preds = %12
%75 = insertelement <2 x float> undef, float %47, i32 0
%76 = insertelement <2 x float> %75, float %48, i32 1
%77 = call i32 @T(<2 x float> %25, float %23, <2 x float> %76, float %49, float* %t, %struct.Vec* %n)
%78 = icmp eq i32 %77, 0
br i1 %78, label %80, label %79
; <label>:79 ; preds = %74, %12
br label %80
; <label>:80 ; preds = %74, %79
%b.0 = phi float [ 0.000000e+00, %79 ], [ %72, %74 ]
%81 = fmul float %47, %63
%82 = fmul float %48, %64
%83 = fadd float %81, %82
%84 = fmul float %49, %65
%85 = fadd float %84, %83
%86 = fcmp ogt float %b.0, 0.000000e+00
%87 = zext i1 %86 to i32
%88 = sitofp i32 %87 to float
%89 = fmul float %85, %88
%90 = call float @powf(float %89, float 9.900000e+01) #1
%91 = icmp eq i32 %3, 1
br i1 %91, label %92, label %113
; <label>:92 ; preds = %80
%93 = fpext float %b.0 to double
%94 = fmul float %20, 0x3FC99999A0000000
%95 = fmul float %22, 0x3FC99999A0000000
%ceilf = call float @ceilf(float %94) #5
%96 = fpext float %ceilf to double
%ceilf121 = call float @ceilf(float %95) #5
%97 = fpext float %ceilf121 to double
%98 = fadd double %96, %97
%99 = fptosi double %98 to i32
%100 = and i32 %99, 1
%101 = icmp eq i32 %100, 0
%. = select i1 %101, { <2 x float>, float } { <2 x float> <float 3.000000e+00, float 3.000000e+00>, float 3.000000e+00 }, { <2 x float>, float } { <2 x float> <float 3.000000e+00, float 1.000000e+00>, float 1.000000e+00 }
%.122 = select i1 %101, <2 x float> <float 3.000000e+00, float 3.000000e+00>, <2 x float> <float 3.000000e+00, float 1.000000e+00>
%102 = extractvalue { <2 x float>, float } %., 1
%103 = fmul double %93, 2.000000e-01
%104 = fadd double %103, 1.000000e-01
%105 = fptrunc double %104 to float
%106 = extractelement <2 x float> %.122, i32 0
%107 = fmul float %105, %106
%108 = extractelement <2 x float> %.122, i32 1
%109 = fmul float %105, %108
%110 = fmul float %105, %102
%111 = insertelement <2 x float> undef, float %107, i32 0
%112 = insertelement <2 x float> %111, float %109, i32 1
br label %127
; <label>:113 ; preds = %80
%114 = call { <2 x float>, float } @S(<2 x float> %25, float %23, <2 x float> %67, float %65)
%115 = extractvalue { <2 x float>, float } %114, 0
%116 = extractvalue { <2 x float>, float } %114, 1
%117 = extractelement <2 x float> %115, i32 0
%118 = fmul float %117, 5.000000e-01
%119 = extractelement <2 x float> %115, i32 1
%120 = fmul float %119, 5.000000e-01
%121 = fmul float %116, 5.000000e-01
%122 = fadd float %90, %118
%123 = fadd float %90, %120
%124 = fadd float %90, %121
%125 = insertelement <2 x float> undef, float %122, i32 0
%126 = insertelement <2 x float> %125, float %123, i32 1
br label %127
; <label>:127 ; preds = %113, %92, %5
%.sroa.0119.0 = phi <2 x float> [ %11, %5 ], [ %112, %92 ], [ %126, %113 ]
%.sroa.1120.0 = phi float [ %7, %5 ], [ %110, %92 ], [ %124, %113 ]
%128 = insertvalue { <2 x float>, float } undef, <2 x float> %.sroa.0119.0, 0
%129 = insertvalue { <2 x float>, float } %128, float %.sroa.1120.0, 1
ret { <2 x float>, float } %129
}
; Function Attrs: nounwind
declare float @powf(float, float) #3
; Function Attrs: nounwind uwtable
define i32 @main() #2 {
%buf = alloca [16 x i8], align 16
%buf1 = alloca [3 x i8], align 1
%1 = getelementptr inbounds [16 x i8]* %buf, i64 0, i64 0
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([16 x i8]* @main.buf, i64 0, i64 0), i64 16, i32 16, i1 false)
%2 = call i64 @write(i32 1, i8* %1, i64 16) #1
%3 = getelementptr inbounds [3 x i8]* %buf1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8]* %buf1, i64 0, i64 1
%5 = getelementptr inbounds [3 x i8]* %buf1, i64 0, i64 2
br label %.preheader176
.loopexit: ; preds = %98
%6 = add nsw i32 %8, -1
%7 = icmp eq i32 %8, 0
br i1 %7, label %105, label %.preheader176
.preheader176: ; preds = %0, %.loopexit
%8 = phi i32 [ 511, %0 ], [ %6, %.loopexit ]
%9 = sitofp i32 %8 to float
br label %.preheader
.preheader: ; preds = %.preheader176, %98
%10 = phi i32 [ 511, %.preheader176 ], [ %103, %98 ]
%11 = sitofp i32 %10 to float
br label %12
; <label>:12 ; preds = %.preheader, %12
%13 = phi float [ 1.300000e+01, %.preheader ], [ %94, %12 ]
%p.sroa.0.2175 = phi <2 x float> [ <float 1.300000e+01, float 1.300000e+01>, %.preheader ], [ %96, %12 ]
%r.0174 = phi i32 [ 64, %.preheader ], [ %14, %12 ]
%14 = add nsw i32 %r.0174, -1
%15 = call i32 @rand() #1
%16 = sitofp i32 %15 to float
%17 = fmul float %16, 0x3E00000000000000
%18 = fpext float %17 to double
%19 = fadd double %18, -5.000000e-01
%20 = fmul double %19, 9.900000e+01
%21 = fptrunc double %20 to float
%22 = fmul float %21, 0x3F5EFCFE80000000
%23 = fmul float %21, 0xBF454DEF00000000
%24 = fmul float %21, 0.000000e+00
%25 = call i32 @rand() #1
%26 = sitofp i32 %25 to float
%27 = fmul float %26, 0x3E00000000000000
%28 = fpext float %27 to double
%29 = fadd double %28, -5.000000e-01
%30 = fmul double %29, 9.900000e+01
%31 = fptrunc double %30 to float
%32 = fmul float %31, 0.000000e+00
%33 = fmul float %31, 0x3F60624DE0000000
%34 = fadd float %22, %32
%35 = fadd float %23, %32
%36 = fadd float %24, %33
%37 = fmul float %34, -1.000000e+00
%38 = fmul float %35, -1.000000e+00
%39 = fmul float %36, -1.000000e+00
%40 = call i32 @rand() #1
%41 = sitofp i32 %40 to float
%42 = fmul float %41, 0x3E00000000000000
%43 = fadd float %11, %42
%44 = fmul float %43, 0x3F5EFCFE80000000
%45 = fmul float %43, 0xBF454DEF00000000
%46 = fmul float %43, 0.000000e+00
%47 = call i32 @rand() #1
%48 = sitofp i32 %47 to float
%49 = fmul float %48, 0x3E00000000000000
%50 = fadd float %9, %49
%51 = fmul float %50, 0.000000e+00
%52 = fmul float %50, 0x3F60624DE0000000
%53 = fadd float %51, 0xBFE9E58D00000000
%54 = fadd float %51, 0xBFE8EF94C0000000
%55 = fadd float %52, 0xBFE0624DE0000000
%56 = fadd float %44, %53
%57 = fadd float %45, %54
%58 = fadd float %46, %55
%59 = fmul float %56, 1.600000e+01
%60 = fmul float %57, 1.600000e+01
%61 = fmul float %58, 1.600000e+01
%62 = fadd float %37, %59
%63 = fadd float %38, %60
%64 = fadd float %39, %61
%65 = fmul float %62, %62
%66 = fmul float %63, %63
%67 = fadd float %65, %66
%68 = fmul float %64, %64
%69 = fadd float %68, %67
%70 = call float @sqrtf(float %69) #1
%71 = fdiv float 1.000000e+00, %70
%72 = fmul float %71, %62
%73 = fmul float %71, %63
%74 = fmul float %71, %64
%75 = insertelement <2 x float> undef, float %72, i32 0
%76 = insertelement <2 x float> %75, float %73, i32 1
%77 = fadd float %34, 1.700000e+01
%78 = fadd float %35, 1.600000e+01
%79 = fadd float %36, 8.000000e+00
%80 = insertelement <2 x float> undef, float %77, i32 0
%81 = insertelement <2 x float> %80, float %78, i32 1
%82 = call { <2 x float>, float } @S(<2 x float> %81, float %79, <2 x float> %76, float %74)
%83 = extractvalue { <2 x float>, float } %82, 0
%84 = extractvalue { <2 x float>, float } %82, 1
%85 = extractelement <2 x float> %83, i32 0
%86 = fmul float %85, 3.500000e+00
%87 = extractelement <2 x float> %83, i32 1
%88 = fmul float %87, 3.500000e+00
%89 = fmul float %84, 3.500000e+00
%90 = extractelement <2 x float> %p.sroa.0.2175, i32 0
%91 = fadd float %90, %86
%92 = extractelement <2 x float> %p.sroa.0.2175, i32 1
%93 = fadd float %92, %88
%94 = fadd float %13, %89
%95 = insertelement <2 x float> undef, float %91, i32 0
%96 = insertelement <2 x float> %95, float %93, i32 1
%97 = icmp eq i32 %14, 0
br i1 %97, label %98, label %12
; <label>:98 ; preds = %12
%99 = fptosi float %93 to i8
store i8 %99, i8* %3, align 1, !tbaa !1
%100 = fptosi float %94 to i8
store i8 %100, i8* %4, align 1, !tbaa !1
%101 = fptosi float %91 to i8
store i8 %101, i8* %5, align 1, !tbaa !1
%102 = call i64 @write(i32 1, i8* %3, i64 3) #1
%103 = add nsw i32 %10, -1
%104 = icmp eq i32 %10, 0
br i1 %104, label %.loopexit, label %.preheader
; <label>:105 ; preds = %.loopexit
ret i32 0
}
declare float @ceilf(float)
attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind }
attributes #2 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #5 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"float", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
!3 = metadata !{metadata !"int", metadata !1}
; ModuleID = 'no_std.rc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.Vec = type { float, float, float }
%tydesc = type { i64, i64, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, i64, { i8*, i64 } }
@_rust_crate_map_toplevel = global { i32, i8*, i64, [1 x i64] } { i32 1, i8* null, i64 ptrtoint ([1 x { i64, i64 }]* @_rust_mod_map to i64), [1 x i64] zeroinitializer }
@const = private constant [9 x i32] [i32 301252, i32 336932, i32 402628, i32 468255, i32 304324, i32 458756, i32 0, i32 0, i32 0]
@_ZN1G18hc31daf886cce669aB4v0.0E = constant { i32*, i64 } { i32* getelementptr inbounds ([9 x i32]* @const, i32 0, i32 0), i64 36 }
@_rust_mod_map = internal global [1 x { i64, i64 }] zeroinitializer
@rust_abi_version = constant i64 1
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0
; Function Attrs: nounwind readonly
declare float @llvm.pow.f32(float, float) #1
; Function Attrs: nounwind readonly
declare float @llvm.sqrt.f32(float) #1
; Function Attrs: nounwind readonly
declare float @llvm.ceil.f32(float) #1
; Function Attrs: nounwind uwtable
define void @V(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, float, float, float) #2 {
"function top level":
%5 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %2, float* %5, align 4
%6 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %3, float* %6, align 4
%7 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %4, float* %7, align 4
ret void
}
; Function Attrs: nounwind uwtable
define void @add(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly) #2 {
"function top level":
%4 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%5 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 0
%6 = load float* %4, align 4
%7 = load float* %5, align 4
%8 = fadd float %6, %7
%9 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%10 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 1
%11 = load float* %9, align 4
%12 = load float* %10, align 4
%13 = fadd float %11, %12
%14 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%15 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
%16 = load float* %14, align 4
%17 = load float* %15, align 4
%18 = fadd float %16, %17
%19 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %8, float* %19, align 4
%20 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %13, float* %20, align 4
%21 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %18, float* %21, align 4
ret void
}
; Function Attrs: nounwind uwtable
define void @mul(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, float) #2 {
"function top level":
%4 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%5 = load float* %4, align 4
%6 = fmul float %5, %3
%7 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%8 = load float* %7, align 4
%9 = fmul float %8, %3
%10 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%11 = load float* %10, align 4
%12 = fmul float %11, %3
%13 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %6, float* %13, align 4
%14 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %9, float* %14, align 4
%15 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %12, float* %15, align 4
ret void
}
; Function Attrs: nounwind readonly uwtable
define float @dot({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly) #3 {
"function top level":
%3 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 0
%4 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%5 = load float* %3, align 4
%6 = load float* %4, align 4
%7 = fmul float %5, %6
%8 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 1
%9 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%10 = load float* %8, align 4
%11 = load float* %9, align 4
%12 = fmul float %10, %11
%13 = fadd float %7, %12
%14 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 2
%15 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%16 = load float* %14, align 4
%17 = load float* %15, align 4
%18 = fmul float %16, %17
%19 = fadd float %13, %18
ret float %19
}
; Function Attrs: nounwind uwtable
define void @cross(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly) #2 {
"function top level":
%4 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%5 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
%6 = load float* %4, align 4
%7 = load float* %5, align 4
%8 = fmul float %6, %7
%9 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%10 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 1
%11 = load float* %9, align 4
%12 = load float* %10, align 4
%13 = fmul float %11, %12
%14 = fsub float %8, %13
%15 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 0
%16 = load float* %15, align 4
%17 = fmul float %11, %16
%18 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%19 = load float* %18, align 4
%20 = fmul float %7, %19
%21 = fsub float %17, %20
%22 = fmul float %12, %19
%23 = fmul float %6, %16
%24 = fsub float %22, %23
%25 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %14, float* %25, align 4
%26 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %21, float* %26, align 4
%27 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %24, float* %27, align 4
ret void
}
; Function Attrs: nounwind uwtable
define void @normalise(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly) #2 {
"function top level":
%__self.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%__self.sroa.0.0.copyload = load float* %__self.sroa.0.0.idx, align 4
%__self.sroa.2.0.idx8 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%__self.sroa.2.0.copyload = load float* %__self.sroa.2.0.idx8, align 4
%__self.sroa.3.0.idx9 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%__self.sroa.3.0.copyload = load float* %__self.sroa.3.0.idx9, align 4
%3 = fmul float %__self.sroa.0.0.copyload, %__self.sroa.0.0.copyload
%4 = fmul float %__self.sroa.2.0.copyload, %__self.sroa.2.0.copyload
%5 = fadd float %3, %4
%6 = fmul float %__self.sroa.3.0.copyload, %__self.sroa.3.0.copyload
%7 = fadd float %5, %6
%8 = tail call float @llvm.sqrt.f32(float %7) #0
%9 = fdiv float 1.000000e+00, %8
%10 = fmul float %__self.sroa.0.0.copyload, %9
%11 = fmul float %__self.sroa.2.0.copyload, %9
%12 = fmul float %__self.sroa.3.0.copyload, %9
%13 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %10, float* %13, align 4
%14 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %11, float* %14, align 4
%15 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %12, float* %15, align 4
ret void
}
; Function Attrs: uwtable
define void @print({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, { i8*, i64 }* nocapture readonly) #4 {
"function top level":
%__self.sroa.0.0.idx = getelementptr inbounds { i8*, i64 }* %1, i64 0, i32 0
%__self.sroa.0.0.copyload = load i8** %__self.sroa.0.0.idx, align 8
%__self.sroa.2.0.idx4 = getelementptr inbounds { i8*, i64 }* %1, i64 0, i32 1
%__self.sroa.2.0.copyload = load i64* %__self.sroa.2.0.idx4, align 8
%2 = tail call i64 @write(i32 1, i8* %__self.sroa.0.0.copyload, i64 %__self.sroa.2.0.copyload)
ret void
}
declare i64 @write(i32, i8* nocapture readonly, i64)
; Function Attrs: alwaysinline nounwind uwtable
define i32 @_ZN5index18hb7ba435a1abb48cam4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, { i32*, i64 }* nocapture readonly, i64) #5 {
"function top level":
%__self.sroa.0.0.idx = getelementptr inbounds { i32*, i64 }* %1, i64 0, i32 0
%__self.sroa.0.0.copyload = load i32** %__self.sroa.0.0.idx, align 8
%3 = getelementptr inbounds i32* %__self.sroa.0.0.copyload, i64 %2
%4 = load i32* %3, align 4
ret i32 %4
}
; Function Attrs: uwtable
define float @R({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #4 {
"function top level":
%1 = tail call i32 @rand()
%2 = sitofp i32 %1 to float
%3 = fmul float %2, 0x3E00000000000000
ret float %3
}
declare i32 @rand()
; Function Attrs: nounwind uwtable
define i32 @T({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly, float* nocapture, %struct.Vec* nocapture) #2 {
"function top level":
store float 1.000000e+09, float* %3, align 4
%5 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 2
%6 = load float* %5, align 4
%7 = fsub float -0.000000e+00, %6
%8 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%9 = load float* %8, align 4
%10 = fdiv float %7, %9
%11 = fcmp ogt float %10, 0x3F847AE140000000
br i1 %11, label %then, label %"function top level.while loop cond.preheader_crit_edge"
"function top level.while loop cond.preheader_crit_edge": ; preds = %"function top level"
%.sroa.049.0.idx.pre = getelementptr inbounds %struct.Vec* %4, i64 0, i32 0
%.sroa.250.0.idx51.pre = getelementptr inbounds %struct.Vec* %4, i64 0, i32 1
%.sroa.3.0.idx52.pre = getelementptr inbounds %struct.Vec* %4, i64 0, i32 2
br label %"while loop cond.preheader"
then: ; preds = %"function top level"
store float %10, float* %3, align 4
%.sroa.075.0.idx = getelementptr inbounds %struct.Vec* %4, i64 0, i32 0
store float 0.000000e+00, float* %.sroa.075.0.idx, align 4
%.sroa.276.0.idx77 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 1
store float 0.000000e+00, float* %.sroa.276.0.idx77, align 4
%.sroa.378.0.idx79 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 2
store float 1.000000e+00, float* %.sroa.378.0.idx79, align 4
br label %"while loop cond.preheader"
"while loop cond.preheader": ; preds = %"function top level.while loop cond.preheader_crit_edge", %then
%.sroa.3.0.idx52.pre-phi = phi float* [ %.sroa.3.0.idx52.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.378.0.idx79, %then ]
%.sroa.250.0.idx51.pre-phi = phi float* [ %.sroa.250.0.idx51.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.276.0.idx77, %then ]
%.sroa.049.0.idx.pre-phi = phi float* [ %.sroa.049.0.idx.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.075.0.idx, %then ]
%m.1.ph = phi i32 [ 0, %"function top level.while loop cond.preheader_crit_edge" ], [ 1, %then ]
%__self8.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %1, i64 0, i32 0
%__self8.sroa.2.0.idx64 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 1
%__self10.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%__self10.sroa.2.0.idx57 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
br label %"while loop cond4.preheader"
"while next": ; preds = %"while next2"
ret i32 %m.3
"while loop cond4.preheader": ; preds = %"while loop cond.preheader", %"while next2"
%m.183 = phi i32 [ %m.1.ph, %"while loop cond.preheader" ], [ %m.3, %"while next2" ]
%k.082 = phi i64 [ 18, %"while loop cond.preheader" ], [ %16, %"while next2" ]
%12 = trunc i64 %k.082 to i32
%13 = shl i32 1, %12
%14 = sub i64 0, %k.082
%15 = sitofp i64 %14 to float
br label %"while loop body5"
"while next2": ; preds = %next19
%16 = add i64 %k.082, -1
%17 = icmp sgt i64 %16, -1
br i1 %17, label %"while loop cond4.preheader", label %"while next"
"while loop body5": ; preds = %"while loop cond4.preheader", %next19
%m.281 = phi i32 [ %m.183, %"while loop cond4.preheader" ], [ %m.3, %next19 ]
%j.080 = phi i64 [ 8, %"while loop cond4.preheader" ], [ %67, %next19 ]
%18 = getelementptr inbounds [9 x i32]* @const, i64 0, i64 %j.080
%19 = load i32* %18, align 4
%20 = and i32 %19, %13
%21 = icmp eq i32 %20, 0
br i1 %21, label %next19, label %then6
then6: ; preds = %"while loop body5"
%__self8.sroa.0.0.copyload = load float* %__self8.sroa.0.0.idx, align 4
%__self8.sroa.2.0.copyload = load float* %__self8.sroa.2.0.idx64, align 4
%__self8.sroa.3.0.copyload = load float* %5, align 4
%22 = sitofp i64 %j.080 to float
%23 = fsub float -4.000000e+00, %22
%24 = fadd float %15, %__self8.sroa.0.0.copyload
%25 = fadd float %__self8.sroa.2.0.copyload, 3.000000e+00
%26 = fadd float %23, %__self8.sroa.3.0.copyload
%__self10.sroa.0.0.copyload = load float* %__self10.sroa.0.0.idx, align 4
%__self10.sroa.2.0.copyload = load float* %__self10.sroa.2.0.idx57, align 4
%__self10.sroa.3.0.copyload = load float* %8, align 4
%27 = fmul float %24, %__self10.sroa.0.0.copyload
%28 = fmul float %25, %__self10.sroa.2.0.copyload
%29 = fadd float %27, %28
%30 = fmul float %26, %__self10.sroa.3.0.copyload
%31 = fadd float %29, %30
%32 = fmul float %24, %24
%33 = fmul float %25, %25
%34 = fadd float %32, %33
%35 = fmul float %26, %26
%36 = fadd float %34, %35
%37 = fadd float %36, -1.000000e+00
%38 = fmul float %31, %31
%39 = fsub float %38, %37
%40 = fcmp ogt float %39, 0.000000e+00
br i1 %40, label %then13, label %next19
then13: ; preds = %then6
%41 = fsub float -0.000000e+00, %31
%42 = tail call float @llvm.sqrt.f32(float %39) #0
%43 = fsub float %41, %42
%44 = fcmp ogt float %43, 0x3F847AE140000000
%45 = zext i1 %44 to i8
br i1 %44, label %rhs, label %join
join: ; preds = %rhs, %then13
%46 = phi i8 [ %45, %then13 ], [ %50, %rhs ]
%47 = icmp eq i8 %46, 0
br i1 %47, label %next19, label %then14
rhs: ; preds = %then13
%48 = load float* %3, align 4
%49 = fcmp olt float %43, %48
%50 = zext i1 %49 to i8
br label %join
then14: ; preds = %join
store float %43, float* %3, align 4
%__self16.sroa.0.0.copyload = load float* %__self10.sroa.0.0.idx, align 4
%__self16.sroa.2.0.copyload = load float* %__self10.sroa.2.0.idx57, align 4
%__self16.sroa.3.0.copyload = load float* %8, align 4
%51 = fmul float %43, %__self16.sroa.0.0.copyload
%52 = fmul float %43, %__self16.sroa.2.0.copyload
%53 = fmul float %43, %__self16.sroa.3.0.copyload
%54 = fadd float %24, %51
%55 = fadd float %25, %52
%56 = fadd float %26, %53
%57 = fmul float %54, %54
%58 = fmul float %55, %55
%59 = fadd float %57, %58
%60 = fmul float %56, %56
%61 = fadd float %59, %60
%62 = tail call float @llvm.sqrt.f32(float %61) #0
%63 = fdiv float 1.000000e+00, %62
%64 = fmul float %54, %63
%65 = fmul float %55, %63
%66 = fmul float %56, %63
store float %64, float* %.sroa.049.0.idx.pre-phi, align 4
store float %65, float* %.sroa.250.0.idx51.pre-phi, align 4
store float %66, float* %.sroa.3.0.idx52.pre-phi, align 4
br label %next19
next19: ; preds = %join, %"while loop body5", %then6, %then14
%m.3 = phi i32 [ 2, %then14 ], [ %m.281, %join ], [ %m.281, %then6 ], [ %m.281, %"while loop body5" ]
%67 = add i64 %j.080, -1
%68 = icmp sgt i64 %67, -1
br i1 %68, label %"while loop body5", label %"while next2"
}
; Function Attrs: uwtable
define void @S(%struct.Vec* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly) #4 {
"function top level":
%t = alloca float, align 4
%n = alloca %struct.Vec, align 8
%__self = alloca %struct.Vec, align 8
%__self1 = alloca %struct.Vec, align 8
%__self11 = alloca %struct.Vec, align 8
%__self12 = alloca %struct.Vec, align 8
%4 = alloca %struct.Vec, align 8
%__self22 = alloca %struct.Vec, align 8
%__self23 = alloca %struct.Vec, align 8
store float 0.000000e+00, float* %t, align 4
%5 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 0
store float 0.000000e+00, float* %5, align 8
%6 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 1
store float 0.000000e+00, float* %6, align 4
%7 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 2
store float 0.000000e+00, float* %7, align 8
%8 = bitcast %struct.Vec* %2 to i8*
%9 = bitcast %struct.Vec* %__self to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %9, i8* %8, i64 12, i32 4, i1 false)
%10 = bitcast %struct.Vec* %3 to i8*
%11 = bitcast %struct.Vec* %__self1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %11, i8* %10, i64 12, i32 4, i1 false)
%12 = call i32 @T({ i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Vec* %__self, %struct.Vec* %__self1, float* %t, %struct.Vec* %n)
%13 = icmp eq i32 %12, 0
br i1 %13, label %then, label %next
then: ; preds = %"function top level"
%14 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
%15 = load float* %14, align 4
%16 = fsub float 1.000000e+00, %15
%17 = tail call float @llvm.pow.f32(float %16, float 4.000000e+00) #0
%18 = fmul float %17, 0x3FE6666660000000
%19 = fmul float %17, 0x3FE3333340000000
%20 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %18, float* %20, align 4
%21 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %19, float* %21, align 4
%22 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %17, float* %22, align 4
br label %return
next: ; preds = %"function top level"
%__self2.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%__self2.sroa.0.0.copyload = load float* %__self2.sroa.0.0.idx, align 4
%__self2.sroa.2.0.idx86 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%__self2.sroa.2.0.copyload = load float* %__self2.sroa.2.0.idx86, align 4
%__self2.sroa.3.0.idx87 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%__self2.sroa.3.0.copyload = load float* %__self2.sroa.3.0.idx87, align 4
%__self3.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %3, i64 0, i32 0
%__self3.sroa.0.0.copyload = load float* %__self3.sroa.0.0.idx, align 4
%__self3.sroa.2.0.idx81 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 1
%__self3.sroa.2.0.copyload = load float* %__self3.sroa.2.0.idx81, align 4
%__self3.sroa.3.0.idx82 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
%__self3.sroa.3.0.copyload = load float* %__self3.sroa.3.0.idx82, align 4
%23 = load float* %t, align 4
%24 = fmul float %__self3.sroa.0.0.copyload, %23
%25 = fmul float %__self3.sroa.2.0.copyload, %23
%26 = fmul float %__self3.sroa.3.0.copyload, %23
%27 = fadd float %__self2.sroa.0.0.copyload, %24
%28 = fadd float %__self2.sroa.2.0.copyload, %25
%29 = fadd float %__self2.sroa.3.0.copyload, %26
%30 = tail call i32 @rand()
%31 = sitofp i32 %30 to float
%32 = fmul float %31, 0x3E00000000000000
%33 = fadd float %32, 9.000000e+00
%34 = tail call i32 @rand()
%35 = sitofp i32 %34 to float
%36 = fmul float %35, 0x3E00000000000000
%37 = fadd float %36, 9.000000e+00
%38 = fmul float %27, -1.000000e+00
%39 = fmul float %28, -1.000000e+00
%40 = fmul float %29, -1.000000e+00
%41 = fadd float %38, %33
%42 = fadd float %39, %37
%43 = fadd float %40, 1.600000e+01
%44 = fmul float %41, %41
%45 = fmul float %42, %42
%46 = fadd float %44, %45
%47 = fmul float %43, %43
%48 = fadd float %47, %46
%49 = tail call float @llvm.sqrt.f32(float %48) #0
%50 = fdiv float 1.000000e+00, %49
%51 = fmul float %50, %41
%52 = fmul float %50, %42
%53 = fmul float %43, %50
%__self5.sroa.0.0.copyload = load float* %__self3.sroa.0.0.idx, align 4
%__self5.sroa.2.0.copyload = load float* %__self3.sroa.2.0.idx81, align 4
%__self5.sroa.3.0.copyload = load float* %__self3.sroa.3.0.idx82, align 4
%__self6.sroa.0.0.copyload = load float* %5, align 8
%__self6.sroa.2.0.copyload = load float* %6, align 4
%__self6.sroa.3.0.copyload = load float* %7, align 8
%54 = fmul float %__self5.sroa.0.0.copyload, %__self6.sroa.0.0.copyload
%55 = fmul float %__self5.sroa.2.0.copyload, %__self6.sroa.2.0.copyload
%56 = fadd float %54, %55
%57 = fmul float %__self5.sroa.3.0.copyload, %__self6.sroa.3.0.copyload
%58 = fadd float %56, %57
%59 = fmul float %58, -2.000000e+00
%60 = fmul float %__self6.sroa.0.0.copyload, %59
%61 = fmul float %__self6.sroa.2.0.copyload, %59
%62 = fmul float %__self6.sroa.3.0.copyload, %59
%63 = fadd float %__self5.sroa.0.0.copyload, %60
%64 = fadd float %__self5.sroa.2.0.copyload, %61
%65 = fadd float %__self5.sroa.3.0.copyload, %62
%66 = fmul float %51, %__self6.sroa.0.0.copyload
%67 = fmul float %52, %__self6.sroa.2.0.copyload
%68 = fadd float %66, %67
%69 = fmul float %53, %__self6.sroa.3.0.copyload
%70 = fadd float %68, %69
%71 = fcmp olt float %70, 0.000000e+00
%72 = zext i1 %71 to i8
br i1 %71, label %join, label %rhs
join: ; preds = %rhs, %next
%73 = phi i8 [ %72, %next ], [ %87, %rhs ]
%74 = icmp eq i8 %73, 0
%. = select i1 %74, float %70, float 0.000000e+00
%75 = fmul float %51, %63
%76 = fmul float %52, %64
%77 = fadd float %75, %76
%78 = fmul float %53, %65
%79 = fadd float %78, %77
%80 = fcmp ogt float %., 0.000000e+00
%81 = uitofp i1 %80 to float
%82 = fmul float %79, %81
%83 = tail call float @llvm.pow.f32(float %82, float 9.900000e+01) #0
%84 = icmp eq i32 %12, 1
br i1 %84, label %then17, label %else21
rhs: ; preds = %next
%h.sroa.0.0.idx89 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 0
store float %27, float* %h.sroa.0.0.idx89, align 8
%h.sroa.5.0.idx92 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 1
store float %28, float* %h.sroa.5.0.idx92, align 4
%h.sroa.8.0.idx96 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 2
store float %29, float* %h.sroa.8.0.idx96, align 8
%l.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 0
store float %51, float* %l.sroa.0.0.idx, align 8
%l.sroa.4.0.idx77 = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 1
store float %52, float* %l.sroa.4.0.idx77, align 4
%l.sroa.7.0.idx79 = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 2
store float %53, float* %l.sroa.7.0.idx79, align 8
%85 = call i32 @T({ i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Vec* %__self11, %struct.Vec* %__self12, float* %t, %struct.Vec* %n)
%86 = icmp ne i32 %85, 0
%87 = zext i1 %86 to i8
br label %join
then17: ; preds = %join
%88 = fmul float %27, 0x3FC99999A0000000
%89 = fmul float %28, 0x3FC99999A0000000
%90 = tail call float @llvm.ceil.f32(float %88) #0
%91 = tail call float @llvm.ceil.f32(float %89) #0
%92 = fadd float %90, %91
%93 = fptosi float %92 to i32
%94 = and i32 %93, 1
%95 = icmp eq i32 %94, 0
%.104 = select i1 %95, float 3.000000e+00, float 1.000000e+00
%96 = fmul float %., 0x3FC99999A0000000
%97 = fadd float %96, 0x3FB99999A0000000
%98 = fmul float %97, 3.000000e+00
%99 = fmul float %97, %.104
%100 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %98, float* %100, align 4
%101 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %99, float* %101, align 4
%102 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %99, float* %102, align 4
br label %return
else21: ; preds = %join
%h.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 0
store float %27, float* %h.sroa.0.0.idx, align 8
%h.sroa.5.0.idx91 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 1
store float %28, float* %h.sroa.5.0.idx91, align 4
%h.sroa.8.0.idx95 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 2
store float %29, float* %h.sroa.8.0.idx95, align 8
%r.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 0
store float %63, float* %r.sroa.0.0.idx, align 8
%r.sroa.3.0.idx63 = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 1
store float %64, float* %r.sroa.3.0.idx63, align 4
%r.sroa.5.0.idx64 = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 2
store float %65, float* %r.sroa.5.0.idx64, align 8
call void @S(%struct.Vec* sret %4, { i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Vec* %__self22, %struct.Vec* %__self23)
%103 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 0
%104 = load float* %103, align 8
%105 = fmul float %104, 5.000000e-01
%106 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 1
%107 = load float* %106, align 4
%108 = fmul float %107, 5.000000e-01
%109 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 2
%110 = load float* %109, align 8
%111 = fmul float %110, 5.000000e-01
%112 = fadd float %83, %105
%113 = fadd float %83, %108
%114 = fadd float %83, %111
%115 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %112, float* %115, align 4
%116 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %113, float* %116, align 4
%117 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %114, float* %117, align 4
br label %return
return: ; preds = %then17, %else21, %then
ret void
}
; Function Attrs: noinline uwtable
define i64 @_ZN4main18h2588239c84f92dbab4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, i64, i8** nocapture readnone) #6 {
"function top level":
%3 = alloca [15 x i8], align 1
%4 = alloca %struct.Vec, align 8
%5 = alloca %struct.Vec, align 8
%__self22 = alloca %struct.Vec, align 8
%6 = alloca [3 x i8], align 1
%.sub = getelementptr inbounds [15 x i8]* %3, i64 0, i64 0
store i8 80, i8* %.sub, align 1
%7 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 1
store i8 54, i8* %7, align 1
%8 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 2
store i8 32, i8* %8, align 1
%9 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 3
store i8 53, i8* %9, align 1
%10 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 4
store i8 49, i8* %10, align 1
%11 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 5
store i8 50, i8* %11, align 1
%12 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 6
store i8 32, i8* %12, align 1
%13 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 7
store i8 53, i8* %13, align 1
%14 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 8
store i8 49, i8* %14, align 1
%15 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 9
store i8 50, i8* %15, align 1
%16 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 10
store i8 32, i8* %16, align 1
%17 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 11
store i8 50, i8* %17, align 1
%18 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 12
store i8 53, i8* %18, align 1
%19 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 13
store i8 53, i8* %19, align 1
%20 = getelementptr inbounds [15 x i8]* %3, i64 0, i64 14
store i8 32, i8* %20, align 1
%21 = call i64 @write(i32 1, i8* %.sub, i64 15)
%22 = getelementptr inbounds %struct.Vec* %5, i64 0, i32 0
%23 = getelementptr inbounds %struct.Vec* %5, i64 0, i32 1
%24 = getelementptr inbounds %struct.Vec* %5, i64 0, i32 2
%dir.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 0
%dir.sroa.2.0.idx100 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 1
%dir.sroa.3.0.idx101 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 2
%25 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 0
%26 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 1
%27 = getelementptr inbounds %struct.Vec* %4, i64 0, i32 2
%28 = getelementptr inbounds [3 x i8]* %6, i64 0, i64 0
%29 = getelementptr inbounds [3 x i8]* %6, i64 0, i64 1
%30 = getelementptr inbounds [3 x i8]* %6, i64 0, i64 2
br label %"while loop cond9.preheader"
"while next": ; preds = %"while next7"
ret i64 0
"while loop cond9.preheader": ; preds = %"function top level", %"while next7"
%y.0183 = phi i64 [ 511, %"function top level" ], [ %32, %"while next7" ]
%31 = sitofp i64 %y.0183 to float
br label %"while loop body10"
"while next7": ; preds = %"while next11"
%32 = add i64 %y.0183, -1
%33 = icmp sgt i64 %32, -1
br i1 %33, label %"while loop cond9.preheader", label %"while next"
"while loop body10": ; preds = %"while loop cond9.preheader", %"while next11"
%x.0182 = phi i64 [ 511, %"while loop cond9.preheader" ], [ %39, %"while next11" ]
%34 = sitofp i64 %x.0182 to float
br label %"while loop body14"
"while next11": ; preds = %"while loop body14"
%35 = fptoui float %106 to i8
store i8 %35, i8* %28, align 1
%36 = fptoui float %107 to i8
store i8 %36, i8* %29, align 1
%37 = fptoui float %108 to i8
store i8 %37, i8* %30, align 1
%38 = call i64 @write(i32 1, i8* %28, i64 3)
%39 = add i64 %x.0182, -1
%40 = icmp sgt i64 %39, -1
br i1 %40, label %"while loop body10", label %"while next7"
"while loop body14": ; preds = %"while loop body10", %"while loop body14"
%r.0181 = phi i64 [ 63, %"while loop body10" ], [ %109, %"while loop body14" ]
%p.sroa.0.0.load175180 = phi float [ 1.300000e+01, %"while loop body10" ], [ %106, %"while loop body14" ]
%p.sroa.4.4.load176179 = phi float [ 1.300000e+01, %"while loop body10" ], [ %107, %"while loop body14" ]
%p.sroa.8.8.load177178 = phi float [ 1.300000e+01, %"while loop body10" ], [ %108, %"while loop body14" ]
%41 = tail call i32 @rand()
%42 = sitofp i32 %41 to float
%43 = fmul float %42, 0x3E00000000000000
%44 = fadd float %43, -5.000000e-01
%45 = fmul float %44, 9.900000e+01
%46 = fmul float %45, 0x3F5EFCFE80000000
%47 = fmul float %45, 0xBF454DEF00000000
%48 = fmul float %45, 0.000000e+00
%49 = tail call i32 @rand()
%50 = sitofp i32 %49 to float
%51 = fmul float %50, 0x3E00000000000000
%52 = fadd float %51, -5.000000e-01
%53 = fmul float %52, 9.900000e+01
%54 = fmul float %53, 0.000000e+00
%55 = fmul float %53, 0x3F60624DE0000000
%56 = fadd float %46, %54
%57 = fadd float %47, %54
%58 = fadd float %48, %55
%59 = fmul float %56, -1.000000e+00
%60 = fmul float %57, -1.000000e+00
%61 = fmul float %58, -1.000000e+00
%62 = tail call i32 @rand()
%63 = sitofp i32 %62 to float
%64 = fmul float %63, 0x3E00000000000000
%65 = fadd float %34, %64
%66 = fmul float %65, 0x3F5EFCFE80000000
%67 = fmul float %65, 0xBF454DEF00000000
%68 = fmul float %65, 0.000000e+00
%69 = tail call i32 @rand()
%70 = sitofp i32 %69 to float
%71 = fmul float %70, 0x3E00000000000000
%72 = fadd float %31, %71
%73 = fmul float %72, 0.000000e+00
%74 = fmul float %72, 0x3F60624DE0000000
%75 = fadd float %73, 0xBFE9E58D00000000
%76 = fadd float %73, 0xBFE8EF94C0000000
%77 = fadd float %74, 0xBFE0624DE0000000
%78 = fadd float %66, %75
%79 = fadd float %67, %76
%80 = fadd float %68, %77
%81 = fmul float %78, 1.600000e+01
%82 = fmul float %79, 1.600000e+01
%83 = fmul float %80, 1.600000e+01
%84 = fadd float %59, %81
%85 = fadd float %60, %82
%86 = fadd float %61, %83
%87 = fmul float %84, %84
%88 = fmul float %85, %85
%89 = fadd float %87, %88
%90 = fmul float %86, %86
%91 = fadd float %90, %89
%92 = tail call float @llvm.sqrt.f32(float %91) #0
%93 = fdiv float 1.000000e+00, %92
%94 = fmul float %93, %84
%95 = fmul float %93, %85
%96 = fmul float %93, %86
%97 = fadd float %56, 1.700000e+01
%98 = fadd float %57, 1.600000e+01
%99 = fadd float %58, 8.000000e+00
store float %97, float* %22, align 8
store float %98, float* %23, align 4
store float %99, float* %24, align 8
store float %94, float* %dir.sroa.0.0.idx, align 8
store float %95, float* %dir.sroa.2.0.idx100, align 4
store float %96, float* %dir.sroa.3.0.idx101, align 8
call void @S(%struct.Vec* sret %4, { i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Vec* %5, %struct.Vec* %__self22)
%100 = load float* %25, align 8
%101 = fmul float %100, 3.500000e+00
%102 = load float* %26, align 4
%103 = fmul float %102, 3.500000e+00
%104 = load float* %27, align 8
%105 = fmul float %104, 3.500000e+00
%106 = fadd float %p.sroa.0.0.load175180, %101
%107 = fadd float %p.sroa.4.4.load176179, %103
%108 = fadd float %p.sroa.8.8.load177178, %105
%109 = add i64 %r.0181, -1
%110 = icmp sgt i64 %109, -1
br i1 %110, label %"while loop body14", label %"while next11"
}
define i64 @main(i64, i8** nocapture readnone) {
top:
%2 = tail call i64 @_ZN4main18h2588239c84f92dbab4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, i64 undef, i8** undef)
ret i64 0
}
attributes #0 = { nounwind }
attributes #1 = { nounwind readonly }
attributes #2 = { nounwind uwtable }
attributes #3 = { nounwind readonly uwtable }
attributes #4 = { uwtable }
attributes #5 = { alwaysinline nounwind uwtable }
attributes #6 = { noinline uwtable "fixed-stack-segment" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment