; LLVM IR from jingweizhanghuai/Morn :: test (test_geometry3)

; 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.MList = type { i32, ptr }
%struct.MImagePoint = type { float, float }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@__const.main.color = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca [3 x i8], align 1
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %15 = call ptr @ImageCreate(i32 noundef 3, i32 noundef 400, i32 noundef 400, ptr noundef null)
  store ptr %15, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %16 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  store ptr %16, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  call void @mPoissonDiskPoint(ptr noundef %17, float noundef 1.600000e+01, float noundef 0.000000e+00, float noundef 4.000000e+02, float noundef 0.000000e+00, float noundef 4.000000e+02)
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.MList, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !12
  br label %22

22:                                               ; preds = %133, %0
  %23 = load i32, ptr %5, align 4, !tbaa !12
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.MList, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %136

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.MList, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = load i32, ptr %5, align 4, !tbaa !12
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  store ptr %36, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.MImagePoint, ptr %37, i32 0, i32 0
  %39 = load float, ptr %38, align 4, !tbaa !14
  %40 = fsub float %39, 2.000000e+02
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MImagePoint, ptr %41, i32 0, i32 0
  %43 = load float, ptr %42, align 4, !tbaa !14
  %44 = fsub float %43, 2.000000e+02
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.MImagePoint, ptr %45, i32 0, i32 1
  %47 = load float, ptr %46, align 4, !tbaa !17
  %48 = fsub float %47, 2.000000e+02
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MImagePoint, ptr %49, i32 0, i32 1
  %51 = load float, ptr %50, align 4, !tbaa !17
  %52 = fsub float %51, 2.000000e+02
  %53 = fmul float %48, %52
  %54 = call float @llvm.fmuladd.f32(float %40, float %44, float %53)
  %55 = fcmp olt float %54, 4.000000e+04
  br i1 %55, label %56, label %132

56:                                               ; preds = %29
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MList, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = load i32, ptr %4, align 4, !tbaa !12
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  store ptr %57, ptr %63, align 8, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !12
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %4, align 4, !tbaa !12
  br label %66

66:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %67 = load i8, ptr @.str.1, align 1, !tbaa !18
  %68 = sext i8 %67 to i32
  %69 = icmp ne i32 %68, 0
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %71 = load i32, ptr %7, align 4, !tbaa !12
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %78

73:                                               ; preds = %66
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.MImagePoint, ptr %76, i64 0
  call void @m_ImageDrawPoint(ptr noundef %74, ptr noundef %75, ptr noundef %77, ptr noundef null, i32 noundef -1)
  br label %129

78:                                               ; preds = %66
  %79 = load i32, ptr %7, align 4, !tbaa !12
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %81, label %100

81:                                               ; preds = %78
  store i64 -1, ptr %8, align 8, !tbaa !19
  %82 = load i64, ptr %8, align 8, !tbaa !19
  %83 = icmp sle i64 %82, 4
  br i1 %83, label %84, label %94

84:                                               ; preds = %81
  %85 = load i64, ptr %8, align 8, !tbaa !19
  %86 = icmp sge i64 %85, -1
  br i1 %86, label %87, label %94

87:                                               ; preds = %84
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.MImagePoint, ptr %90, i64 0
  %92 = load i64, ptr %8, align 8, !tbaa !19
  %93 = trunc i64 %92 to i32
  call void @m_ImageDrawPoint(ptr noundef %88, ptr noundef %89, ptr noundef %91, ptr noundef null, i32 noundef %93)
  br label %99

94:                                               ; preds = %84, %81
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MImagePoint, ptr %97, i64 0
  call void @m_ImageDrawPoint(ptr noundef %95, ptr noundef %96, ptr noundef %98, ptr noundef inttoptr (i64 -1 to ptr), i32 noundef -1)
  br label %99

99:                                               ; preds = %94, %87
  br label %128

100:                                              ; preds = %78
  %101 = load i32, ptr %7, align 4, !tbaa !12
  %102 = icmp eq i32 %101, 3
  br i1 %102, label %103, label %110

103:                                              ; preds = %100
  store i64 -1, ptr %8, align 8, !tbaa !19
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.MImagePoint, ptr %106, i64 0
  %108 = load i64, ptr %8, align 8, !tbaa !19
  %109 = trunc i64 %108 to i32
  call void @m_ImageDrawPoint(ptr noundef %104, ptr noundef %105, ptr noundef %107, ptr noundef inttoptr (i64 -1 to ptr), i32 noundef %109)
  br label %127

110:                                              ; preds = %100
  %111 = load i32, ptr %7, align 4, !tbaa !12
  %112 = icmp eq i32 %111, 4
  br i1 %112, label %113, label %117

113:                                              ; preds = %110
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.MImagePoint, ptr %115, i64 0
  call void @m_ImageDrawPoint(ptr noundef %114, ptr noundef %116, ptr noundef inttoptr (i64 -1 to ptr), ptr noundef inttoptr (i64 -1 to ptr), i32 noundef -1)
  br label %126

117:                                              ; preds = %110
  br label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !12
  %119 = load i32, ptr %9, align 4, !tbaa !12
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = load i32, ptr %9, align 4, !tbaa !12
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %122, i32 noundef -1, ptr noundef @.str.2, i32 noundef 18, ptr noundef @__FUNCTION__.main, ptr noundef @.str.3)
  br label %123

123:                                              ; preds = %121, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125, %113
  br label %127

127:                                              ; preds = %126, %103
  br label %128

128:                                              ; preds = %127, %99
  br label %129

129:                                              ; preds = %128, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %5, align 4, !tbaa !12
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !12
  br label %22, !llvm.loop !21

136:                                              ; preds = %28
  %137 = load i32, ptr %4, align 4, !tbaa !12
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.MList, ptr %138, i32 0, i32 0
  store i32 %137, ptr %139, align 8, !tbaa !9
  %140 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ptr, ...) @mImageSave(ptr noundef %140, ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %141 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  store ptr %141, ptr %10, align 8, !tbaa !5
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  call void @mConvexHull(ptr noundef %142, ptr noundef %143)
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.MList, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !9
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %146)
  call void @llvm.lifetime.start.p0(i64 3, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 @__const.main.color, i64 3, i1 false)
  br label %148

148:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 2, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %149 = load i32, ptr %12, align 4, !tbaa !12
  %150 = icmp eq i32 %149, 1
  br i1 %150, label %151, label %156

151:                                              ; preds = %148
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.MList, ptr %154, i64 0
  call void @m_ImageDrawShape(ptr noundef %152, ptr noundef %153, ptr noundef %155, ptr noundef null, i32 noundef -1)
  br label %212

156:                                              ; preds = %148
  %157 = load i32, ptr %12, align 4, !tbaa !12
  %158 = icmp eq i32 %157, 2
  br i1 %158, label %159, label %181

159:                                              ; preds = %156
  %160 = getelementptr inbounds [3 x i8], ptr %11, i64 0, i64 0
  %161 = ptrtoint ptr %160 to i64
  store i64 %161, ptr %13, align 8, !tbaa !19
  %162 = load i64, ptr %13, align 8, !tbaa !19
  %163 = icmp sle i64 %162, 4
  br i1 %163, label %164, label %174

164:                                              ; preds = %159
  %165 = load i64, ptr %13, align 8, !tbaa !19
  %166 = icmp sge i64 %165, -1
  br i1 %166, label %167, label %174

167:                                              ; preds = %164
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.MList, ptr %170, i64 0
  %172 = load i64, ptr %13, align 8, !tbaa !19
  %173 = trunc i64 %172 to i32
  call void @m_ImageDrawShape(ptr noundef %168, ptr noundef %169, ptr noundef %171, ptr noundef null, i32 noundef %173)
  br label %180

174:                                              ; preds = %164, %159
  %175 = load ptr, ptr %2, align 8, !tbaa !5
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.MList, ptr %177, i64 0
  %179 = getelementptr inbounds [3 x i8], ptr %11, i64 0, i64 0
  call void @m_ImageDrawShape(ptr noundef %175, ptr noundef %176, ptr noundef %178, ptr noundef %179, i32 noundef -1)
  br label %180

180:                                              ; preds = %174, %167
  br label %211

181:                                              ; preds = %156
  %182 = load i32, ptr %12, align 4, !tbaa !12
  %183 = icmp eq i32 %182, 3
  br i1 %183, label %184, label %192

184:                                              ; preds = %181
  store i64 -1, ptr %13, align 8, !tbaa !19
  %185 = load ptr, ptr %2, align 8, !tbaa !5
  %186 = load ptr, ptr %2, align 8, !tbaa !5
  %187 = load ptr, ptr %10, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.MList, ptr %187, i64 0
  %189 = getelementptr inbounds [3 x i8], ptr %11, i64 0, i64 0
  %190 = load i64, ptr %13, align 8, !tbaa !19
  %191 = trunc i64 %190 to i32
  call void @m_ImageDrawShape(ptr noundef %185, ptr noundef %186, ptr noundef %188, ptr noundef %189, i32 noundef %191)
  br label %210

192:                                              ; preds = %181
  %193 = load i32, ptr %12, align 4, !tbaa !12
  %194 = icmp eq i32 %193, 4
  br i1 %194, label %195, label %200

195:                                              ; preds = %192
  %196 = load ptr, ptr %2, align 8, !tbaa !5
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.MList, ptr %197, i64 0
  %199 = getelementptr inbounds [3 x i8], ptr %11, i64 0, i64 0
  call void @m_ImageDrawShape(ptr noundef %196, ptr noundef %198, ptr noundef %199, ptr noundef inttoptr (i64 -1 to ptr), i32 noundef -1)
  br label %209

200:                                              ; preds = %192
  br label %201

201:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !12
  %202 = load i32, ptr %14, align 4, !tbaa !12
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %206

204:                                              ; preds = %201
  %205 = load i32, ptr %14, align 4, !tbaa !12
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %205, i32 noundef -1, ptr noundef @.str.2, i32 noundef 29, ptr noundef @__FUNCTION__.main, ptr noundef @.str.3)
  br label %206

206:                                              ; preds = %204, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208, %195
  br label %210

210:                                              ; preds = %209, %184
  br label %211

211:                                              ; preds = %210, %180
  br label %212

212:                                              ; preds = %211, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ptr, ...) @mImageSave(ptr noundef %215, ptr noundef @.str.6)
  %216 = load ptr, ptr %2, align 8, !tbaa !5
  call void @mImageRelease(ptr noundef %216)
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  call void @mListRelease(ptr noundef %217)
  %218 = load ptr, ptr %10, align 8, !tbaa !5
  call void @mListRelease(ptr noundef %218)
  call void @llvm.lifetime.end.p0(i64 3, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %219 = load i32, ptr %1, align 4
  ret i32 %219
}

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

declare ptr @ImageCreate(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare ptr @ListCreate(i32 noundef, ptr noundef) #2

declare void @mPoissonDiskPoint(ptr noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #2

declare i32 @printf(ptr noundef, ...) #2

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

declare void @m_ImageDrawPoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

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

declare void @mImageSave(ptr noundef, ptr noundef, ...) #2

declare void @mConvexHull(ptr noundef, ptr noundef) #2

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

declare void @m_ImageDrawShape(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @mImageRelease(ptr noundef) #2

declare void @mListRelease(ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

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

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@__const.main.color = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [3 x i8], align 1
  %2 = tail call ptr @ImageCreate(i32 noundef 3, i32 noundef 400, i32 noundef 400, ptr noundef null) #6
  %3 = tail call ptr @ListCreate(i32 noundef -1, ptr noundef null) #6
  tail call void @mPoissonDiskPoint(ptr noundef %3, float noundef 1.600000e+01, float noundef 0.000000e+00, float noundef 4.000000e+02, float noundef 0.000000e+00, float noundef 4.000000e+02) #6
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
  %6 = load i32, ptr %3, align 8, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %8 = getelementptr inbounds i8, ptr %3, i64 8
  %9 = load i8, ptr @.str.1, align 1
  %.fr = freeze i8 %9
  %.not = icmp eq i8 %.fr, 0
  br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %26
  %10 = phi i32 [ %27, %26 ], [ %6, %.lr.ph ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %26 ], [ 0, %.lr.ph ]
  %.079.us = phi i32 [ %.1.us, %26 ], [ 0, %.lr.ph ]
  %11 = load ptr, ptr %8, align 8, !tbaa !11
  %12 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv82
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = load float, ptr %13, align 4, !tbaa !13
  %15 = fadd float %14, -2.000000e+02
  %16 = getelementptr inbounds i8, ptr %13, i64 4
  %17 = load float, ptr %16, align 4, !tbaa !16
  %18 = fadd float %17, -2.000000e+02
  %19 = fmul float %18, %18
  %20 = tail call float @llvm.fmuladd.f32(float %15, float %15, float %19)
  %21 = fcmp olt float %20, 4.000000e+04
  br i1 %21, label %22, label %26

22:                                               ; preds = %.lr.ph.split.us
  %23 = sext i32 %.079.us to i64
  %24 = getelementptr inbounds ptr, ptr %11, i64 %23
  store ptr %13, ptr %24, align 8, !tbaa !12
  %25 = add nsw i32 %.079.us, 1
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 18, ptr noundef nonnull @__FUNCTION__.main, ptr noundef nonnull @.str.3) #6
  %.pre85 = load i32, ptr %3, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %22, %.lr.ph.split.us
  %27 = phi i32 [ %10, %.lr.ph.split.us ], [ %.pre85, %22 ]
  %.1.us = phi i32 [ %.079.us, %.lr.ph.split.us ], [ %25, %22 ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next83, %28
  br i1 %29, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %51, %26, %0
  %.0.lcssa = phi i32 [ 0, %0 ], [ %.1.us, %26 ], [ %.1, %51 ]
  store i32 %.0.lcssa, ptr %3, align 8, !tbaa !5
  tail call void (ptr, ptr, ...) @mImageSave(ptr noundef %2, ptr noundef nonnull @.str.4) #6
  %30 = tail call ptr @ListCreate(i32 noundef -1, ptr noundef null) #6
  tail call void @mConvexHull(ptr noundef nonnull %3, ptr noundef %30) #6
  %31 = load i32, ptr %30, align 8, !tbaa !5
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %31)
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %1, ptr noundef nonnull align 1 dereferenceable(3) @__const.main.color, i64 3, i1 false)
  %33 = icmp slt ptr %1, inttoptr (i64 5 to ptr)
  %34 = icmp sgt ptr %1, inttoptr (i64 -2 to ptr)
  %or.cond3 = and i1 %33, %34
  br i1 %or.cond3, label %55, label %58

.lr.ph.split:                                     ; preds = %.lr.ph, %51
  %35 = phi i32 [ %52, %51 ], [ %6, %.lr.ph ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %51 ], [ 0, %.lr.ph ]
  %.079 = phi i32 [ %.1, %51 ], [ 0, %.lr.ph ]
  %36 = load ptr, ptr %8, align 8, !tbaa !11
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  %39 = load float, ptr %38, align 4, !tbaa !13
  %40 = fadd float %39, -2.000000e+02
  %41 = getelementptr inbounds i8, ptr %38, i64 4
  %42 = load float, ptr %41, align 4, !tbaa !16
  %43 = fadd float %42, -2.000000e+02
  %44 = fmul float %43, %43
  %45 = tail call float @llvm.fmuladd.f32(float %40, float %40, float %44)
  %46 = fcmp olt float %45, 4.000000e+04
  br i1 %46, label %47, label %51

47:                                               ; preds = %.lr.ph.split
  %48 = sext i32 %.079 to i64
  %49 = getelementptr inbounds ptr, ptr %36, i64 %48
  store ptr %38, ptr %49, align 8, !tbaa !12
  %50 = add nsw i32 %.079, 1
  tail call void @m_ImageDrawPoint(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %38, ptr noundef null, i32 noundef -1) #6
  %.pre = load i32, ptr %3, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %47, %.lr.ph.split
  %52 = phi i32 [ %35, %.lr.ph.split ], [ %.pre, %47 ]
  %.1 = phi i32 [ %.079, %.lr.ph.split ], [ %50, %47 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next, %53
  br i1 %54, label %.lr.ph.split, label %._crit_edge, !llvm.loop !17

55:                                               ; preds = %._crit_edge
  %56 = ptrtoint ptr %1 to i64
  %57 = trunc nsw i64 %56 to i32
  call void @m_ImageDrawShape(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %30, ptr noundef null, i32 noundef %57) #6
  br label %59

58:                                               ; preds = %._crit_edge
  call void @m_ImageDrawShape(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %30, ptr noundef nonnull %1, i32 noundef -1) #6
  br label %59

59:                                               ; preds = %58, %55
  call void (ptr, ptr, ...) @mImageSave(ptr noundef %2, ptr noundef nonnull @.str.6) #6
  call void @mImageRelease(ptr noundef %2) #6
  call void @mListRelease(ptr noundef nonnull %3) #6
  call void @mListRelease(ptr noundef nonnull %30) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %1) #6
  ret i32 0
}

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

declare ptr @ImageCreate(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @ListCreate(i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @mPoissonDiskPoint(ptr noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #2

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

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

declare void @m_ImageDrawPoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare void @mImageSave(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare void @mConvexHull(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @m_ImageDrawShape(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @mImageRelease(ptr noundef) local_unnamed_addr #2

declare void @mListRelease(ptr noundef) local_unnamed_addr #2

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


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