; LLVM IR from ChenyangZhang-cs/iMLBench :: BP/co-run&zero-copy/backprop_ocl.ll (Z17bpnn_train_kernelP4BPNNPfS1_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.BPNN = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [26 x i8], align 1
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp1 = external hidden unnamed_addr constant [22 x i8], align 16
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp2 = external hidden unnamed_addr constant [24 x i8], align 16
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.tempchar = external hidden unnamed_addr constant [21 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@_ZL7context = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.local_work = external hidden unnamed_addr constant [3 x i64], align 16
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@cpu_offset = external global i32, align 4
@_ZL9cmd_queue = external hidden global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z21bpnn_layerforward_ompPfS_S_S_S_S_iii(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z23bpnn_adjust_weights_ompPfiS_iS_S_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z17bpnn_train_kernelP4BPNNPfS1_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca [22 x i8], align 16
  %17 = alloca [24 x i8], align 16
  %18 = alloca [21 x i8], align 16
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca [2 x ptr], align 16
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca float, align 4
  %30 = alloca i32, align 4
  %31 = alloca [3 x i64], align 16
  %32 = alloca [3 x i64], align 16
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca i8, align 1
  %43 = alloca i8, align 1
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca [3 x i64], align 16
  %47 = alloca [3 x i64], align 16
  %48 = alloca [2 x i64], align 16
  %49 = alloca ptr, align 8
  %50 = alloca double, align 8
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.BPNN, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !9
  store i32 %58, ptr %8, align 4, !tbaa !12
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.BPNN, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !13
  store i32 %61, ptr %9, align 4, !tbaa !12
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.BPNN, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 8, !tbaa !14
  store i32 %64, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1048576, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %65 = load i32, ptr %13, align 4, !tbaa !12
  %66 = sext i32 %65 to i64
  %67 = call noalias ptr @calloc(i64 noundef %66, i64 noundef 1) #9
  store ptr %67, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %73, label %70

70:                                               ; preds = %3
  %71 = load i32, ptr %13, align 4, !tbaa !12
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %71)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %555

73:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 22, ptr %16) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 @__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp1, i64 22, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 @__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp2, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 21, ptr %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 @__const._Z17bpnn_train_kernelP4BPNNPfS1_.tempchar, i64 21, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %74 = getelementptr inbounds [21 x i8], ptr %18, i64 0, i64 0
  %75 = call noalias ptr @fopen(ptr noundef %74, ptr noundef @.str.1)
  store ptr %75, ptr %19, align 8, !tbaa !5
  %76 = load ptr, ptr %19, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %81, label %78

78:                                               ; preds = %73
  %79 = getelementptr inbounds [21 x i8], ptr %18, i64 0, i64 0
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %79)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %554

81:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = call i64 @strlen(ptr noundef %83) #10
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  %86 = load i32, ptr %13, align 4, !tbaa !12
  %87 = sext i32 %86 to i64
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = call i64 @fread(ptr noundef %85, i64 noundef %87, i64 noundef 1, ptr noundef %88)
  store i64 %89, ptr %20, align 8, !tbaa !15
  %90 = load ptr, ptr %19, align 8, !tbaa !5
  %91 = call i32 @fclose(ptr noundef %90)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 1, ptr %21, align 4, !tbaa !12
  %92 = load i32, ptr %21, align 4, !tbaa !12
  %93 = call noundef i32 @_ZL10initializei(i32 noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %81
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %553

96:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %97, ptr %23, align 8, !tbaa !5
  %98 = getelementptr inbounds ptr, ptr %23, i64 1
  store ptr null, ptr %98, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %99 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %100 = getelementptr inbounds [2 x ptr], ptr %23, i64 0, i64 0
  %101 = call ptr @clCreateProgramWithSource(ptr noundef %99, i32 noundef 1, ptr noundef %100, ptr noundef null, ptr noundef %22)
  store ptr %101, ptr %24, align 8, !tbaa !5
  %102 = load i32, ptr %22, align 4, !tbaa !12
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %107

104:                                              ; preds = %96
  %105 = load i32, ptr %22, align 4, !tbaa !12
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %105)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %552

107:                                              ; preds = %96
  %108 = load ptr, ptr %24, align 8, !tbaa !5
  %109 = call i32 @clBuildProgram(ptr noundef %108, i32 noundef 0, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %109, ptr %22, align 4, !tbaa !12
  %110 = load i32, ptr %22, align 4, !tbaa !12
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %107
  %113 = load i32, ptr %22, align 4, !tbaa !12
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %113)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %552

115:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %116 = load ptr, ptr %24, align 8, !tbaa !5
  %117 = getelementptr inbounds [22 x i8], ptr %16, i64 0, i64 0
  %118 = call ptr @clCreateKernel(ptr noundef %116, ptr noundef %117, ptr noundef %22)
  store ptr %118, ptr %25, align 8, !tbaa !5
  %119 = load ptr, ptr %24, align 8, !tbaa !5
  %120 = getelementptr inbounds [24 x i8], ptr %17, i64 0, i64 0
  %121 = call ptr @clCreateKernel(ptr noundef %119, ptr noundef %120, ptr noundef %22)
  store ptr %121, ptr %26, align 8, !tbaa !5
  %122 = load i32, ptr %22, align 4, !tbaa !12
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %115
  %125 = load i32, ptr %22, align 4, !tbaa !12
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %125)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %551

127:                                              ; preds = %115
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  %129 = call i32 @clReleaseProgram(ptr noundef %128)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %130 = load i32, ptr %8, align 4, !tbaa !12
  %131 = sdiv i32 %130, 16
  store i32 %131, ptr %30, align 4, !tbaa !12
  %132 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %133 = load i32, ptr %8, align 4, !tbaa !12
  %134 = add nsw i32 %133, 1
  %135 = load i32, ptr %9, align 4, !tbaa !12
  %136 = add nsw i32 %135, 1
  %137 = mul nsw i32 %134, %136
  %138 = sext i32 %137 to i64
  %139 = mul i64 %138, 4
  %140 = call ptr @clSVMAlloc(ptr noundef %132, i64 noundef 1, i64 noundef %139, i32 noundef 0)
  store ptr %140, ptr %27, align 8, !tbaa !5
  %141 = load ptr, ptr %27, align 8, !tbaa !5
  %142 = icmp eq ptr %141, null
  br i1 %142, label %143, label %145

143:                                              ; preds = %127
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %550

145:                                              ; preds = %127
  %146 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !12
  %148 = add nsw i32 %147, 1
  %149 = load i32, ptr %9, align 4, !tbaa !12
  %150 = add nsw i32 %149, 1
  %151 = mul nsw i32 %148, %150
  %152 = sext i32 %151 to i64
  %153 = mul i64 %152, 4
  %154 = call ptr @clSVMAlloc(ptr noundef %146, i64 noundef 1, i64 noundef %153, i32 noundef 0)
  store ptr %154, ptr %28, align 8, !tbaa !5
  %155 = load ptr, ptr %28, align 8, !tbaa !5
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %159

157:                                              ; preds = %145
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %550

159:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #8
  store i64 16, ptr %31, align 8, !tbaa !15
  %160 = getelementptr inbounds i64, ptr %31, i64 1
  %161 = load i32, ptr %30, align 4, !tbaa !12
  %162 = mul nsw i32 16, %161
  %163 = sext i32 %162 to i64
  store i64 %163, ptr %160, align 8, !tbaa !15
  %164 = getelementptr inbounds i64, ptr %31, i64 2
  store i64 1, ptr %164, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 @__const._Z17bpnn_train_kernelP4BPNNPfS1_.local_work, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  store i32 0, ptr %34, align 4, !tbaa !12
  br label %165

165:                                              ; preds = %213, %159
  %166 = load i32, ptr %34, align 4, !tbaa !12
  %167 = load i32, ptr %8, align 4, !tbaa !12
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %216

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !12
  br label %171

171:                                              ; preds = %209, %170
  %172 = load i32, ptr %35, align 4, !tbaa !12
  %173 = load i32, ptr %9, align 4, !tbaa !12
  %174 = icmp sle i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %212

176:                                              ; preds = %171
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.BPNN, ptr %177, i32 0, i32 9
  %179 = load ptr, ptr %178, align 8, !tbaa !17
  %180 = load i32, ptr %34, align 4, !tbaa !12
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds ptr, ptr %179, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !5
  %184 = load i32, ptr %35, align 4, !tbaa !12
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds float, ptr %183, i64 %185
  %187 = load float, ptr %186, align 4, !tbaa !18
  %188 = load ptr, ptr %27, align 8, !tbaa !5
  %189 = load i32, ptr %33, align 4, !tbaa !12
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds float, ptr %188, i64 %190
  store float %187, ptr %191, align 4, !tbaa !18
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.BPNN, ptr %192, i32 0, i32 11
  %194 = load ptr, ptr %193, align 8, !tbaa !20
  %195 = load i32, ptr %34, align 4, !tbaa !12
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds ptr, ptr %194, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  %199 = load i32, ptr %35, align 4, !tbaa !12
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds float, ptr %198, i64 %200
  %202 = load float, ptr %201, align 4, !tbaa !18
  %203 = load ptr, ptr %28, align 8, !tbaa !5
  %204 = load i32, ptr %33, align 4, !tbaa !12
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds float, ptr %203, i64 %205
  store float %202, ptr %206, align 4, !tbaa !18
  %207 = load i32, ptr %33, align 4, !tbaa !12
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %33, align 4, !tbaa !12
  br label %209

209:                                              ; preds = %176
  %210 = load i32, ptr %35, align 4, !tbaa !12
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %35, align 4, !tbaa !12
  br label %171, !llvm.loop !21

212:                                              ; preds = %175
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %34, align 4, !tbaa !12
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %34, align 4, !tbaa !12
  br label %165, !llvm.loop !23

216:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %217 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %217, ptr %36, align 8, !tbaa !5
  %218 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %219 = load i32, ptr %8, align 4, !tbaa !12
  %220 = add nsw i32 %219, 1
  %221 = sext i32 %220 to i64
  %222 = mul i64 %221, 4
  %223 = call ptr @clSVMAlloc(ptr noundef %218, i64 noundef 1, i64 noundef %222, i32 noundef 0)
  store ptr %223, ptr %37, align 8, !tbaa !5
  %224 = load ptr, ptr %37, align 8, !tbaa !5
  %225 = icmp eq ptr %224, null
  br i1 %225, label %226, label %228

226:                                              ; preds = %216
  %227 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %549

228:                                              ; preds = %216
  %229 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %230 = load i32, ptr %9, align 4, !tbaa !12
  %231 = add nsw i32 %230, 1
  %232 = sext i32 %231 to i64
  %233 = mul i64 %232, 4
  %234 = call ptr @clSVMAlloc(ptr noundef %229, i64 noundef 1, i64 noundef %233, i32 noundef 0)
  store ptr %234, ptr %38, align 8, !tbaa !5
  %235 = load ptr, ptr %38, align 8, !tbaa !5
  %236 = icmp eq ptr %235, null
  br i1 %236, label %237, label %239

237:                                              ; preds = %228
  %238 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %549

239:                                              ; preds = %228
  %240 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %241 = load i32, ptr %30, align 4, !tbaa !12
  %242 = mul nsw i32 %241, 16
  %243 = sext i32 %242 to i64
  %244 = mul i64 %243, 4
  %245 = call ptr @clSVMAlloc(ptr noundef %240, i64 noundef 1, i64 noundef %244, i32 noundef 0)
  store ptr %245, ptr %39, align 8, !tbaa !5
  %246 = load ptr, ptr %39, align 8, !tbaa !5
  %247 = icmp eq ptr %246, null
  br i1 %247, label %248, label %250

248:                                              ; preds = %239
  %249 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %549

250:                                              ; preds = %239
  %251 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %252 = load i32, ptr %9, align 4, !tbaa !12
  %253 = add nsw i32 %252, 1
  %254 = sext i32 %253 to i64
  %255 = mul i64 %254, 4
  %256 = call ptr @clSVMAlloc(ptr noundef %251, i64 noundef 1, i64 noundef %255, i32 noundef 0)
  store ptr %256, ptr %40, align 8, !tbaa !5
  %257 = load ptr, ptr %40, align 8, !tbaa !5
  %258 = icmp eq ptr %257, null
  br i1 %258, label %259, label %261

259:                                              ; preds = %250
  %260 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %549

261:                                              ; preds = %250
  %262 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %262, ptr %41, align 8, !tbaa !5
  %263 = load ptr, ptr %37, align 8, !tbaa !5
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.BPNN, ptr %264, i32 0, i32 3
  %266 = load ptr, ptr %265, align 8, !tbaa !24
  %267 = load i32, ptr %8, align 4, !tbaa !12
  %268 = add nsw i32 %267, 1
  %269 = sext i32 %268 to i64
  %270 = mul i64 %269, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %263, ptr align 4 %266, i64 %270, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %42) #8
  store i8 1, ptr %42, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #8
  store i8 0, ptr %43, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  store i32 1, ptr %44, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  %271 = load i32, ptr @cpu_offset, align 4, !tbaa !12
  %272 = load i32, ptr %30, align 4, !tbaa !12
  %273 = mul nsw i32 %271, %272
  %274 = sdiv i32 %273, 100
  store i32 %274, ptr %45, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr %46) #8
  store i64 16, ptr %46, align 8, !tbaa !15
  %275 = getelementptr inbounds i64, ptr %46, i64 1
  %276 = load i32, ptr %45, align 4, !tbaa !12
  %277 = mul nsw i32 16, %276
  %278 = sext i32 %277 to i64
  store i64 %278, ptr %275, align 8, !tbaa !15
  %279 = getelementptr inbounds i64, ptr %46, i64 2
  store i64 1, ptr %279, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %47) #8
  store i64 16, ptr %47, align 8, !tbaa !15
  %280 = getelementptr inbounds i64, ptr %47, i64 1
  %281 = load i32, ptr %30, align 4, !tbaa !12
  %282 = load i32, ptr %45, align 4, !tbaa !12
  %283 = sub nsw i32 %281, %282
  %284 = mul nsw i32 16, %283
  %285 = sext i32 %284 to i64
  store i64 %285, ptr %280, align 8, !tbaa !15
  %286 = getelementptr inbounds i64, ptr %47, i64 2
  store i64 1, ptr %286, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %48) #8
  store i64 0, ptr %48, align 8, !tbaa !15
  %287 = getelementptr inbounds i64, ptr %48, i64 1
  %288 = load i32, ptr %45, align 4, !tbaa !12
  %289 = mul nsw i32 16, %288
  %290 = sext i32 %289 to i64
  store i64 %290, ptr %287, align 8, !tbaa !15
  %291 = load i32, ptr @cpu_offset, align 4, !tbaa !12
  %292 = icmp sgt i32 %291, 0
  br i1 %292, label %293, label %294

293:                                              ; preds = %261
  store i8 1, ptr %43, align 1, !tbaa !25
  br label %294

294:                                              ; preds = %293, %261
  %295 = getelementptr inbounds [3 x i64], ptr %47, i64 0, i64 1
  %296 = load i64, ptr %295, align 8, !tbaa !15
  %297 = icmp ule i64 %296, 0
  br i1 %297, label %298, label %299

298:                                              ; preds = %294
  store i8 0, ptr %42, align 1, !tbaa !25
  br label %299

299:                                              ; preds = %298, %294
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  %300 = call noundef double @_Z7gettimev()
  store double %300, ptr %50, align 8, !tbaa !27
  %301 = load i8, ptr %42, align 1, !tbaa !25, !range !29, !noundef !30
  %302 = trunc i8 %301 to i1
  br i1 %302, label %303, label %335

303:                                              ; preds = %299
  %304 = load ptr, ptr %25, align 8, !tbaa !5
  %305 = load ptr, ptr %37, align 8, !tbaa !5
  %306 = call i32 @clSetKernelArgSVMPointer(ptr noundef %304, i32 noundef 0, ptr noundef %305)
  %307 = load ptr, ptr %25, align 8, !tbaa !5
  %308 = load ptr, ptr %38, align 8, !tbaa !5
  %309 = call i32 @clSetKernelArgSVMPointer(ptr noundef %307, i32 noundef 1, ptr noundef %308)
  %310 = load ptr, ptr %25, align 8, !tbaa !5
  %311 = load ptr, ptr %36, align 8, !tbaa !5
  %312 = call i32 @clSetKernelArgSVMPointer(ptr noundef %310, i32 noundef 2, ptr noundef %311)
  %313 = load ptr, ptr %25, align 8, !tbaa !5
  %314 = load ptr, ptr %39, align 8, !tbaa !5
  %315 = call i32 @clSetKernelArgSVMPointer(ptr noundef %313, i32 noundef 3, ptr noundef %314)
  %316 = load ptr, ptr %25, align 8, !tbaa !5
  %317 = call i32 @clSetKernelArg(ptr noundef %316, i32 noundef 4, i64 noundef 64, ptr noundef null)
  %318 = load ptr, ptr %25, align 8, !tbaa !5
  %319 = call i32 @clSetKernelArg(ptr noundef %318, i32 noundef 5, i64 noundef 1024, ptr noundef null)
  %320 = load ptr, ptr %25, align 8, !tbaa !5
  %321 = call i32 @clSetKernelArg(ptr noundef %320, i32 noundef 6, i64 noundef 4, ptr noundef %8)
  %322 = load ptr, ptr %25, align 8, !tbaa !5
  %323 = call i32 @clSetKernelArg(ptr noundef %322, i32 noundef 7, i64 noundef 4, ptr noundef %9)
  %324 = load ptr, ptr @_ZL9cmd_queue, align 8, !tbaa !5
  %325 = load ptr, ptr %25, align 8, !tbaa !5
  %326 = getelementptr inbounds [2 x i64], ptr %48, i64 0, i64 0
  %327 = getelementptr inbounds [3 x i64], ptr %47, i64 0, i64 0
  %328 = getelementptr inbounds [3 x i64], ptr %32, i64 0, i64 0
  %329 = call i32 @clEnqueueNDRangeKernel(ptr noundef %324, ptr noundef %325, i32 noundef 2, ptr noundef %326, ptr noundef %327, ptr noundef %328, i32 noundef 0, ptr noundef null, ptr noundef %49)
  store i32 %329, ptr %22, align 4, !tbaa !12
  %330 = load i32, ptr %22, align 4, !tbaa !12
  %331 = icmp ne i32 %330, 0
  br i1 %331, label %332, label %334

332:                                              ; preds = %303
  %333 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  br label %334

334:                                              ; preds = %332, %303
  br label %335

335:                                              ; preds = %334, %299
  %336 = load i8, ptr %43, align 1, !tbaa !25, !range !29, !noundef !30
  %337 = trunc i8 %336 to i1
  br i1 %337, label %338, label %346

338:                                              ; preds = %335
  %339 = load ptr, ptr %37, align 8, !tbaa !5
  %340 = load ptr, ptr %38, align 8, !tbaa !5
  %341 = load ptr, ptr %36, align 8, !tbaa !5
  %342 = load ptr, ptr %39, align 8, !tbaa !5
  %343 = load i32, ptr %8, align 4, !tbaa !12
  %344 = load i32, ptr %9, align 4, !tbaa !12
  %345 = load i32, ptr %45, align 4, !tbaa !12
  call void @_Z21bpnn_layerforward_ompPfS_S_S_S_S_iii(ptr noundef %339, ptr noundef %340, ptr noundef %341, ptr noundef %342, ptr noundef null, ptr noundef null, i32 noundef %343, i32 noundef %344, i32 noundef %345)
  br label %346

346:                                              ; preds = %338, %335
  %347 = load i8, ptr %42, align 1, !tbaa !25, !range !29, !noundef !30
  %348 = trunc i8 %347 to i1
  br i1 %348, label %349, label %356

349:                                              ; preds = %346
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #8
  %350 = call i32 @clWaitForEvents(i32 noundef 1, ptr noundef %49)
  store i32 %350, ptr %51, align 4, !tbaa !12
  %351 = load i32, ptr %51, align 4, !tbaa !12
  %352 = icmp ne i32 %351, 0
  br i1 %352, label %353, label %355

353:                                              ; preds = %349
  %354 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %355

355:                                              ; preds = %353, %349
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #8
  br label %356

356:                                              ; preds = %355, %346
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #8
  store i32 1, ptr %52, align 4, !tbaa !12
  br label %357

357:                                              ; preds = %409, %356
  %358 = load i32, ptr %52, align 4, !tbaa !12
  %359 = load i32, ptr %9, align 4, !tbaa !12
  %360 = icmp sle i32 %358, %359
  br i1 %360, label %362, label %361

361:                                              ; preds = %357
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #8
  br label %412

362:                                              ; preds = %357
  store float 0.000000e+00, ptr %29, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #8
  store i32 0, ptr %53, align 4, !tbaa !12
  br label %363

363:                                              ; preds = %381, %362
  %364 = load i32, ptr %53, align 4, !tbaa !12
  %365 = load i32, ptr %30, align 4, !tbaa !12
  %366 = icmp slt i32 %364, %365
  br i1 %366, label %368, label %367

367:                                              ; preds = %363
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #8
  br label %384

368:                                              ; preds = %363
  %369 = load ptr, ptr %39, align 8, !tbaa !5
  %370 = load i32, ptr %53, align 4, !tbaa !12
  %371 = load i32, ptr %9, align 4, !tbaa !12
  %372 = mul nsw i32 %370, %371
  %373 = load i32, ptr %52, align 4, !tbaa !12
  %374 = add nsw i32 %372, %373
  %375 = sub nsw i32 %374, 1
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds float, ptr %369, i64 %376
  %378 = load float, ptr %377, align 4, !tbaa !18
  %379 = load float, ptr %29, align 4, !tbaa !18
  %380 = fadd float %379, %378
  store float %380, ptr %29, align 4, !tbaa !18
  br label %381

381:                                              ; preds = %368
  %382 = load i32, ptr %53, align 4, !tbaa !12
  %383 = add nsw i32 %382, 1
  store i32 %383, ptr %53, align 4, !tbaa !12
  br label %363, !llvm.loop !31

384:                                              ; preds = %367
  %385 = load ptr, ptr %5, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.BPNN, ptr %385, i32 0, i32 9
  %387 = load ptr, ptr %386, align 8, !tbaa !17
  %388 = getelementptr inbounds ptr, ptr %387, i64 0
  %389 = load ptr, ptr %388, align 8, !tbaa !5
  %390 = load i32, ptr %52, align 4, !tbaa !12
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds float, ptr %389, i64 %391
  %393 = load float, ptr %392, align 4, !tbaa !18
  %394 = load float, ptr %29, align 4, !tbaa !18
  %395 = fadd float %394, %393
  store float %395, ptr %29, align 4, !tbaa !18
  %396 = load float, ptr %29, align 4, !tbaa !18
  %397 = fneg float %396
  %398 = call noundef float @_ZSt3expf(float noundef %397)
  %399 = fpext float %398 to double
  %400 = fadd double 1.000000e+00, %399
  %401 = fdiv double 1.000000e+00, %400
  %402 = fptrunc double %401 to float
  %403 = load ptr, ptr %5, align 8, !tbaa !5
  %404 = getelementptr inbounds %struct.BPNN, ptr %403, i32 0, i32 4
  %405 = load ptr, ptr %404, align 8, !tbaa !32
  %406 = load i32, ptr %52, align 4, !tbaa !12
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds float, ptr %405, i64 %407
  store float %402, ptr %408, align 4, !tbaa !18
  br label %409

409:                                              ; preds = %384
  %410 = load i32, ptr %52, align 4, !tbaa !12
  %411 = add nsw i32 %410, 1
  store i32 %411, ptr %52, align 4, !tbaa !12
  br label %357, !llvm.loop !33

412:                                              ; preds = %361
  %413 = load ptr, ptr %5, align 8, !tbaa !5
  %414 = getelementptr inbounds %struct.BPNN, ptr %413, i32 0, i32 4
  %415 = load ptr, ptr %414, align 8, !tbaa !32
  %416 = load ptr, ptr %5, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.BPNN, ptr %416, i32 0, i32 5
  %418 = load ptr, ptr %417, align 8, !tbaa !34
  %419 = load ptr, ptr %5, align 8, !tbaa !5
  %420 = getelementptr inbounds %struct.BPNN, ptr %419, i32 0, i32 10
  %421 = load ptr, ptr %420, align 8, !tbaa !35
  %422 = load i32, ptr %9, align 4, !tbaa !12
  %423 = load i32, ptr %10, align 4, !tbaa !12
  call void @_Z17bpnn_layerforwardPfS_PS_ii(ptr noundef %415, ptr noundef %418, ptr noundef %421, i32 noundef %422, i32 noundef %423)
  %424 = load ptr, ptr %5, align 8, !tbaa !5
  %425 = getelementptr inbounds %struct.BPNN, ptr %424, i32 0, i32 7
  %426 = load ptr, ptr %425, align 8, !tbaa !36
  %427 = load ptr, ptr %5, align 8, !tbaa !5
  %428 = getelementptr inbounds %struct.BPNN, ptr %427, i32 0, i32 8
  %429 = load ptr, ptr %428, align 8, !tbaa !37
  %430 = load ptr, ptr %5, align 8, !tbaa !5
  %431 = getelementptr inbounds %struct.BPNN, ptr %430, i32 0, i32 5
  %432 = load ptr, ptr %431, align 8, !tbaa !34
  %433 = load i32, ptr %10, align 4, !tbaa !12
  call void @_Z17bpnn_output_errorPfS_S_iS_(ptr noundef %426, ptr noundef %429, ptr noundef %432, i32 noundef %433, ptr noundef %11)
  %434 = load ptr, ptr %5, align 8, !tbaa !5
  %435 = getelementptr inbounds %struct.BPNN, ptr %434, i32 0, i32 6
  %436 = load ptr, ptr %435, align 8, !tbaa !38
  %437 = load i32, ptr %9, align 4, !tbaa !12
  %438 = load ptr, ptr %5, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.BPNN, ptr %438, i32 0, i32 7
  %440 = load ptr, ptr %439, align 8, !tbaa !36
  %441 = load i32, ptr %10, align 4, !tbaa !12
  %442 = load ptr, ptr %5, align 8, !tbaa !5
  %443 = getelementptr inbounds %struct.BPNN, ptr %442, i32 0, i32 10
  %444 = load ptr, ptr %443, align 8, !tbaa !35
  %445 = load ptr, ptr %5, align 8, !tbaa !5
  %446 = getelementptr inbounds %struct.BPNN, ptr %445, i32 0, i32 4
  %447 = load ptr, ptr %446, align 8, !tbaa !32
  call void @_Z17bpnn_hidden_errorPfiS_iPS_S_S_(ptr noundef %436, i32 noundef %437, ptr noundef %440, i32 noundef %441, ptr noundef %444, ptr noundef %447, ptr noundef %12)
  %448 = load ptr, ptr %5, align 8, !tbaa !5
  %449 = getelementptr inbounds %struct.BPNN, ptr %448, i32 0, i32 7
  %450 = load ptr, ptr %449, align 8, !tbaa !36
  %451 = load i32, ptr %10, align 4, !tbaa !12
  %452 = load ptr, ptr %5, align 8, !tbaa !5
  %453 = getelementptr inbounds %struct.BPNN, ptr %452, i32 0, i32 4
  %454 = load ptr, ptr %453, align 8, !tbaa !32
  %455 = load i32, ptr %9, align 4, !tbaa !12
  %456 = load ptr, ptr %5, align 8, !tbaa !5
  %457 = getelementptr inbounds %struct.BPNN, ptr %456, i32 0, i32 10
  %458 = load ptr, ptr %457, align 8, !tbaa !35
  %459 = load ptr, ptr %5, align 8, !tbaa !5
  %460 = getelementptr inbounds %struct.BPNN, ptr %459, i32 0, i32 12
  %461 = load ptr, ptr %460, align 8, !tbaa !39
  call void @_Z19bpnn_adjust_weightsPfiS_iPS_S0_(ptr noundef %450, i32 noundef %451, ptr noundef %454, i32 noundef %455, ptr noundef %458, ptr noundef %461)
  %462 = load ptr, ptr %40, align 8, !tbaa !5
  %463 = load ptr, ptr %5, align 8, !tbaa !5
  %464 = getelementptr inbounds %struct.BPNN, ptr %463, i32 0, i32 6
  %465 = load ptr, ptr %464, align 8, !tbaa !38
  %466 = load i32, ptr %9, align 4, !tbaa !12
  %467 = add nsw i32 %466, 1
  %468 = sext i32 %467 to i64
  %469 = mul i64 %468, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %462, ptr align 4 %465, i64 %469, i1 false)
  %470 = load i8, ptr %42, align 1, !tbaa !25, !range !29, !noundef !30
  %471 = trunc i8 %470 to i1
  br i1 %471, label %472, label %501

