; LLVM IR from hans-ob1/neural_cam_ros :: src/detector (data)

; 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.image = type { i32, i32, i32, ptr }
%struct.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_paths(ptr noundef, i32 noundef, i32 noundef) #1

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

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

declare void @free_image(ptr noundef byval(%struct.image) align 8) #4

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

declare void @load_image_color(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef, i32 noundef, i32 noundef) #4

declare void @flip_image(ptr noundef byval(%struct.image) align 8) #4

declare void @random_distort_image(ptr noundef byval(%struct.image) align 8, float noundef, float noundef, float noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @fill_truth_detection(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) #1

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

declare { i64, ptr } @make_matrix(i32 noundef, i32 noundef) #4

declare float @rand_uniform(float noundef, float noundef) #4

declare void @crop_image(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef byval(%struct.image) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

declare void @resize_image(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef byval(%struct.image) align 8, i32 noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @load_data_detection(ptr dead_on_unwind noalias writable sret(%struct.data) align 8 %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, float noundef %8, float noundef %9, float noundef %10, float noundef %11) #1 {
  %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 i32, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %struct.matrix, align 8
  %27 = alloca %struct.image, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca float, align 4
  %39 = alloca float, align 4
  %40 = alloca i32, align 4
  %41 = alloca %struct.image, align 8
  %42 = alloca float, align 4
  %43 = alloca float, align 4
  %44 = alloca %struct.image, align 8
  store i32 %1, ptr %13, align 4, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !9
  store i32 %3, ptr %15, align 4, !tbaa !5
  store i32 %4, ptr %16, align 4, !tbaa !5
  store i32 %5, ptr %17, align 4, !tbaa !5
  store i32 %6, ptr %18, align 4, !tbaa !5
  store i32 %7, ptr %19, align 4, !tbaa !5
  store float %8, ptr %20, align 4, !tbaa !11
  store float %9, ptr %21, align 4, !tbaa !11
  store float %10, ptr %22, align 4, !tbaa !11
  store float %11, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %45 = load ptr, ptr %14, align 8, !tbaa !9
  %46 = load i32, ptr %13, align 4, !tbaa !5
  %47 = load i32, ptr %15, align 4, !tbaa !5
  %48 = call ptr @get_random_paths(ptr noundef %45, i32 noundef %46, i32 noundef %47)
  store ptr %48, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 64, i1 false)
  %49 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 4
  store i32 0, ptr %49, align 8, !tbaa !13
  %50 = load i32, ptr %13, align 4, !tbaa !5
  %51 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  %52 = getelementptr inbounds %struct.matrix, ptr %51, i32 0, i32 0
  store i32 %50, ptr %52, align 8, !tbaa !16
  %53 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  %54 = getelementptr inbounds %struct.matrix, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !16
  %56 = sext i32 %55 to i64
  %57 = call noalias ptr @calloc(i64 noundef %56, i64 noundef 8) #8
  %58 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  %59 = getelementptr inbounds %struct.matrix, ptr %58, i32 0, i32 2
  store ptr %57, ptr %59, align 8, !tbaa !17
  %60 = load i32, ptr %17, align 4, !tbaa !5
  %61 = load i32, ptr %16, align 4, !tbaa !5
  %62 = mul nsw i32 %60, %61
  %63 = mul nsw i32 %62, 3
  %64 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  %65 = getelementptr inbounds %struct.matrix, ptr %64, i32 0, i32 1
  store i32 %63, ptr %65, align 4, !tbaa !18
  %66 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %67 = load i32, ptr %13, align 4, !tbaa !5
  %68 = load i32, ptr %18, align 4, !tbaa !5
  %69 = mul nsw i32 5, %68
  %70 = call { i64, ptr } @make_matrix(i32 noundef %67, i32 noundef %69)
  %71 = getelementptr inbounds { i64, ptr }, ptr %26, i32 0, i32 0
  %72 = extractvalue { i64, ptr } %70, 0
  store i64 %72, ptr %71, align 8
  %73 = getelementptr inbounds { i64, ptr }, ptr %26, i32 0, i32 1
  %74 = extractvalue { i64, ptr } %70, 1
  store ptr %74, ptr %73, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %66, ptr align 8 %26, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %209, %12
  %76 = load i32, ptr %25, align 4, !tbaa !5
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %212

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  %80 = load ptr, ptr %24, align 8, !tbaa !9
  %81 = load i32, ptr %25, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  call void @load_image_color(ptr dead_on_unwind writable sret(%struct.image) align 8 %27, ptr noundef %84, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %85 = getelementptr inbounds %struct.image, ptr %27, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !20
  store i32 %86, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %87 = getelementptr inbounds %struct.image, ptr %27, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !22
  store i32 %88, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %89 = load i32, ptr %29, align 4, !tbaa !5
  %90 = sitofp i32 %89 to float
  %91 = load float, ptr %20, align 4, !tbaa !11
  %92 = fmul float %90, %91
  %93 = fptosi float %92 to i32
  store i32 %93, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %94 = load i32, ptr %28, align 4, !tbaa !5
  %95 = sitofp i32 %94 to float
  %96 = load float, ptr %20, align 4, !tbaa !11
  %97 = fmul float %95, %96
  %98 = fptosi float %97 to i32
  store i32 %98, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %99 = load i32, ptr %30, align 4, !tbaa !5
  %100 = sub nsw i32 0, %99
  %101 = sitofp i32 %100 to float
  %102 = load i32, ptr %30, align 4, !tbaa !5
  %103 = sitofp i32 %102 to float
  %104 = call float @rand_uniform(float noundef %101, float noundef %103)
  %105 = fptosi float %104 to i32
  store i32 %105, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %106 = load i32, ptr %30, align 4, !tbaa !5
  %107 = sub nsw i32 0, %106
  %108 = sitofp i32 %107 to float
  %109 = load i32, ptr %30, align 4, !tbaa !5
  %110 = sitofp i32 %109 to float
  %111 = call float @rand_uniform(float noundef %108, float noundef %110)
  %112 = fptosi float %111 to i32
  store i32 %112, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %113 = load i32, ptr %31, align 4, !tbaa !5
  %114 = sub nsw i32 0, %113
  %115 = sitofp i32 %114 to float
  %116 = load i32, ptr %31, align 4, !tbaa !5
  %117 = sitofp i32 %116 to float
  %118 = call float @rand_uniform(float noundef %115, float noundef %117)
  %119 = fptosi float %118 to i32
  store i32 %119, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %120 = load i32, ptr %31, align 4, !tbaa !5
  %121 = sub nsw i32 0, %120
  %122 = sitofp i32 %121 to float
  %123 = load i32, ptr %31, align 4, !tbaa !5
  %124 = sitofp i32 %123 to float
  %125 = call float @rand_uniform(float noundef %122, float noundef %124)
  %126 = fptosi float %125 to i32
  store i32 %126, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %127 = load i32, ptr %29, align 4, !tbaa !5
  %128 = load i32, ptr %32, align 4, !tbaa !5
  %129 = sub nsw i32 %127, %128
  %130 = load i32, ptr %33, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  store i32 %131, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %132 = load i32, ptr %28, align 4, !tbaa !5
  %133 = load i32, ptr %34, align 4, !tbaa !5
  %134 = sub nsw i32 %132, %133
  %135 = load i32, ptr %35, align 4, !tbaa !5
  %136 = sub nsw i32 %134, %135
  store i32 %136, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %137 = load i32, ptr %36, align 4, !tbaa !5
  %138 = sitofp i32 %137 to float
  %139 = load i32, ptr %29, align 4, !tbaa !5
  %140 = sitofp i32 %139 to float
  %141 = fdiv float %138, %140
  store float %141, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  %142 = load i32, ptr %37, align 4, !tbaa !5
  %143 = sitofp i32 %142 to float
  %144 = load i32, ptr %28, align 4, !tbaa !5
  %145 = sitofp i32 %144 to float
  %146 = fdiv float %143, %145
  store float %146, ptr %39, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  %147 = call i32 @rand() #7
  %148 = srem i32 %147, 2
  store i32 %148, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %41) #7
  %149 = load i32, ptr %32, align 4, !tbaa !5
  %150 = load i32, ptr %34, align 4, !tbaa !5
  %151 = load i32, ptr %36, align 4, !tbaa !5
  %152 = load i32, ptr %37, align 4, !tbaa !5
  call void @crop_image(ptr dead_on_unwind writable sret(%struct.image) align 8 %41, ptr noundef byval(%struct.image) align 8 %27, i32 noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152)
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  %153 = load i32, ptr %32, align 4, !tbaa !5
  %154 = sitofp i32 %153 to float
  %155 = load i32, ptr %29, align 4, !tbaa !5
  %156 = sitofp i32 %155 to float
  %157 = fdiv float %154, %156
  %158 = load float, ptr %38, align 4, !tbaa !11
  %159 = fdiv float %157, %158
  store float %159, ptr %42, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  %160 = load i32, ptr %34, align 4, !tbaa !5
  %161 = sitofp i32 %160 to float
  %162 = load i32, ptr %28, align 4, !tbaa !5
  %163 = sitofp i32 %162 to float
  %164 = fdiv float %161, %163
  %165 = load float, ptr %39, align 4, !tbaa !11
  %166 = fdiv float %164, %165
  store float %166, ptr %43, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %44) #7
  %167 = load i32, ptr %16, align 4, !tbaa !5
  %168 = load i32, ptr %17, align 4, !tbaa !5
  call void @resize_image(ptr dead_on_unwind writable sret(%struct.image) align 8 %44, ptr noundef byval(%struct.image) align 8 %41, i32 noundef %167, i32 noundef %168)
  %169 = load i32, ptr %40, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %172

171:                                              ; preds = %79
  call void @flip_image(ptr noundef byval(%struct.image) align 8 %44)
  br label %172

172:                                              ; preds = %171, %79
  %173 = load float, ptr %21, align 4, !tbaa !11
  %174 = load float, ptr %22, align 4, !tbaa !11
  %175 = load float, ptr %23, align 4, !tbaa !11
  call void @random_distort_image(ptr noundef byval(%struct.image) align 8 %44, float noundef %173, float noundef %174, float noundef %175)
  %176 = getelementptr inbounds %struct.image, ptr %44, i32 0, i32 3
  %177 = load ptr, ptr %176, align 8, !tbaa !23
  %178 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 2
  %179 = getelementptr inbounds %struct.matrix, ptr %178, i32 0, i32 2
  %180 = load ptr, ptr %179, align 8, !tbaa !17
  %181 = load i32, ptr %25, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds ptr, ptr %180, i64 %182
  store ptr %177, ptr %183, align 8, !tbaa !9
  %184 = load ptr, ptr %24, align 8, !tbaa !9
  %185 = load i32, ptr %25, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds ptr, ptr %184, i64 %186
  %188 = load ptr, ptr %187, align 8, !tbaa !9
  %189 = load i32, ptr %18, align 4, !tbaa !5
  %190 = getelementptr inbounds %struct.data, ptr %0, i32 0, i32 3
  %191 = getelementptr inbounds %struct.matrix, ptr %190, i32 0, i32 2
  %192 = load ptr, ptr %191, align 8, !tbaa !24
  %193 = load i32, ptr %25, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds ptr, ptr %192, i64 %194
  %196 = load ptr, ptr %195, align 8, !tbaa !9
  %197 = load i32, ptr %19, align 4, !tbaa !5
  %198 = load i32, ptr %40, align 4, !tbaa !5
  %199 = load float, ptr %42, align 4, !tbaa !11
  %200 = load float, ptr %43, align 4, !tbaa !11
  %201 = load float, ptr %38, align 4, !tbaa !11
  %202 = fpext float %201 to double
  %203 = fdiv double 1.000000e+00, %202
  %204 = fptrunc double %203 to float
  %205 = load float, ptr %39, align 4, !tbaa !11
  %206 = fpext float %205 to double
  %207 = fdiv double 1.000000e+00, %206
  %208 = fptrunc double %207 to float
  call void @fill_truth_detection(ptr noundef %188, i32 noundef %189, ptr noundef %196, i32 noundef %197, i32 noundef %198, float noundef %199, float noundef %200, float noundef %204, float noundef %208)
  call void @free_image(ptr noundef byval(%struct.image) align 8 %27)
  call void @free_image(ptr noundef byval(%struct.image) align 8 %41)
  call void @llvm.lifetime.end.p0(i64 24, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %209

209:                                              ; preds = %172
  %210 = load i32, ptr %25, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %25, align 4, !tbaa !5
  br label %75, !llvm.loop !25

212:                                              ; preds = %75
  %213 = load ptr, ptr %24, align 8, !tbaa !9
  call void @free(ptr noundef %213) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }

!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 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 40}
!14 = !{!"", !6, i64 0, !6, i64 4, !15, i64 8, !15, i64 24, !6, i64 40, !10, i64 48, !10, i64 56}
!15 = !{!"matrix", !6, i64 0, !6, i64 4, !10, i64 8}
!16 = !{!14, !6, i64 8}
!17 = !{!14, !10, i64 16}
!18 = !{!14, !6, i64 12}
!19 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 8, !9}
!20 = !{!21, !6, i64 0}
!21 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!22 = !{!21, !6, i64 4}
!23 = !{!21, !10, i64 16}
!24 = !{!14, !10, i64 32}
!25 = distinct !{!25, !26}
!26 = !{!"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.image = type { i32, i32, i32, ptr }
%struct.data = type { i32, i32, %struct.matrix, %struct.matrix, i32, ptr, ptr }
%struct.matrix = type { i32, i32, ptr }

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_paths(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

declare void @free_image(ptr noundef byval(%struct.image) align 8) local_unnamed_addr #4

declare void @load_image_color(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @flip_image(ptr noundef byval(%struct.image) align 8) local_unnamed_addr #4

declare void @random_distort_image(ptr noundef byval(%struct.image) align 8, float noundef, float noundef, float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local void @fill_truth_detection(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

declare { i64, ptr } @make_matrix(i32 noundef, i32 noundef) local_unnamed_addr #4

declare float @rand_uniform(float noundef, float noundef) local_unnamed_addr #4

declare void @crop_image(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef byval(%struct.image) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @resize_image(ptr dead_on_unwind writable sret(%struct.image) align 8, ptr noundef byval(%struct.image) align 8, i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @load_data_detection(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.data) align 8 %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, float noundef %8, float noundef %9, float noundef %10, float noundef %11) local_unnamed_addr #1 {
  %13 = alloca %struct.image, align 8
  %14 = alloca %struct.image, align 8
  %15 = alloca %struct.image, align 8
  %16 = tail call ptr @get_random_paths(ptr noundef %2, i32 noundef %1, i32 noundef %3)
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, i8 0, i64 64, i1 false)
  store i32 %1, ptr %17, align 8, !tbaa !5
  %18 = sext i32 %1 to i64
  %19 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 8) #7
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %19, ptr %20, align 8, !tbaa !12
  %21 = mul i32 %4, 3
  %22 = mul i32 %21, %5
  %23 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %22, ptr %23, align 4, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  %25 = mul nsw i32 %6, 5
  %26 = tail call { i64, ptr } @make_matrix(i32 noundef %1, i32 noundef %25) #8
  %27 = extractvalue { i64, ptr } %26, 0
  %28 = extractvalue { i64, ptr } %26, 1
  store i64 %27, ptr %24, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %28, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !14
  %29 = icmp sgt i32 %1, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %30 = getelementptr inbounds i8, ptr %13, i64 4
  %31 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %32

32:                                               ; preds = %.lr.ph, %74
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %74 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  %33 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  call void @load_image_color(ptr dead_on_unwind nonnull writable sret(%struct.image) align 8 %13, ptr noundef %34, i32 noundef 0, i32 noundef 0) #8
  %35 = load i32, ptr %13, align 8, !tbaa !15
  %36 = load i32, ptr %30, align 4, !tbaa !17
  %37 = sitofp i32 %36 to float
  %38 = fmul float %37, %8
  %39 = fptosi float %38 to i32
  %40 = sitofp i32 %35 to float
  %41 = fmul float %40, %8
  %42 = fptosi float %41 to i32
  %43 = sub nsw i32 0, %39
  %44 = sitofp i32 %43 to float
  %45 = sitofp i32 %39 to float
  %46 = call float @rand_uniform(float noundef %44, float noundef %45) #8
  %47 = fptosi float %46 to i32
  %48 = call float @rand_uniform(float noundef %44, float noundef %45) #8
  %49 = fptosi float %48 to i32
  %50 = sub nsw i32 0, %42
  %51 = sitofp i32 %50 to float
  %52 = sitofp i32 %42 to float
  %53 = call float @rand_uniform(float noundef %51, float noundef %52) #8
  %54 = fptosi float %53 to i32
  %55 = call float @rand_uniform(float noundef %51, float noundef %52) #8
  %56 = fptosi float %55 to i32
  %57 = add i32 %47, %49
  %58 = sub i32 %36, %57
  %59 = add i32 %54, %56
  %60 = sub i32 %35, %59
  %61 = sitofp i32 %58 to float
  %62 = fdiv float %61, %37
  %63 = sitofp i32 %60 to float
  %64 = fdiv float %63, %40
  %65 = call i32 @rand() #8
  %66 = srem i32 %65, 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #8
  call void @crop_image(ptr dead_on_unwind nonnull writable sret(%struct.image) align 8 %14, ptr noundef nonnull byval(%struct.image) align 8 %13, i32 noundef %47, i32 noundef %54, i32 noundef %58, i32 noundef %60) #8
  %67 = sitofp i32 %47 to float
  %68 = fdiv float %67, %37
  %69 = fdiv float %68, %62
  %70 = sitofp i32 %54 to float
  %71 = fdiv float %70, %40
  %72 = fdiv float %71, %64
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #8
  call void @resize_image(ptr dead_on_unwind nonnull writable sret(%struct.image) align 8 %15, ptr noundef nonnull byval(%struct.image) align 8 %14, i32 noundef %4, i32 noundef %5) #8
  %.not = icmp eq i32 %66, 0
  br i1 %.not, label %74, label %73

73:                                               ; preds = %32
  call void @flip_image(ptr noundef nonnull byval(%struct.image) align 8 %15) #8
  br label %74

74:                                               ; preds = %73, %32
  call void @random_distort_image(ptr noundef nonnull byval(%struct.image) align 8 %15, float noundef %9, float noundef %10, float noundef %11) #8
  %75 = load ptr, ptr %31, align 8, !tbaa !18
  %76 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv
  store ptr %75, ptr %76, align 8, !tbaa !14
  %77 = load ptr, ptr %33, align 8, !tbaa !14
  %78 = getelementptr inbounds ptr, ptr %28, i64 %indvars.iv
  %79 = load ptr, ptr %78, align 8, !tbaa !14
  %80 = fdiv float 1.000000e+00, %62
  %81 = fdiv float 1.000000e+00, %64
  call void @fill_truth_detection(ptr noundef %77, i32 noundef %6, ptr noundef %79, i32 noundef %7, i32 noundef %66, float noundef %69, float noundef %72, float noundef %80, float noundef %81)
  call void @free_image(ptr noundef nonnull byval(%struct.image) align 8 %13) #8
  call void @free_image(ptr noundef nonnull byval(%struct.image) align 8 %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  %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 %32, !llvm.loop !19

._crit_edge:                                      ; preds = %74, %12
  call void @free(ptr noundef %16) #8
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { 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 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 24, !7, i64 40, !11, i64 48, !11, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"matrix", !7, i64 0, !7, i64 4, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 16}
!13 = !{!6, !7, i64 12}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !11, i64 16}
!17 = !{!16, !7, i64 4}
!18 = !{!16, !11, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass