; LLVM IR from ANL-CESAR/XSBench :: opencl (Simulation)

; 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.Inputs = type { i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SimulationData = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i32, i32, ptr, i32, ptr, i32 }
%struct.OpenCLInfo = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.run_event_based_simulation = external hidden unnamed_addr constant [85 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [60 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @run_event_based_simulation(ptr noundef byval(%struct.Inputs) align 8 %0, ptr noundef byval(%struct.SimulationData) align 8 %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca %struct.OpenCLInfo, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca double, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i32, align 4
  store i32 %2, ptr %5, align 4, !tbaa !5
  store ptr %3, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %34 = call double @get_time()
  store double %34, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %35 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = sext i32 %36 to i64
  %38 = mul i64 %37, 4
  %39 = call noalias ptr @malloc(i64 noundef %38) #7
  store ptr %39, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %40 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %40, ptr %9, align 8, !tbaa !9
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  %42 = icmp ne ptr %41, null
  br i1 %42, label %46, label %43

43:                                               ; preds = %4
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.2) #6
  call void @exit(i32 noundef 1) #8
  unreachable

46:                                               ; preds = %4
  %47 = call noalias ptr @malloc(i64 noundef 1048576) #7
  store ptr %47, ptr %10, align 8, !tbaa !9
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  %49 = load ptr, ptr %9, align 8, !tbaa !9
  %50 = call i64 @fread(ptr noundef %48, i64 noundef 1, i64 noundef 1048576, ptr noundef %49)
  store i64 %50, ptr %11, align 8, !tbaa !16
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = call i32 @fclose(ptr noundef %51)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %53 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 11
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 12
  %56 = load i32, ptr %55, align 4, !tbaa !18
  call void @initialize_device(ptr dead_on_unwind writable sret(%struct.OpenCLInfo) align 8 %12, i32 noundef %54, i32 noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %57 = getelementptr inbounds %struct.OpenCLInfo, ptr %12, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  store ptr %58, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %59 = getelementptr inbounds %struct.OpenCLInfo, ptr %12, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  store ptr %60, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %61 = getelementptr inbounds %struct.OpenCLInfo, ptr %12, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  store ptr %62, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %63 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 6
  %64 = load i32, ptr %63, align 8, !tbaa !23
  %65 = sext i32 %64 to i64
  %66 = mul i64 %65, 4
  store i64 %66, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %67 = load ptr, ptr %14, align 8, !tbaa !9
  %68 = load i64, ptr %16, align 8, !tbaa !16
  %69 = call ptr @clCreateBuffer(ptr noundef %67, i64 noundef 4, i64 noundef %68, ptr noundef null, ptr noundef %17)
  store ptr %69, ptr %18, align 8, !tbaa !9
  %70 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %70)
  %71 = load ptr, ptr %15, align 8, !tbaa !9
  %72 = load ptr, ptr %18, align 8, !tbaa !9
  %73 = load i64, ptr %16, align 8, !tbaa !16
  %74 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !25
  %76 = call i32 @clEnqueueWriteBuffer(ptr noundef %71, ptr noundef %72, i32 noundef 1, i64 noundef 0, i64 noundef %73, ptr noundef %75, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %76, ptr %17, align 4, !tbaa !5
  %77 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %77)
  %78 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 7
  %79 = load i32, ptr %78, align 4, !tbaa !26
  %80 = sext i32 %79 to i64
  %81 = mul i64 %80, 8
  store i64 %81, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %82 = load ptr, ptr %14, align 8, !tbaa !9
  %83 = load i64, ptr %16, align 8, !tbaa !16
  %84 = call ptr @clCreateBuffer(ptr noundef %82, i64 noundef 4, i64 noundef %83, ptr noundef null, ptr noundef %17)
  store ptr %84, ptr %19, align 8, !tbaa !9
  %85 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %85)
  %86 = load ptr, ptr %15, align 8, !tbaa !9
  %87 = load ptr, ptr %19, align 8, !tbaa !9
  %88 = load i64, ptr %16, align 8, !tbaa !16
  %89 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !27
  %91 = call i32 @clEnqueueWriteBuffer(ptr noundef %86, ptr noundef %87, i32 noundef 1, i64 noundef 0, i64 noundef %88, ptr noundef %90, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %91, ptr %17, align 4, !tbaa !5
  %92 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %92)
  %93 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 8
  %94 = load i32, ptr %93, align 8, !tbaa !28
  %95 = sext i32 %94 to i64
  %96 = mul i64 %95, 4
  store i64 %96, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %97 = load ptr, ptr %14, align 8, !tbaa !9
  %98 = load i64, ptr %16, align 8, !tbaa !16
  %99 = call ptr @clCreateBuffer(ptr noundef %97, i64 noundef 4, i64 noundef %98, ptr noundef null, ptr noundef %17)
  store ptr %99, ptr %20, align 8, !tbaa !9
  %100 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %100)
  %101 = load ptr, ptr %15, align 8, !tbaa !9
  %102 = load ptr, ptr %20, align 8, !tbaa !9
  %103 = load i64, ptr %16, align 8, !tbaa !16
  %104 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !29
  %106 = call i32 @clEnqueueWriteBuffer(ptr noundef %101, ptr noundef %102, i32 noundef 1, i64 noundef 0, i64 noundef %103, ptr noundef %105, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %106, ptr %17, align 4, !tbaa !5
  %107 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %107)
  %108 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 9
  %109 = load i32, ptr %108, align 4, !tbaa !30
  %110 = sext i32 %109 to i64
  %111 = mul i64 %110, 8
  store i64 %111, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %112 = load i64, ptr %16, align 8, !tbaa !16
  %113 = icmp ugt i64 %112, 0
  br i1 %113, label %114, label %126

114:                                              ; preds = %46
  %115 = load ptr, ptr %14, align 8, !tbaa !9
  %116 = load i64, ptr %16, align 8, !tbaa !16
  %117 = call ptr @clCreateBuffer(ptr noundef %115, i64 noundef 4, i64 noundef %116, ptr noundef null, ptr noundef %17)
  store ptr %117, ptr %21, align 8, !tbaa !9
  %118 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %118)
  %119 = load ptr, ptr %15, align 8, !tbaa !9
  %120 = load ptr, ptr %21, align 8, !tbaa !9
  %121 = load i64, ptr %16, align 8, !tbaa !16
  %122 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 3
  %123 = load ptr, ptr %122, align 8, !tbaa !31
  %124 = call i32 @clEnqueueWriteBuffer(ptr noundef %119, ptr noundef %120, i32 noundef 1, i64 noundef 0, i64 noundef %121, ptr noundef %123, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %124, ptr %17, align 4, !tbaa !5
  %125 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %125)
  br label %126

126:                                              ; preds = %114, %46
  %127 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 10
  %128 = load i64, ptr %127, align 8, !tbaa !32
  %129 = mul i64 %128, 4
  store i64 %129, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %130 = load i64, ptr %16, align 8, !tbaa !16
  %131 = icmp ugt i64 %130, 0
  br i1 %131, label %132, label %163

132:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %133 = load ptr, ptr %13, align 8, !tbaa !9
  %134 = call i32 @clGetDeviceInfo(ptr noundef %133, i32 noundef 4112, i64 noundef 8, ptr noundef %23, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %135 = load i64, ptr %16, align 8, !tbaa !16
  store i64 %135, ptr %24, align 8, !tbaa !16
  %136 = load i64, ptr %24, align 8, !tbaa !16
  %137 = load i64, ptr %23, align 8, !tbaa !16
  %138 = icmp ule i64 %136, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %132
  br label %141

140:                                              ; preds = %132
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.run_event_based_simulation) #8
  unreachable

141:                                              ; preds = %139
  %142 = load ptr, ptr %14, align 8, !tbaa !9
  %143 = load i64, ptr %16, align 8, !tbaa !16
  %144 = call ptr @clCreateBuffer(ptr noundef %142, i64 noundef 4, i64 noundef %143, ptr noundef null, ptr noundef %17)
  store ptr %144, ptr %22, align 8, !tbaa !9
  %145 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %145)
  %146 = load i32, ptr %17, align 4, !tbaa !5
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %141
  br label %150

149:                                              ; preds = %141
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 118, ptr noundef @__PRETTY_FUNCTION__.run_event_based_simulation) #8
  unreachable

150:                                              ; preds = %148
  %151 = load ptr, ptr %22, align 8, !tbaa !9
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %154

153:                                              ; preds = %150
  br label %155

154:                                              ; preds = %150
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 119, ptr noundef @__PRETTY_FUNCTION__.run_event_based_simulation) #8
  unreachable

155:                                              ; preds = %153
  %156 = load ptr, ptr %15, align 8, !tbaa !9
  %157 = load ptr, ptr %22, align 8, !tbaa !9
  %158 = load i64, ptr %16, align 8, !tbaa !16
  %159 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 4
  %160 = load ptr, ptr %159, align 8, !tbaa !33
  %161 = call i32 @clEnqueueWriteBuffer(ptr noundef %156, ptr noundef %157, i32 noundef 1, i64 noundef 0, i64 noundef %158, ptr noundef %160, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %161, ptr %17, align 4, !tbaa !5
  %162 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %162)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %163

163:                                              ; preds = %155, %126
  %164 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 11
  %165 = load i32, ptr %164, align 8, !tbaa !34
  %166 = sext i32 %165 to i64
  %167 = mul i64 %166, 48
  store i64 %167, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %168 = load ptr, ptr %14, align 8, !tbaa !9
  %169 = load i64, ptr %16, align 8, !tbaa !16
  %170 = call ptr @clCreateBuffer(ptr noundef %168, i64 noundef 4, i64 noundef %169, ptr noundef null, ptr noundef %17)
  store ptr %170, ptr %25, align 8, !tbaa !9
  %171 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %171)
  %172 = load ptr, ptr %15, align 8, !tbaa !9
  %173 = load ptr, ptr %25, align 8, !tbaa !9
  %174 = load i64, ptr %16, align 8, !tbaa !16
  %175 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 5
  %176 = load ptr, ptr %175, align 8, !tbaa !35
  %177 = call i32 @clEnqueueWriteBuffer(ptr noundef %172, ptr noundef %173, i32 noundef 1, i64 noundef 0, i64 noundef %174, ptr noundef %176, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %177, ptr %17, align 4, !tbaa !5
  %178 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %178)
  %179 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %180 = load i32, ptr %179, align 8, !tbaa !13
  %181 = sext i32 %180 to i64
  %182 = mul i64 %181, 4
  store i64 %182, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %183 = load ptr, ptr %14, align 8, !tbaa !9
  %184 = load i64, ptr %16, align 8, !tbaa !16
  %185 = call ptr @clCreateBuffer(ptr noundef %183, i64 noundef 1, i64 noundef %184, ptr noundef null, ptr noundef %17)
  store ptr %185, ptr %26, align 8, !tbaa !9
  %186 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %186)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %187 = load ptr, ptr %14, align 8, !tbaa !9
  %188 = call ptr @clCreateProgramWithSource(ptr noundef %187, i32 noundef 1, ptr noundef %10, ptr noundef %11, ptr noundef %17)
  store ptr %188, ptr %27, align 8, !tbaa !9
  %189 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %189)
  %190 = load ptr, ptr %27, align 8, !tbaa !9
  %191 = call i32 @clBuildProgram(ptr noundef %190, i32 noundef 1, ptr noundef %13, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %191, ptr %17, align 4, !tbaa !5
  %192 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %192)
  %193 = load ptr, ptr %27, align 8, !tbaa !9
  %194 = load ptr, ptr %13, align 8, !tbaa !9
  call void @printCompilerError(ptr noundef %193, ptr noundef %194)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %195 = load ptr, ptr %27, align 8, !tbaa !9
  %196 = call ptr @clCreateKernel(ptr noundef %195, ptr noundef @.str.7, ptr noundef %17)
  store ptr %196, ptr %28, align 8, !tbaa !9
  %197 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %197)
  %198 = load ptr, ptr %28, align 8, !tbaa !9
  %199 = call i32 @clSetKernelArg(ptr noundef %198, i32 noundef 0, i64 noundef 64, ptr noundef %0)
  store i32 %199, ptr %17, align 4, !tbaa !5
  %200 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %200)
  %201 = load ptr, ptr %28, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 12
  %203 = call i32 @clSetKernelArg(ptr noundef %201, i32 noundef 1, i64 noundef 4, ptr noundef %202)
  store i32 %203, ptr %17, align 4, !tbaa !5
  %204 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %204)
  %205 = load ptr, ptr %28, align 8, !tbaa !9
  %206 = call i32 @clSetKernelArg(ptr noundef %205, i32 noundef 2, i64 noundef 8, ptr noundef %18)
  store i32 %206, ptr %17, align 4, !tbaa !5
  %207 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %207)
  %208 = load ptr, ptr %28, align 8, !tbaa !9
  %209 = call i32 @clSetKernelArg(ptr noundef %208, i32 noundef 3, i64 noundef 8, ptr noundef %19)
  store i32 %209, ptr %17, align 4, !tbaa !5
  %210 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %210)
  %211 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 9
  %212 = load i32, ptr %211, align 4, !tbaa !30
  %213 = icmp sgt i32 %212, 0
  br i1 %213, label %214, label %218

214:                                              ; preds = %163
  %215 = load ptr, ptr %28, align 8, !tbaa !9
  %216 = call i32 @clSetKernelArg(ptr noundef %215, i32 noundef 4, i64 noundef 8, ptr noundef %21)
  store i32 %216, ptr %17, align 4, !tbaa !5
  %217 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %217)
  br label %222

218:                                              ; preds = %163
  %219 = load ptr, ptr %28, align 8, !tbaa !9
  %220 = call i32 @clSetKernelArg(ptr noundef %219, i32 noundef 4, i64 noundef 8, ptr noundef null)
  store i32 %220, ptr %17, align 4, !tbaa !5
  %221 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %221)
  br label %222

222:                                              ; preds = %218, %214
  %223 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 10
  %224 = load i64, ptr %223, align 8, !tbaa !32
  %225 = icmp sgt i64 %224, 0
  br i1 %225, label %226, label %230

226:                                              ; preds = %222
  %227 = load ptr, ptr %28, align 8, !tbaa !9
  %228 = call i32 @clSetKernelArg(ptr noundef %227, i32 noundef 5, i64 noundef 8, ptr noundef %22)
  store i32 %228, ptr %17, align 4, !tbaa !5
  %229 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %229)
  br label %234

230:                                              ; preds = %222
  %231 = load ptr, ptr %28, align 8, !tbaa !9
  %232 = call i32 @clSetKernelArg(ptr noundef %231, i32 noundef 5, i64 noundef 8, ptr noundef null)
  store i32 %232, ptr %17, align 4, !tbaa !5
  %233 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %233)
  br label %234

234:                                              ; preds = %230, %226
  %235 = load ptr, ptr %28, align 8, !tbaa !9
  %236 = call i32 @clSetKernelArg(ptr noundef %235, i32 noundef 6, i64 noundef 8, ptr noundef %25)
  store i32 %236, ptr %17, align 4, !tbaa !5
  %237 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %237)
  %238 = load ptr, ptr %28, align 8, !tbaa !9
  %239 = call i32 @clSetKernelArg(ptr noundef %238, i32 noundef 7, i64 noundef 8, ptr noundef %20)
  store i32 %239, ptr %17, align 4, !tbaa !5
  %240 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %240)
  %241 = load ptr, ptr %28, align 8, !tbaa !9
  %242 = call i32 @clSetKernelArg(ptr noundef %241, i32 noundef 8, i64 noundef 8, ptr noundef %26)
  store i32 %242, ptr %17, align 4, !tbaa !5
  %243 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %243)
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %244 = call double @get_time()
  store double %244, ptr %29, align 8, !tbaa !11
  %245 = load i32, ptr %5, align 4, !tbaa !5
  %246 = icmp eq i32 %245, 0
  br i1 %246, label %247, label %252

247:                                              ; preds = %234
  %248 = load double, ptr %29, align 8, !tbaa !11
  %249 = load double, ptr %7, align 8, !tbaa !11
  %250 = fsub double %248, %249
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, double noundef %250)
  br label %252

252:                                              ; preds = %247, %234
  %253 = load double, ptr %29, align 8, !tbaa !11
  store double %253, ptr %7, align 8, !tbaa !11
  %254 = load i32, ptr %5, align 4, !tbaa !5
  %255 = icmp eq i32 %254, 0
  br i1 %255, label %256, label %257

256:                                              ; preds = %252
  call void @border_print()
  call void @center_print(ptr noundef @.str.9, i32 noundef 79)
  call void @border_print()
  br label %257

257:                                              ; preds = %256, %252
  %258 = load i32, ptr %5, align 4, !tbaa !5
  %259 = icmp eq i32 %258, 0
  br i1 %259, label %260, label %262

260:                                              ; preds = %257
  %261 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %262

262:                                              ; preds = %260, %257
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store i64 256, ptr %30, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %263 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %264 = load i32, ptr %263, align 8, !tbaa !13
  %265 = sext i32 %264 to i64
  store i64 %265, ptr %31, align 8, !tbaa !16
  %266 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %267 = load i32, ptr %266, align 8, !tbaa !13
  %268 = sext i32 %267 to i64
  %269 = load i64, ptr %30, align 8, !tbaa !16
  %270 = urem i64 %268, %269
  %271 = icmp ne i64 %270, 0
  br i1 %271, label %272, label %287

272:                                              ; preds = %262
  %273 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %274 = load i32, ptr %273, align 8, !tbaa !13
  %275 = sext i32 %274 to i64
  %276 = load i64, ptr %30, align 8, !tbaa !16
  %277 = icmp ugt i64 %275, %276
  br i1 %277, label %278, label %287

278:                                              ; preds = %272
  %279 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %280 = load i32, ptr %279, align 8, !tbaa !13
  %281 = sext i32 %280 to i64
  %282 = load i64, ptr %30, align 8, !tbaa !16
  %283 = udiv i64 %281, %282
  %284 = add i64 %283, 1
  %285 = load i64, ptr %30, align 8, !tbaa !16
  %286 = mul i64 %284, %285
  store i64 %286, ptr %31, align 8, !tbaa !16
  br label %287

287:                                              ; preds = %278, %272, %262
  %288 = load ptr, ptr %15, align 8, !tbaa !9
  %289 = load ptr, ptr %28, align 8, !tbaa !9
  %290 = call i32 @clEnqueueNDRangeKernel(ptr noundef %288, ptr noundef %289, i32 noundef 1, ptr noundef null, ptr noundef %31, ptr noundef %30, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %290, ptr %17, align 4, !tbaa !5
  %291 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %291)
  %292 = load ptr, ptr %15, align 8, !tbaa !9
  %293 = load ptr, ptr %26, align 8, !tbaa !9
  %294 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %295 = load i32, ptr %294, align 8, !tbaa !13
  %296 = sext i32 %295 to i64
  %297 = mul i64 %296, 4
  %298 = load ptr, ptr %8, align 8, !tbaa !9
  %299 = call i32 @clEnqueueReadBuffer(ptr noundef %292, ptr noundef %293, i32 noundef 1, i64 noundef 0, i64 noundef %297, ptr noundef %298, i32 noundef 0, ptr noundef null, ptr noundef null)
  store i32 %299, ptr %17, align 4, !tbaa !5
  %300 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %300)
  %301 = call double @get_time()
  store double %301, ptr %29, align 8, !tbaa !11
  %302 = load i32, ptr %5, align 4, !tbaa !5
  %303 = icmp eq i32 %302, 0
  br i1 %303, label %304, label %306

304:                                              ; preds = %287
  %305 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %306

306:                                              ; preds = %304, %287
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  store i64 0, ptr %32, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %307

307:                                              ; preds = %322, %306
  %308 = load i32, ptr %33, align 4, !tbaa !5
  %309 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %310 = load i32, ptr %309, align 8, !tbaa !13
  %311 = icmp slt i32 %308, %310
  br i1 %311, label %313, label %312

312:                                              ; preds = %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %325

313:                                              ; preds = %307
  %314 = load ptr, ptr %8, align 8, !tbaa !9
  %315 = load i32, ptr %33, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds i32, ptr %314, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = load i64, ptr %32, align 8, !tbaa !36
  %321 = add i64 %320, %319
  store i64 %321, ptr %32, align 8, !tbaa !36
  br label %322

322:                                              ; preds = %313
  %323 = load i32, ptr %33, align 4, !tbaa !5
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %33, align 4, !tbaa !5
  br label %307, !llvm.loop !38

325:                                              ; preds = %312
  %326 = load double, ptr %29, align 8, !tbaa !11
  %327 = load double, ptr %7, align 8, !tbaa !11
  %328 = fsub double %326, %327
  %329 = load ptr, ptr %6, align 8, !tbaa !9
  store double %328, ptr %329, align 8, !tbaa !11
  %330 = load i32, ptr %5, align 4, !tbaa !5
  %331 = icmp eq i32 %330, 0
  br i1 %331, label %332, label %336

332:                                              ; preds = %325
  %333 = load ptr, ptr %6, align 8, !tbaa !9
  %334 = load double, ptr %333, align 8, !tbaa !11
  %335 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, double noundef %334)
  br label %336

336:                                              ; preds = %332, %325
  %337 = load ptr, ptr %15, align 8, !tbaa !9
  %338 = call i32 @clFlush(ptr noundef %337)
  store i32 %338, ptr %17, align 4, !tbaa !5
  %339 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %339)
  %340 = load ptr, ptr %15, align 8, !tbaa !9
  %341 = call i32 @clFinish(ptr noundef %340)
  store i32 %341, ptr %17, align 4, !tbaa !5
  %342 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %342)
  %343 = load ptr, ptr %28, align 8, !tbaa !9
  %344 = call i32 @clReleaseKernel(ptr noundef %343)
  store i32 %344, ptr %17, align 4, !tbaa !5
  %345 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %345)
  %346 = load ptr, ptr %27, align 8, !tbaa !9
  %347 = call i32 @clReleaseProgram(ptr noundef %346)
  store i32 %347, ptr %17, align 4, !tbaa !5
  %348 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %348)
  %349 = load ptr, ptr %18, align 8, !tbaa !9
  %350 = call i32 @clReleaseMemObject(ptr noundef %349)
  store i32 %350, ptr %17, align 4, !tbaa !5
  %351 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %351)
  %352 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 9
  %353 = load i32, ptr %352, align 4, !tbaa !30
  %354 = icmp sgt i32 %353, 0
  br i1 %354, label %355, label %359

355:                                              ; preds = %336
  %356 = load ptr, ptr %21, align 8, !tbaa !9
  %357 = call i32 @clReleaseMemObject(ptr noundef %356)
  store i32 %357, ptr %17, align 4, !tbaa !5
  %358 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %358)
  br label %359

359:                                              ; preds = %355, %336
  %360 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 10
  %361 = load i64, ptr %360, align 8, !tbaa !32
  %362 = icmp sgt i64 %361, 0
  br i1 %362, label %363, label %367

363:                                              ; preds = %359
  %364 = load ptr, ptr %22, align 8, !tbaa !9
  %365 = call i32 @clReleaseMemObject(ptr noundef %364)
  store i32 %365, ptr %17, align 4, !tbaa !5
  %366 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %366)
  br label %367

367:                                              ; preds = %363, %359
  %368 = load ptr, ptr %25, align 8, !tbaa !9
  %369 = call i32 @clReleaseMemObject(ptr noundef %368)
  store i32 %369, ptr %17, align 4, !tbaa !5
  %370 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %370)
  %371 = load ptr, ptr %20, align 8, !tbaa !9
  %372 = call i32 @clReleaseMemObject(ptr noundef %371)
  store i32 %372, ptr %17, align 4, !tbaa !5
  %373 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %373)
  %374 = load ptr, ptr %26, align 8, !tbaa !9
  %375 = call i32 @clReleaseMemObject(ptr noundef %374)
  store i32 %375, ptr %17, align 4, !tbaa !5
  %376 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %376)
  %377 = load ptr, ptr %15, align 8, !tbaa !9
  %378 = call i32 @clReleaseCommandQueue(ptr noundef %377)
  store i32 %378, ptr %17, align 4, !tbaa !5
  %379 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %379)
  %380 = load ptr, ptr %14, align 8, !tbaa !9
  %381 = call i32 @clReleaseContext(ptr noundef %380)
  store i32 %381, ptr %17, align 4, !tbaa !5
  %382 = load i32, ptr %17, align 4, !tbaa !5
  call void @check(i32 noundef %382)
  %383 = load i64, ptr %32, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret i64 %383
}

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

declare double @get_time() #2

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

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

declare i32 @fclose(ptr noundef) #2

declare void @initialize_device(ptr dead_on_unwind writable sret(%struct.OpenCLInfo) align 8, i32 noundef, i32 noundef) #2

declare ptr @clCreateBuffer(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #2

declare void @check(i32 noundef) #2

declare i32 @clEnqueueWriteBuffer(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @clGetDeviceInfo(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

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

declare void @printCompilerError(ptr noundef, ptr noundef) #2

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

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

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

declare void @border_print() #2

declare void @center_print(ptr noundef, i32 noundef) #2

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

declare i32 @clEnqueueReadBuffer(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @clFlush(ptr noundef) #2

declare i32 @clFinish(ptr noundef) #2

declare i32 @clReleaseKernel(ptr noundef) #2

declare i32 @clReleaseProgram(ptr noundef) #2

declare i32 @clReleaseMemObject(ptr noundef) #2

declare i32 @clReleaseCommandQueue(ptr noundef) #2

declare i32 @clReleaseContext(ptr noundef) #2

attributes #0 = { 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 = { "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) "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 = { 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 = { noreturn 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { noreturn nounwind }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"", !6, i64 0, !15, i64 8, !15, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60}
!15 = !{!"long", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!14, !6, i64 56}
!18 = !{!14, !6, i64 60}
!19 = !{!20, !10, i64 8}
!20 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!20, !10, i64 16}
!22 = !{!20, !10, i64 24}
!23 = !{!24, !6, i64 48}
!24 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !15, i64 64, !6, i64 72, !6, i64 76, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104}
!25 = !{!24, !10, i64 0}
!26 = !{!24, !6, i64 52}
!27 = !{!24, !10, i64 8}
!28 = !{!24, !6, i64 56}
!29 = !{!24, !10, i64 16}
!30 = !{!24, !6, i64 60}
!31 = !{!24, !10, i64 24}
!32 = !{!24, !15, i64 64}
!33 = !{!24, !10, i64 32}
!34 = !{!24, !6, i64 72}
!35 = !{!24, !10, i64 40}
!36 = !{!37, !37, i64 0}
!37 = !{!"long long", !7, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


; 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"

%struct.Inputs = type { i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SimulationData = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i32, i32, ptr, i32, ptr, i32 }
%struct.OpenCLInfo = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.run_event_based_simulation = external hidden unnamed_addr constant [85 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [60 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @run_event_based_simulation(ptr noundef byval(%struct.Inputs) align 8 %0, ptr noundef byval(%struct.SimulationData) align 8 %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %struct.OpenCLInfo, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = tail call double @get_time() #7
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = load i32, ptr %21, align 8, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = shl nsw i64 %23, 2
  %25 = tail call noalias ptr @malloc(i64 noundef %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %26 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %27, label %30

27:                                               ; preds = %4
  %28 = load ptr, ptr @stderr, align 8, !tbaa !11
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.2) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

30:                                               ; preds = %4
  %31 = tail call noalias dereferenceable_or_null(1048576) ptr @malloc(i64 noundef 1048576) #8
  store ptr %31, ptr %5, align 8, !tbaa !11
  %32 = tail call i64 @fread(ptr noundef %31, i64 noundef 1, i64 noundef 1048576, ptr noundef nonnull %26)
  store i64 %32, ptr %6, align 8, !tbaa !13
  %33 = tail call i32 @fclose(ptr noundef nonnull %26)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %34 = getelementptr inbounds i8, ptr %0, i64 56
  %35 = load i32, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %0, i64 60
  %37 = load i32, ptr %36, align 4, !tbaa !15
  call void @initialize_device(ptr dead_on_unwind nonnull writable sret(%struct.OpenCLInfo) align 8 %7, i32 noundef %35, i32 noundef %37) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %38 = getelementptr inbounds i8, ptr %7, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  store ptr %39, ptr %8, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %7, i64 16
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = getelementptr inbounds i8, ptr %7, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %1, i64 48
  %45 = load i32, ptr %44, align 8, !tbaa !20
  %46 = sext i32 %45 to i64
  %47 = shl nsw i64 %46, 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %48 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %47, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %48, ptr %10, align 8, !tbaa !11
  %49 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %49) #7
  %50 = load ptr, ptr %1, align 8, !tbaa !23
  %51 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef %48, i32 noundef 1, i64 noundef 0, i64 noundef %47, ptr noundef %50, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %51, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %51) #7
  %52 = getelementptr inbounds i8, ptr %1, i64 52
  %53 = load i32, ptr %52, align 4, !tbaa !24
  %54 = sext i32 %53 to i64
  %55 = shl nsw i64 %54, 3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %56 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %55, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %56, ptr %11, align 8, !tbaa !11
  %57 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %57) #7
  %58 = getelementptr inbounds i8, ptr %1, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !25
  %60 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef %56, i32 noundef 1, i64 noundef 0, i64 noundef %55, ptr noundef %59, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %60, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %60) #7
  %61 = getelementptr inbounds i8, ptr %1, i64 56
  %62 = load i32, ptr %61, align 8, !tbaa !26
  %63 = sext i32 %62 to i64
  %64 = shl nsw i64 %63, 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %65 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %64, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %65, ptr %12, align 8, !tbaa !11
  %66 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %66) #7
  %67 = getelementptr inbounds i8, ptr %1, i64 16
  %68 = load ptr, ptr %67, align 8, !tbaa !27
  %69 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef %65, i32 noundef 1, i64 noundef 0, i64 noundef %64, ptr noundef %68, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %69, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %69) #7
  %70 = getelementptr inbounds i8, ptr %1, i64 60
  %71 = load i32, ptr %70, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %.not82 = icmp eq i32 %71, 0
  br i1 %.not82, label %80, label %72

72:                                               ; preds = %30
  %73 = sext i32 %71 to i64
  %74 = shl nsw i64 %73, 3
  %75 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %74, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %75, ptr %13, align 8, !tbaa !11
  %76 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %76) #7
  %77 = getelementptr inbounds i8, ptr %1, i64 24
  %78 = load ptr, ptr %77, align 8, !tbaa !29
  %79 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef %75, i32 noundef 1, i64 noundef 0, i64 noundef %74, ptr noundef %78, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %79, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %79) #7
  br label %80

80:                                               ; preds = %72, %30
  %81 = getelementptr inbounds i8, ptr %1, i64 64
  %82 = load i64, ptr %81, align 8, !tbaa !30
  %83 = shl i64 %82, 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %.not83 = icmp eq i64 %83, 0
  br i1 %.not83, label %100, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %85 = call i32 @clGetDeviceInfo(ptr noundef %39, i32 noundef 4112, i64 noundef 8, ptr noundef nonnull %15, ptr noundef null) #7
  %86 = load i64, ptr %15, align 8, !tbaa !13
  %.not84 = icmp ugt i64 %83, %86
  br i1 %.not84, label %87, label %88

87:                                               ; preds = %84
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 114, ptr noundef nonnull @__PRETTY_FUNCTION__.run_event_based_simulation) #10
  unreachable

88:                                               ; preds = %84
  %89 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %83, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %89, ptr %14, align 8, !tbaa !11
  %90 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %90) #7
  %91 = load i32, ptr %9, align 4, !tbaa !22
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 118, ptr noundef nonnull @__PRETTY_FUNCTION__.run_event_based_simulation) #10
  unreachable

94:                                               ; preds = %88
  %.not85 = icmp eq ptr %89, null
  br i1 %.not85, label %95, label %96

95:                                               ; preds = %94
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 119, ptr noundef nonnull @__PRETTY_FUNCTION__.run_event_based_simulation) #10
  unreachable

96:                                               ; preds = %94
  %97 = getelementptr inbounds i8, ptr %1, i64 32
  %98 = load ptr, ptr %97, align 8, !tbaa !31
  %99 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef nonnull %89, i32 noundef 1, i64 noundef 0, i64 noundef %83, ptr noundef %98, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %99, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %99) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  br label %100

100:                                              ; preds = %96, %80
  %101 = getelementptr inbounds i8, ptr %1, i64 72
  %102 = load i32, ptr %101, align 8, !tbaa !32
  %103 = sext i32 %102 to i64
  %104 = mul nsw i64 %103, 48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %105 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 4, i64 noundef %104, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %105, ptr %16, align 8, !tbaa !11
  %106 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %106) #7
  %107 = getelementptr inbounds i8, ptr %1, i64 40
  %108 = load ptr, ptr %107, align 8, !tbaa !33
  %109 = call i32 @clEnqueueWriteBuffer(ptr noundef %43, ptr noundef %105, i32 noundef 1, i64 noundef 0, i64 noundef %104, ptr noundef %108, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %109, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %109) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %110 = call ptr @clCreateBuffer(ptr noundef %41, i64 noundef 1, i64 noundef %24, ptr noundef null, ptr noundef nonnull %9) #7
  store ptr %110, ptr %17, align 8, !tbaa !11
  %111 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %111) #7
  %112 = call ptr @clCreateProgramWithSource(ptr noundef %41, i32 noundef 1, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %9) #7
  %113 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %113) #7
  %114 = call i32 @clBuildProgram(ptr noundef %112, i32 noundef 1, ptr noundef nonnull %8, ptr noundef null, ptr noundef null, ptr noundef null) #7
  store i32 %114, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %114) #7
  %115 = load ptr, ptr %8, align 8, !tbaa !11
  call void @printCompilerError(ptr noundef %112, ptr noundef %115) #7
  %116 = call ptr @clCreateKernel(ptr noundef %112, ptr noundef nonnull @.str.7, ptr noundef nonnull %9) #7
  %117 = load i32, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %117) #7
  %118 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 0, i64 noundef 64, ptr noundef nonnull %0) #7
  store i32 %118, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %118) #7
  %119 = getelementptr inbounds i8, ptr %1, i64 76
  %120 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 1, i64 noundef 4, ptr noundef nonnull %119) #7
  store i32 %120, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %120) #7
  %121 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 2, i64 noundef 8, ptr noundef nonnull %10) #7
  store i32 %121, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %121) #7
  %122 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 3, i64 noundef 8, ptr noundef nonnull %11) #7
  store i32 %122, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %122) #7
  %123 = load i32, ptr %70, align 4, !tbaa !28
  %124 = icmp sgt i32 %123, 0
  br i1 %124, label %125, label %127

125:                                              ; preds = %100
  %126 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 4, i64 noundef 8, ptr noundef nonnull %13) #7
  br label %129

127:                                              ; preds = %100
  %128 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 4, i64 noundef 8, ptr noundef null) #7
  br label %129

129:                                              ; preds = %127, %125
  %.sink = phi i32 [ %128, %127 ], [ %126, %125 ]
  store i32 %.sink, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %.sink) #7
  %130 = load i64, ptr %81, align 8, !tbaa !30
  %131 = icmp sgt i64 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 5, i64 noundef 8, ptr noundef nonnull %14) #7
  br label %136

134:                                              ; preds = %129
  %135 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 5, i64 noundef 8, ptr noundef null) #7
  br label %136

136:                                              ; preds = %134, %132
  %.sink91 = phi i32 [ %135, %134 ], [ %133, %132 ]
  store i32 %.sink91, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %.sink91) #7
  %137 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 6, i64 noundef 8, ptr noundef nonnull %16) #7
  store i32 %137, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %137) #7
  %138 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 7, i64 noundef 8, ptr noundef nonnull %12) #7
  store i32 %138, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %138) #7
  %139 = call i32 @clSetKernelArg(ptr noundef %116, i32 noundef 8, i64 noundef 8, ptr noundef nonnull %17) #7
  store i32 %139, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %139) #7
  %140 = call double @get_time() #7
  %141 = icmp eq i32 %2, 0
  br i1 %141, label %.critedge, label %.critedge87

.critedge:                                        ; preds = %136
  %142 = fsub double %140, %20
  %143 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, double noundef %142)
  call void @border_print() #7
  call void @center_print(ptr noundef nonnull @.str.9, i32 noundef 79) #7
  call void @border_print() #7
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %.critedge87

.critedge87:                                      ; preds = %136, %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  store i64 256, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %145 = load i32, ptr %21, align 8, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = and i64 %146, 255
  %.not86 = icmp ne i64 %147, 0
  %148 = icmp ugt i32 %145, 256
  %or.cond = and i1 %148, %.not86
  %149 = and i64 %146, -256
  %150 = add nsw i64 %149, 256
  %storemerge = select i1 %or.cond, i64 %150, i64 %146
  store i64 %storemerge, ptr %19, align 8, !tbaa !13
  %151 = call i32 @clEnqueueNDRangeKernel(ptr noundef %43, ptr noundef %116, i32 noundef 1, ptr noundef null, ptr noundef nonnull %19, ptr noundef nonnull %18, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %151, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %151) #7
  %152 = load ptr, ptr %17, align 8, !tbaa !11
  %153 = load i32, ptr %21, align 8, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = shl nsw i64 %154, 2
  %156 = call i32 @clEnqueueReadBuffer(ptr noundef %43, ptr noundef %152, i32 noundef 1, i64 noundef 0, i64 noundef %155, ptr noundef %25, i32 noundef 0, ptr noundef null, ptr noundef null) #7
  store i32 %156, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %156) #7
  %157 = call double @get_time() #7
  br i1 %141, label %158, label %160

158:                                              ; preds = %.critedge87
  %159 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %160

160:                                              ; preds = %158, %.critedge87
  %161 = load i32, ptr %21, align 8, !tbaa !5
  %162 = icmp sgt i32 %161, 0
  br i1 %162, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %160
  %wide.trip.count = zext nneg i32 %161 to i64
  %min.iters.check = icmp ult i32 %161, 4
  br i1 %min.iters.check, label %.lr.ph.preheader96, label %vector.ph

.lr.ph.preheader96:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.07588.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %170, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %167, %vector.body ]
  %vec.phi94 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %168, %vector.body ]
  %163 = getelementptr inbounds i32, ptr %25, i64 %index
  %164 = getelementptr inbounds i8, ptr %163, i64 8
  %wide.load = load <2 x i32>, ptr %163, align 4, !tbaa !22
  %wide.load95 = load <2 x i32>, ptr %164, align 4, !tbaa !22
  %165 = sext <2 x i32> %wide.load to <2 x i64>
  %166 = sext <2 x i32> %wide.load95 to <2 x i64>
  %167 = add <2 x i64> %vec.phi, %165
  %168 = add <2 x i64> %vec.phi94, %166
  %index.next = add nuw i64 %index, 4
  %169 = icmp eq i64 %index.next, %n.vec
  br i1 %169, label %middle.block, label %vector.body, !llvm.loop !34

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %168, %167
  %170 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader96

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %160
  %.075.lcssa = phi i64 [ 0, %160 ], [ %170, %middle.block ], [ %175, %.lr.ph ]
  %171 = fsub double %157, %140
  store double %171, ptr %3, align 8, !tbaa !38
  br i1 %141, label %176, label %178

.lr.ph:                                           ; preds = %.lr.ph.preheader96, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader96 ]
  %.07588 = phi i64 [ %175, %.lr.ph ], [ %.07588.ph, %.lr.ph.preheader96 ]
  %172 = getelementptr inbounds i32, ptr %25, i64 %indvars.iv
  %173 = load i32, ptr %172, align 4, !tbaa !22
  %174 = sext i32 %173 to i64
  %175 = add i64 %.07588, %174
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !40

176:                                              ; preds = %._crit_edge
  %177 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, double noundef %171)
  br label %178

178:                                              ; preds = %176, %._crit_edge
  %179 = call i32 @clFlush(ptr noundef %43) #7
  store i32 %179, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %179) #7
  %180 = call i32 @clFinish(ptr noundef %43) #7
  store i32 %180, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %180) #7
  %181 = call i32 @clReleaseKernel(ptr noundef %116) #7
  store i32 %181, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %181) #7
  %182 = call i32 @clReleaseProgram(ptr noundef %112) #7
  store i32 %182, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %182) #7
  %183 = load ptr, ptr %10, align 8, !tbaa !11
  %184 = call i32 @clReleaseMemObject(ptr noundef %183) #7
  store i32 %184, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %184) #7
  %185 = load i32, ptr %70, align 4, !tbaa !28
  %186 = icmp sgt i32 %185, 0
  br i1 %186, label %187, label %190

187:                                              ; preds = %178
  %188 = load ptr, ptr %13, align 8, !tbaa !11
  %189 = call i32 @clReleaseMemObject(ptr noundef %188) #7
  store i32 %189, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %189) #7
  br label %190

190:                                              ; preds = %187, %178
  %191 = load i64, ptr %81, align 8, !tbaa !30
  %192 = icmp sgt i64 %191, 0
  br i1 %192, label %193, label %196

193:                                              ; preds = %190
  %194 = load ptr, ptr %14, align 8, !tbaa !11
  %195 = call i32 @clReleaseMemObject(ptr noundef %194) #7
  store i32 %195, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %195) #7
  br label %196

196:                                              ; preds = %193, %190
  %197 = load ptr, ptr %16, align 8, !tbaa !11
  %198 = call i32 @clReleaseMemObject(ptr noundef %197) #7
  store i32 %198, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %198) #7
  %199 = load ptr, ptr %12, align 8, !tbaa !11
  %200 = call i32 @clReleaseMemObject(ptr noundef %199) #7
  store i32 %200, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %200) #7
  %201 = load ptr, ptr %17, align 8, !tbaa !11
  %202 = call i32 @clReleaseMemObject(ptr noundef %201) #7
  store i32 %202, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %202) #7
  %203 = call i32 @clReleaseCommandQueue(ptr noundef %43) #7
  store i32 %203, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %203) #7
  %204 = call i32 @clReleaseContext(ptr noundef %41) #7
  store i32 %204, ptr %9, align 4, !tbaa !22
  call void @check(i32 noundef %204) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret i64 %.075.lcssa
}

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

declare double @get_time() local_unnamed_addr #2

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

; 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 i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

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

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

declare void @initialize_device(ptr dead_on_unwind writable sret(%struct.OpenCLInfo) align 8, i32 noundef, i32 noundef) local_unnamed_addr #2

declare ptr @clCreateBuffer(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @check(i32 noundef) local_unnamed_addr #2

declare i32 @clEnqueueWriteBuffer(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @clGetDeviceInfo(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

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

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

declare void @printCompilerError(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

declare void @border_print() local_unnamed_addr #2

declare void @center_print(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @clEnqueueReadBuffer(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @clFlush(ptr noundef) local_unnamed_addr #2

declare i32 @clFinish(ptr noundef) local_unnamed_addr #2

declare i32 @clReleaseKernel(ptr noundef) local_unnamed_addr #2

declare i32 @clReleaseProgram(ptr noundef) local_unnamed_addr #2

declare i32 @clReleaseMemObject(ptr noundef) local_unnamed_addr #2

declare i32 @clReleaseCommandQueue(ptr noundef) local_unnamed_addr #2

declare i32 @clReleaseContext(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

attributes #0 = { 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 = { "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,uninitialized") allocsize(0) 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 = { noreturn 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }

!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 24}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !7, i64 56}
!15 = !{!6, !7, i64 60}
!16 = !{!17, !12, i64 8}
!17 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!18 = !{!17, !12, i64 16}
!19 = !{!17, !12, i64 24}
!20 = !{!21, !7, i64 48}
!21 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !10, i64 64, !7, i64 72, !7, i64 76, !12, i64 80, !7, i64 88, !12, i64 96, !7, i64 104}
!22 = !{!7, !7, i64 0}
!23 = !{!21, !12, i64 0}
!24 = !{!21, !7, i64 52}
!25 = !{!21, !12, i64 8}
!26 = !{!21, !7, i64 56}
!27 = !{!21, !12, i64 16}
!28 = !{!21, !7, i64 60}
!29 = !{!21, !12, i64 24}
!30 = !{!21, !10, i64 64}
!31 = !{!21, !12, i64 32}
!32 = !{!21, !7, i64 72}
!33 = !{!21, !12, i64 40}
!34 = distinct !{!34, !35, !36, !37}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!"llvm.loop.isvectorized", i32 1}
!37 = !{!"llvm.loop.unroll.runtime.disable"}
!38 = !{!39, !39, i64 0}
!39 = !{!"double", !8, i64 0}
!40 = distinct !{!40, !35, !37, !36}


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