472:                                              ; preds = %412
  %473 = load ptr, ptr %26, align 8, !tbaa !5
  %474 = load ptr, ptr %40, align 8, !tbaa !5
  %475 = call i32 @clSetKernelArgSVMPointer(ptr noundef %473, i32 noundef 0, ptr noundef %474)
  %476 = load ptr, ptr %26, align 8, !tbaa !5
  %477 = call i32 @clSetKernelArg(ptr noundef %476, i32 noundef 1, i64 noundef 4, ptr noundef %9)
  %478 = load ptr, ptr %26, align 8, !tbaa !5
  %479 = load ptr, ptr %37, align 8, !tbaa !5
  %480 = call i32 @clSetKernelArgSVMPointer(ptr noundef %478, i32 noundef 2, ptr noundef %479)
  %481 = load ptr, ptr %26, align 8, !tbaa !5
  %482 = call i32 @clSetKernelArg(ptr noundef %481, i32 noundef 3, i64 noundef 4, ptr noundef %8)
  %483 = load ptr, ptr %26, align 8, !tbaa !5
  %484 = load ptr, ptr %36, align 8, !tbaa !5
  %485 = call i32 @clSetKernelArgSVMPointer(ptr noundef %483, i32 noundef 4, ptr noundef %484)
  %486 = load ptr, ptr %26, align 8, !tbaa !5
  %487 = load ptr, ptr %41, align 8, !tbaa !5
  %488 = call i32 @clSetKernelArgSVMPointer(ptr noundef %486, i32 noundef 5, ptr noundef %487)
  %489 = load ptr, ptr @_ZL9cmd_queue, align 8, !tbaa !5
  %490 = load ptr, ptr %26, align 8, !tbaa !5
  %491 = getelementptr inbounds [2 x i64], ptr %48, i64 0, i64 0
  %492 = getelementptr inbounds [3 x i64], ptr %47, i64 0, i64 0
  %493 = getelementptr inbounds [3 x i64], ptr %32, i64 0, i64 0
  %494 = call i32 @clEnqueueNDRangeKernel(ptr noundef %489, ptr noundef %490, i32 noundef 2, ptr noundef %491, ptr noundef %492, ptr noundef %493, i32 noundef 0, ptr noundef null, ptr noundef %49)
  store i32 %494, ptr %22, align 4, !tbaa !12
  %495 = load i32, ptr %22, align 4, !tbaa !12
  %496 = icmp ne i32 %495, 0
  br i1 %496, label %497, label %500

497:                                              ; preds = %472
  %498 = load i32, ptr %22, align 4, !tbaa !12
  %499 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %498)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %42) #8
  br label %549

500:                                              ; preds = %472
  br label %501

501:                                              ; preds = %500, %412
  %502 = load i8, ptr %43, align 1, !tbaa !25, !range !29, !noundef !30
  %503 = trunc i8 %502 to i1
  br i1 %503, label %504, label %512

504:                                              ; preds = %501
  %505 = load ptr, ptr %40, align 8, !tbaa !5
  %506 = load i32, ptr %9, align 4, !tbaa !12
  %507 = load ptr, ptr %37, align 8, !tbaa !5
  %508 = load i32, ptr %8, align 4, !tbaa !12
  %509 = load ptr, ptr %36, align 8, !tbaa !5
  %510 = load ptr, ptr %41, align 8, !tbaa !5
  %511 = load i32, ptr %45, align 4, !tbaa !12
  call void @_Z23bpnn_adjust_weights_ompPfiS_iS_S_i(ptr noundef %505, i32 noundef %506, ptr noundef %507, i32 noundef %508, ptr noundef %509, ptr noundef %510, i32 noundef %511)
  br label %512

512:                                              ; preds = %504, %501
  %513 = load i8, ptr %42, align 1, !tbaa !25, !range !29, !noundef !30
  %514 = trunc i8 %513 to i1
  br i1 %514, label %515, label %522

515:                                              ; preds = %512
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #8
  %516 = call i32 @clWaitForEvents(i32 noundef 1, ptr noundef %49)
  store i32 %516, ptr %54, align 4, !tbaa !12
  %517 = load i32, ptr %54, align 4, !tbaa !12
  %518 = icmp ne i32 %517, 0
  br i1 %518, label %519, label %521

519:                                              ; preds = %515
  %520 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %521

521:                                              ; preds = %519, %515
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #8
  br label %522

522:                                              ; preds = %521, %512
  %523 = load ptr, ptr %5, align 8, !tbaa !5
  %524 = getelementptr inbounds %struct.BPNN, ptr %523, i32 0, i32 3
  %525 = load ptr, ptr %524, align 8, !tbaa !24
  %526 = load ptr, ptr %37, align 8, !tbaa !5
  %527 = load i32, ptr %8, align 4, !tbaa !12
  %528 = add nsw i32 %527, 1
  %529 = sext i32 %528 to i64
  %530 = mul i64 %529, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %525, ptr align 1 %526, i64 %530, i1 false)
  %531 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %532 = load ptr, ptr %36, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %531, ptr noundef %532)
  %533 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %534 = load ptr, ptr %37, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %533, ptr noundef %534)
  %535 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %536 = load ptr, ptr %38, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %535, ptr noundef %536)
  %537 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %538 = load ptr, ptr %39, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %537, ptr noundef %538)
  %539 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %540 = load ptr, ptr %40, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %539, ptr noundef %540)
  %541 = load ptr, ptr @_ZL7context, align 8, !tbaa !5
  %542 = load ptr, ptr %41, align 8, !tbaa !5
  call void @clSVMFree(ptr noundef %541, ptr noundef %542)
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #8
  %543 = call noundef double @_Z7gettimev()
  store double %543, ptr %55, align 8, !tbaa !27
  %544 = load double, ptr %55, align 8, !tbaa !27
  %545 = load double, ptr %50, align 8, !tbaa !27
  %546 = fsub double %544, %545
  %547 = fmul double 1.000000e+03, %546
  %548 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, double noundef %547)
  unreachable

549:                                              ; preds = %497, %259, %248, %237, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  br label %550

550:                                              ; preds = %549, %157, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %551

551:                                              ; preds = %550, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %552

552:                                              ; preds = %551, %112, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %553

553:                                              ; preds = %552, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %554

554:                                              ; preds = %553, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 21, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 22, ptr %16) #8
  br label %555

555:                                              ; preds = %554, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %556 = load i32, ptr %4, align 4
  ret i32 %556
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

declare i32 @fclose(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL10initializei(i32 noundef) #2

declare ptr @clCreateProgramWithSource(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @clBuildProgram(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare ptr @clCreateKernel(ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @clReleaseProgram(ptr noundef) #4

declare ptr @clSVMAlloc(ptr noundef, i64 noundef, i64 noundef, i32 noundef) #4

declare noundef double @_Z7gettimev() #4

declare i32 @clSetKernelArgSVMPointer(ptr noundef, i32 noundef, ptr noundef) #4

declare i32 @clSetKernelArg(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #4

declare i32 @clEnqueueNDRangeKernel(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #4

declare i32 @clWaitForEvents(i32 noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) #7

declare void @_Z17bpnn_layerforwardPfS_PS_ii(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

declare void @_Z17bpnn_output_errorPfS_S_iS_(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

declare void @_Z17bpnn_hidden_errorPfiS_iPS_S_S_(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare void @_Z19bpnn_adjust_weightsPfiS_iPS_S0_(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #4

declare void @clSVMFree(ptr noundef, ptr noundef) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS4BPNN", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!10, !6, i64 64}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!10, !6, i64 80}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!10, !6, i64 16}
!25 = !{!26, !26, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"double", !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !22}
!32 = !{!10, !6, i64 24}
!33 = distinct !{!33, !22}
!34 = !{!10, !6, i64 32}
!35 = !{!10, !6, i64 72}
!36 = !{!10, !6, i64 48}
!37 = !{!10, !6, i64 56}
!38 = !{!10, !6, i64 40}
!39 = !{!10, !6, i64 88}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [26 x i8], align 1
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp1 = external hidden unnamed_addr constant [22 x i8], align 16
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp2 = external hidden unnamed_addr constant [24 x i8], align 16
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.tempchar = external hidden unnamed_addr constant [21 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@_ZL7context = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@__const._Z17bpnn_train_kernelP4BPNNPfS1_.local_work = external hidden unnamed_addr constant [3 x i64], align 16
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@cpu_offset = external local_unnamed_addr global i32, align 4
@_ZL9cmd_queue = external hidden local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z21bpnn_layerforward_ompPfS_S_S_S_S_iii(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z23bpnn_adjust_weights_ompPfiS_iS_S_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z17bpnn_train_kernelP4BPNNPfS1_(ptr nocapture noundef readonly %0, ptr nocapture noundef readnone %1, ptr nocapture noundef readnone %2) local_unnamed_addr #2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca [22 x i8], align 16
  %9 = alloca [24 x i8], align 16
  %10 = alloca [21 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca [2 x ptr], align 16
  %13 = alloca [3 x i64], align 16
  %14 = alloca [3 x i64], align 16
  %15 = alloca [2 x i64], align 16
  %16 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %17 = load i32, ptr %0, align 8, !tbaa !5
  store i32 %17, ptr %4, align 4, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !12
  store i32 %19, ptr %5, align 4, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = tail call noalias dereferenceable_or_null(1048576) ptr @calloc(i64 noundef 1048576, i64 noundef 1) #10
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %23, label %25

23:                                               ; preds = %3
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1048576)
  br label %312

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 22, ptr nonnull %8) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(22) %8, ptr noundef nonnull align 16 dereferenceable(22) @__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp1, i64 22, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %9, ptr noundef nonnull align 16 dereferenceable(24) @__const._Z17bpnn_train_kernelP4BPNNPfS1_.kernel_bp2, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %10) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(21) %10, ptr noundef nonnull align 16 dereferenceable(21) @__const._Z17bpnn_train_kernelP4BPNNPfS1_.tempchar, i64 21, i1 false)
  %26 = call noalias ptr @fopen(ptr noundef nonnull %10, ptr noundef nonnull @.str.1)
  %.not162 = icmp eq ptr %26, null
  br i1 %.not162, label %27, label %29

27:                                               ; preds = %25
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %10)
  br label %311

29:                                               ; preds = %25
  %30 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %22) #11
  %31 = getelementptr inbounds i8, ptr %22, i64 %30
  %32 = tail call i64 @fread(ptr noundef nonnull %31, i64 noundef 1048576, i64 noundef 1, ptr noundef nonnull %26)
  %33 = tail call i32 @fclose(ptr noundef nonnull %26)
  %34 = tail call noundef i32 @_ZL10initializei(i32 noundef 1)
  %.not163 = icmp eq i32 %34, 0
  br i1 %.not163, label %35, label %311

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #9
  store ptr %22, ptr %12, align 16, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr null, ptr %36, align 8, !tbaa !14
  %37 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %38 = call ptr @clCreateProgramWithSource(ptr noundef %37, i32 noundef 1, ptr noundef nonnull %12, ptr noundef null, ptr noundef nonnull %11)
  %39 = load i32, ptr %11, align 4, !tbaa !11
  %.not164 = icmp eq i32 %39, 0
  br i1 %.not164, label %42, label %40

40:                                               ; preds = %35
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %39)
  br label %310

42:                                               ; preds = %35
  %43 = call i32 @clBuildProgram(ptr noundef %38, i32 noundef 0, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %43, ptr %11, align 4, !tbaa !11
  %.not165 = icmp eq i32 %43, 0
  br i1 %.not165, label %46, label %44

44:                                               ; preds = %42
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %43)
  br label %310

46:                                               ; preds = %42
  %47 = call ptr @clCreateKernel(ptr noundef %38, ptr noundef nonnull %8, ptr noundef nonnull %11)
  %48 = call ptr @clCreateKernel(ptr noundef %38, ptr noundef nonnull %9, ptr noundef nonnull %11)
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %.not166 = icmp eq i32 %49, 0
  br i1 %.not166, label %52, label %50

50:                                               ; preds = %46
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %49)
  br label %310

52:                                               ; preds = %46
  %53 = call i32 @clReleaseProgram(ptr noundef %38)
  %54 = sdiv i32 %17, 16
  %55 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %56 = add i32 %17, 1
  %57 = add i32 %19, 1
  %58 = mul nsw i32 %57, %56
  %59 = sext i32 %58 to i64
  %60 = shl nsw i64 %59, 2
  %61 = call ptr @clSVMAlloc(ptr noundef %55, i64 noundef 1, i64 noundef %60, i32 noundef 0)
  %62 = ptrtoint ptr %61 to i64
  %63 = icmp eq ptr %61, null
  br i1 %63, label %64, label %66

64:                                               ; preds = %52
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %310

66:                                               ; preds = %52
  %67 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %68 = call ptr @clSVMAlloc(ptr noundef %67, i64 noundef 1, i64 noundef %60, i32 noundef 0)
  %69 = ptrtoint ptr %68 to i64
  %70 = icmp eq ptr %68, null
  br i1 %70, label %71, label %73

71:                                               ; preds = %66
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %310

73:                                               ; preds = %66
  %74 = shl nsw i32 %54, 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %13, ptr noundef nonnull align 16 dereferenceable(24) @__const._Z17bpnn_train_kernelP4BPNNPfS1_.local_work, i64 24, i1 false)
  %.not167180 = icmp slt i32 %17, 0
  %.not174177 = icmp slt i32 %19, 0
  %or.cond = select i1 %.not167180, i1 true, i1 %.not174177
  br i1 %or.cond, label %._crit_edge183, label %.preheader175.lr.ph.split

.preheader175.lr.ph.split:                        ; preds = %73
  %75 = getelementptr inbounds i8, ptr %0, i64 80
  %76 = getelementptr inbounds i8, ptr %0, i64 64
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  %78 = load ptr, ptr %75, align 8, !tbaa !16
  %wide.trip.count208 = zext i32 %56 to i64
  %wide.trip.count = zext i32 %57 to i64
  %79 = sub i64 %69, %62
  %min.iters.check = icmp ult i32 %57, 12
  %diff.check = icmp ult i64 %79, 32
  %n.vec = and i64 %wide.trip.count, 4294967288
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %80 = add nsw i64 %wide.trip.count, -1
  br label %.preheader175

.preheader175:                                    ; preds = %.preheader175.lr.ph.split, %._crit_edge
  %indvars.iv205 = phi i64 [ 0, %.preheader175.lr.ph.split ], [ %indvars.iv.next206, %._crit_edge ]
  %.0143182 = phi i64 [ 0, %.preheader175.lr.ph.split ], [ %indvars.iv.next.lcssa, %._crit_edge ]
  %81 = getelementptr inbounds ptr, ptr %77, i64 %indvars.iv205
  %82 = load ptr, ptr %81, align 8, !tbaa !14
  %83 = getelementptr inbounds ptr, ptr %78, i64 %indvars.iv205
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  %sext = shl i64 %.0143182, 32
  %85 = ashr exact i64 %sext, 32
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader175
  %indvars.iv200.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader175 ], [ %n.vec, %middle.block ]
  %indvars.iv.ph = phi i64 [ %85, %vector.memcheck ], [ %85, %.preheader175 ], [ %ind.end, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %86 = getelementptr inbounds float, ptr %82, i64 %indvars.iv200.ph
  %87 = load float, ptr %86, align 4, !tbaa !17
  %88 = getelementptr inbounds float, ptr %61, i64 %indvars.iv.ph
  store float %87, ptr %88, align 4, !tbaa !17
  %89 = getelementptr inbounds float, ptr %84, i64 %indvars.iv200.ph
  %90 = load float, ptr %89, align 4, !tbaa !17
  %91 = getelementptr inbounds float, ptr %68, i64 %indvars.iv.ph
  store float %90, ptr %91, align 4, !tbaa !17
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
  %indvars.iv.next201.prol = or disjoint i64 %indvars.iv200.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.next.lcssa251.unr = phi i64 [ poison, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %indvars.iv200.unr = phi i64 [ %indvars.iv200.ph, %scalar.ph.preheader ], [ %indvars.iv.next201.prol, %scalar.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %92 = icmp eq i64 %indvars.iv200.ph, %80
  br i1 %92, label %._crit_edge, label %scalar.ph

vector.memcheck:                                  ; preds = %.preheader175
  %93 = ptrtoint ptr %84 to i64
  %94 = ptrtoint ptr %82 to i64
  %95 = ashr exact i64 %sext, 30
  %96 = add i64 %95, %62
  %97 = sub i64 %96, %94
  %diff.check234 = icmp ult i64 %97, 32
  %conflict.rdx = or i1 %diff.check, %diff.check234
  %98 = add i64 %95, %62
  %99 = sub i64 %93, %98
  %diff.check235 = icmp ult i64 %99, 32
  %conflict.rdx236 = or i1 %conflict.rdx, %diff.check235
  %100 = add i64 %95, %69
  %101 = sub i64 %100, %94
  %diff.check237 = icmp ult i64 %101, 32
  %conflict.rdx238 = or i1 %conflict.rdx236, %diff.check237
  %102 = sub i64 %100, %93
  %diff.check239 = icmp ult i64 %102, 32
  %conflict.rdx240 = or i1 %conflict.rdx238, %diff.check239
  br i1 %conflict.rdx240, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %ind.end = add nsw i64 %85, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %85, %index
  %103 = getelementptr inbounds float, ptr %82, i64 %index
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %wide.load = load <4 x float>, ptr %103, align 4, !tbaa !17
  %wide.load242 = load <4 x float>, ptr %104, align 4, !tbaa !17
  %105 = getelementptr inbounds float, ptr %61, i64 %offset.idx
  %106 = getelementptr inbounds i8, ptr %105, i64 16
  store <4 x float> %wide.load, ptr %105, align 4, !tbaa !17
  store <4 x float> %wide.load242, ptr %106, align 4, !tbaa !17
  %107 = getelementptr inbounds float, ptr %84, i64 %index
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  %wide.load243 = load <4 x float>, ptr %107, align 4, !tbaa !17
  %wide.load244 = load <4 x float>, ptr %108, align 4, !tbaa !17
  %109 = getelementptr inbounds float, ptr %68, i64 %offset.idx
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  store <4 x float> %wide.load243, ptr %109, align 4, !tbaa !17
  store <4 x float> %wide.load244, ptr %110, align 4, !tbaa !17
  %index.next = add nuw i64 %index, 8
  %111 = icmp eq i64 %index.next, %n.vec
  br i1 %111, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge183:                                   ; preds = %._crit_edge, %73
  %112 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %113 = sext i32 %56 to i64
  %114 = shl nsw i64 %113, 2
  %115 = call ptr @clSVMAlloc(ptr noundef %112, i64 noundef 1, i64 noundef %114, i32 noundef 0)
  %116 = icmp eq ptr %115, null
  br i1 %116, label %129, label %131

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next.lcssa251.unr, %scalar.ph.prol.loopexit ], [ %indvars.iv.next.1, %scalar.ph ]
  %indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
  %exitcond209.not = icmp eq i64 %indvars.iv.next206, %wide.trip.count208
  br i1 %exitcond209.not, label %._crit_edge183, label %.preheader175, !llvm.loop !23

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv200 = phi i64 [ %indvars.iv.next201.1, %scalar.ph ], [ %indvars.iv200.unr, %scalar.ph.prol.loopexit ]
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %117 = getelementptr inbounds float, ptr %82, i64 %indvars.iv200
  %118 = load float, ptr %117, align 4, !tbaa !17
  %119 = getelementptr inbounds float, ptr %61, i64 %indvars.iv
  store float %118, ptr %119, align 4, !tbaa !17
  %120 = getelementptr inbounds float, ptr %84, i64 %indvars.iv200
  %121 = load float, ptr %120, align 4, !tbaa !17
  %122 = getelementptr inbounds float, ptr %68, i64 %indvars.iv
  store float %121, ptr %122, align 4, !tbaa !17
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
  %123 = getelementptr inbounds float, ptr %82, i64 %indvars.iv.next201
  %124 = load float, ptr %123, align 4, !tbaa !17
  %125 = getelementptr inbounds float, ptr %61, i64 %indvars.iv.next
  store float %124, ptr %125, align 4, !tbaa !17
  %126 = getelementptr inbounds float, ptr %84, i64 %indvars.iv.next201
  %127 = load float, ptr %126, align 4, !tbaa !17
  %128 = getelementptr inbounds float, ptr %68, i64 %indvars.iv.next
  store float %127, ptr %128, align 4, !tbaa !17
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %indvars.iv.next201.1 = add nuw nsw i64 %indvars.iv200, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next201.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %scalar.ph, !llvm.loop !24

129:                                              ; preds = %._crit_edge183
  %130 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  br label %309

131:                                              ; preds = %._crit_edge183
  %132 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %133 = sext i32 %57 to i64
  %134 = shl nsw i64 %133, 2
  %135 = call ptr @clSVMAlloc(ptr noundef %132, i64 noundef 1, i64 noundef %134, i32 noundef 0)
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %139

137:                                              ; preds = %131
  %138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %309

139:                                              ; preds = %131
  %140 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %141 = sext i32 %74 to i64
  %142 = shl nsw i64 %141, 2
  %143 = call ptr @clSVMAlloc(ptr noundef %140, i64 noundef 1, i64 noundef %142, i32 noundef 0)
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %147

145:                                              ; preds = %139
  %146 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %309

147:                                              ; preds = %139
  %148 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  %149 = call ptr @clSVMAlloc(ptr noundef %148, i64 noundef 1, i64 noundef %134, i32 noundef 0)
  %150 = icmp eq ptr %149, null
  br i1 %150, label %151, label %153

151:                                              ; preds = %147
  %152 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %309

153:                                              ; preds = %147
  %154 = getelementptr inbounds i8, ptr %0, i64 16
  %155 = load ptr, ptr %154, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %115, ptr align 4 %155, i64 %114, i1 false)
  %156 = load i32, ptr @cpu_offset, align 4, !tbaa !11
  %157 = mul nsw i32 %156, %54
  %158 = sdiv i32 %157, 100
  %159 = shl nsw i32 %158, 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  store i64 16, ptr %14, align 16, !tbaa !26
  %160 = getelementptr inbounds i8, ptr %14, i64 8
  %161 = sub nsw i32 %54, %158
  %162 = shl nsw i32 %161, 4
  %163 = sext i32 %162 to i64
  store i64 %163, ptr %160, align 8, !tbaa !26
  %164 = getelementptr inbounds i8, ptr %14, i64 16
  store i64 1, ptr %164, align 16, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #9
  store i64 0, ptr %15, align 16, !tbaa !26
  %165 = getelementptr inbounds i8, ptr %15, i64 8
  %166 = sext i32 %159 to i64
  store i64 %166, ptr %165, align 8, !tbaa !26
  %167 = icmp sgt i32 %156, 0
  %.not168 = icmp eq i32 %54, %158
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %168 = call noundef double @_Z7gettimev()
  br i1 %.not168, label %182, label %169

169:                                              ; preds = %153
  %170 = call i32 @clSetKernelArgSVMPointer(ptr noundef %47, i32 noundef 0, ptr noundef nonnull %115)
  %171 = call i32 @clSetKernelArgSVMPointer(ptr noundef %47, i32 noundef 1, ptr noundef nonnull %135)
  %172 = call i32 @clSetKernelArgSVMPointer(ptr noundef %47, i32 noundef 2, ptr noundef nonnull %61)
  %173 = call i32 @clSetKernelArgSVMPointer(ptr noundef %47, i32 noundef 3, ptr noundef nonnull %143)
  %174 = call i32 @clSetKernelArg(ptr noundef %47, i32 noundef 4, i64 noundef 64, ptr noundef null)
  %175 = call i32 @clSetKernelArg(ptr noundef %47, i32 noundef 5, i64 noundef 1024, ptr noundef null)
  %176 = call i32 @clSetKernelArg(ptr noundef %47, i32 noundef 6, i64 noundef 4, ptr noundef nonnull %4)
  %177 = call i32 @clSetKernelArg(ptr noundef %47, i32 noundef 7, i64 noundef 4, ptr noundef nonnull %5)
  %178 = load ptr, ptr @_ZL9cmd_queue, align 8, !tbaa !14
  %179 = call i32 @clEnqueueNDRangeKernel(ptr noundef %178, ptr noundef %47, i32 noundef 2, ptr noundef nonnull %15, ptr noundef nonnull %14, ptr noundef nonnull %13, i32 noundef 0, ptr noundef null, ptr noundef nonnull %16)
  store i32 %179, ptr %11, align 4, !tbaa !11
  %.not169 = icmp eq i32 %179, 0
  br i1 %.not169, label %182, label %180

180:                                              ; preds = %169
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  br label %182

182:                                              ; preds = %169, %180, %153
  br i1 %167, label %183, label %186

183:                                              ; preds = %182
  %184 = load i32, ptr %4, align 4, !tbaa !11
  %185 = load i32, ptr %5, align 4, !tbaa !11
  call void @_Z21bpnn_layerforward_ompPfS_S_S_S_S_iii(ptr noundef nonnull %115, ptr noundef nonnull %135, ptr noundef nonnull %61, ptr noundef nonnull %143, ptr noundef null, ptr noundef null, i32 noundef %184, i32 noundef %185, i32 noundef %158)
  br label %186

186:                                              ; preds = %183, %182
  br i1 %.not168, label %191, label %187

187:                                              ; preds = %186
  %188 = call i32 @clWaitForEvents(i32 noundef 1, ptr noundef nonnull %16)
  %.not170 = icmp eq i32 %188, 0
  br i1 %.not170, label %191, label %189

189:                                              ; preds = %187
  %190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %191

191:                                              ; preds = %187, %189, %186
  %192 = load i32, ptr %5, align 4, !tbaa !11
  %.not171189 = icmp slt i32 %192, 1
  br i1 %.not171189, label %.._crit_edge191_crit_edge, label %.preheader.lr.ph

.._crit_edge191_crit_edge:                        ; preds = %191
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 24
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !28
  br label %._crit_edge191

.preheader.lr.ph:                                 ; preds = %191
  %invariant.gep = getelementptr i8, ptr %143, i64 -4
  %193 = icmp sgt i32 %17, 15
  %194 = getelementptr inbounds i8, ptr %0, i64 64
  %195 = getelementptr inbounds i8, ptr %0, i64 24
  br i1 %193, label %.preheader.us.preheader, label %.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count216 = zext nneg i32 %54 to i64
  %196 = add nsw i64 %wide.trip.count216, -1
  %xtraiter252 = and i64 %wide.trip.count216, 3
  %197 = icmp ult i64 %196, 3
  %unroll_iter = and i64 %wide.trip.count216, 134217724
  %lcmp.mod253.not = icmp eq i64 %xtraiter252, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge187.us
  %indvars.iv218 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next219, %._crit_edge187.us ]
  %198 = phi i32 [ %192, %.preheader.us.preheader ], [ %228, %._crit_edge187.us ]
  %199 = sext i32 %198 to i64
  %invariant.gep227 = getelementptr float, ptr %invariant.gep, i64 %indvars.iv218
  br i1 %197, label %._crit_edge187.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv213 = phi i64 [ %indvars.iv.next214.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %.0142185.us = phi float [ %211, %.preheader.us.new ], [ 0.000000e+00, %.preheader.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %200 = mul nsw i64 %indvars.iv213, %199
  %gep = getelementptr float, ptr %invariant.gep227, i64 %200
  %201 = load float, ptr %gep, align 4, !tbaa !17
  %202 = fadd float %.0142185.us, %201
  %indvars.iv.next214 = or disjoint i64 %indvars.iv213, 1
  %203 = mul nsw i64 %indvars.iv.next214, %199
  %gep.1 = getelementptr float, ptr %invariant.gep227, i64 %203
  %204 = load float, ptr %gep.1, align 4, !tbaa !17
  %205 = fadd float %202, %204
  %indvars.iv.next214.1 = or disjoint i64 %indvars.iv213, 2
  %206 = mul nsw i64 %indvars.iv.next214.1, %199
  %gep.2 = getelementptr float, ptr %invariant.gep227, i64 %206
  %207 = load float, ptr %gep.2, align 4, !tbaa !17
  %208 = fadd float %205, %207
  %indvars.iv.next214.2 = or disjoint i64 %indvars.iv213, 3
  %209 = mul nsw i64 %indvars.iv.next214.2, %199
  %gep.3 = getelementptr float, ptr %invariant.gep227, i64 %209
  %210 = load float, ptr %gep.3, align 4, !tbaa !17
  %211 = fadd float %208, %210
  %indvars.iv.next214.3 = add nuw nsw i64 %indvars.iv213, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge187.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !29

._crit_edge187.us.unr-lcssa:                      ; preds = %.preheader.us.new, %.preheader.us
  %.lcssa245.ph = phi float [ poison, %.preheader.us ], [ %211, %.preheader.us.new ]
  %indvars.iv213.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next214.3, %.preheader.us.new ]
  %.0142185.us.unr = phi float [ 0.000000e+00, %.preheader.us ], [ %211, %.preheader.us.new ]
  br i1 %lcmp.mod253.not, label %._crit_edge187.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge187.us.unr-lcssa, %.epil.preheader
  %indvars.iv213.epil = phi i64 [ %indvars.iv.next214.epil, %.epil.preheader ], [ %indvars.iv213.unr, %._crit_edge187.us.unr-lcssa ]
  %.0142185.us.epil = phi float [ %214, %.epil.preheader ], [ %.0142185.us.unr, %._crit_edge187.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge187.us.unr-lcssa ]
  %212 = mul nsw i64 %indvars.iv213.epil, %199
  %gep.epil = getelementptr float, ptr %invariant.gep227, i64 %212
  %213 = load float, ptr %gep.epil, align 4, !tbaa !17
  %214 = fadd float %.0142185.us.epil, %213
  %indvars.iv.next214.epil = add nuw nsw i64 %indvars.iv213.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter252
  br i1 %epil.iter.cmp.not, label %._crit_edge187.us, label %.epil.preheader, !llvm.loop !30

._crit_edge187.us:                                ; preds = %.epil.preheader, %._crit_edge187.us.unr-lcssa
  %.lcssa245 = phi float [ %.lcssa245.ph, %._crit_edge187.us.unr-lcssa ], [ %214, %.epil.preheader ]
  %215 = load ptr, ptr %194, align 8, !tbaa !15
  %216 = load ptr, ptr %215, align 8, !tbaa !14
  %217 = getelementptr inbounds float, ptr %216, i64 %indvars.iv218
  %218 = load float, ptr %217, align 4, !tbaa !17
  %219 = fadd float %.lcssa245, %218
  %220 = fneg float %219
  %221 = call noundef float @_ZSt3expf(float noundef %220)
  %222 = fpext float %221 to double
  %223 = fadd double %222, 1.000000e+00
  %224 = fdiv double 1.000000e+00, %223
  %225 = fptrunc double %224 to float
  %226 = load ptr, ptr %195, align 8, !tbaa !28
  %227 = getelementptr inbounds float, ptr %226, i64 %indvars.iv218
  store float %225, ptr %227, align 4, !tbaa !17
  %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
  %228 = load i32, ptr %5, align 4, !tbaa !11
  %229 = sext i32 %228 to i64
  %.not171.us.not = icmp slt i64 %indvars.iv218, %229
  br i1 %.not171.us.not, label %.preheader.us, label %._crit_edge191, !llvm.loop !32

.preheader:                                       ; preds = %.preheader.lr.ph, %.preheader
  %indvars.iv210 = phi i64 [ %indvars.iv.next211, %.preheader ], [ 1, %.preheader.lr.ph ]
  %230 = load ptr, ptr %194, align 8, !tbaa !15
  %231 = load ptr, ptr %230, align 8, !tbaa !14
  %232 = getelementptr inbounds float, ptr %231, i64 %indvars.iv210
  %233 = load float, ptr %232, align 4, !tbaa !17
  %234 = fadd float %233, 0.000000e+00
  %235 = fneg float %234
  %236 = call noundef float @_ZSt3expf(float noundef %235)
  %237 = fpext float %236 to double
  %238 = fadd double %237, 1.000000e+00
  %239 = fdiv double 1.000000e+00, %238
  %240 = fptrunc double %239 to float
  %241 = load ptr, ptr %195, align 8, !tbaa !28
  %242 = getelementptr inbounds float, ptr %241, i64 %indvars.iv210
  store float %240, ptr %242, align 4, !tbaa !17
  %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
  %243 = load i32, ptr %5, align 4, !tbaa !11
  %244 = sext i32 %243 to i64
  %.not171.not = icmp slt i64 %indvars.iv210, %244
  br i1 %.not171.not, label %.preheader, label %._crit_edge191, !llvm.loop !32

._crit_edge191:                                   ; preds = %.preheader, %._crit_edge187.us, %.._crit_edge191_crit_edge
  %245 = phi ptr [ %.pre, %.._crit_edge191_crit_edge ], [ %226, %._crit_edge187.us ], [ %241, %.preheader ]
  %.lcssa = phi i32 [ %192, %.._crit_edge191_crit_edge ], [ %228, %._crit_edge187.us ], [ %243, %.preheader ]
  %246 = getelementptr inbounds i8, ptr %0, i64 24
  %247 = getelementptr inbounds i8, ptr %0, i64 32
  %248 = load ptr, ptr %247, align 8, !tbaa !33
  %249 = getelementptr inbounds i8, ptr %0, i64 72
  %250 = load ptr, ptr %249, align 8, !tbaa !34
  call void @_Z17bpnn_layerforwardPfS_PS_ii(ptr noundef %245, ptr noundef %248, ptr noundef %250, i32 noundef %.lcssa, i32 noundef %21)
  %251 = getelementptr inbounds i8, ptr %0, i64 48
  %252 = load ptr, ptr %251, align 8, !tbaa !35
  %253 = getelementptr inbounds i8, ptr %0, i64 56
  %254 = load ptr, ptr %253, align 8, !tbaa !36
  %255 = load ptr, ptr %247, align 8, !tbaa !33
  call void @_Z17bpnn_output_errorPfS_S_iS_(ptr noundef %252, ptr noundef %254, ptr noundef %255, i32 noundef %21, ptr noundef nonnull %6)
  %256 = getelementptr inbounds i8, ptr %0, i64 40
  %257 = load ptr, ptr %256, align 8, !tbaa !37
  %258 = load i32, ptr %5, align 4, !tbaa !11
  %259 = load ptr, ptr %251, align 8, !tbaa !35
  %260 = load ptr, ptr %249, align 8, !tbaa !34
  %261 = load ptr, ptr %246, align 8, !tbaa !28
  call void @_Z17bpnn_hidden_errorPfiS_iPS_S_S_(ptr noundef %257, i32 noundef %258, ptr noundef %259, i32 noundef %21, ptr noundef %260, ptr noundef %261, ptr noundef nonnull %7)
  %262 = load ptr, ptr %251, align 8, !tbaa !35
  %263 = load ptr, ptr %246, align 8, !tbaa !28
  %264 = load i32, ptr %5, align 4, !tbaa !11
  %265 = load ptr, ptr %249, align 8, !tbaa !34
  %266 = getelementptr inbounds i8, ptr %0, i64 88
  %267 = load ptr, ptr %266, align 8, !tbaa !38
  call void @_Z19bpnn_adjust_weightsPfiS_iPS_S0_(ptr noundef %262, i32 noundef %21, ptr noundef %263, i32 noundef %264, ptr noundef %265, ptr noundef %267)
  %268 = load ptr, ptr %256, align 8, !tbaa !37
  %269 = load i32, ptr %5, align 4, !tbaa !11
  %270 = add nsw i32 %269, 1
  %271 = sext i32 %270 to i64
  %272 = shl nsw i64 %271, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %149, ptr align 4 %268, i64 %272, i1 false)
  br i1 %.not168, label %284, label %273

273:                                              ; preds = %._crit_edge191
  %274 = call i32 @clSetKernelArgSVMPointer(ptr noundef %48, i32 noundef 0, ptr noundef nonnull %149)
  %275 = call i32 @clSetKernelArg(ptr noundef %48, i32 noundef 1, i64 noundef 4, ptr noundef nonnull %5)
  %276 = call i32 @clSetKernelArgSVMPointer(ptr noundef %48, i32 noundef 2, ptr noundef nonnull %115)
  %277 = call i32 @clSetKernelArg(ptr noundef %48, i32 noundef 3, i64 noundef 4, ptr noundef nonnull %4)
  %278 = call i32 @clSetKernelArgSVMPointer(ptr noundef %48, i32 noundef 4, ptr noundef nonnull %61)
  %279 = call i32 @clSetKernelArgSVMPointer(ptr noundef %48, i32 noundef 5, ptr noundef nonnull %68)
  %280 = load ptr, ptr @_ZL9cmd_queue, align 8, !tbaa !14
  %281 = call i32 @clEnqueueNDRangeKernel(ptr noundef %280, ptr noundef %48, i32 noundef 2, ptr noundef nonnull %15, ptr noundef nonnull %14, ptr noundef nonnull %13, i32 noundef 0, ptr noundef null, ptr noundef nonnull %16)
  store i32 %281, ptr %11, align 4, !tbaa !11
  %.not172 = icmp eq i32 %281, 0
  br i1 %.not172, label %284, label %282

282:                                              ; preds = %273
  %283 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %281)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  br label %309

284:                                              ; preds = %273, %._crit_edge191
  br i1 %167, label %285, label %288

285:                                              ; preds = %284
  %286 = load i32, ptr %5, align 4, !tbaa !11
  %287 = load i32, ptr %4, align 4, !tbaa !11
  call void @_Z23bpnn_adjust_weights_ompPfiS_iS_S_i(ptr noundef nonnull %149, i32 noundef %286, ptr noundef nonnull %115, i32 noundef %287, ptr noundef nonnull %61, ptr noundef nonnull %68, i32 noundef %158)
  br label %288

288:                                              ; preds = %285, %284
  br i1 %.not168, label %293, label %289

289:                                              ; preds = %288
  %290 = call i32 @clWaitForEvents(i32 noundef 1, ptr noundef nonnull %16)
  %.not173 = icmp eq i32 %290, 0
  br i1 %.not173, label %293, label %291

291:                                              ; preds = %289
  %292 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %293

293:                                              ; preds = %289, %291, %288
  %294 = load ptr, ptr %154, align 8, !tbaa !25
  %295 = load i32, ptr %4, align 4, !tbaa !11
  %296 = add nsw i32 %295, 1
  %297 = sext i32 %296 to i64
  %298 = shl nsw i64 %297, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %294, ptr nonnull align 1 %115, i64 %298, i1 false)
  %299 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %299, ptr noundef nonnull %61)
  %300 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %300, ptr noundef nonnull %115)
  %301 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %301, ptr noundef nonnull %135)
  %302 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %302, ptr noundef nonnull %143)
  %303 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %303, ptr noundef nonnull %149)
  %304 = load ptr, ptr @_ZL7context, align 8, !tbaa !14
  call void @clSVMFree(ptr noundef %304, ptr noundef nonnull %68)
  %305 = call noundef double @_Z7gettimev()
  %306 = fsub double %305, %168
  %307 = fmul double %306, 1.000000e+03
  %308 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, double noundef %307)
  unreachable

309:                                              ; preds = %282, %151, %145, %137, %129
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  br label %310

310:                                              ; preds = %50, %309, %71, %64, %44, %40
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  br label %311

311:                                              ; preds = %310, %29, %27
  call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 22, ptr nonnull %8) #9
  br label %312

312:                                              ; preds = %311, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  ret i32 -1
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL10initializei(i32 noundef) local_unnamed_addr #2

declare ptr @clCreateProgramWithSource(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @clBuildProgram(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare ptr @clCreateKernel(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @clReleaseProgram(ptr noundef) local_unnamed_addr #7

declare ptr @clSVMAlloc(ptr noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #7

declare noundef double @_Z7gettimev() local_unnamed_addr #7

declare i32 @clSetKernelArgSVMPointer(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

declare i32 @clSetKernelArg(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #7

declare i32 @clEnqueueNDRangeKernel(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @clWaitForEvents(i32 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) local_unnamed_addr #8

declare void @_Z17bpnn_layerforwardPfS_PS_ii(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

declare void @_Z17bpnn_output_errorPfS_S_iS_(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

declare void @_Z17bpnn_hidden_errorPfiS_iPS_S_S_(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare void @_Z19bpnn_adjust_weightsPfiS_iPS_S0_(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

declare void @clSVMFree(ptr noundef, ptr noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0,1) }
attributes #11 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS4BPNN", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !10, i64 64}
!16 = !{!6, !10, i64 80}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !8, i64 0}
!19 = distinct !{!19, !20, !21, !22}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20, !21}
!25 = !{!6, !10, i64 16}
!26 = !{!27, !27, i64 0}
!27 = !{!"long", !8, i64 0}
!28 = !{!6, !10, i64 24}
!29 = distinct !{!29, !20}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = distinct !{!32, !20}
!33 = !{!6, !10, i64 32}
!34 = !{!6, !10, i64 72}
!35 = !{!6, !10, i64 48}
!36 = !{!6, !10, i64 56}
!37 = !{!6, !10, i64 40}
!38 = !{!6, !10, i64 88}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass