; LLVM IR from zchrissirhcz/pixel :: legacy/NaiveCNN/cnn (cnn)

; 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.px_size_t = type { i32, i32 }
%struct.px_pad_t = type { i32, i32, i32, i32 }
%struct.px_tensor_dim_t = type { i32, i32, i32, i32 }
%struct.px_cube_dim_t = type { i32, i32, i32 }
%struct.ConvLayer = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, i8, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.tensor_t = type { i32, i32, i32, i32, ptr }

; Function Attrs: nounwind uwtable
declare dso_local i64 @get_conv_output_size(i64, i64, i64, i64, i64) #0

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

declare i64 @px_create_size(i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @init_conv_layer(i64 %0, i32 noundef %1, i64 %2, i64 %3, i64 %4, i32 noundef %5, i32 noundef %6) #0 {
  %8 = alloca %struct.px_size_t, align 4
  %9 = alloca %struct.px_size_t, align 4
  %10 = alloca %struct.px_pad_t, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.px_tensor_dim_t, align 4
  %20 = alloca float, align 4
  %21 = alloca %struct.px_size_t, align 4
  %22 = alloca %struct.px_size_t, align 4
  %23 = alloca %struct.px_cube_dim_t, align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca { i64, i32 }, align 4
  %26 = alloca { i64, i32 }, align 4
  %27 = alloca { i64, i32 }, align 4
  store i64 %0, ptr %8, align 4
  store i64 %2, ptr %9, align 4
  %28 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  store i64 %3, ptr %28, align 4
  %29 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  store i64 %4, ptr %29, align 4
  store i32 %1, ptr %11, align 4, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !5
  store i32 %6, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %30 = call noalias ptr @malloc(i64 noundef 120) #8
  store ptr %30, ptr %14, align 8, !tbaa !9
  %31 = load ptr, ptr %14, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 8 %31, i8 0, i64 120, i1 false)
  %32 = getelementptr inbounds %struct.px_size_t, ptr %8, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = load ptr, ptr %14, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.ConvLayer, ptr %34, i32 0, i32 1
  store i32 %33, ptr %35, align 4, !tbaa !13
  %36 = getelementptr inbounds %struct.px_size_t, ptr %8, i32 0, i32 0
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = load ptr, ptr %14, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.ConvLayer, ptr %38, i32 0, i32 0
  store i32 %37, ptr %39, align 8, !tbaa !17
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = load ptr, ptr %14, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.ConvLayer, ptr %41, i32 0, i32 2
  store i32 %40, ptr %42, align 8, !tbaa !18
  %43 = load i32, ptr %12, align 4, !tbaa !5
  %44 = load ptr, ptr %14, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.ConvLayer, ptr %44, i32 0, i32 3
  store i32 %43, ptr %45, align 4, !tbaa !19
  %46 = load i32, ptr %13, align 4, !tbaa !5
  %47 = load ptr, ptr %14, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.ConvLayer, ptr %47, i32 0, i32 4
  store i32 %46, ptr %48, align 8, !tbaa !20
  %49 = load ptr, ptr %14, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.ConvLayer, ptr %49, i32 0, i32 8
  store i8 1, ptr %50, align 8, !tbaa !21
  %51 = getelementptr inbounds %struct.px_size_t, ptr %9, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = load ptr, ptr %14, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.ConvLayer, ptr %53, i32 0, i32 13
  store i32 %52, ptr %54, align 8, !tbaa !22
  %55 = getelementptr inbounds %struct.px_size_t, ptr %9, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !16
  %57 = load ptr, ptr %14, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.ConvLayer, ptr %57, i32 0, i32 14
  store i32 %56, ptr %58, align 4, !tbaa !23
  %59 = getelementptr inbounds %struct.px_pad_t, ptr %10, i32 0, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !24
  %61 = load ptr, ptr %14, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.ConvLayer, ptr %61, i32 0, i32 16
  store i32 %60, ptr %62, align 4, !tbaa !26
  %63 = getelementptr inbounds %struct.px_pad_t, ptr %10, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !27
  %65 = load ptr, ptr %14, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.ConvLayer, ptr %65, i32 0, i32 15
  store i32 %64, ptr %66, align 8, !tbaa !28
  %67 = getelementptr inbounds %struct.px_pad_t, ptr %10, i32 0, i32 2
  %68 = load i32, ptr %67, align 4, !tbaa !29
  %69 = load ptr, ptr %14, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.ConvLayer, ptr %69, i32 0, i32 17
  store i32 %68, ptr %70, align 8, !tbaa !30
  %71 = getelementptr inbounds %struct.px_pad_t, ptr %10, i32 0, i32 3
  %72 = load i32, ptr %71, align 4, !tbaa !31
  %73 = load ptr, ptr %14, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.ConvLayer, ptr %73, i32 0, i32 18
  store i32 %72, ptr %74, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = call { i64, i64 } @px_create_tensor_dim(i32 noundef %75, i32 noundef %76, i32 noundef %77, i32 noundef %78)
  %80 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %81 = extractvalue { i64, i64 } %79, 0
  store i64 %81, ptr %80, align 4
  %82 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %83 = extractvalue { i64, i64 } %79, 1
  store i64 %83, ptr %82, align 4
  %84 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %85 = load i64, ptr %84, align 4
  %86 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %87 = load i64, ptr %86, align 4
  %88 = call ptr @create_tensor(i64 %85, i64 %87)
  %89 = load ptr, ptr %14, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.ConvLayer, ptr %89, i32 0, i32 5
  store ptr %88, ptr %90, align 8, !tbaa !33
  %91 = call i64 @time(ptr noundef null) #7
  %92 = trunc i64 %91 to i32
  call void @srand(i32 noundef %92) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %167, %7
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %170

97:                                               ; preds = %93
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %163, %97
  %99 = load i32, ptr %16, align 4, !tbaa !5
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %166

102:                                              ; preds = %98
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %159, %102
  %104 = load i32, ptr %18, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %162

107:                                              ; preds = %103
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %155, %107
  %109 = load i32, ptr %17, align 4, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %112, label %158

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %113 = call i32 @rand() #7
  %114 = sitofp i32 %113 to float
  %115 = fdiv float %114, 0x41E0000000000000
  %116 = fpext float %115 to double
  %117 = fsub double %116, 5.000000e-01
  %118 = fmul double %117, 2.000000e+00
  %119 = fptrunc double %118 to float
  store float %119, ptr %20, align 4, !tbaa !34
  %120 = load float, ptr %20, align 4, !tbaa !34
  %121 = fpext float %120 to double
  %122 = load i32, ptr %11, align 4, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = mul nsw i32 %122, %123
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = add nsw i32 %125, %126
  %128 = mul nsw i32 %124, %127
  %129 = sitofp i32 %128 to float
  %130 = fdiv float 6.000000e+00, %129
  %131 = fpext float %130 to double
  %132 = call double @sqrt(double noundef %131) #7
  %133 = fmul double %121, %132
  %134 = fptrunc double %133 to float
  %135 = load ptr, ptr %14, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.ConvLayer, ptr %135, i32 0, i32 5
  %137 = load ptr, ptr %136, align 8, !tbaa !33
  %138 = getelementptr inbounds %struct.tensor_t, ptr %137, i32 0, i32 4
  %139 = load ptr, ptr %138, align 8, !tbaa !36
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds ptr, ptr %139, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds ptr, ptr %143, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = load i32, ptr %18, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %147, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !9
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds float, ptr %151, i64 %153
  store float %134, ptr %154, align 4, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %155

155:                                              ; preds = %112
  %156 = load i32, ptr %17, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %17, align 4, !tbaa !5
  br label %108, !llvm.loop !38

158:                                              ; preds = %108
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %18, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %18, align 4, !tbaa !5
  br label %103, !llvm.loop !40

162:                                              ; preds = %103
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %16, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %16, align 4, !tbaa !5
  br label %98, !llvm.loop !41

166:                                              ; preds = %98
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %15, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %15, align 4, !tbaa !5
  br label %93, !llvm.loop !42

170:                                              ; preds = %93
  %171 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %172 = load i64, ptr %171, align 4
  %173 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %174 = load i64, ptr %173, align 4
  %175 = call ptr @create_tensor(i64 %172, i64 %174)
  %176 = load ptr, ptr %14, align 8, !tbaa !9
  %177 = getelementptr inbounds %struct.ConvLayer, ptr %176, i32 0, i32 6
  store ptr %175, ptr %177, align 8, !tbaa !43
  %178 = load ptr, ptr %14, align 8, !tbaa !9
  %179 = getelementptr inbounds %struct.ConvLayer, ptr %178, i32 0, i32 6
  %180 = load ptr, ptr %179, align 8, !tbaa !43
  call void @clear_tensor(ptr noundef %180)
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = call ptr @create_array(i32 noundef %181)
  %183 = load ptr, ptr %14, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.ConvLayer, ptr %183, i32 0, i32 7
  store ptr %182, ptr %184, align 8, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %185 = load i32, ptr %11, align 4, !tbaa !5
  %186 = load i32, ptr %11, align 4, !tbaa !5
  %187 = call i64 @px_create_size(i32 noundef %185, i32 noundef %186)
  store i64 %187, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %188 = load i64, ptr %8, align 4
  %189 = load i64, ptr %21, align 4
  %190 = load i64, ptr %9, align 4
  %191 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %192 = load i64, ptr %191, align 4
  %193 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %194 = load i64, ptr %193, align 4
  %195 = call i64 @get_conv_output_size(i64 %188, i64 %189, i64 %190, i64 %192, i64 %194)
  store i64 %195, ptr %22, align 4
  %196 = getelementptr inbounds %struct.px_size_t, ptr %22, i32 0, i32 1
  %197 = load i32, ptr %196, align 4, !tbaa !11
  %198 = load ptr, ptr %14, align 8, !tbaa !9
  %199 = getelementptr inbounds %struct.ConvLayer, ptr %198, i32 0, i32 19
  store i32 %197, ptr %199, align 8, !tbaa !45
  %200 = getelementptr inbounds %struct.px_size_t, ptr %22, i32 0, i32 0
  %201 = load i32, ptr %200, align 4, !tbaa !16
  %202 = load ptr, ptr %14, align 8, !tbaa !9
  %203 = getelementptr inbounds %struct.ConvLayer, ptr %202, i32 0, i32 20
  store i32 %201, ptr %203, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = getelementptr inbounds %struct.px_size_t, ptr %22, i32 0, i32 1
  %206 = load i32, ptr %205, align 4, !tbaa !11
  %207 = getelementptr inbounds %struct.px_size_t, ptr %22, i32 0, i32 0
  %208 = load i32, ptr %207, align 4, !tbaa !16
  %209 = call { i64, i32 } @px_create_cube_dim(i32 noundef %204, i32 noundef %206, i32 noundef %208)
  store { i64, i32 } %209, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %24, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %23, i64 12, i1 false)
  %210 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 0
  %211 = load i64, ptr %210, align 4
  %212 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 1
  %213 = load i32, ptr %212, align 4
  %214 = call ptr @create_cube(i64 %211, i32 %213)
  %215 = load ptr, ptr %14, align 8, !tbaa !9
  %216 = getelementptr inbounds %struct.ConvLayer, ptr %215, i32 0, i32 12
  store ptr %214, ptr %216, align 8, !tbaa !47
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %23, i64 12, i1 false)
  %217 = getelementptr inbounds { i64, i32 }, ptr %26, i32 0, i32 0
  %218 = load i64, ptr %217, align 4
  %219 = getelementptr inbounds { i64, i32 }, ptr %26, i32 0, i32 1
  %220 = load i32, ptr %219, align 4
  %221 = call ptr @create_cube(i64 %218, i32 %220)
  %222 = load ptr, ptr %14, align 8, !tbaa !9
  %223 = getelementptr inbounds %struct.ConvLayer, ptr %222, i32 0, i32 10
  store ptr %221, ptr %223, align 8, !tbaa !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %23, i64 12, i1 false)
  %224 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 0
  %225 = load i64, ptr %224, align 4
  %226 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 1
  %227 = load i32, ptr %226, align 4
  %228 = call ptr @create_cube(i64 %225, i32 %227)
  %229 = load ptr, ptr %14, align 8, !tbaa !9
  %230 = getelementptr inbounds %struct.ConvLayer, ptr %229, i32 0, i32 11
  store ptr %228, ptr %230, align 8, !tbaa !49
  %231 = load ptr, ptr %14, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.ConvLayer, ptr %231, i32 0, i32 12
  %233 = load ptr, ptr %232, align 8, !tbaa !47
  call void @clear_cube(ptr noundef %233)
  %234 = load ptr, ptr %14, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.ConvLayer, ptr %234, i32 0, i32 10
  %236 = load ptr, ptr %235, align 8, !tbaa !48
  call void @clear_cube(ptr noundef %236)
  %237 = load ptr, ptr %14, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.ConvLayer, ptr %237, i32 0, i32 11
  %239 = load ptr, ptr %238, align 8, !tbaa !49
  call void @clear_cube(ptr noundef %239)
  %240 = load ptr, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  ret ptr %240
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare { i64, i64 } @px_create_tensor_dim(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare ptr @create_tensor(i64, i64) #2

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @rand() #5

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

declare void @clear_tensor(ptr noundef) #2

declare ptr @create_array(i32 noundef) #2

declare { i64, i32 } @px_create_cube_dim(i32 noundef, i32 noundef, i32 noundef) #2

; 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) #6

declare ptr @create_cube(i64, i32) #2

declare void @clear_cube(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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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, !6, i64 4}
!12 = !{!"px_size_t", !6, i64 0, !6, i64 4}
!13 = !{!14, !6, i64 4}
!14 = !{!"ConvLayer", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !15, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = !{!14, !6, i64 0}
!18 = !{!14, !6, i64 8}
!19 = !{!14, !6, i64 12}
!20 = !{!14, !6, i64 16}
!21 = !{!14, !15, i64 48}
!22 = !{!14, !6, i64 88}
!23 = !{!14, !6, i64 92}
!24 = !{!25, !6, i64 4}
!25 = !{!"px_pad_t", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!26 = !{!14, !6, i64 100}
!27 = !{!25, !6, i64 0}
!28 = !{!14, !6, i64 96}
!29 = !{!25, !6, i64 8}
!30 = !{!14, !6, i64 104}
!31 = !{!25, !6, i64 12}
!32 = !{!14, !6, i64 108}
!33 = !{!14, !10, i64 24}
!34 = !{!35, !35, i64 0}
!35 = !{!"float", !7, i64 0}
!36 = !{!37, !10, i64 16}
!37 = !{!"tensor_t", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}
!41 = distinct !{!41, !39}
!42 = distinct !{!42, !39}
!43 = !{!14, !10, i64 32}
!44 = !{!14, !10, i64 40}
!45 = !{!14, !6, i64 112}
!46 = !{!14, !6, i64 116}
!47 = !{!14, !10, i64 80}
!48 = !{!14, !10, i64 64}
!49 = !{!14, !10, i64 72}


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

; Function Attrs: nounwind uwtable
declare dso_local i64 @get_conv_output_size(i64, i64, i64, i64, i64) local_unnamed_addr #0

declare i64 @px_create_size(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @init_conv_layer(i64 %0, i32 noundef %1, i64 %2, i64 %3, i64 %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #0 {
  %.sroa.083.0.extract.trunc = trunc i64 %0 to i32
  %.sroa.385.0.extract.shift = lshr i64 %0, 32
  %.sroa.385.0.extract.trunc = trunc nuw i64 %.sroa.385.0.extract.shift to i32
  %.sroa.080.0.extract.trunc = trunc i64 %2 to i32
  %.sroa.382.0.extract.shift = lshr i64 %2, 32
  %.sroa.382.0.extract.trunc = trunc nuw i64 %.sroa.382.0.extract.shift to i32
  %.sroa.077.0.extract.trunc = trunc i64 %3 to i32
  %.sroa.3.0.extract.shift = lshr i64 %3, 32
  %.sroa.3.0.extract.trunc = trunc nuw i64 %.sroa.3.0.extract.shift to i32
  %.sroa.4.8.extract.trunc = trunc i64 %4 to i32
  %.sroa.7.8.extract.shift = lshr i64 %4, 32
  %.sroa.7.8.extract.trunc = trunc nuw i64 %.sroa.7.8.extract.shift to i32
  %calloc = tail call dereferenceable_or_null(120) ptr @calloc(i64 1, i64 120)
  %8 = getelementptr inbounds i8, ptr %calloc, i64 4
  store i32 %.sroa.385.0.extract.trunc, ptr %8, align 4, !tbaa !5
  store i32 %.sroa.083.0.extract.trunc, ptr %calloc, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %calloc, i64 8
  store i32 %1, ptr %9, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %calloc, i64 12
  store i32 %5, ptr %10, align 4, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %calloc, i64 16
  store i32 %6, ptr %11, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %calloc, i64 48
  store i8 1, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %calloc, i64 88
  store i32 %.sroa.382.0.extract.trunc, ptr %13, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %calloc, i64 92
  store i32 %.sroa.080.0.extract.trunc, ptr %14, align 4, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %calloc, i64 100
  store i32 %.sroa.3.0.extract.trunc, ptr %15, align 4, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %calloc, i64 96
  store i32 %.sroa.077.0.extract.trunc, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %calloc, i64 104
  store i32 %.sroa.4.8.extract.trunc, ptr %17, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %calloc, i64 108
  store i32 %.sroa.7.8.extract.trunc, ptr %18, align 4, !tbaa !22
  %19 = tail call { i64, i64 } @px_create_tensor_dim(i32 noundef %5, i32 noundef %6, i32 noundef %1, i32 noundef %1) #5
  %20 = extractvalue { i64, i64 } %19, 0
  %21 = extractvalue { i64, i64 } %19, 1
  %22 = tail call ptr @create_tensor(i64 %20, i64 %21) #5
  %23 = getelementptr inbounds i8, ptr %calloc, i64 24
  store ptr %22, ptr %23, align 8, !tbaa !23
  %24 = tail call i64 @time(ptr noundef null) #5
  %25 = trunc i64 %24 to i32
  tail call void @srand(i32 noundef %25) #5
  %26 = icmp sgt i32 %5, 0
  br i1 %26, label %.preheader93.lr.ph, label %._crit_edge99

.preheader93.lr.ph:                               ; preds = %7
  %27 = icmp sgt i32 %6, 0
  %28 = mul nsw i32 %1, %1
  %29 = add nsw i32 %6, %5
  %30 = mul nsw i32 %28, %29
  %31 = sitofp i32 %30 to float
  %32 = fdiv float 6.000000e+00, %31
  %33 = fpext float %32 to double
  %34 = getelementptr inbounds i8, ptr %22, i64 16
  %35 = icmp sgt i32 %1, 0
  %or.cond = and i1 %27, %35
  br i1 %or.cond, label %.preheader93.us.us.preheader, label %._crit_edge99

.preheader93.us.us.preheader:                     ; preds = %.preheader93.lr.ph
  %wide.trip.count120 = zext nneg i32 %5 to i64
  %wide.trip.count115 = zext nneg i32 %6 to i64
  %wide.trip.count110 = zext nneg i32 %1 to i64
  br label %.preheader93.us.us

.preheader93.us.us:                               ; preds = %.preheader93.us.us.preheader, %._crit_edge.split.us.us.us
  %indvars.iv117 = phi i64 [ 0, %.preheader93.us.us.preheader ], [ %indvars.iv.next118, %._crit_edge.split.us.us.us ]
  br label %.preheader92.us.us.us

.preheader92.us.us.us:                            ; preds = %._crit_edge96.split.us.us.us.us, %.preheader93.us.us
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %._crit_edge96.split.us.us.us.us ], [ 0, %.preheader93.us.us ]
  br label %.preheader.us.us.us.us

.preheader.us.us.us.us:                           ; preds = %._crit_edge.us.us.us.us, %.preheader92.us.us.us
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %._crit_edge.us.us.us.us ], [ 0, %.preheader92.us.us.us ]
  br label %36

36:                                               ; preds = %36, %.preheader.us.us.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 0, %.preheader.us.us.us.us ]
  %37 = tail call i32 @rand() #5
  %38 = sitofp i32 %37 to float
  %39 = fmul float %38, 0x3E00000000000000
  %40 = fpext float %39 to double
  %41 = fadd double %40, -5.000000e-01
  %42 = fmul double %41, 2.000000e+00
  %43 = fptrunc double %42 to float
  %44 = fpext float %43 to double
  %45 = tail call double @sqrt(double noundef %33) #5
  %46 = fmul double %45, %44
  %47 = fptrunc double %46 to float
  %48 = load ptr, ptr %34, align 8, !tbaa !24
  %49 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv117
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  %51 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv112
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv107
  %54 = load ptr, ptr %53, align 8, !tbaa !26
  %55 = getelementptr inbounds float, ptr %54, i64 %indvars.iv
  store float %47, ptr %55, align 4, !tbaa !27
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count110
  br i1 %exitcond.not, label %._crit_edge.us.us.us.us, label %36, !llvm.loop !29

._crit_edge.us.us.us.us:                          ; preds = %36
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
  br i1 %exitcond111.not, label %._crit_edge96.split.us.us.us.us, label %.preheader.us.us.us.us, !llvm.loop !31

._crit_edge96.split.us.us.us.us:                  ; preds = %._crit_edge.us.us.us.us
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %._crit_edge.split.us.us.us, label %.preheader92.us.us.us, !llvm.loop !32

._crit_edge.split.us.us.us:                       ; preds = %._crit_edge96.split.us.us.us.us
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120
  br i1 %exitcond121.not, label %._crit_edge99, label %.preheader93.us.us, !llvm.loop !33

._crit_edge99:                                    ; preds = %._crit_edge.split.us.us.us, %.preheader93.lr.ph, %7
  %56 = tail call ptr @create_tensor(i64 %20, i64 %21) #5
  %57 = getelementptr inbounds i8, ptr %calloc, i64 32
  store ptr %56, ptr %57, align 8, !tbaa !34
  tail call void @clear_tensor(ptr noundef %56) #5
  %58 = tail call ptr @create_array(i32 noundef %6) #5
  %59 = getelementptr inbounds i8, ptr %calloc, i64 40
  store ptr %58, ptr %59, align 8, !tbaa !35
  %60 = tail call i64 @px_create_size(i32 noundef %1, i32 noundef %1) #5
  %61 = tail call i64 @get_conv_output_size(i64 %0, i64 %60, i64 %2, i64 %3, i64 %4)
  %.sroa.012.0.extract.trunc = trunc i64 %61 to i32
  %.sroa.5.0.extract.shift = lshr i64 %61, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  %62 = getelementptr inbounds i8, ptr %calloc, i64 112
  store i32 %.sroa.5.0.extract.trunc, ptr %62, align 8, !tbaa !36
  %63 = getelementptr inbounds i8, ptr %calloc, i64 116
  store i32 %.sroa.012.0.extract.trunc, ptr %63, align 4, !tbaa !37
  %64 = tail call { i64, i32 } @px_create_cube_dim(i32 noundef %6, i32 noundef %.sroa.5.0.extract.trunc, i32 noundef %.sroa.012.0.extract.trunc) #5
  %.fca.0.extract = extractvalue { i64, i32 } %64, 0
  %.fca.1.extract = extractvalue { i64, i32 } %64, 1
  %65 = tail call ptr @create_cube(i64 %.fca.0.extract, i32 %.fca.1.extract) #5
  %66 = getelementptr inbounds i8, ptr %calloc, i64 80
  store ptr %65, ptr %66, align 8, !tbaa !38
  %67 = tail call ptr @create_cube(i64 %.fca.0.extract, i32 %.fca.1.extract) #5
  %68 = getelementptr inbounds i8, ptr %calloc, i64 64
  store ptr %67, ptr %68, align 8, !tbaa !39
  %69 = tail call ptr @create_cube(i64 %.fca.0.extract, i32 %.fca.1.extract) #5
  %70 = getelementptr inbounds i8, ptr %calloc, i64 72
  store ptr %69, ptr %70, align 8, !tbaa !40
  tail call void @clear_cube(ptr noundef %65) #5
  tail call void @clear_cube(ptr noundef %67) #5
  tail call void @clear_cube(ptr noundef %69) #5
  ret ptr %calloc
}

declare { i64, i64 } @px_create_tensor_dim(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @create_tensor(i64, i64) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

declare void @clear_tensor(ptr noundef) local_unnamed_addr #1

declare ptr @create_array(i32 noundef) local_unnamed_addr #1

declare { i64, i32 } @px_create_cube_dim(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @create_cube(i64, i32) local_unnamed_addr #1

declare void @clear_cube(ptr noundef) local_unnamed_addr #1

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

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 = { "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 #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(write) "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 willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #5 = { 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 4}
!6 = !{!"ConvLayer", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 12}
!15 = !{!6, !7, i64 16}
!16 = !{!6, !11, i64 48}
!17 = !{!6, !7, i64 88}
!18 = !{!6, !7, i64 92}
!19 = !{!6, !7, i64 100}
!20 = !{!6, !7, i64 96}
!21 = !{!6, !7, i64 104}
!22 = !{!6, !7, i64 108}
!23 = !{!6, !10, i64 24}
!24 = !{!25, !10, i64 16}
!25 = !{!"tensor_t", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16}
!26 = !{!10, !10, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"float", !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = distinct !{!32, !30}
!33 = distinct !{!33, !30}
!34 = !{!6, !10, i64 32}
!35 = !{!6, !10, i64 40}
!36 = !{!6, !7, i64 112}
!37 = !{!6, !7, i64 116}
!38 = !{!6, !10, i64 80}
!39 = !{!6, !10, i64 64}
!40 = !{!6, !10, i64 72}


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