; LLVM IR from greensoftwarelab/Energy-Languages :: C/mandelbrot/mandelbrot.gcc-6 (main)

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

@.str = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @numDigits(i64 noundef) #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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @mand64(ptr noundef, <2 x double> noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare i64 @mand8(ptr noundef, <2 x double> noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca <2 x double>, align 16
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca <2 x double>, align 16
  %22 = alloca <2 x double>, align 16
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca <2 x double>, align 16
  %27 = alloca <2 x double>, align 16
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  store i64 16000, ptr %6, align 8, !tbaa !11
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp sge i32 %31, 2
  br i1 %32, label %33, label %39

33:                                               ; preds = %2
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i32 @atoi(ptr noundef %36) #11
  %38 = sext i32 %37 to i64
  store i64 %38, ptr %6, align 8, !tbaa !11
  br label %39

39:                                               ; preds = %33, %2
  %40 = load i64, ptr %6, align 8, !tbaa !11
  %41 = add nsw i64 %40, 7
  %42 = and i64 %41, -8
  store i64 %42, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %43 = load i64, ptr %6, align 8, !tbaa !11
  %44 = call i64 @numDigits(i64 noundef %43)
  %45 = mul nsw i64 %44, 2
  %46 = add nsw i64 %45, 5
  store i64 %46, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %47 = load i64, ptr %7, align 8, !tbaa !11
  %48 = add nsw i64 %47, 7
  %49 = and i64 %48, -8
  %50 = load i64, ptr %7, align 8, !tbaa !11
  %51 = sub nsw i64 %49, %50
  store i64 %51, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %52 = load i64, ptr %7, align 8, !tbaa !11
  %53 = load i64, ptr %6, align 8, !tbaa !11
  %54 = load i64, ptr %6, align 8, !tbaa !11
  %55 = ashr i64 %54, 3
  %56 = mul nsw i64 %53, %55
  %57 = add nsw i64 %52, %56
  store i64 %57, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %58 = load i64, ptr %8, align 8, !tbaa !11
  %59 = load i64, ptr %9, align 8, !tbaa !11
  %60 = add nsw i64 %58, %59
  %61 = call noalias ptr @malloc(i64 noundef %60) #12
  store ptr %61, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %62 = load ptr, ptr %10, align 8, !tbaa !9
  %63 = load i64, ptr %8, align 8, !tbaa !11
  %64 = getelementptr inbounds i8, ptr %62, i64 %63
  store ptr %64, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %65 = load ptr, ptr %11, align 8, !tbaa !9
  %66 = load i64, ptr %7, align 8, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %65, i64 %66
  store ptr %67, ptr %12, align 8, !tbaa !9
  %68 = load ptr, ptr %11, align 8, !tbaa !9
  %69 = load i64, ptr %6, align 8, !tbaa !11
  %70 = load i64, ptr %6, align 8, !tbaa !11
  %71 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %68, ptr noundef @.str, i64 noundef %69, i64 noundef %70) #10
  %72 = load i64, ptr %6, align 8, !tbaa !11
  %73 = sdiv i64 %72, 2
  %74 = call ptr @llvm.stacksave.p0()
  store ptr %74, ptr %13, align 8
  %75 = alloca <2 x double>, i64 %73, align 16
  store i64 %73, ptr %14, align 8
  %76 = load i64, ptr %6, align 8, !tbaa !11
  %77 = alloca double, i64 %76, align 16
  store i64 %76, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  store i64 0, ptr %16, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %119, %39
  %79 = load i64, ptr %16, align 8, !tbaa !11
  %80 = load i64, ptr %6, align 8, !tbaa !11
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br label %122

83:                                               ; preds = %78
  %84 = load i64, ptr %6, align 8, !tbaa !11
  %85 = sitofp i64 %84 to double
  %86 = fdiv double 2.000000e+00, %85
  %87 = insertelement <2 x double> poison, double %86, i64 0
  %88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> zeroinitializer
  %89 = load i64, ptr %16, align 8, !tbaa !11
  %90 = sitofp i64 %89 to double
  %91 = insertelement <2 x double> poison, double %90, i32 0
  %92 = load i64, ptr %16, align 8, !tbaa !11
  %93 = add nsw i64 %92, 1
  %94 = sitofp i64 %93 to double
  %95 = insertelement <2 x double> %91, double %94, i32 1
  store <2 x double> %95, ptr %17, align 16, !tbaa !13
  %96 = load <2 x double>, ptr %17, align 16, !tbaa !13
  %97 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %88, <2 x double> %96, <2 x double> <double -1.500000e+00, double -1.500000e+00>)
  %98 = load i64, ptr %16, align 8, !tbaa !11
  %99 = ashr i64 %98, 1
  %100 = getelementptr inbounds <2 x double>, ptr %75, i64 %99
  store <2 x double> %97, ptr %100, align 16, !tbaa !13
  %101 = load i64, ptr %6, align 8, !tbaa !11
  %102 = sitofp i64 %101 to double
  %103 = fdiv double 2.000000e+00, %102
  %104 = load i64, ptr %16, align 8, !tbaa !11
  %105 = sitofp i64 %104 to double
  %106 = call double @llvm.fmuladd.f64(double %103, double %105, double -1.000000e+00)
  %107 = load i64, ptr %16, align 8, !tbaa !11
  %108 = getelementptr inbounds double, ptr %77, i64 %107
  store double %106, ptr %108, align 8, !tbaa !14
  %109 = load i64, ptr %6, align 8, !tbaa !11
  %110 = sitofp i64 %109 to double
  %111 = fdiv double 2.000000e+00, %110
  %112 = load i64, ptr %16, align 8, !tbaa !11
  %113 = add nsw i64 %112, 1
  %114 = sitofp i64 %113 to double
  %115 = call double @llvm.fmuladd.f64(double %111, double %114, double -1.000000e+00)
  %116 = load i64, ptr %16, align 8, !tbaa !11
  %117 = add nsw i64 %116, 1
  %118 = getelementptr inbounds double, ptr %77, i64 %117
  store double %115, ptr %118, align 8, !tbaa !14
  br label %119

119:                                              ; preds = %83
  %120 = load i64, ptr %16, align 8, !tbaa !11
  %121 = add nsw i64 %120, 2
  store i64 %121, ptr %16, align 8, !tbaa !11
  br label %78, !llvm.loop !16

122:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  %123 = load i64, ptr %6, align 8, !tbaa !11
  %124 = srem i64 %123, 64
  store i64 %124, ptr %18, align 8, !tbaa !11
  %125 = load i64, ptr %18, align 8, !tbaa !11
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %173

127:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %169, %127
  %129 = load i64, ptr %19, align 8, !tbaa !11
  %130 = load i64, ptr %6, align 8, !tbaa !11
  %131 = icmp slt i64 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %172

133:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #10
  %134 = load i64, ptr %19, align 8, !tbaa !11
  %135 = getelementptr inbounds double, ptr %77, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !14
  %137 = insertelement <2 x double> poison, double %136, i32 0
  %138 = load i64, ptr %19, align 8, !tbaa !11
  %139 = getelementptr inbounds double, ptr %77, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !14
  %141 = insertelement <2 x double> %137, double %140, i32 1
  store <2 x double> %141, ptr %22, align 16, !tbaa !13
  %142 = load <2 x double>, ptr %22, align 16, !tbaa !13
  store <2 x double> %142, ptr %21, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %143 = load i64, ptr %19, align 8, !tbaa !11
  %144 = load i64, ptr %6, align 8, !tbaa !11
  %145 = mul nsw i64 %143, %144
  %146 = sdiv i64 %145, 8
  store i64 %146, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  store i64 0, ptr %24, align 8, !tbaa !11
  br label %147

147:                                              ; preds = %165, %133
  %148 = load i64, ptr %24, align 8, !tbaa !11
  %149 = load i64, ptr %6, align 8, !tbaa !11
  %150 = icmp slt i64 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  br label %168

152:                                              ; preds = %147
  %153 = load i64, ptr %24, align 8, !tbaa !11
  %154 = sdiv i64 %153, 2
  %155 = getelementptr inbounds <2 x double>, ptr %75, i64 %154
  %156 = load <2 x double>, ptr %21, align 16, !tbaa !13
  %157 = call i64 @mand8(ptr noundef %155, <2 x double> noundef %156)
  %158 = trunc i64 %157 to i8
  %159 = load ptr, ptr %12, align 8, !tbaa !9
  %160 = load i64, ptr %23, align 8, !tbaa !11
  %161 = load i64, ptr %24, align 8, !tbaa !11
  %162 = sdiv i64 %161, 8
  %163 = add nsw i64 %160, %162
  %164 = getelementptr inbounds i8, ptr %159, i64 %163
  store i8 %158, ptr %164, align 1, !tbaa !13
  br label %165

165:                                              ; preds = %152
  %166 = load i64, ptr %24, align 8, !tbaa !11
  %167 = add nsw i64 %166, 8
  store i64 %167, ptr %24, align 8, !tbaa !11
  br label %147, !llvm.loop !18

168:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #10
  br label %169

169:                                              ; preds = %168
  %170 = load i64, ptr %19, align 8, !tbaa !11
  %171 = add nsw i64 %170, 1
  store i64 %171, ptr %19, align 8, !tbaa !11
  br label %128, !llvm.loop !19

172:                                              ; preds = %132
  br label %218

173:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  store i64 0, ptr %25, align 8, !tbaa !11
  br label %174

174:                                              ; preds = %214, %173
  %175 = load i64, ptr %25, align 8, !tbaa !11
  %176 = load i64, ptr %6, align 8, !tbaa !11
  %177 = icmp slt i64 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  br label %217

179:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #10
  %180 = load i64, ptr %25, align 8, !tbaa !11
  %181 = getelementptr inbounds double, ptr %77, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !14
  %183 = insertelement <2 x double> poison, double %182, i32 0
  %184 = load i64, ptr %25, align 8, !tbaa !11
  %185 = getelementptr inbounds double, ptr %77, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !14
  %187 = insertelement <2 x double> %183, double %186, i32 1
  store <2 x double> %187, ptr %27, align 16, !tbaa !13
  %188 = load <2 x double>, ptr %27, align 16, !tbaa !13
  store <2 x double> %188, ptr %26, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #10
  %189 = load i64, ptr %25, align 8, !tbaa !11
  %190 = load i64, ptr %6, align 8, !tbaa !11
  %191 = mul nsw i64 %189, %190
  %192 = sdiv i64 %191, 64
  store i64 %192, ptr %28, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  store i64 0, ptr %29, align 8, !tbaa !11
  br label %193

193:                                              ; preds = %210, %179
  %194 = load i64, ptr %29, align 8, !tbaa !11
  %195 = load i64, ptr %6, align 8, !tbaa !11
  %196 = icmp slt i64 %194, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  br label %213

198:                                              ; preds = %193
  %199 = load i64, ptr %29, align 8, !tbaa !11
  %200 = sdiv i64 %199, 2
  %201 = getelementptr inbounds <2 x double>, ptr %75, i64 %200
  %202 = load <2 x double>, ptr %26, align 16, !tbaa !13
  %203 = call i64 @mand64(ptr noundef %201, <2 x double> noundef %202)
  %204 = load ptr, ptr %12, align 8, !tbaa !9
  %205 = load i64, ptr %28, align 8, !tbaa !11
  %206 = load i64, ptr %29, align 8, !tbaa !11
  %207 = sdiv i64 %206, 64
  %208 = add nsw i64 %205, %207
  %209 = getelementptr inbounds i64, ptr %204, i64 %208
  store i64 %203, ptr %209, align 8, !tbaa !11
  br label %210

210:                                              ; preds = %198
  %211 = load i64, ptr %29, align 8, !tbaa !11
  %212 = add nsw i64 %211, 64
  store i64 %212, ptr %29, align 8, !tbaa !11
  br label %193, !llvm.loop !20

213:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #10
  br label %214

214:                                              ; preds = %213
  %215 = load i64, ptr %25, align 8, !tbaa !11
  %216 = add nsw i64 %215, 1
  store i64 %216, ptr %25, align 8, !tbaa !11
  br label %174, !llvm.loop !21

217:                                              ; preds = %178
  br label %218

218:                                              ; preds = %217, %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  %219 = load ptr, ptr %11, align 8, !tbaa !9
  %220 = load i64, ptr %9, align 8, !tbaa !11
  %221 = call i64 @write(i32 noundef 1, ptr noundef %219, i64 noundef %220)
  store i64 %221, ptr %30, align 8, !tbaa !11
  store i64 %221, ptr %30, align 8, !tbaa !11
  %222 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %222) #10
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  %223 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %223)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  %224 = load i32, ptr %3, align 4
  ret i32 %224
}

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #8

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #9

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7

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 uwtable "min-legal-vector-width"="128" "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 = { inlinehint nounwind uwtable "min-legal-vector-width"="128" "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 nounwind willreturn memory(read) 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 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind willreturn }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { "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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}


; 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 [12 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @numDigits(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @mand64(ptr noundef, <2 x double> noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare i64 @mand8(ptr noundef, <2 x double> noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = icmp sgt i32 %0, 1
  br i1 %3, label %4, label %11

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @atoi(ptr nocapture noundef %6) #9
  %8 = sext i32 %7 to i64
  %9 = add nsw i64 %8, 7
  %10 = and i64 %9, -8
  br label %11

11:                                               ; preds = %4, %2
  %.072 = phi i64 [ %10, %4 ], [ 16000, %2 ]
  %12 = tail call i64 @numDigits(i64 noundef %.072)
  %13 = shl nsw i64 %12, 1
  %14 = add nsw i64 %13, 5
  %15 = add nsw i64 %13, 12
  %16 = and i64 %15, -8
  %17 = sub nsw i64 %16, %14
  %18 = ashr exact i64 %.072, 3
  %19 = mul nsw i64 %18, %.072
  %20 = add i64 %16, %19
  %21 = tail call noalias ptr @malloc(i64 noundef %20) #10
  %22 = getelementptr inbounds i8, ptr %21, i64 %17
  %23 = getelementptr inbounds i8, ptr %21, i64 %16
  %24 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.072, i64 noundef %.072) #11
  %25 = ashr exact i64 %.072, 1
  %26 = alloca <2 x double>, i64 %25, align 16
  %27 = alloca double, i64 %.072, align 16
  %28 = icmp sgt i64 %.072, 0
  br i1 %28, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %11
  %29 = uitofp nneg i64 %.072 to double
  %30 = fdiv double 2.000000e+00, %29
  %31 = insertelement <2 x double> poison, double %30, i64 0
  %32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
  %33 = insertelement <2 x double> poison, double %30, i64 0
  %34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
  br label %69

._crit_edge:                                      ; preds = %69
  %35 = and i64 %.072, 56
  %.not = icmp eq i64 %35, 0
  br i1 %.not, label %.preheader, label %.preheader78

.preheader78:                                     ; preds = %._crit_edge
  br i1 %28, label %.lr.ph83.us, label %.loopexit

.lr.ph83.us:                                      ; preds = %.preheader78, %._crit_edge84.us
  %.07485.us = phi i64 [ %52, %._crit_edge84.us ], [ 0, %.preheader78 ]
  %36 = getelementptr inbounds double, ptr %27, i64 %.07485.us
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = insertelement <2 x double> poison, double %37, i64 0
  %39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
  %40 = mul nuw nsw i64 %.07485.us, %.072
  %41 = lshr exact i64 %40, 3
  %42 = getelementptr i8, ptr %23, i64 %41
  br label %43

43:                                               ; preds = %.lr.ph83.us, %43
  %.07681.us = phi i64 [ 0, %.lr.ph83.us ], [ %50, %43 ]
  %44 = lshr exact i64 %.07681.us, 1
  %45 = getelementptr inbounds <2 x double>, ptr %26, i64 %44
  %46 = call i64 @mand8(ptr noundef nonnull %45, <2 x double> noundef %39)
  %47 = trunc i64 %46 to i8
  %48 = lshr exact i64 %.07681.us, 3
  %49 = getelementptr i8, ptr %42, i64 %48
  store i8 %47, ptr %49, align 1, !tbaa !11
  %50 = add nuw nsw i64 %.07681.us, 8
  %51 = icmp slt i64 %50, %.072
  br i1 %51, label %43, label %._crit_edge84.us, !llvm.loop !12

._crit_edge84.us:                                 ; preds = %43
  %52 = add nuw nsw i64 %.07485.us, 1
  %exitcond.not = icmp eq i64 %52, %.072
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph83.us, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge
  br i1 %28, label %.lr.ph89.us, label %.loopexit

.lr.ph89.us:                                      ; preds = %.preheader, %._crit_edge90.us
  %.07591.us = phi i64 [ %68, %._crit_edge90.us ], [ 0, %.preheader ]
  %53 = getelementptr inbounds double, ptr %27, i64 %.07591.us
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = insertelement <2 x double> poison, double %54, i64 0
  %56 = shufflevector <2 x double> %55, <2 x double> poison, <2 x i32> zeroinitializer
  %57 = mul nuw nsw i64 %.07591.us, %.072
  %58 = lshr exact i64 %57, 3
  %59 = getelementptr i8, ptr %23, i64 %58
  br label %60

60:                                               ; preds = %.lr.ph89.us, %60
  %.087.us = phi i64 [ 0, %.lr.ph89.us ], [ %66, %60 ]
  %61 = lshr exact i64 %.087.us, 1
  %62 = getelementptr inbounds <2 x double>, ptr %26, i64 %61
  %63 = call i64 @mand64(ptr noundef nonnull %62, <2 x double> noundef %56)
  %64 = lshr exact i64 %.087.us, 3
  %65 = getelementptr i8, ptr %59, i64 %64
  store i64 %63, ptr %65, align 8, !tbaa !15
  %66 = add nuw nsw i64 %.087.us, 64
  %67 = icmp slt i64 %66, %.072
  br i1 %67, label %60, label %._crit_edge90.us, !llvm.loop !17

._crit_edge90.us:                                 ; preds = %60
  %68 = add nuw nsw i64 %.07591.us, 1
  %exitcond94.not = icmp eq i64 %68, %.072
  br i1 %exitcond94.not, label %.loopexit, label %.lr.ph89.us, !llvm.loop !18

69:                                               ; preds = %.lr.ph, %69
  %.07380 = phi i64 [ 0, %.lr.ph ], [ %79, %69 ]
  %70 = or disjoint i64 %.07380, 1
  %71 = lshr exact i64 %.07380, 1
  %72 = getelementptr inbounds <2 x double>, ptr %26, i64 %71
  %73 = getelementptr inbounds double, ptr %27, i64 %.07380
  %74 = insertelement <2 x i64> poison, i64 %.07380, i64 0
  %75 = insertelement <2 x i64> %74, i64 %70, i64 1
  %76 = uitofp nneg <2 x i64> %75 to <2 x double>
  %77 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %32, <2 x double> %76, <2 x double> <double -1.500000e+00, double -1.500000e+00>)
  store <2 x double> %77, ptr %72, align 16, !tbaa !11
  %78 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %76, <2 x double> <double -1.000000e+00, double -1.000000e+00>)
  store <2 x double> %78, ptr %73, align 16, !tbaa !9
  %79 = add nuw nsw i64 %.07380, 2
  %80 = icmp slt i64 %79, %.072
  br i1 %80, label %69, label %._crit_edge, !llvm.loop !19

.loopexit:                                        ; preds = %._crit_edge84.us, %._crit_edge90.us, %11, %.preheader78, %.preheader
  %81 = add nsw i64 %14, %19
  %82 = call i64 @write(i32 noundef 1, ptr noundef nonnull %22, i64 noundef %81) #11
  call void @free(ptr noundef %21) #11
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #7

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

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 = { nounwind uwtable "min-legal-vector-width"="128" "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 = { inlinehint nounwind uwtable "min-legal-vector-width"="128" "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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nofree "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 = { 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 #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { 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 = !{!"double", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass