; ModuleID = 'autogen_tmp/symmatkernel_pass.bc'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-pc-linux-gnu"

define void @dummy_call() nounwind {
  call void @fw_data_get(i32 0, i32 0, i32 0, i32 0, float* null, i32 0, i32 0, i32 0)
  %1 = call i32 @fw_init_fw(i32 0)
  call void @fw_data_init(i32 0, i32 0, i32 0, i32 0, float* null, i32 %1, i32 %1, i32 0, float 0.000000e+00)
  call void @fw_op_start(i32 0)
  call void @fw_init_table()
  ret void
}

declare void @fw_data_get(i32, i32, i32, i32, float*, i32, i32, i32)

declare i32 @fw_init_fw(i32)

declare void @fw_data_init(i32, i32, i32, i32, float*, i32, i32, i32, float)

declare void @fw_op_start(i32)

declare void @fw_init_table()

define float @bar(float %c) nounwind readnone {
  %1 = fmul float %c, %c
  ret float %1
}

define float @foo(float* nocapture %c, float* nocapture %a, float* nocapture %b) nounwind {
  br label %codeRepl

codeRepl:                                         ; preds = %0
  call void @foo_(float* %a, float* %c, float* %b)
  br label %1

; <label>:1                                       ; preds = %codeRepl
  %2 = getelementptr inbounds float* %b, i32 3
  %3 = load float* %2, align 4, !tbaa !0
  %4 = getelementptr inbounds float* %b, i32 5
  store float %3, float* %4, align 4, !tbaa !0
  %5 = load float* %2, align 4, !tbaa !0
  ret float %5
}

define void @foo2(float* nocapture %c, float* nocapture %a, float* nocapture %b) nounwind {
  br label %codeRepl

codeRepl:                                         ; preds = %0
  call void @foo2_(float* %b, float* %c, float* %a)
  br label %1

; <label>:1                                       ; preds = %codeRepl
  %2 = getelementptr inbounds float* %b, i32 2
  %3 = load float* %2, align 4, !tbaa !0
  %4 = getelementptr inbounds float* %b, i32 5
  store float %3, float* %4, align 4, !tbaa !0
  ret void
}

define float @foo_bar(float* nocapture %b, float* nocapture %a, float* nocapture %c) nounwind readnone {
  %mean = alloca [256 x float], align 4
  %symmat = alloca [256 x [256 x float]], align 4
  %data = alloca [256 x [256 x float]], align 4
  br label %1

; <label>:1                                       ; preds = %7, %0
  %j.012 = phi i32 [ 0, %0 ], [ %8, %7 ]
  %scevgep21 = getelementptr [256 x float]* %mean, i32 0, i32 %j.012
  store float 0.000000e+00, float* %scevgep21, align 4, !tbaa !0
  br label %2

; <label>:2                                       ; preds = %2, %1
  %3 = phi float [ 0.000000e+00, %1 ], [ %5, %2 ]
  %i.09 = phi i32 [ 0, %1 ], [ %6, %2 ]
  %scevgep18 = getelementptr [256 x [256 x float]]* %data, i32 0, i32 %i.09, i32 %j.012
  %4 = load float* %scevgep18, align 4, !tbaa !0
  %5 = fadd float %3, %4
  %6 = add nsw i32 %i.09, 1
  %exitcond17 = icmp eq i32 %6, 125
  br i1 %exitcond17, label %7, label %2

; <label>:7                                       ; preds = %2
  %.lcssa16 = phi float [ %5, %2 ]
  store float %.lcssa16, float* %scevgep21, align 4
  %8 = add nsw i32 %j.012, 1
  %exitcond19 = icmp eq i32 %8, 125
  br i1 %exitcond19, label %.preheader5.preheader, label %1

.preheader5.preheader:                            ; preds = %7
  br label %.preheader5

.preheader5:                                      ; preds = %14, %.preheader5.preheader
  %i.18 = phi i32 [ %15, %14 ], [ 0, %.preheader5.preheader ]
  br label %9

; <label>:9                                       ; preds = %9, %.preheader5
  %j.16 = phi i32 [ 0, %.preheader5 ], [ %13, %9 ]
  %scevgep12 = getelementptr [256 x [256 x float]]* %data, i32 0, i32 %i.18, i32 %j.16
  %scevgep13 = getelementptr [256 x float]* %mean, i32 0, i32 %j.16
  %10 = load float* %scevgep13, align 4, !tbaa !0
  %11 = load float* %scevgep12, align 4, !tbaa !0
  %12 = fsub float %11, %10
  store float %12, float* %scevgep12, align 4, !tbaa !0
  %13 = add nsw i32 %j.16, 1
  %exitcond11 = icmp eq i32 %13, 125
  br i1 %exitcond11, label %14, label %9

; <label>:14                                      ; preds = %9
  %15 = add nsw i32 %i.18, 1
  %exitcond14 = icmp eq i32 %15, 125
  br i1 %exitcond14, label %.lr.ph.preheader, label %.preheader5

.lr.ph.preheader:                                 ; preds = %14
  br label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge, %.lr.ph.preheader
  %j1.04 = phi i32 [ %30, %._crit_edge ], [ 0, %.lr.ph.preheader ]
  %16 = mul i32 %j1.04, 257
  %17 = mul i32 %j1.04, -1
  %18 = add i32 %17, 125
  br label %19

; <label>:19                                      ; preds = %29, %.lr.ph
  %indvar = phi i32 [ %indvar.next, %29 ], [ 0, %.lr.ph ]
  %20 = add i32 %16, %indvar
  %scevgep5 = getelementptr [256 x [256 x float]]* %symmat, i32 0, i32 0, i32 %20
  %scevgep4 = getelementptr [256 x [256 x float]]* %symmat, i32 0, i32 %indvar, i32 %16
  %21 = add i32 %j1.04, %indvar
  store float 0.000000e+00, float* %scevgep5, align 4, !tbaa !0
  br label %22

; <label>:22                                      ; preds = %22, %19
  %23 = phi float [ 0.000000e+00, %19 ], [ %27, %22 ]
  %i.21 = phi i32 [ 0, %19 ], [ %28, %22 ]
  %scevgep = getelementptr [256 x [256 x float]]* %data, i32 0, i32 %i.21, i32 %21
  %scevgep2 = getelementptr [256 x [256 x float]]* %data, i32 0, i32 %i.21, i32 %j1.04
  %24 = load float* %scevgep2, align 4, !tbaa !0
  %25 = load float* %scevgep, align 4, !tbaa !0
  %26 = fmul float %24, %25
  %27 = fadd float %23, %26
  %28 = add nsw i32 %i.21, 1
  %exitcond1 = icmp eq i32 %28, 125
  br i1 %exitcond1, label %29, label %22

; <label>:29                                      ; preds = %22
  %.lcssa = phi float [ %27, %22 ]
  store float %.lcssa, float* %scevgep5, align 4
  store float %.lcssa, float* %scevgep4, align 4, !tbaa !0
  %indvar.next = add i32 %indvar, 1
  %exitcond = icmp eq i32 %indvar.next, %18
  br i1 %exitcond, label %._crit_edge, label %19

._crit_edge:                                      ; preds = %29
  %30 = add nsw i32 %j1.04, 1
  %exitcond6 = icmp eq i32 %30, 125
  br i1 %exitcond6, label %31, label %.lr.ph

; <label>:31                                      ; preds = %._crit_edge
  ret float undef
}

define void @compute(float* nocapture %a, float* nocapture %b, float* nocapture %c, i32 %decide) nounwind {
  %1 = icmp eq i32 %decide, 0
  br i1 %1, label %4, label %2

; <label>:2                                       ; preds = %0
  %3 = tail call float @foo(float* %c, float* %a, float* %b)
  br label %5

; <label>:4                                       ; preds = %0
  tail call void @foo2(float* %b, float* %a, float* %c)
  br label %5

; <label>:5                                       ; preds = %4, %2
  ret void
}

define i32 @main() nounwind {
  %a = alloca [256 x float], align 4
  %b = alloca [256 x float], align 4
  %c = alloca [256 x float], align 4
  br label %codeRepl1

codeRepl1:                                        ; preds = %0
  call void @main_1([256 x float]* %c, [256 x float]* %b, [256 x float]* %a)
  br label %1

; <label>:1                                       ; preds = %codeRepl1
  %2 = getelementptr inbounds [256 x float]* %a, i32 0, i32 1
  %3 = ptrtoint float* %2 to i32
  %4 = and i32 %3, -8
  %5 = inttoptr i32 %4 to float*
  %6 = getelementptr inbounds [256 x float]* %b, i32 0, i32 1
  %7 = ptrtoint float* %6 to i32
  %8 = and i32 %7, -8
  %9 = inttoptr i32 %8 to float*
  %10 = getelementptr inbounds [256 x float]* %c, i32 0, i32 1
  %11 = ptrtoint float* %10 to i32
  %12 = and i32 %11, -8
  %13 = inttoptr i32 %12 to float*
  br label %codeRepl

codeRepl:                                         ; preds = %1
  call void @main_(float* %5, float* %9, float* %13)
  br label %14

; <label>:14                                      ; preds = %codeRepl
  ret i32 0
}

define internal void @foo_(float* %a, float* %c, float* %b) nounwind {
newFuncRoot:
  br label %man_block_0

man_block_0:                                      ; preds = %newFuncRoot
  call void @fw_init_table()
  %wrk_id = call i32 @fw_init_fw(i32 0)
  call void @fw_data_init(i32 %wrk_id, i32 0, i32 1, i32 1, float* %b, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_data_init(i32 %wrk_id, i32 255, i32 1, i32 1, float* %c, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_data_init(i32 %wrk_id, i32 0, i32 2, i32 1, float* %a, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_op_start(i32 %wrk_id)
  call void @fw_data_get(i32 %wrk_id, i32 0, i32 1, i32 1, float* %a, i32 0, i32 0, i32 250)
  br label %.exitStub

.exitStub:                                        ; preds = %man_block_0
  ret void
}

define internal void @foo2_(float* %b, float* %c, float* %a) nounwind {
newFuncRoot:
  br label %man_block_1

man_block_1:                                      ; preds = %newFuncRoot
  call void @fw_init_table()
  %wrk_id = call i32 @fw_init_fw(i32 1)
  call void @fw_data_init(i32 %wrk_id, i32 0, i32 1, i32 1, float* %a, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_data_init(i32 %wrk_id, i32 255, i32 1, i32 1, float* %c, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_data_init(i32 %wrk_id, i32 0, i32 2, i32 1, float* %b, i32 0, i32 0, i32 250, float 0.000000e+00)
  call void @fw_op_start(i32 %wrk_id)
  call void @fw_data_get(i32 %wrk_id, i32 0, i32 1, i32 1, float* %b, i32 0, i32 0, i32 250)
  br label %.exitStub

.exitStub:                                        ; preds = %man_block_1
  ret void
}

define internal void @main_(float*, float*, float*) nounwind {
newFuncRoot:
  br label %3

.exitStub:                                        ; preds = %3
  ret void

; <label>:3                                       ; preds = %3, %newFuncRoot
  %i.11 = phi i32 [ 0, %newFuncRoot ], [ %4, %3 ]
  call void @compute(float* %0, float* %1, float* %2, i32 0)
  %4 = add nsw i32 %i.11, 1
  %exitcond1 = icmp eq i32 %4, 10000
  br i1 %exitcond1, label %.exitStub, label %3
}

define internal void @main_1([256 x float]* %c, [256 x float]* %b, [256 x float]* %a) nounwind {
newFuncRoot:
  br label %0

.exitStub:                                        ; preds = %0
  ret void

; <label>:0                                       ; preds = %0, %newFuncRoot
  %i.02 = phi i32 [ 0, %newFuncRoot ], [ %1, %0 ]
  %scevgep = getelementptr [256 x float]* %c, i32 0, i32 %i.02
  %scevgep2 = getelementptr [256 x float]* %b, i32 0, i32 %i.02
  %scevgep3 = getelementptr [256 x float]* %a, i32 0, i32 %i.02
  store float 1.000000e+01, float* %scevgep3, align 4, !tbaa !0
  store float 2.000000e+00, float* %scevgep2, align 4, !tbaa !0
  store float 1.000000e+00, float* %scevgep, align 4, !tbaa !0
  %1 = add nsw i32 %i.02, 1
  %exitcond = icmp eq i32 %1, 256
  br i1 %exitcond, label %.exitStub, label %0
}

!0 = metadata !{metadata !"float", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
