; LLVM IR from NotManyIdeasDev/double-pendulum-sim :: double-pendulum-sim/Libraries/raygui-2.8/examples/custom_file_dialog (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"

%struct.GuiFileDialogState = type { %struct.Vector2, %struct.Vector2, i8, i8, [256 x i8], i32, i8, i32, i8, [256 x i8], i8, i8, i32, i32, ptr, i32, [256 x i8], [256 x i8], [256 x i8], i32 }
%struct.Vector2 = type { float, float }
%struct.Texture = type { i32, i32, i32, i32, i32 }
%struct.Color = type { i8, i8, i8, i8 }
%struct.Rectangle = type { float, float, float, float }

@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @GuiLock() #0

; Function Attrs: nounwind uwtable
declare dso_local void @GuiUnlock() #0

; 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) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @GuiGetStyle(i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @GuiButton(<2 x float>, <2 x float>, ptr noundef) #3

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

declare i32 @GetColor(i32 noundef) #4

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

declare ptr @TextFormat(ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare dso_local void @InitGuiFileDialog(ptr dead_on_unwind noalias writable sret(%struct.GuiFileDialogState) align 8, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext) #0

declare i32 @GetScreenWidth() #4

declare i32 @GetScreenHeight() #4

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #6

declare ptr @GetWorkingDirectory() #4

; Function Attrs: nounwind uwtable
declare dso_local void @GuiFileDialog(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.GuiFileDialogState, align 8
  %5 = alloca i8, align 1
  %6 = alloca [512 x i8], align 16
  %7 = alloca %struct.Texture, align 8
  %8 = alloca %struct.Texture, align 4
  %9 = alloca %struct.Color, align 1
  %10 = alloca %struct.Color, align 1
  %11 = alloca %struct.Color, align 1
  %12 = alloca %struct.Color, align 1
  %13 = alloca %struct.Rectangle, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 800, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 560, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  call void @InitWindow(i32 noundef %14, i32 noundef %15, ptr noundef @.str.19)
  call void @SetExitKey(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1344, ptr %4) #7
  %16 = call ptr @GetWorkingDirectory()
  call void @InitGuiFileDialog(ptr dead_on_unwind writable sret(%struct.GuiFileDialogState) align 8 %4, i32 noundef 420, i32 noundef 310, ptr noundef %16, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 512, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 512, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %7) #7
  call void @llvm.memset.p0.i64(ptr align 4 %7, i8 0, i64 20, i1 false)
  call void @SetTargetFPS(i32 noundef 60)
  br label %17

17:                                               ; preds = %111, %0
  %18 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  %20 = xor i1 %19, true
  br i1 %20, label %21, label %112

21:                                               ; preds = %17
  %22 = call zeroext i1 @WindowShouldClose()
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %5, align 1, !tbaa !9
  %24 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 10
  %25 = load i8, ptr %24, align 1, !tbaa !13, !range !11, !noundef !12
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %42

27:                                               ; preds = %21
  %28 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 9
  %29 = getelementptr inbounds [256 x i8], ptr %28, i64 0, i64 0
  %30 = call zeroext i1 @IsFileExtension(ptr noundef %29, ptr noundef @.str.20)
  br i1 %30, label %31, label %40

31:                                               ; preds = %27
  %32 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  %33 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 4
  %34 = getelementptr inbounds [256 x i8], ptr %33, i64 0, i64 0
  %35 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 9
  %36 = getelementptr inbounds [256 x i8], ptr %35, i64 0, i64 0
  %37 = call ptr (ptr, ...) @TextFormat(ptr noundef @.str.5, ptr noundef %34, ptr noundef %36)
  %38 = call ptr @strcpy(ptr noundef %32, ptr noundef %37) #7
  call void @UnloadTexture(ptr noundef byval(%struct.Texture) align 8 %7)
  call void @llvm.lifetime.start.p0(i64 20, ptr %8) #7
  %39 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  call void @LoadTexture(ptr dead_on_unwind writable sret(%struct.Texture) align 4 %8, ptr noundef %39)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %8, i64 20, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 20, ptr %8) #7
  br label %40

40:                                               ; preds = %31, %27
  %41 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 10
  store i8 0, ptr %41, align 1, !tbaa !13
  br label %42

42:                                               ; preds = %40, %21
  call void @BeginDrawing()
  %43 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 19)
  %44 = call i32 @GetColor(i32 noundef %43)
  store i32 %44, ptr %9, align 1
  %45 = load i32, ptr %9, align 1
  call void @ClearBackground(i32 %45)
  %46 = call i32 @GetScreenWidth()
  %47 = sdiv i32 %46, 2
  %48 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !19
  %50 = sdiv i32 %49, 2
  %51 = sub nsw i32 %47, %50
  %52 = call i32 @GetScreenHeight()
  %53 = sdiv i32 %52, 2
  %54 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !21
  %56 = sdiv i32 %55, 2
  %57 = sub nsw i32 %53, %56
  %58 = sub nsw i32 %57, 5
  %59 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 0
  store i8 -1, ptr %59, align 1, !tbaa !22
  %60 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 1
  store i8 -1, ptr %60, align 1, !tbaa !24
  %61 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 2
  store i8 -1, ptr %61, align 1, !tbaa !25
  %62 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 3
  store i8 -1, ptr %62, align 1, !tbaa !26
  %63 = load i32, ptr %10, align 1
  call void @DrawTexture(ptr noundef byval(%struct.Texture) align 8 %7, i32 noundef %51, i32 noundef %58, i32 %63)
  %64 = call i32 @GetScreenWidth()
  %65 = sdiv i32 %64, 2
  %66 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !19
  %68 = sdiv i32 %67, 2
  %69 = sub nsw i32 %65, %68
  %70 = call i32 @GetScreenHeight()
  %71 = sdiv i32 %70, 2
  %72 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !21
  %74 = sdiv i32 %73, 2
  %75 = sub nsw i32 %71, %74
  %76 = sub nsw i32 %75, 5
  %77 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !19
  %79 = getelementptr inbounds %struct.Texture, ptr %7, i32 0, i32 2
  %80 = load i32, ptr %79, align 4, !tbaa !21
  %81 = getelementptr inbounds %struct.Color, ptr %11, i32 0, i32 0
  store i8 0, ptr %81, align 1, !tbaa !22
  %82 = getelementptr inbounds %struct.Color, ptr %11, i32 0, i32 1
  store i8 0, ptr %82, align 1, !tbaa !24
  %83 = getelementptr inbounds %struct.Color, ptr %11, i32 0, i32 2
  store i8 0, ptr %83, align 1, !tbaa !25
  %84 = getelementptr inbounds %struct.Color, ptr %11, i32 0, i32 3
  store i8 -1, ptr %84, align 1, !tbaa !26
  %85 = load i32, ptr %11, align 1
  call void @DrawRectangleLines(i32 noundef %69, i32 noundef %76, i32 noundef %78, i32 noundef %80, i32 %85)
  %86 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  %87 = call i32 @GetScreenHeight()
  %88 = sub nsw i32 %87, 20
  %89 = getelementptr inbounds %struct.Color, ptr %12, i32 0, i32 0
  store i8 -126, ptr %89, align 1, !tbaa !22
  %90 = getelementptr inbounds %struct.Color, ptr %12, i32 0, i32 1
  store i8 -126, ptr %90, align 1, !tbaa !24
  %91 = getelementptr inbounds %struct.Color, ptr %12, i32 0, i32 2
  store i8 -126, ptr %91, align 1, !tbaa !25
  %92 = getelementptr inbounds %struct.Color, ptr %12, i32 0, i32 3
  store i8 -1, ptr %92, align 1, !tbaa !26
  %93 = load i32, ptr %12, align 1
  call void @DrawText(ptr noundef %86, i32 noundef 208, i32 noundef %88, i32 noundef 10, i32 %93)
  %94 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 2
  %95 = load i8, ptr %94, align 8, !tbaa !27, !range !11, !noundef !12
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %98

97:                                               ; preds = %42
  call void @GuiLock()
  br label %98

98:                                               ; preds = %97, %42
  %99 = getelementptr inbounds %struct.Rectangle, ptr %13, i32 0, i32 0
  store float 2.000000e+01, ptr %99, align 4, !tbaa !28
  %100 = getelementptr inbounds %struct.Rectangle, ptr %13, i32 0, i32 1
  store float 2.000000e+01, ptr %100, align 4, !tbaa !30
  %101 = getelementptr inbounds %struct.Rectangle, ptr %13, i32 0, i32 2
  store float 1.400000e+02, ptr %101, align 4, !tbaa !31
  %102 = getelementptr inbounds %struct.Rectangle, ptr %13, i32 0, i32 3
  store float 3.000000e+01, ptr %102, align 4, !tbaa !32
  %103 = call ptr @GuiIconText(i32 noundef 5, ptr noundef @.str.21)
  %104 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %105 = load <2 x float>, ptr %104, align 4
  %106 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %107 = load <2 x float>, ptr %106, align 4
  %108 = call zeroext i1 @GuiButton(<2 x float> %105, <2 x float> %107, ptr noundef %103)
  br i1 %108, label %109, label %111

109:                                              ; preds = %98
  %110 = getelementptr inbounds %struct.GuiFileDialogState, ptr %4, i32 0, i32 2
  store i8 1, ptr %110, align 8, !tbaa !27
  br label %111

111:                                              ; preds = %109, %98
  call void @GuiUnlock()
  call void @GuiFileDialog(ptr noundef %4)
  call void @EndDrawing()
  br label %17, !llvm.loop !33

112:                                              ; preds = %17
  call void @UnloadTexture(ptr noundef byval(%struct.Texture) align 8 %7)
  call void @CloseWindow()
  call void @llvm.lifetime.end.p0(i64 20, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1344, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

declare void @InitWindow(i32 noundef, i32 noundef, ptr noundef) #4

declare void @SetExitKey(i32 noundef) #4

declare void @SetTargetFPS(i32 noundef) #4

declare zeroext i1 @WindowShouldClose() #4

declare zeroext i1 @IsFileExtension(ptr noundef, ptr noundef) #4

declare void @UnloadTexture(ptr noundef byval(%struct.Texture) align 8) #4

declare void @LoadTexture(ptr dead_on_unwind writable sret(%struct.Texture) align 4, ptr noundef) #4

declare void @BeginDrawing() #4

declare void @ClearBackground(i32) #4

declare void @DrawTexture(ptr noundef byval(%struct.Texture) align 8, i32 noundef, i32 noundef, i32) #4

declare void @DrawRectangleLines(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32) #4

declare void @DrawText(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32) #4

declare void @EndDrawing() #4

declare void @CloseWindow() #4

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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !10, i64 545}
!14 = !{!"", !15, i64 0, !15, i64 8, !10, i64 16, !10, i64 17, !7, i64 18, !6, i64 276, !10, i64 280, !6, i64 284, !10, i64 288, !7, i64 289, !10, i64 545, !10, i64 546, !6, i64 548, !6, i64 552, !17, i64 560, !6, i64 568, !7, i64 572, !7, i64 828, !7, i64 1084, !6, i64 1340}
!15 = !{!"Vector2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 4, !5}
!19 = !{!20, !6, i64 4}
!20 = !{!"Texture", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !7, i64 0}
!23 = !{!"Color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!24 = !{!23, !7, i64 1}
!25 = !{!23, !7, i64 2}
!26 = !{!23, !7, i64 3}
!27 = !{!14, !10, i64 16}
!28 = !{!29, !16, i64 0}
!29 = !{!"Rectangle", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!30 = !{!29, !16, i64 4}
!31 = !{!29, !16, i64 8}
!32 = !{!29, !16, i64 12}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


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

%struct.GuiFileDialogState = type { %struct.Vector2, %struct.Vector2, i8, i8, [256 x i8], i32, i8, i32, i8, [256 x i8], i8, i8, i32, i32, ptr, i32, [256 x i8], [256 x i8], [256 x i8], i32 }
%struct.Vector2 = type { float, float }
%struct.Texture = type { i32, i32, i32, i32, i32 }

@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @GuiLock() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @GuiUnlock() local_unnamed_addr #0

; 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) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @GuiGetStyle(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @GuiButton(<2 x float>, <2 x float>, ptr noundef) local_unnamed_addr #3

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

declare i32 @GetColor(i32 noundef) local_unnamed_addr #4

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

declare ptr @TextFormat(ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @InitGuiFileDialog(ptr dead_on_unwind noalias writable sret(%struct.GuiFileDialogState) align 8, i32 noundef, i32 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #0

declare i32 @GetScreenWidth() local_unnamed_addr #4

declare i32 @GetScreenHeight() local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6

declare ptr @GetWorkingDirectory() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @GuiFileDialog(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
.critedge:
  %0 = alloca %struct.GuiFileDialogState, align 8
  %1 = alloca [512 x i8], align 16
  %2 = alloca %struct.Texture, align 8
  %3 = alloca %struct.Texture, align 4
  tail call void @InitWindow(i32 noundef 800, i32 noundef 560, ptr noundef nonnull @.str.19) #7
  tail call void @SetExitKey(i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 1344, ptr nonnull %0) #7
  %4 = tail call ptr @GetWorkingDirectory() #7
  call void @InitGuiFileDialog(ptr dead_on_unwind nonnull writable sret(%struct.GuiFileDialogState) align 8 %0, i32 noundef 420, i32 noundef 310, ptr noundef %4, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %1, i8 0, i64 512, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %2, i8 0, i64 20, i1 false)
  call void @SetTargetFPS(i32 noundef 60) #7
  %5 = getelementptr inbounds i8, ptr %0, i64 545
  %6 = getelementptr inbounds i8, ptr %0, i64 289
  %7 = getelementptr inbounds i8, ptr %0, i64 18
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  br label %11

11:                                               ; preds = %.critedge, %52
  %12 = call zeroext i1 @WindowShouldClose() #7
  %13 = load i8, ptr %5, align 1, !tbaa !5, !range !14, !noundef !15
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %21

15:                                               ; preds = %11
  %16 = call zeroext i1 @IsFileExtension(ptr noundef nonnull %6, ptr noundef nonnull @.str.20) #7
  br i1 %16, label %17, label %20

17:                                               ; preds = %15
  %18 = call ptr (ptr, ...) @TextFormat(ptr noundef nonnull @.str.5, ptr noundef nonnull %7, ptr noundef nonnull %6) #7
  %19 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) %18) #7
  call void @UnloadTexture(ptr noundef nonnull byval(%struct.Texture) align 8 %2) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #7
  call void @LoadTexture(ptr dead_on_unwind nonnull writable sret(%struct.Texture) align 4 %3, ptr noundef nonnull %1) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull align 4 dereferenceable(20) %3, i64 20, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  br label %20

20:                                               ; preds = %17, %15
  store i8 0, ptr %5, align 1, !tbaa !5
  br label %21

21:                                               ; preds = %20, %11
  call void @BeginDrawing() #7
  %22 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 19)
  %23 = call i32 @GetColor(i32 noundef %22) #7
  call void @ClearBackground(i32 %23) #7
  %24 = call i32 @GetScreenWidth() #7
  %25 = sdiv i32 %24, 2
  %26 = load i32, ptr %8, align 4, !tbaa !18
  %.neg = sdiv i32 %26, -2
  %27 = add nsw i32 %.neg, %25
  %28 = call i32 @GetScreenHeight() #7
  %29 = sdiv i32 %28, 2
  %30 = load i32, ptr %9, align 8, !tbaa !20
  %.neg16 = sdiv i32 %30, -2
  %31 = add nsw i32 %29, -5
  %32 = add i32 %31, %.neg16
  call void @DrawTexture(ptr noundef nonnull byval(%struct.Texture) align 8 %2, i32 noundef %27, i32 noundef %32, i32 -1) #7
  %33 = call i32 @GetScreenWidth() #7
  %34 = sdiv i32 %33, 2
  %35 = load i32, ptr %8, align 4, !tbaa !18
  %.neg17 = sdiv i32 %35, -2
  %36 = add nsw i32 %.neg17, %34
  %37 = call i32 @GetScreenHeight() #7
  %38 = sdiv i32 %37, 2
  %39 = load i32, ptr %9, align 8, !tbaa !20
  %.neg18 = sdiv i32 %39, -2
  %40 = add nsw i32 %38, -5
  %41 = add i32 %40, %.neg18
  %42 = load i32, ptr %8, align 4, !tbaa !18
  call void @DrawRectangleLines(i32 noundef %36, i32 noundef %41, i32 noundef %42, i32 noundef %39, i32 -16777216) #7
  %43 = call i32 @GetScreenHeight() #7
  %44 = add nsw i32 %43, -20
  call void @DrawText(ptr noundef nonnull %1, i32 noundef 208, i32 noundef %44, i32 noundef 10, i32 -8224126) #7
  %45 = load i8, ptr %10, align 8, !tbaa !21, !range !14, !noundef !15
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %48

47:                                               ; preds = %21
  call void @GuiLock()
  br label %48

48:                                               ; preds = %47, %21
  %49 = call ptr @GuiIconText(i32 noundef 5, ptr noundef nonnull @.str.21)
  %50 = call zeroext i1 @GuiButton(<2 x float> <float 2.000000e+01, float 2.000000e+01>, <2 x float> <float 1.400000e+02, float 3.000000e+01>, ptr noundef %49)
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  store i8 1, ptr %10, align 8, !tbaa !21
  br label %52

52:                                               ; preds = %51, %48
  call void @GuiUnlock()
  call void @GuiFileDialog(ptr noundef nonnull %0)
  call void @EndDrawing() #7
  br i1 %12, label %53, label %11

53:                                               ; preds = %52
  call void @UnloadTexture(ptr noundef nonnull byval(%struct.Texture) align 8 %2) #7
  call void @CloseWindow() #7
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %1) #7
  call void @llvm.lifetime.end.p0(i64 1344, ptr nonnull %0) #7
  ret i32 0
}

declare void @InitWindow(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @SetExitKey(i32 noundef) local_unnamed_addr #4

declare void @SetTargetFPS(i32 noundef) local_unnamed_addr #4

declare zeroext i1 @WindowShouldClose() local_unnamed_addr #4

declare zeroext i1 @IsFileExtension(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare void @LoadTexture(ptr dead_on_unwind writable sret(%struct.Texture) align 4, ptr noundef) local_unnamed_addr #4

declare void @BeginDrawing() local_unnamed_addr #4

declare void @ClearBackground(i32) local_unnamed_addr #4

declare void @DrawTexture(ptr noundef byval(%struct.Texture) align 8, i32 noundef, i32 noundef, i32) local_unnamed_addr #4

declare void @DrawRectangleLines(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32) local_unnamed_addr #4

declare void @DrawText(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32) local_unnamed_addr #4

declare void @EndDrawing() local_unnamed_addr #4

declare void @CloseWindow() local_unnamed_addr #4

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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { 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, !11, i64 545}
!6 = !{!"", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 17, !9, i64 18, !12, i64 276, !11, i64 280, !12, i64 284, !11, i64 288, !9, i64 289, !11, i64 545, !11, i64 546, !12, i64 548, !12, i64 552, !13, i64 560, !12, i64 568, !9, i64 572, !9, i64 828, !9, i64 1084, !12, i64 1340}
!7 = !{!"Vector2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"_Bool", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17, i64 12, i64 4, !17, i64 16, i64 4, !17}
!17 = !{!12, !12, i64 0}
!18 = !{!19, !12, i64 4}
!19 = !{!"Texture", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!20 = !{!19, !12, i64 8}
!21 = !{!6, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass