; LLVM IR from Discngine/fpocket :: src (mdpout)

; 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.s_mdparams = type { ptr, [2000 x i8], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, i32, [3 x float], float, i16, [3 x i16] }
%struct.s_fparams = type { [2000 x i8], [2000 x i8], [2000 x i8], [8000 x i8], ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, i8, i8, i32, i32, i16, i32, i32, i32, i16, i32, i32, i32, i16, float, float, float, float, float, [20 x ptr], i16, i16, [20 x ptr], i32, [10 x i8] }
%struct.s_mdgrid = type { ptr, ptr, i32, i32, i32, float, i32 }

@.str = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @write_md_grid(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, float noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store float %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !11
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str) #4
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.1) #4
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.2) #4
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.3) #4
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.s_mdparams, ptr %29, i32 0, i32 18
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds %struct.s_fparams, ptr %31, i32 0, i32 27
  %33 = load float, ptr %32, align 8, !tbaa !17
  %34 = fpext float %33 to double
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_mdparams, ptr %35, i32 0, i32 18
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = getelementptr inbounds %struct.s_fparams, ptr %37, i32 0, i32 29
  %39 = load float, ptr %38, align 8, !tbaa !19
  %40 = fpext float %39 to double
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.4, double noundef %34, double noundef %40) #4
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_mdparams, ptr %43, i32 0, i32 18
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct.s_fparams, ptr %45, i32 0, i32 24
  %47 = load i16, ptr %46, align 4, !tbaa !20
  %48 = zext i16 %47 to i32
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.5, i32 noundef %48) #4
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s_mdparams, ptr %50, i32 0, i32 19
  %52 = load i32, ptr %51, align 8, !tbaa !21
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %5
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.6) #4
  br label %57

57:                                               ; preds = %54, %5
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.s_mdgrid, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %60, align 8, !tbaa !22
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.s_mdgrid, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 4, !tbaa !24
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.s_mdgrid, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 8, !tbaa !25
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.7, i32 noundef %61, i32 noundef %64, i32 noundef %67) #4
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s_mdgrid, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = getelementptr inbounds float, ptr %72, i64 0
  %74 = load float, ptr %73, align 4, !tbaa !9
  %75 = fpext float %74 to double
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.s_mdgrid, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = getelementptr inbounds float, ptr %78, i64 1
  %80 = load float, ptr %79, align 4, !tbaa !9
  %81 = fpext float %80 to double
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.s_mdgrid, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !26
  %85 = getelementptr inbounds float, ptr %84, i64 2
  %86 = load float, ptr %85, align 4, !tbaa !9
  %87 = fpext float %86 to double
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.8, double noundef %75, double noundef %81, double noundef %87) #4
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.s_mdgrid, ptr %90, i32 0, i32 5
  %92 = load float, ptr %91, align 4, !tbaa !27
  %93 = fpext float %92 to double
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.9, double noundef %93) #4
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.s_mdgrid, ptr %96, i32 0, i32 5
  %98 = load float, ptr %97, align 4, !tbaa !27
  %99 = fpext float %98 to double
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.10, double noundef %99) #4
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.s_mdgrid, ptr %102, i32 0, i32 5
  %104 = load float, ptr %103, align 4, !tbaa !27
  %105 = fpext float %104 to double
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.11, double noundef %105) #4
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.s_mdgrid, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !22
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.s_mdgrid, ptr %111, i32 0, i32 3
  %113 = load i32, ptr %112, align 4, !tbaa !24
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.s_mdgrid, ptr %114, i32 0, i32 4
  %116 = load i32, ptr %115, align 8, !tbaa !25
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.12, i32 noundef %110, i32 noundef %113, i32 noundef %116) #4
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.s_mdgrid, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 8, !tbaa !22
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.s_mdgrid, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 4, !tbaa !24
  %125 = mul nsw i32 %121, %124
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.s_mdgrid, ptr %126, i32 0, i32 4
  %128 = load i32, ptr %127, align 8, !tbaa !25
  %129 = mul nsw i32 %125, %128
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.13, i32 noundef %129) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !28
  store i32 0, ptr %11, align 4, !tbaa !28
  br label %131

131:                                              ; preds = %237, %57
  %132 = load i32, ptr %11, align 4, !tbaa !28
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.s_mdgrid, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 8, !tbaa !22
  %136 = icmp slt i32 %132, %135
  br i1 %136, label %137, label %240

137:                                              ; preds = %131
  store i32 0, ptr %12, align 4, !tbaa !28
  br label %138

138:                                              ; preds = %233, %137
  %139 = load i32, ptr %12, align 4, !tbaa !28
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.s_mdgrid, ptr %140, i32 0, i32 3
  %142 = load i32, ptr %141, align 4, !tbaa !24
  %143 = icmp slt i32 %139, %142
  br i1 %143, label %144, label %236

144:                                              ; preds = %138
  store i32 0, ptr %13, align 4, !tbaa !28
  br label %145

145:                                              ; preds = %229, %144
  %146 = load i32, ptr %13, align 4, !tbaa !28
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.s_mdgrid, ptr %147, i32 0, i32 4
  %149 = load i32, ptr %148, align 8, !tbaa !25
  %150 = icmp slt i32 %146, %149
  br i1 %150, label %151, label %232

151:                                              ; preds = %145
  %152 = load i32, ptr %19, align 4, !tbaa !28
  %153 = icmp eq i32 %152, 3
  br i1 %153, label %154, label %157

154:                                              ; preds = %151
  store i32 0, ptr %19, align 4, !tbaa !28
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.14) #4
  br label %157

157:                                              ; preds = %154, %151
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.s_mdgrid, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !29
  %161 = load i32, ptr %11, align 4, !tbaa !28
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds ptr, ptr %160, i64 %162
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = load i32, ptr %12, align 4, !tbaa !28
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %164, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  %169 = load i32, ptr %13, align 4, !tbaa !28
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds float, ptr %168, i64 %170
  %172 = load float, ptr %171, align 4, !tbaa !9
  store float %172, ptr %14, align 4, !tbaa !9
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load float, ptr %14, align 4, !tbaa !9
  %175 = fpext float %174 to double
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str.15, double noundef %175) #4
  %177 = load float, ptr %14, align 4, !tbaa !9
  %178 = load float, ptr %10, align 4, !tbaa !9
  %179 = fcmp oge float %177, %178
  br i1 %179, label %180, label %226

180:                                              ; preds = %157
  %181 = load i64, ptr %18, align 8, !tbaa !11
  %182 = add i64 %181, 1
  store i64 %182, ptr %18, align 8, !tbaa !11
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.s_mdgrid, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !26
  %186 = getelementptr inbounds float, ptr %185, i64 0
  %187 = load float, ptr %186, align 4, !tbaa !9
  %188 = load i32, ptr %11, align 4, !tbaa !28
  %189 = sitofp i32 %188 to float
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.s_mdgrid, ptr %190, i32 0, i32 5
  %192 = load float, ptr %191, align 4, !tbaa !27
  %193 = call float @llvm.fmuladd.f32(float %189, float %192, float %187)
  store float %193, ptr %15, align 4, !tbaa !9
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.s_mdgrid, ptr %194, i32 0, i32 1
  %196 = load ptr, ptr %195, align 8, !tbaa !26
  %197 = getelementptr inbounds float, ptr %196, i64 1
  %198 = load float, ptr %197, align 4, !tbaa !9
  %199 = load i32, ptr %12, align 4, !tbaa !28
  %200 = sitofp i32 %199 to float
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.s_mdgrid, ptr %201, i32 0, i32 5
  %203 = load float, ptr %202, align 4, !tbaa !27
  %204 = call float @llvm.fmuladd.f32(float %200, float %203, float %198)
  store float %204, ptr %16, align 4, !tbaa !9
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.s_mdgrid, ptr %205, i32 0, i32 1
  %207 = load ptr, ptr %206, align 8, !tbaa !26
  %208 = getelementptr inbounds float, ptr %207, i64 2
  %209 = load float, ptr %208, align 4, !tbaa !9
  %210 = load i32, ptr %13, align 4, !tbaa !28
  %211 = sitofp i32 %210 to float
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.s_mdgrid, ptr %212, i32 0, i32 5
  %214 = load float, ptr %213, align 4, !tbaa !27
  %215 = call float @llvm.fmuladd.f32(float %211, float %214, float %209)
  store float %215, ptr %17, align 4, !tbaa !9
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  %217 = load i64, ptr %18, align 8, !tbaa !11
  %218 = trunc i64 %217 to i32
  %219 = load float, ptr %15, align 4, !tbaa !9
  %220 = fpext float %219 to double
  %221 = load float, ptr %16, align 4, !tbaa !9
  %222 = fpext float %221 to double
  %223 = load float, ptr %17, align 4, !tbaa !9
  %224 = fpext float %223 to double
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.16, i32 noundef %218, double noundef %220, double noundef %222, double noundef %224, double noundef 0.000000e+00, double noundef 0.000000e+00) #4
  br label %226

226:                                              ; preds = %180, %157
  %227 = load i32, ptr %19, align 4, !tbaa !28
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %19, align 4, !tbaa !28
  br label %229

229:                                              ; preds = %226
  %230 = load i32, ptr %13, align 4, !tbaa !28
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %13, align 4, !tbaa !28
  br label %145, !llvm.loop !30

232:                                              ; preds = %145
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %12, align 4, !tbaa !28
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %12, align 4, !tbaa !28
  br label %138, !llvm.loop !32

236:                                              ; preds = %138
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %11, align 4, !tbaa !28
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %11, align 4, !tbaa !28
  br label %131, !llvm.loop !33

240:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

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

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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 2136}
!14 = !{!"s_mdparams", !6, i64 0, !7, i64 8, !6, i64 2008, !6, i64 2016, !6, i64 2024, !6, i64 2032, !6, i64 2040, !6, i64 2048, !6, i64 2056, !6, i64 2064, !6, i64 2072, !6, i64 2080, !6, i64 2088, !6, i64 2096, !6, i64 2104, !6, i64 2112, !6, i64 2120, !15, i64 2128, !6, i64 2136, !15, i64 2144, !15, i64 2148, !7, i64 2152, !10, i64 2164, !16, i64 2168, !7, i64 2170}
!15 = !{!"int", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!18, !10, i64 14112}
!18 = !{!"s_fparams", !7, i64 0, !7, i64 2000, !7, i64 4000, !7, i64 6000, !6, i64 14000, !6, i64 14008, !6, i64 14016, !15, i64 14024, !15, i64 14028, !6, i64 14032, !6, i64 14040, !6, i64 14048, !7, i64 14056, !7, i64 14057, !15, i64 14060, !15, i64 14064, !16, i64 14068, !15, i64 14072, !15, i64 14076, !15, i64 14080, !16, i64 14084, !15, i64 14088, !15, i64 14092, !15, i64 14096, !16, i64 14100, !10, i64 14104, !10, i64 14108, !10, i64 14112, !10, i64 14116, !10, i64 14120, !7, i64 14128, !16, i64 14288, !16, i64 14290, !7, i64 14296, !15, i64 14456, !7, i64 14460}
!19 = !{!18, !10, i64 14120}
!20 = !{!18, !16, i64 14100}
!21 = !{!14, !15, i64 2144}
!22 = !{!23, !15, i64 16}
!23 = !{!"s_mdgrid", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 20, !15, i64 24, !10, i64 28, !15, i64 32}
!24 = !{!23, !15, i64 20}
!25 = !{!23, !15, i64 24}
!26 = !{!23, !6, i64 8}
!27 = !{!23, !10, i64 28}
!28 = !{!15, !15, i64 0}
!29 = !{!23, !6, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


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

@.str = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @write_md_grid(ptr nocapture noundef readonly %0, ptr nocapture noundef %1, ptr nocapture noundef %2, ptr nocapture noundef readonly %3, float noundef %4) local_unnamed_addr #0 {
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str) #3
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.1) #3
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.2) #3
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.3) #3
  %10 = getelementptr inbounds i8, ptr %3, i64 2136
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 14112
  %13 = load float, ptr %12, align 8, !tbaa !13
  %14 = fpext float %13 to double
  %15 = getelementptr inbounds i8, ptr %11, i64 14120
  %16 = load float, ptr %15, align 8, !tbaa !15
  %17 = fpext float %16 to double
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.4, double noundef %14, double noundef %17) #3
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 14100
  %21 = load i16, ptr %20, align 4, !tbaa !16
  %22 = zext i16 %21 to i32
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.5, i32 noundef %22) #3
  %24 = getelementptr inbounds i8, ptr %3, i64 2144
  %25 = load i32, ptr %24, align 8, !tbaa !17
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %28, label %26

26:                                               ; preds = %5
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.6) #3
  br label %28

28:                                               ; preds = %26, %5
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load i32, ptr %29, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %0, i64 20
  %32 = load i32, ptr %31, align 4, !tbaa !20
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.7, i32 noundef %30, i32 noundef %32, i32 noundef %34) #3
  %36 = getelementptr inbounds i8, ptr %0, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  %38 = load float, ptr %37, align 4, !tbaa !23
  %39 = fpext float %38 to double
  %40 = getelementptr inbounds i8, ptr %37, i64 4
  %41 = load float, ptr %40, align 4, !tbaa !23
  %42 = fpext float %41 to double
  %43 = getelementptr inbounds i8, ptr %37, i64 8
  %44 = load float, ptr %43, align 4, !tbaa !23
  %45 = fpext float %44 to double
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.8, double noundef %39, double noundef %42, double noundef %45) #3
  %47 = getelementptr inbounds i8, ptr %0, i64 28
  %48 = load float, ptr %47, align 4, !tbaa !24
  %49 = fpext float %48 to double
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.9, double noundef %49) #3
  %51 = load float, ptr %47, align 4, !tbaa !24
  %52 = fpext float %51 to double
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.10, double noundef %52) #3
  %54 = load float, ptr %47, align 4, !tbaa !24
  %55 = fpext float %54 to double
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.11, double noundef %55) #3
  %57 = load i32, ptr %29, align 8, !tbaa !18
  %58 = load i32, ptr %31, align 4, !tbaa !20
  %59 = load i32, ptr %33, align 8, !tbaa !21
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.12, i32 noundef %57, i32 noundef %58, i32 noundef %59) #3
  %61 = load i32, ptr %29, align 8, !tbaa !18
  %62 = load i32, ptr %31, align 4, !tbaa !20
  %63 = mul nsw i32 %62, %61
  %64 = load i32, ptr %33, align 8, !tbaa !21
  %65 = mul nsw i32 %63, %64
  %66 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.13, i32 noundef %65) #3
  %67 = load i32, ptr %29, align 8, !tbaa !18
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.preheader74.lr.ph, label %._crit_edge89

.preheader74.lr.ph:                               ; preds = %28
  %69 = load i32, ptr %31, align 4, !tbaa !20
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.preheader74, label %._crit_edge89

.preheader74:                                     ; preds = %.preheader74.lr.ph, %._crit_edge82
  %71 = phi i32 [ %126, %._crit_edge82 ], [ %67, %.preheader74.lr.ph ]
  %72 = phi i32 [ %127, %._crit_edge82 ], [ %69, %.preheader74.lr.ph ]
  %73 = phi i32 [ %128, %._crit_edge82 ], [ %69, %.preheader74.lr.ph ]
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %._crit_edge82 ], [ 0, %.preheader74.lr.ph ]
  %.088 = phi i32 [ %.1.lcssa, %._crit_edge82 ], [ 0, %.preheader74.lr.ph ]
  %.06787 = phi i32 [ %.168.lcssa, %._crit_edge82 ], [ 0, %.preheader74.lr.ph ]
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.preheader.lr.ph, label %._crit_edge82

.preheader.lr.ph:                                 ; preds = %.preheader74
  %75 = trunc nuw nsw i64 %indvars.iv96 to i32
  %76 = uitofp nneg i32 %75 to float
  %77 = load i32, ptr %33, align 8, !tbaa !21
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.preheader, label %._crit_edge82

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %79 = phi i32 [ %122, %._crit_edge ], [ %72, %.preheader.lr.ph ]
  %80 = phi i32 [ %123, %._crit_edge ], [ %77, %.preheader.lr.ph ]
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.181 = phi i32 [ %.2.lcssa, %._crit_edge ], [ %.088, %.preheader.lr.ph ]
  %.16880 = phi i32 [ %.269.lcssa, %._crit_edge ], [ %.06787, %.preheader.lr.ph ]
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %82 = trunc nuw nsw i64 %indvars.iv93 to i32
  %83 = uitofp nneg i32 %82 to float
  br label %84

84:                                               ; preds = %.lr.ph, %117
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %117 ]
  %.277 = phi i32 [ %.181, %.lr.ph ], [ %118, %117 ]
  %.26976 = phi i32 [ %.16880, %.lr.ph ], [ %.370, %117 ]
  %85 = icmp eq i32 %.277, 3
  br i1 %85, label %86, label %88

86:                                               ; preds = %84
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.14) #3
  br label %88

88:                                               ; preds = %86, %84
  %.3 = phi i32 [ 0, %86 ], [ %.277, %84 ]
  %89 = load ptr, ptr %0, align 8, !tbaa !25
  %90 = getelementptr inbounds ptr, ptr %89, i64 %indvars.iv96
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = getelementptr inbounds ptr, ptr %91, i64 %indvars.iv93
  %93 = load ptr, ptr %92, align 8, !tbaa !26
  %94 = getelementptr inbounds float, ptr %93, i64 %indvars.iv
  %95 = load float, ptr %94, align 4, !tbaa !23
  %96 = fpext float %95 to double
  %97 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.15, double noundef %96) #3
  %98 = fcmp ult float %95, %4
  br i1 %98, label %117, label %99

99:                                               ; preds = %88
  %100 = add i32 %.26976, 1
  %101 = load ptr, ptr %36, align 8, !tbaa !22
  %102 = load float, ptr %101, align 4, !tbaa !23
  %103 = load float, ptr %47, align 4, !tbaa !24
  %104 = tail call float @llvm.fmuladd.f32(float %76, float %103, float %102)
  %105 = getelementptr inbounds i8, ptr %101, i64 4
  %106 = load float, ptr %105, align 4, !tbaa !23
  %107 = tail call float @llvm.fmuladd.f32(float %83, float %103, float %106)
  %108 = getelementptr inbounds i8, ptr %101, i64 8
  %109 = load float, ptr %108, align 4, !tbaa !23
  %110 = trunc nuw nsw i64 %indvars.iv to i32
  %111 = uitofp nneg i32 %110 to float
  %112 = tail call float @llvm.fmuladd.f32(float %111, float %103, float %109)
  %113 = fpext float %104 to double
  %114 = fpext float %107 to double
  %115 = fpext float %112 to double
  %116 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.16, i32 noundef %100, double noundef %113, double noundef %114, double noundef %115, double noundef 0.000000e+00, double noundef 0.000000e+00) #3
  br label %117

117:                                              ; preds = %99, %88
  %.370 = phi i32 [ %100, %99 ], [ %.26976, %88 ]
  %118 = add nsw i32 %.3, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %119 = load i32, ptr %33, align 8, !tbaa !21
  %120 = sext i32 %119 to i64
  %121 = icmp slt i64 %indvars.iv.next, %120
  br i1 %121, label %84, label %._crit_edge.loopexit, !llvm.loop !27

._crit_edge.loopexit:                             ; preds = %117
  %.pre = load i32, ptr %31, align 4, !tbaa !20
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %122 = phi i32 [ %79, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %123 = phi i32 [ %80, %.preheader ], [ %119, %._crit_edge.loopexit ]
  %.269.lcssa = phi i32 [ %.16880, %.preheader ], [ %.370, %._crit_edge.loopexit ]
  %.2.lcssa = phi i32 [ %.181, %.preheader ], [ %118, %._crit_edge.loopexit ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %124 = sext i32 %122 to i64
  %125 = icmp slt i64 %indvars.iv.next94, %124
  br i1 %125, label %.preheader, label %._crit_edge82.loopexit, !llvm.loop !29

._crit_edge82.loopexit:                           ; preds = %._crit_edge
  %.pre99 = load i32, ptr %29, align 8, !tbaa !18
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %.preheader.lr.ph, %._crit_edge82.loopexit, %.preheader74
  %126 = phi i32 [ %71, %.preheader74 ], [ %.pre99, %._crit_edge82.loopexit ], [ %71, %.preheader.lr.ph ]
  %127 = phi i32 [ %72, %.preheader74 ], [ %122, %._crit_edge82.loopexit ], [ %72, %.preheader.lr.ph ]
  %128 = phi i32 [ %73, %.preheader74 ], [ %122, %._crit_edge82.loopexit ], [ %73, %.preheader.lr.ph ]
  %.168.lcssa = phi i32 [ %.06787, %.preheader74 ], [ %.269.lcssa, %._crit_edge82.loopexit ], [ %.06787, %.preheader.lr.ph ]
  %.1.lcssa = phi i32 [ %.088, %.preheader74 ], [ %.2.lcssa, %._crit_edge82.loopexit ], [ %.088, %.preheader.lr.ph ]
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %129 = sext i32 %126 to i64
  %130 = icmp slt i64 %indvars.iv.next97, %129
  br i1 %130, label %.preheader74, label %._crit_edge89, !llvm.loop !31

._crit_edge89:                                    ; preds = %._crit_edge82, %.preheader74.lr.ph, %28
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

attributes #0 = { nofree 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 2136}
!6 = !{!"s_mdparams", !7, i64 0, !8, i64 8, !7, i64 2008, !7, i64 2016, !7, i64 2024, !7, i64 2032, !7, i64 2040, !7, i64 2048, !7, i64 2056, !7, i64 2064, !7, i64 2072, !7, i64 2080, !7, i64 2088, !7, i64 2096, !7, i64 2104, !7, i64 2112, !7, i64 2120, !10, i64 2128, !7, i64 2136, !10, i64 2144, !10, i64 2148, !8, i64 2152, !11, i64 2164, !12, i64 2168, !8, i64 2170}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !11, i64 14112}
!14 = !{!"s_fparams", !8, i64 0, !8, i64 2000, !8, i64 4000, !8, i64 6000, !7, i64 14000, !7, i64 14008, !7, i64 14016, !10, i64 14024, !10, i64 14028, !7, i64 14032, !7, i64 14040, !7, i64 14048, !8, i64 14056, !8, i64 14057, !10, i64 14060, !10, i64 14064, !12, i64 14068, !10, i64 14072, !10, i64 14076, !10, i64 14080, !12, i64 14084, !10, i64 14088, !10, i64 14092, !10, i64 14096, !12, i64 14100, !11, i64 14104, !11, i64 14108, !11, i64 14112, !11, i64 14116, !11, i64 14120, !8, i64 14128, !12, i64 14288, !12, i64 14290, !8, i64 14296, !10, i64 14456, !8, i64 14460}
!15 = !{!14, !11, i64 14120}
!16 = !{!14, !12, i64 14100}
!17 = !{!6, !10, i64 2144}
!18 = !{!19, !10, i64 16}
!19 = !{!"s_mdgrid", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !11, i64 28, !10, i64 32}
!20 = !{!19, !10, i64 20}
!21 = !{!19, !10, i64 24}
!22 = !{!19, !7, i64 8}
!23 = !{!11, !11, i64 0}
!24 = !{!19, !11, i64 28}
!25 = !{!19, !7, i64 0}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28, !30}
!30 = !{!"llvm.loop.unswitch.partial.disable"}
!31 = distinct !{!31, !28, !30}


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