; LLVM IR from NotManyIdeasDev/double-pendulum-sim :: double-pendulum-sim/Libraries/raygui-2.8/examples/text_box_selection (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.Font = type { i32, i32, i32, %struct.Texture, ptr, ptr }
%struct.Texture = type { i32, i32, i32, i32, i32 }
%struct.Rectangle = type { float, float, float, float }
%struct.Image = type { ptr, i32, i32, i32, i32 }
%struct.Color = type { i8, i8, i8, i8 }
%struct.Vector2 = type { float, float }

@guiFont = external hidden global %struct.Font, align 8
@checked = external hidden global %struct.Texture, align 4
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1
@textboxActive = external hidden global i32, align 4
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@text02 = external hidden global [128 x i8], align 16
@text01 = external hidden global [92 x i8], align 16
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1
@textboxBounds = external hidden global [4 x %struct.Rectangle], align 16
@__const.main.menuItems = external hidden unnamed_addr constant [4 x ptr], align 16

; Function Attrs: nounwind uwtable
declare dso_local void @GuiSetFont(ptr noundef byval(%struct.Font) align 8) #0

; Function Attrs: nounwind uwtable
declare dso_local void @GuiLoadStyleDefault() #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: nounwind uwtable
declare dso_local void @GuiSetStyle(i32 noundef, i32 noundef, i32 noundef) #0

; 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

declare i32 @GetColor(i32 noundef) #3

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

declare <2 x float> @GetMousePosition() #3

declare zeroext i1 @CheckCollisionPointRec(<2 x float>, <2 x float>, <2 x float>) #3

declare zeroext i1 @IsMouseButtonPressed(i32 noundef) #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @GuiListViewEx(<2 x float>, <2 x float>, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef) #5

declare void @LoadTextureFromImage(ptr dead_on_unwind writable sret(%struct.Texture) align 4, ptr noundef byval(%struct.Image) align 8) #3

declare void @UnloadImage(ptr noundef byval(%struct.Image) align 8) #3

declare void @GetFontDefault(ptr dead_on_unwind writable sret(%struct.Font) align 8) #3

; Function Attrs: nounwind uwtable
declare dso_local <2 x float> @GuiTextBoxGetSelection() #5

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

; Function Attrs: nounwind uwtable
declare dso_local void @GuiTextBoxSelectAll(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @GuiTextBoxCopy(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @GuiTextBoxCut(ptr noundef) #0

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

declare void @DrawTextRecEx(ptr noundef byval(%struct.Font) align 8, ptr noundef, <2 x float>, <2 x float>, float noundef, float noundef, i1 noundef zeroext, i32, i32 noundef, i32 noundef, i32, i32) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Image, align 8
  %9 = alloca %struct.Color, align 1
  %10 = alloca %struct.Color, align 1
  %11 = alloca %struct.Texture, align 4
  %12 = alloca %struct.Font, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.Color, align 1
  %18 = alloca %struct.Color, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i8, align 1
  %21 = alloca %struct.Rectangle, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  %26 = alloca i8, align 1
  %27 = alloca i8, align 1
  %28 = alloca %struct.Vector2, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca %struct.Font, align 8
  %32 = alloca ptr, align 8
  %33 = alloca i64, align 8
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca %struct.Vector2, align 4
  %41 = alloca i32, align 4
  %42 = alloca %struct.Color, align 1
  %43 = alloca %struct.Font, align 8
  %44 = alloca %struct.Rectangle, align 4
  %45 = alloca %struct.Color, align 1
  %46 = alloca [4 x ptr], align 16
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  %50 = alloca ptr, 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 4, ptr %6) #8
  store i32 800, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 450, ptr %7, align 4, !tbaa !5
  call void @InitWindow(i32 noundef 800, i32 noundef 450, ptr noundef @.str.10)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #8
  %51 = getelementptr inbounds %struct.Color, ptr %9, i32 0, i32 0
  store i8 -11, ptr %51, align 1, !tbaa !11
  %52 = getelementptr inbounds %struct.Color, ptr %9, i32 0, i32 1
  store i8 -11, ptr %52, align 1, !tbaa !13
  %53 = getelementptr inbounds %struct.Color, ptr %9, i32 0, i32 2
  store i8 -11, ptr %53, align 1, !tbaa !14
  %54 = getelementptr inbounds %struct.Color, ptr %9, i32 0, i32 3
  store i8 -1, ptr %54, align 1, !tbaa !15
  %55 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 0
  store i8 80, ptr %55, align 1, !tbaa !11
  %56 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 1
  store i8 80, ptr %56, align 1, !tbaa !13
  %57 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 2
  store i8 80, ptr %57, align 1, !tbaa !14
  %58 = getelementptr inbounds %struct.Color, ptr %10, i32 0, i32 3
  store i8 -1, ptr %58, align 1, !tbaa !15
  %59 = load i32, ptr %9, align 1
  %60 = load i32, ptr %10, align 1
  call void @GenImageChecked(ptr dead_on_unwind writable sret(%struct.Image) align 8 %8, i32 noundef 26, i32 noundef 26, i32 noundef 5, i32 noundef 5, i32 %59, i32 %60)
  call void @llvm.lifetime.start.p0(i64 20, ptr %11) #8
  call void @LoadTextureFromImage(ptr dead_on_unwind writable sret(%struct.Texture) align 4 %11, ptr noundef byval(%struct.Image) align 8 %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @checked, ptr align 4 %11, i64 20, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 20, ptr %11) #8
  call void @UnloadImage(ptr noundef byval(%struct.Image) align 8 %8)
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #8
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %61 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  store i32 %61, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %62 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 17)
  store i32 %62, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %63 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 16)
  store i32 %63, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %64 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 12)
  store i32 %64, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %65 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 18)
  %66 = call i32 @GetColor(i32 noundef %65)
  store i32 %66, ptr %17, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %67 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 19)
  %68 = call i32 @GetColor(i32 noundef %67)
  store i32 %68, ptr %18, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store ptr %17, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #8
  store i8 0, ptr %20, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  call void @llvm.memset.p0.i64(ptr align 4 %21, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #8
  store i8 0, ptr %24, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #8
  store i8 0, ptr %25, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #8
  store i8 0, ptr %26, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #8
  store i8 0, ptr %27, align 1, !tbaa !17
  call void @SetTargetFPS(i32 noundef 60)
  br label %69

69:                                               ; preds = %314, %2
  %70 = call zeroext i1 @WindowShouldClose()
  %71 = xor i1 %70, true
  br i1 %71, label %72, label %316

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %73 = call <2 x float> @GetMousePosition()
  store <2 x float> %73, ptr %28, align 4
  %74 = load i8, ptr %24, align 1, !tbaa !17, !range !19, !noundef !20
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  store i32 0, ptr @textboxActive, align 4, !tbaa !5
  br label %92

77:                                               ; preds = %72
  %78 = load i8, ptr %25, align 1, !tbaa !17, !range !19, !noundef !20
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  store i32 1, ptr @textboxActive, align 4, !tbaa !5
  br label %91

81:                                               ; preds = %77
  %82 = load i8, ptr %26, align 1, !tbaa !17, !range !19, !noundef !20
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  store i32 2, ptr @textboxActive, align 4, !tbaa !5
  br label %90

85:                                               ; preds = %81
  %86 = load i8, ptr %27, align 1, !tbaa !17, !range !19, !noundef !20
  %87 = trunc i8 %86 to i1
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  store i32 3, ptr @textboxActive, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %88, %85
  br label %90

90:                                               ; preds = %89, %84
  br label %91

91:                                               ; preds = %90, %80
  br label %92

92:                                               ; preds = %91, %76
  %93 = load i8, ptr %20, align 1, !tbaa !17, !range !19, !noundef !20
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %105

95:                                               ; preds = %92
  %96 = call zeroext i1 @IsMouseButtonPressed(i32 noundef 0)
  br i1 %96, label %97, label %105

97:                                               ; preds = %95
  %98 = load <2 x float>, ptr %28, align 4
  %99 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 0
  %100 = load <2 x float>, ptr %99, align 4
  %101 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 1
  %102 = load <2 x float>, ptr %101, align 4
  %103 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %98, <2 x float> %100, <2 x float> %102)
  br i1 %103, label %105, label %104

104:                                              ; preds = %97
  store i8 0, ptr %20, align 1, !tbaa !17
  br label %105

105:                                              ; preds = %104, %97, %95, %92
  %106 = call zeroext i1 @IsFileDropped()
  br i1 %106, label %107, label %142

107:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %108 = call ptr @GetDroppedFiles(ptr noundef %29)
  store ptr %108, ptr %30, align 8, !tbaa !9
  %109 = load ptr, ptr %30, align 8, !tbaa !9
  %110 = getelementptr inbounds ptr, ptr %109, i64 0
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = call zeroext i1 @IsFileExtension(ptr noundef %111, ptr noundef @.str.11)
  br i1 %112, label %123, label %113

113:                                              ; preds = %107
  %114 = load ptr, ptr %30, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %114, i64 0
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = call zeroext i1 @IsFileExtension(ptr noundef %116, ptr noundef @.str.12)
  br i1 %117, label %123, label %118

118:                                              ; preds = %113
  %119 = load ptr, ptr %30, align 8, !tbaa !9
  %120 = getelementptr inbounds ptr, ptr %119, i64 0
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = call zeroext i1 @IsFileExtension(ptr noundef %121, ptr noundef @.str.13)
  br i1 %122, label %123, label %141

123:                                              ; preds = %118, %113, %107
  call void @llvm.lifetime.start.p0(i64 48, ptr %31) #8
  %124 = load ptr, ptr %30, align 8, !tbaa !9
  %125 = getelementptr inbounds ptr, ptr %124, i64 0
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  call void @LoadFont(ptr dead_on_unwind writable sret(%struct.Font) align 8 %31, ptr noundef %126)
  %127 = getelementptr inbounds %struct.Font, ptr %31, i32 0, i32 3
  %128 = getelementptr inbounds %struct.Texture, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !21
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %140

131:                                              ; preds = %123
  call void @GuiSetFont(ptr noundef byval(%struct.Font) align 8 %31)
  %132 = getelementptr inbounds %struct.Font, ptr %31, i32 0, i32 0
  %133 = load i32, ptr %132, align 8, !tbaa !24
  store i32 %133, ptr %13, align 4, !tbaa !5
  %134 = getelementptr inbounds %struct.Font, ptr %12, i32 0, i32 3
  %135 = getelementptr inbounds %struct.Texture, ptr %134, i32 0, i32 0
  %136 = load i32, ptr %135, align 4, !tbaa !21
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %131
  call void @UnloadFont(ptr noundef byval(%struct.Font) align 8 %12)
  br label %139

139:                                              ; preds = %138, %131
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %31, i64 48, i1 false), !tbaa.struct !25
  br label %140

140:                                              ; preds = %139, %123
  call void @llvm.lifetime.end.p0(i64 48, ptr %31) #8
  br label %141

141:                                              ; preds = %140, %118
  call void @ClearDroppedFiles()
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %142

142:                                              ; preds = %141, %105
  %143 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %144 = icmp eq i32 %143, 1
  %145 = zext i1 %144 to i64
  %146 = select i1 %144, i64 128, i64 92
  %147 = add i64 %146, 1
  %148 = mul i64 %147, 3
  %149 = add i64 %148, 1
  %150 = call ptr @llvm.stacksave.p0()
  store ptr %150, ptr %32, align 8
  %151 = alloca i8, i64 %149, align 16
  store i64 %149, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %152 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %153 = icmp eq i32 %152, 1
  %154 = zext i1 %153 to i64
  %155 = select i1 %153, ptr @text02, ptr @text01
  store ptr %155, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %156 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %157 = icmp eq i32 %156, 1
  %158 = zext i1 %157 to i64
  %159 = select i1 %157, i64 128, i64 92
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  store i32 0, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %177, %142
  %162 = load i32, ptr %36, align 4, !tbaa !5
  %163 = load i32, ptr %35, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %182

166:                                              ; preds = %161
  %167 = load i32, ptr %37, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i8, ptr %151, i64 %168
  %170 = load ptr, ptr %34, align 8, !tbaa !9
  %171 = load i32, ptr %36, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i8, ptr %170, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !26
  %175 = sext i8 %174 to i32
  %176 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %169, ptr noundef @.str.14, i32 noundef %175) #8
  br label %177

177:                                              ; preds = %166
  %178 = load i32, ptr %36, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %36, align 4, !tbaa !5
  %180 = load i32, ptr %37, align 4, !tbaa !5
  %181 = add nsw i32 %180, 3
  store i32 %181, ptr %37, align 4, !tbaa !5
  br label %161, !llvm.loop !27

182:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 0, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  store i32 0, ptr %39, align 4, !tbaa !5
  %183 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %184 = icmp slt i32 %183, 2
  br i1 %184, label %185, label %200

185:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %186 = call <2 x float> @GuiTextBoxGetSelection()
  store <2 x float> %186, ptr %40, align 4
  %187 = load ptr, ptr %34, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.Vector2, ptr %40, i32 0, i32 0
  %189 = load float, ptr %188, align 4, !tbaa !29
  %190 = fptosi float %189 to i32
  %191 = call i32 @GuiTextBoxGetByteIndex(ptr noundef %187, i32 noundef 0, i32 noundef 0, i32 noundef %190)
  store i32 %191, ptr %38, align 4, !tbaa !5
  %192 = load ptr, ptr %34, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.Vector2, ptr %40, i32 0, i32 0
  %194 = load float, ptr %193, align 4, !tbaa !29
  %195 = getelementptr inbounds %struct.Vector2, ptr %40, i32 0, i32 1
  %196 = load float, ptr %195, align 4, !tbaa !32
  %197 = fadd float %194, %196
  %198 = fptosi float %197 to i32
  %199 = call i32 @GuiTextBoxGetByteIndex(ptr noundef %192, i32 noundef 0, i32 noundef 0, i32 noundef %198)
  store i32 %199, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %200

200:                                              ; preds = %185, %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %201 = load i32, ptr %39, align 4, !tbaa !5
  %202 = load i32, ptr %38, align 4, !tbaa !5
  %203 = sub nsw i32 %201, %202
  store i32 %203, ptr %41, align 4, !tbaa !5
  call void @BeginDrawing()
  %204 = getelementptr inbounds %struct.Color, ptr %42, i32 0, i32 0
  store i8 -11, ptr %204, align 1, !tbaa !11
  %205 = getelementptr inbounds %struct.Color, ptr %42, i32 0, i32 1
  store i8 -11, ptr %205, align 1, !tbaa !13
  %206 = getelementptr inbounds %struct.Color, ptr %42, i32 0, i32 2
  store i8 -11, ptr %206, align 1, !tbaa !14
  %207 = getelementptr inbounds %struct.Color, ptr %42, i32 0, i32 3
  store i8 -1, ptr %207, align 1, !tbaa !15
  %208 = load i32, ptr %42, align 1
  call void @ClearBackground(i32 %208)
  %209 = load i32, ptr %13, align 4, !tbaa !5
  call void @GuiSetStyle(i32 noundef 0, i32 noundef 16, i32 noundef %209)
  %210 = load i32, ptr %14, align 4, !tbaa !5
  call void @GuiSetStyle(i32 noundef 0, i32 noundef 17, i32 noundef %210)
  %211 = load i32, ptr %15, align 4, !tbaa !5
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 16, i32 noundef %211)
  %212 = load i32, ptr %16, align 4, !tbaa !5
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 12, i32 noundef %212)
  %213 = load i32, ptr %18, align 1
  %214 = call i32 @ColorToInt(i32 %213)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 19, i32 noundef %214)
  %215 = load i32, ptr %17, align 1
  %216 = call i32 @ColorToInt(i32 %215)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 18, i32 noundef %216)
  %217 = load i8, ptr %24, align 1, !tbaa !17, !range !19, !noundef !20
  %218 = trunc i8 %217 to i1
  %219 = load <2 x float>, ptr @textboxBounds, align 16
  %220 = load <2 x float>, ptr getelementptr inbounds ({ <2 x float>, <2 x float> }, ptr @textboxBounds, i32 0, i32 1), align 8
  %221 = call zeroext i1 @GuiTextBoxEx(<2 x float> %219, <2 x float> %220, ptr noundef @text01, i32 noundef 91, i1 noundef zeroext %218)
  br i1 %221, label %222, label %227

222:                                              ; preds = %200
  %223 = load i8, ptr %24, align 1, !tbaa !17, !range !19, !noundef !20
  %224 = trunc i8 %223 to i1
  %225 = xor i1 %224, true
  %226 = zext i1 %225 to i8
  store i8 %226, ptr %24, align 1, !tbaa !17
  br label %227

227:                                              ; preds = %222, %200
  %228 = load i8, ptr %25, align 1, !tbaa !17, !range !19, !noundef !20
  %229 = trunc i8 %228 to i1
  %230 = load <2 x float>, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 1), align 16
  %231 = load <2 x float>, ptr getelementptr inbounds ({ <2 x float>, <2 x float> }, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 1), i32 0, i32 1), align 8
  %232 = call zeroext i1 @GuiTextBoxEx(<2 x float> %230, <2 x float> %231, ptr noundef @text02, i32 noundef 127, i1 noundef zeroext %229)
  br i1 %232, label %233, label %238

233:                                              ; preds = %227
  %234 = load i8, ptr %25, align 1, !tbaa !17, !range !19, !noundef !20
  %235 = trunc i8 %234 to i1
  %236 = xor i1 %235, true
  %237 = zext i1 %236 to i8
  store i8 %237, ptr %25, align 1, !tbaa !17
  br label %238

238:                                              ; preds = %233, %227
  %239 = load i8, ptr %26, align 1, !tbaa !17, !range !19, !noundef !20
  %240 = trunc i8 %239 to i1
  %241 = load <2 x float>, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 2), align 16
  %242 = load <2 x float>, ptr getelementptr inbounds ({ <2 x float>, <2 x float> }, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 2), i32 0, i32 1), align 8
  %243 = call zeroext i1 @GuiSpinner(<2 x float> %241, <2 x float> %242, ptr noundef null, ptr noundef %22, i32 noundef -2147483648, i32 noundef 2147483647, i1 noundef zeroext %240)
  br i1 %243, label %244, label %249

244:                                              ; preds = %238
  %245 = load i8, ptr %26, align 1, !tbaa !17, !range !19, !noundef !20
  %246 = trunc i8 %245 to i1
  %247 = xor i1 %246, true
  %248 = zext i1 %247 to i8
  store i8 %248, ptr %26, align 1, !tbaa !17
  br label %249

249:                                              ; preds = %244, %238
  %250 = load i8, ptr %27, align 1, !tbaa !17, !range !19, !noundef !20
  %251 = trunc i8 %250 to i1
  %252 = load <2 x float>, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 3), align 16
  %253 = load <2 x float>, ptr getelementptr inbounds ({ <2 x float>, <2 x float> }, ptr getelementptr inbounds ([4 x %struct.Rectangle], ptr @textboxBounds, i64 0, i64 3), i32 0, i32 1), align 8
  %254 = call zeroext i1 @GuiValueBox(<2 x float> %252, <2 x float> %253, ptr noundef null, ptr noundef %23, i32 noundef -2147483648, i32 noundef 2147483647, i1 noundef zeroext %251)
  br i1 %254, label %255, label %260

255:                                              ; preds = %249
  %256 = load i8, ptr %27, align 1, !tbaa !17, !range !19, !noundef !20
  %257 = trunc i8 %256 to i1
  %258 = xor i1 %257, true
  %259 = zext i1 %258 to i8
  store i8 %259, ptr %27, align 1, !tbaa !17
  br label %260

260:                                              ; preds = %255, %249
  call void @GuiLoadStyleDefault()
  call void @GetFontDefault(ptr dead_on_unwind writable sret(%struct.Font) align 8 %43)
  call void @GuiSetFont(ptr noundef byval(%struct.Font) align 8 %43)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 14, i32 noundef 1)
  %261 = getelementptr inbounds %struct.Rectangle, ptr %44, i32 0, i32 0
  store float 2.000000e+01, ptr %261, align 4, !tbaa !33
  %262 = getelementptr inbounds %struct.Rectangle, ptr %44, i32 0, i32 1
  store float 9.500000e+01, ptr %262, align 4, !tbaa !35
  %263 = getelementptr inbounds %struct.Rectangle, ptr %44, i32 0, i32 2
  store float 7.600000e+02, ptr %263, align 4, !tbaa !36
  %264 = getelementptr inbounds %struct.Rectangle, ptr %44, i32 0, i32 3
  store float 2.050000e+02, ptr %264, align 4, !tbaa !37
  %265 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 0
  store i8 0, ptr %265, align 1, !tbaa !11
  %266 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 1
  store i8 0, ptr %266, align 1, !tbaa !13
  %267 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 2
  store i8 0, ptr %267, align 1, !tbaa !14
  %268 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 3
  store i8 -1, ptr %268, align 1, !tbaa !15
  %269 = load i32, ptr %38, align 4, !tbaa !5
  %270 = mul nsw i32 %269, 3
  %271 = load i32, ptr %41, align 4, !tbaa !5
  %272 = mul nsw i32 %271, 3
  %273 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %44, i32 0, i32 0
  %274 = load <2 x float>, ptr %273, align 4
  %275 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %44, i32 0, i32 1
  %276 = load <2 x float>, ptr %275, align 4
  %277 = load i32, ptr %45, align 1
  %278 = load i32, ptr %17, align 1
  %279 = load i32, ptr %18, align 1
  call void @DrawTextRecEx(ptr noundef byval(%struct.Font) align 8 @guiFont, ptr noundef %151, <2 x float> %274, <2 x float> %276, float noundef 2.000000e+01, float noundef 1.000000e+00, i1 noundef zeroext true, i32 %277, i32 noundef %270, i32 noundef %272, i32 %278, i32 %279)
  %280 = load i8, ptr %20, align 1, !tbaa !17, !range !19, !noundef !20
  %281 = trunc i8 %280 to i1
  br i1 %281, label %282, label %314

282:                                              ; preds = %260
  call void @GuiSetStyle(i32 noundef 12, i32 noundef 16, i32 noundef 24)
  call void @llvm.lifetime.start.p0(i64 32, ptr %46) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 16 @__const.main.menuItems, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 -1, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #8
  store i32 0, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #8
  store i32 0, ptr %49, align 4, !tbaa !5
  call void @GuiSetStyle(i32 noundef 0, i32 noundef 14, i32 noundef 0)
  %283 = getelementptr inbounds [4 x ptr], ptr %46, i64 0, i64 0
  %284 = load i32, ptr %47, align 4, !tbaa !5
  %285 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 0
  %286 = load <2 x float>, ptr %285, align 4
  %287 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 1
  %288 = load <2 x float>, ptr %287, align 4
  %289 = call i32 @GuiListViewEx(<2 x float> %286, <2 x float> %288, ptr noundef %283, i32 noundef 4, ptr noundef %48, ptr noundef %49, i32 noundef %284)
  store i32 %289, ptr %47, align 4, !tbaa !5
  %290 = load i32, ptr %47, align 4, !tbaa !5
  %291 = icmp ne i32 %290, -1
  br i1 %291, label %292, label %313

292:                                              ; preds = %282
  store i8 0, ptr %20, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  %293 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %294 = icmp eq i32 %293, 1
  %295 = zext i1 %294 to i64
  %296 = select i1 %294, ptr @text02, ptr @text01
  store ptr %296, ptr %50, align 8, !tbaa !9
  %297 = load i32, ptr %47, align 4, !tbaa !5
  switch i32 %297, label %311 [
    i32 0, label %298
    i32 1, label %300
    i32 2, label %302
    i32 3, label %309
  ]

298:                                              ; preds = %292
  %299 = load ptr, ptr %50, align 8, !tbaa !9
  call void @GuiTextBoxCut(ptr noundef %299)
  br label %312

300:                                              ; preds = %292
  %301 = load ptr, ptr %50, align 8, !tbaa !9
  call void @GuiTextBoxCopy(ptr noundef %301)
  br label %312

302:                                              ; preds = %292
  %303 = load ptr, ptr %50, align 8, !tbaa !9
  %304 = load i32, ptr @textboxActive, align 4, !tbaa !5
  %305 = icmp eq i32 %304, 1
  %306 = zext i1 %305 to i64
  %307 = select i1 %305, i64 128, i64 92
  %308 = trunc i64 %307 to i32
  call void @GuiTextBoxPaste(ptr noundef %303, i32 noundef %308)
  br label %312

309:                                              ; preds = %292
  %310 = load ptr, ptr %50, align 8, !tbaa !9
  call void @GuiTextBoxSelectAll(ptr noundef %310)
  br label %312

311:                                              ; preds = %292
  br label %312

312:                                              ; preds = %311, %309, %302, %300, %298
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  br label %313

313:                                              ; preds = %312, %282
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %46) #8
  br label %314

314:                                              ; preds = %313, %260
  call void @EndDrawing()
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  %315 = load ptr, ptr %32, align 8
  call void @llvm.stackrestore.p0(ptr %315)
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %69, !llvm.loop !38

316:                                              ; preds = %69
  call void @CloseWindow()
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  ret i32 0
}

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

declare void @GenImageChecked(ptr dead_on_unwind writable sret(%struct.Image) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32, i32) #3

declare void @SetTargetFPS(i32 noundef) #3

declare zeroext i1 @WindowShouldClose() #3

declare zeroext i1 @IsFileDropped() #3

declare ptr @GetDroppedFiles(ptr noundef) #3

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

declare void @LoadFont(ptr dead_on_unwind writable sret(%struct.Font) align 8, ptr noundef) #3

declare void @UnloadFont(ptr noundef byval(%struct.Font) align 8) #3

declare void @ClearDroppedFiles() #3

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

declare void @BeginDrawing() #3

declare void @ClearBackground(i32) #3

declare i32 @ColorToInt(i32) #3

declare void @EndDrawing() #3

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

declare void @CloseWindow() #3

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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"Color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!13 = !{!12, !7, i64 1}
!14 = !{!12, !7, i64 2}
!15 = !{!12, !7, i64 3}
!16 = !{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}
!17 = !{!18, !18, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !6, i64 12}
!22 = !{!"Font", !6, i64 0, !6, i64 4, !6, i64 8, !23, i64 12, !10, i64 32, !10, i64 40}
!23 = !{!"Texture", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!24 = !{!22, !6, i64 0}
!25 = !{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, i64 20, i64 4, !5, i64 24, i64 4, !5, i64 28, i64 4, !5, i64 32, i64 8, !9, i64 40, i64 8, !9}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !31, i64 0}
!30 = !{!"Vector2", !31, i64 0, !31, i64 4}
!31 = !{!"float", !7, i64 0}
!32 = !{!30, !31, i64 4}
!33 = !{!34, !31, i64 0}
!34 = !{!"Rectangle", !31, i64 0, !31, i64 4, !31, i64 8, !31, i64 12}
!35 = !{!34, !31, i64 4}
!36 = !{!34, !31, i64 8}
!37 = !{!34, !31, i64 12}
!38 = distinct !{!38, !28}


; 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.Font = type { i32, i32, i32, %struct.Texture, ptr, ptr }
%struct.Texture = type { i32, i32, i32, i32, i32 }
%struct.Rectangle = type { float, float, float, float }
%struct.Image = type { ptr, i32, i32, i32, i32 }

@guiFont = external hidden global %struct.Font, align 8
@checked = external hidden local_unnamed_addr global %struct.Texture, align 4
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1
@textboxActive = external hidden local_unnamed_addr global i32, align 4
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@text02 = external hidden global [128 x i8], align 16
@text01 = external hidden global [92 x i8], align 16
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1
@textboxBounds = external hidden local_unnamed_addr global [4 x %struct.Rectangle], align 16

; Function Attrs: nounwind uwtable
declare dso_local void @GuiSetFont(ptr noundef byval(%struct.Font) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @GuiLoadStyleDefault() 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: nounwind uwtable
declare dso_local void @GuiSetStyle(i32 noundef, i32 noundef, i32 noundef) 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) #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

declare i32 @GetColor(i32 noundef) local_unnamed_addr #3

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

declare <2 x float> @GetMousePosition() local_unnamed_addr #3

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

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

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

declare void @LoadTextureFromImage(ptr dead_on_unwind writable sret(%struct.Texture) align 4, ptr noundef byval(%struct.Image) align 8) local_unnamed_addr #3

declare void @UnloadImage(ptr noundef byval(%struct.Image) align 8) local_unnamed_addr #3

declare void @GetFontDefault(ptr dead_on_unwind writable sret(%struct.Font) align 8) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local <2 x float> @GuiTextBoxGetSelection() local_unnamed_addr #5

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

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

declare void @DrawTextRecEx(ptr noundef byval(%struct.Font) align 8, ptr noundef, <2 x float>, <2 x float>, float noundef, float noundef, i1 noundef zeroext, i32, i32 noundef, i32 noundef, i32, i32) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #5 {
  %3 = alloca %struct.Image, align 8
  %4 = alloca %struct.Texture, align 4
  %5 = alloca %struct.Font, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Font, align 8
  %10 = alloca %struct.Font, align 8
  tail call void @InitWindow(i32 noundef 800, i32 noundef 450, ptr noundef nonnull @.str.10) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #8
  call void @GenImageChecked(ptr dead_on_unwind nonnull writable sret(%struct.Image) align 8 %3, i32 noundef 26, i32 noundef 26, i32 noundef 5, i32 noundef 5, i32 -657931, i32 -11513776) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #8
  call void @LoadTextureFromImage(ptr dead_on_unwind nonnull writable sret(%struct.Texture) align 4 %4, ptr noundef nonnull byval(%struct.Image) align 8 %3) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) @checked, ptr noundef nonnull align 4 dereferenceable(20) %4, i64 20, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #8
  call void @UnloadImage(ptr noundef nonnull byval(%struct.Image) align 8 %3) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %5, i8 0, i64 48, i1 false)
  %11 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %12 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 17)
  %13 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 16)
  %14 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 12)
  %15 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 18)
  %16 = call i32 @GetColor(i32 noundef %15) #8
  %17 = call i32 @GuiGetStyle(i32 noundef 9, i32 noundef 19)
  %18 = call i32 @GetColor(i32 noundef %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !6
  call void @SetTargetFPS(i32 noundef 60) #8
  %19 = call zeroext i1 @WindowShouldClose() #8
  br i1 %19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %20 = getelementptr inbounds i8, ptr %9, i64 12
  %21 = getelementptr inbounds i8, ptr %5, i64 12
  br label %22

22:                                               ; preds = %.lr.ph, %78
  %.092 = phi i32 [ %11, %.lr.ph ], [ %.3, %78 ]
  %.07191 = phi i1 [ false, %.lr.ph ], [ %.172, %78 ]
  %.07390 = phi i8 [ 0, %.lr.ph ], [ %.174, %78 ]
  %.07589 = phi i8 [ 0, %.lr.ph ], [ %.176, %78 ]
  %.07788 = phi i8 [ 0, %.lr.ph ], [ %.178, %78 ]
  %23 = call <2 x float> @GetMousePosition() #8
  br i1 %.07191, label %.sink.split, label %24

24:                                               ; preds = %22
  %25 = trunc i8 %.07390 to i1
  br i1 %25, label %.sink.split, label %26

26:                                               ; preds = %24
  %27 = trunc i8 %.07589 to i1
  br i1 %27, label %.sink.split, label %28

28:                                               ; preds = %26
  %29 = trunc i8 %.07788 to i1
  br i1 %29, label %.sink.split, label %30

.sink.split:                                      ; preds = %28, %26, %24, %22
  %.sink = phi i32 [ 0, %22 ], [ 1, %24 ], [ 2, %26 ], [ 3, %28 ]
  store i32 %.sink, ptr @textboxActive, align 4, !tbaa !6
  br label %30

30:                                               ; preds = %.sink.split, %28
  %31 = call zeroext i1 @IsFileDropped() #8
  br i1 %31, label %32, label %52

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !6
  %33 = call ptr @GetDroppedFiles(ptr noundef nonnull %8) #8
  %34 = load ptr, ptr %33, align 8, !tbaa !10
  %35 = call zeroext i1 @IsFileExtension(ptr noundef %34, ptr noundef nonnull @.str.11) #8
  br i1 %35, label %42, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr %33, align 8, !tbaa !10
  %38 = call zeroext i1 @IsFileExtension(ptr noundef %37, ptr noundef nonnull @.str.12) #8
  br i1 %38, label %42, label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr %33, align 8, !tbaa !10
  %41 = call zeroext i1 @IsFileExtension(ptr noundef %40, ptr noundef nonnull @.str.13) #8
  br i1 %41, label %42, label %51

42:                                               ; preds = %39, %36, %32
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #8
  %43 = load ptr, ptr %33, align 8, !tbaa !10
  call void @LoadFont(ptr dead_on_unwind nonnull writable sret(%struct.Font) align 8 %9, ptr noundef %43) #8
  %44 = load i32, ptr %20, align 4, !tbaa !12
  %.not = icmp eq i32 %44, 0
  br i1 %.not, label %50, label %45

45:                                               ; preds = %42
  call void @GuiSetFont(ptr noundef nonnull byval(%struct.Font) align 8 %9)
  %46 = load i32, ptr %9, align 8, !tbaa !15
  %47 = load i32, ptr %21, align 4, !tbaa !12
  %.not85 = icmp eq i32 %47, 0
  br i1 %.not85, label %49, label %48

48:                                               ; preds = %45
  call void @UnloadFont(ptr noundef nonnull byval(%struct.Font) align 8 %5) #8
  br label %49

49:                                               ; preds = %48, %45
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(48) %9, i64 48, i1 false), !tbaa.struct !16
  br label %50

50:                                               ; preds = %49, %42
  %.1 = phi i32 [ %46, %49 ], [ %.092, %42 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #8
  br label %51

51:                                               ; preds = %50, %39
  %.2 = phi i32 [ %.1, %50 ], [ %.092, %39 ]
  call void @ClearDroppedFiles() #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %52

52:                                               ; preds = %51, %30
  %.3 = phi i32 [ %.2, %51 ], [ %.092, %30 ]
  %53 = load i32, ptr @textboxActive, align 4, !tbaa !6
  %54 = icmp eq i32 %53, 1
  %55 = select i1 %54, i64 388, i64 280
  %56 = call ptr @llvm.stacksave.p0()
  %57 = alloca i8, i64 %55, align 16
  %58 = load i32, ptr @textboxActive, align 4, !tbaa !6
  %59 = icmp eq i32 %58, 1
  %60 = select i1 %59, ptr @text02, ptr @text01
  %wide.trip.count = select i1 %59, i64 128, i64 92
  br label %64

61:                                               ; preds = %64
  %62 = load i32, ptr @textboxActive, align 4, !tbaa !6
  %63 = icmp slt i32 %62, 2
  br i1 %63, label %70, label %78

64:                                               ; preds = %52, %64
  %indvars.iv93 = phi i64 [ 0, %52 ], [ %indvars.iv.next94, %64 ]
  %indvars.iv = phi i64 [ 0, %52 ], [ %indvars.iv.next, %64 ]
  %65 = getelementptr inbounds i8, ptr %57, i64 %indvars.iv93
  %66 = getelementptr inbounds i8, ptr %60, i64 %indvars.iv
  %67 = load i8, ptr %66, align 1, !tbaa !17
  %68 = sext i8 %67 to i32
  %69 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %65, ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %68) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 3
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %61, label %64, !llvm.loop !18

70:                                               ; preds = %61
  %71 = call <2 x float> @GuiTextBoxGetSelection()
  %.sroa.015.0.vec.extract = extractelement <2 x float> %71, i64 0
  %72 = fptosi float %.sroa.015.0.vec.extract to i32
  %73 = call i32 @GuiTextBoxGetByteIndex(ptr noundef nonnull %60, i32 noundef 0, i32 noundef 0, i32 noundef %72)
  %shift = shufflevector <2 x float> %71, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %74 = fadd <2 x float> %71, %shift
  %75 = extractelement <2 x float> %74, i64 0
  %76 = fptosi float %75 to i32
  %77 = call i32 @GuiTextBoxGetByteIndex(ptr noundef nonnull %60, i32 noundef 0, i32 noundef 0, i32 noundef %76)
  br label %78

78:                                               ; preds = %70, %61
  %.082 = phi i32 [ %77, %70 ], [ 0, %61 ]
  %.081 = phi i32 [ %73, %70 ], [ 0, %61 ]
  %79 = sub nsw i32 %.082, %.081
  call void @BeginDrawing() #8
  call void @ClearBackground(i32 -657931) #8
  call void @GuiSetStyle(i32 noundef 0, i32 noundef 16, i32 noundef %.3)
  call void @GuiSetStyle(i32 noundef 0, i32 noundef 17, i32 noundef %12)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 16, i32 noundef %13)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 12, i32 noundef %14)
  %80 = call i32 @ColorToInt(i32 %18) #8
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 19, i32 noundef %80)
  %81 = call i32 @ColorToInt(i32 %16) #8
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 18, i32 noundef %81)
  %82 = load <2 x float>, ptr @textboxBounds, align 16
  %83 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 8), align 8
  %84 = call zeroext i1 @GuiTextBoxEx(<2 x float> %82, <2 x float> %83, ptr noundef nonnull @text01, i32 noundef 91, i1 noundef zeroext %.07191)
  %.172 = xor i1 %.07191, %84
  %85 = trunc i8 %.07390 to i1
  %86 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 16), align 16
  %87 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 24), align 8
  %88 = call zeroext i1 @GuiTextBoxEx(<2 x float> %86, <2 x float> %87, ptr noundef nonnull @text02, i32 noundef 127, i1 noundef zeroext %85)
  %89 = zext i1 %88 to i8
  %.174 = xor i8 %.07390, %89
  %90 = trunc i8 %.07589 to i1
  %91 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 32), align 16
  %92 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 40), align 8
  %93 = call zeroext i1 @GuiSpinner(<2 x float> %91, <2 x float> %92, ptr noundef null, ptr noundef nonnull %6, i32 noundef -2147483648, i32 noundef 2147483647, i1 noundef zeroext %90)
  %94 = zext i1 %93 to i8
  %.176 = xor i8 %.07589, %94
  %95 = trunc i8 %.07788 to i1
  %96 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 48), align 16
  %97 = load <2 x float>, ptr getelementptr inbounds (i8, ptr @textboxBounds, i64 56), align 8
  %98 = call zeroext i1 @GuiValueBox(<2 x float> %96, <2 x float> %97, ptr noundef null, ptr noundef nonnull %7, i32 noundef -2147483648, i32 noundef 2147483647, i1 noundef zeroext %95)
  %99 = zext i1 %98 to i8
  %.178 = xor i8 %.07788, %99
  call void @GuiLoadStyleDefault()
  call void @GetFontDefault(ptr dead_on_unwind nonnull writable sret(%struct.Font) align 8 %10) #8
  call void @GuiSetFont(ptr noundef nonnull byval(%struct.Font) align 8 %10)
  call void @GuiSetStyle(i32 noundef 9, i32 noundef 14, i32 noundef 1)
  %100 = mul nsw i32 %.081, 3
  %101 = mul nsw i32 %79, 3
  call void @DrawTextRecEx(ptr noundef nonnull byval(%struct.Font) align 8 @guiFont, ptr noundef nonnull %57, <2 x float> <float 2.000000e+01, float 9.500000e+01>, <2 x float> <float 7.600000e+02, float 2.050000e+02>, float noundef 2.000000e+01, float noundef 1.000000e+00, i1 noundef zeroext true, i32 -16777216, i32 noundef %100, i32 noundef %101, i32 %16, i32 %18) #8
  call void @EndDrawing() #8
  call void @llvm.stackrestore.p0(ptr %56)
  %102 = call zeroext i1 @WindowShouldClose() #8
  br i1 %102, label %._crit_edge, label %22, !llvm.loop !20

._crit_edge:                                      ; preds = %78, %2
  call void @CloseWindow() #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  ret i32 0
}

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

declare void @GenImageChecked(ptr dead_on_unwind writable sret(%struct.Image) align 8, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32, i32) local_unnamed_addr #3

declare void @SetTargetFPS(i32 noundef) local_unnamed_addr #3

declare zeroext i1 @WindowShouldClose() local_unnamed_addr #3

declare zeroext i1 @IsFileDropped() local_unnamed_addr #3

declare ptr @GetDroppedFiles(ptr noundef) local_unnamed_addr #3

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

declare void @LoadFont(ptr dead_on_unwind writable sret(%struct.Font) align 8, ptr noundef) local_unnamed_addr #3

declare void @UnloadFont(ptr noundef byval(%struct.Font) align 8) local_unnamed_addr #3

declare void @ClearDroppedFiles() local_unnamed_addr #3

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

declare void @BeginDrawing() local_unnamed_addr #3

declare void @ClearBackground(i32) local_unnamed_addr #3

declare i32 @ColorToInt(i32) local_unnamed_addr #3

declare void @EndDrawing() local_unnamed_addr #3

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

declare void @CloseWindow() local_unnamed_addr #3

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 = { "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 nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 12}
!13 = !{!"Font", !7, i64 0, !7, i64 4, !7, i64 8, !14, i64 12, !11, i64 32, !11, i64 40}
!14 = !{!"Texture", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16}
!15 = !{!13, !7, i64 0}
!16 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6, i64 24, i64 4, !6, i64 28, i64 4, !6, i64 32, i64 8, !10, i64 40, i64 8, !10}
!17 = !{!8, !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,PromotePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass