; LLVM IR from EntityFX/anybench :: src/benchmarks/generic/gsynth/gsynth.ll (Z14render_to_filePKcf)

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

%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }

@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6warmupv() #0

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14render_to_filePKcf(ptr noundef %0, float noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca %"class.std::basic_ofstream", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::fpos", align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca i64, align 8
  %18 = alloca %"class.std::fpos", align 8
  %19 = alloca %"class.std::fpos", align 8
  %20 = alloca %"class.std::fpos", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @_Z6warmupv()
  call void @llvm.lifetime.start.p0(i64 512, ptr %5) #9
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %5, ptr noundef %21, i32 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 1, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 48000, ptr %7, align 4, !tbaa !11
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.3)
          to label %23 unwind label %82

23:                                               ; preds = %2
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 16, i32 noundef 4)
          to label %25 unwind label %82

25:                                               ; preds = %23
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 1, i32 noundef 2)
          to label %27 unwind label %82

27:                                               ; preds = %25
  %28 = load i32, ptr %6, align 4, !tbaa !11
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %28, i32 noundef 2)
          to label %30 unwind label %82

30:                                               ; preds = %27
  %31 = load i32, ptr %7, align 4, !tbaa !11
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %31, i32 noundef 4)
          to label %33 unwind label %82

33:                                               ; preds = %30
  %34 = load i32, ptr %7, align 4, !tbaa !11
  %35 = mul nsw i32 %34, 2
  %36 = load i32, ptr %6, align 4, !tbaa !11
  %37 = mul nsw i32 %35, %36
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %37, i32 noundef 4)
          to label %39 unwind label %82

39:                                               ; preds = %33
  %40 = load i32, ptr %6, align 4, !tbaa !11
  %41 = mul nsw i32 2, %40
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %41, i32 noundef 2)
          to label %43 unwind label %82

43:                                               ; preds = %39
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 16, i32 noundef 2)
          to label %45 unwind label %82

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #9
  %46 = invoke { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %47 unwind label %86

47:                                               ; preds = %45
  %48 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %49 = extractvalue { i64, i64 } %46, 0
  store i64 %49, ptr %48, align 8
  %50 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %51 = extractvalue { i64, i64 } %46, 1
  store i64 %51, ptr %50, align 8
  %52 = invoke noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %53 unwind label %86

53:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #9
  store i64 %52, ptr %10, align 8, !tbaa !13
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.4)
          to label %55 unwind label %90

55:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %56 = load i32, ptr %7, align 4, !tbaa !11
  %57 = sitofp i32 %56 to double
  store double %57, ptr %12, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %58 = load double, ptr %12, align 8, !tbaa !15
  %59 = load float, ptr %4, align 4, !tbaa !9
  %60 = fpext float %59 to double
  %61 = fmul double %58, %60
  %62 = fptosi double %61 to i32
  %63 = or i32 %62, 255
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %65 = load i32, ptr %13, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %66, i64 4)
  %68 = extractvalue { i64, i1 } %67, 1
  %69 = extractvalue { i64, i1 } %67, 0
  %70 = select i1 %68, i64 -1, i64 %69
  %71 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %70) #10
          to label %72 unwind label %94

72:                                               ; preds = %55
  store ptr %71, ptr %14, align 8, !tbaa !5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !11
  %75 = load float, ptr %4, align 4, !tbaa !9
  invoke void @_Z12fill_samplesPfif(ptr noundef %73, i32 noundef %74, float noundef %75)
          to label %76 unwind label %94

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %123, %76
  %78 = load i32, ptr %15, align 4, !tbaa !11
  %79 = load i32, ptr %13, align 4, !tbaa !11
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %98, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %126

82:                                               ; preds = %43, %39, %33, %30, %27, %25, %23, %2
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %8, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %9, align 4
  br label %176

86:                                               ; preds = %47, %45
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %8, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #9
  br label %175

90:                                               ; preds = %53
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  br label %175

94:                                               ; preds = %72, %55
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %174

98:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds float, ptr %99, i64 %101
  %103 = load float, ptr %102, align 4, !tbaa !9
  %104 = invoke noundef float @_Z6clampffff(float noundef %103, float noundef -1.000000e+00, float noundef 1.000000e+00)
          to label %105 unwind label %118

105:                                              ; preds = %98
  %106 = fmul float %104, 3.276000e+04
  store float %106, ptr %16, align 4, !tbaa !9
  %107 = load float, ptr %16, align 4, !tbaa !9
  %108 = fptosi float %107 to i32
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %108, i32 noundef 2)
          to label %110 unwind label %118

110:                                              ; preds = %105
  %111 = load i32, ptr %6, align 4, !tbaa !11
  %112 = icmp sgt i32 %111, 1
  br i1 %112, label %113, label %122

113:                                              ; preds = %110
  %114 = load float, ptr %16, align 4, !tbaa !9
  %115 = fptosi float %114 to i32
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %115, i32 noundef 2)
          to label %117 unwind label %118

117:                                              ; preds = %113
  br label %122

118:                                              ; preds = %113, %105, %98
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %8, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %174

122:                                              ; preds = %117, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %15, align 4, !tbaa !11
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %15, align 4, !tbaa !11
  br label %77, !llvm.loop !17

126:                                              ; preds = %81
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  call void @_ZdaPv(ptr noundef %127) #11
  br label %130

130:                                              ; preds = %129, %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #9
  %131 = invoke { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %132 unwind label %165

132:                                              ; preds = %130
  %133 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %134 = extractvalue { i64, i64 } %131, 0
  store i64 %134, ptr %133, align 8
  %135 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %136 = extractvalue { i64, i64 } %131, 1
  store i64 %136, ptr %135, align 8
  %137 = invoke noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %138 unwind label %165

138:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  store i64 %137, ptr %17, align 8, !tbaa !13
  %139 = load i64, ptr %10, align 8, !tbaa !13
  %140 = add i64 %139, 4
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef %140)
          to label %141 unwind label %169

141:                                              ; preds = %138
  %142 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %143 = load i64, ptr %142, align 8
  %144 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %145 = load i64, ptr %144, align 8
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 %143, i64 %145)
          to label %147 unwind label %169

147:                                              ; preds = %141
  %148 = load i64, ptr %17, align 8, !tbaa !13
  %149 = load i64, ptr %10, align 8, !tbaa !13
  %150 = sub i64 %148, %149
  %151 = sub i64 %150, 8
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %151, i32 noundef 4)
          to label %153 unwind label %169

153:                                              ; preds = %147
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %20, i64 noundef 4)
          to label %154 unwind label %169

154:                                              ; preds = %153
  %155 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %156 = load i64, ptr %155, align 8
  %157 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %158 = load i64, ptr %157, align 8
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 %156, i64 %158)
          to label %160 unwind label %169

160:                                              ; preds = %154
  %161 = load i64, ptr %17, align 8, !tbaa !13
  %162 = sub i64 %161, 8
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %162, i32 noundef 4)
          to label %164 unwind label %169

164:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %5) #9
  call void @llvm.lifetime.end.p0(i64 512, ptr %5) #9
  ret void

165:                                              ; preds = %132, %130
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %8, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  br label %173

169:                                              ; preds = %160, %154, %153, %147, %141, %138
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %8, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %9, align 4
  br label %173

173:                                              ; preds = %169, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %174

174:                                              ; preds = %173, %118, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %175

175:                                              ; preds = %174, %90, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %176

176:                                              ; preds = %175, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %5) #9
  call void @llvm.lifetime.end.p0(i64 512, ptr %5) #9
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr %8, align 8
  %179 = load i32, ptr %9, align 4
  %180 = insertvalue { ptr, i32 } poison, ptr %178, 0
  %181 = insertvalue { ptr, i32 } %180, i32 %179, 1
  resume { ptr, i32 } %181
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) #0

declare { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16)) #7 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8), i64, i64) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #7 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin 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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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"

%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }

@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6warmupv() local_unnamed_addr #0

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14render_to_filePKcf(ptr noundef %0, float noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca %"class.std::fpos", align 8
  %5 = alloca %"class.std::fpos", align 8
  %6 = alloca %"class.std::fpos", align 8
  %7 = alloca %"class.std::fpos", align 8
  tail call void @_Z6warmupv()
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %3) #8
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef %0, i32 noundef 4)
  %8 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull @.str.3)
          to label %9 unwind label %43

9:                                                ; preds = %2
  %10 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 16, i32 noundef 4)
          to label %11 unwind label %43

11:                                               ; preds = %9
  %12 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 2)
          to label %13 unwind label %43

13:                                               ; preds = %11
  %14 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 2)
          to label %15 unwind label %43

15:                                               ; preds = %13
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 48000, i32 noundef 4)
          to label %17 unwind label %43

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 96000, i32 noundef 4)
          to label %19 unwind label %43

19:                                               ; preds = %17
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 2)
          to label %21 unwind label %43

21:                                               ; preds = %19
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 16, i32 noundef 2)
          to label %23 unwind label %43

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %24 = invoke { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %25 unwind label %45

25:                                               ; preds = %23
  %26 = extractvalue { i64, i64 } %24, 0
  store i64 %26, ptr %4, align 8
  %27 = getelementptr inbounds i8, ptr %4, i64 8
  %28 = extractvalue { i64, i64 } %24, 1
  store i64 %28, ptr %27, align 8
  %29 = call noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull @.str.4)
          to label %31 unwind label %47

31:                                               ; preds = %25
  %32 = fpext float %1 to double
  %33 = fmul double %32, 4.800000e+04
  %34 = fptosi double %33 to i32
  %35 = or i32 %34, 255
  %36 = add i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = icmp slt i32 %35, -1
  %39 = shl nsw i64 %37, 2
  %40 = select i1 %38, i64 -1, i64 %39
  %41 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %40) #9
          to label %42 unwind label %49

42:                                               ; preds = %31
  invoke void @_Z12fill_samplesPfif(ptr noundef nonnull %41, i32 noundef %36, float noundef %1)
          to label %.preheader unwind label %49

.preheader:                                       ; preds = %42
  %.not37 = icmp slt i32 %34, 0
  br i1 %.not37, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext i32 %36 to i64
  br label %.lr.ph

43:                                               ; preds = %21, %19, %17, %15, %13, %11, %9, %2
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %87

45:                                               ; preds = %23
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %87

47:                                               ; preds = %25
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %87

49:                                               ; preds = %42, %31
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %87

.lr.ph:                                           ; preds = %.lr.ph.preheader, %59
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %59 ]
  %51 = getelementptr inbounds float, ptr %41, i64 %indvars.iv
  %52 = load float, ptr %51, align 4, !tbaa !5
  %53 = call noundef float @_Z6clampffff(float noundef %52, float noundef -1.000000e+00, float noundef 1.000000e+00)
  %54 = fmul float %53, 3.276000e+04
  %55 = fptosi float %54 to i32
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %55, i32 noundef 2)
          to label %59 unwind label %57

57:                                               ; preds = %.lr.ph
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %87

59:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %59, %.preheader
  call void @_ZdaPv(ptr noundef nonnull %41) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %60 = invoke { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %61 unwind label %83

61:                                               ; preds = %._crit_edge
  %62 = extractvalue { i64, i64 } %60, 0
  store i64 %62, ptr %5, align 8
  %63 = getelementptr inbounds i8, ptr %5, i64 8
  %64 = extractvalue { i64, i64 } %60, 1
  store i64 %64, ptr %63, align 8
  %65 = call noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %66 = add i64 %29, 4
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %66)
  %67 = load i64, ptr %6, align 8
  %68 = getelementptr inbounds i8, ptr %6, i64 8
  %69 = load i64, ptr %68, align 8
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %67, i64 %69)
          to label %71 unwind label %85

71:                                               ; preds = %61
  %reass.sub = sub i64 %65, %29
  %72 = add i64 %reass.sub, -8
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %72, i32 noundef 4)
          to label %74 unwind label %85

74:                                               ; preds = %71
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 4)
  %75 = load i64, ptr %7, align 8
  %76 = getelementptr inbounds i8, ptr %7, i64 8
  %77 = load i64, ptr %76, align 8
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %75, i64 %77)
          to label %79 unwind label %85

79:                                               ; preds = %74
  %80 = add i64 %65, -8
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %80, i32 noundef 4)
          to label %82 unwind label %85

82:                                               ; preds = %79
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %3) #8
  ret void

83:                                               ; preds = %._crit_edge
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  br label %87

85:                                               ; preds = %79, %74, %71, %61
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %87

87:                                               ; preds = %45, %47, %83, %85, %57, %49, %43
  %.pn33.pn.pn = phi { ptr, i32 } [ %44, %43 ], [ %48, %47 ], [ %46, %45 ], [ %58, %57 ], [ %50, %49 ], [ %86, %85 ], [ %84, %83 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn33.pn.pn
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordIiERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #0

declare { i64, i64 } @_ZNSo5tellpEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt4fposI11__mbstate_tEcvlEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5seekpESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(8), i64, i64) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_Z10write_wordImERSoS0_T_j(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #6 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin 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 #3 = { nobuiltin 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass