; LLVM IR from jasonlmfong/Model-Modifier :: Model-Modifier/src/external/imgui/imgui_impl_opengl3.ll (Z22ImGui_ImplOpenGL3_InitPKc)

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

%union.GL3WProcs = type { [58 x ptr] }
%struct.ImNewWrapper = type { i8 }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, float, float, float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, i32, %struct.ImVec2, [652 x i32], [652 x i8], [16 x float], %struct.ImVec2, [5 x i8], float, float, i8, i8, i8, i8, i32, [652 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x i8], [5 x i8], [5 x float], [5 x float], [5 x float], float, i8, i8, i8, i8, i16, %struct.ImVector }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVec2 = type { float, float }
%struct.ImVector = type { i32, i32, ptr }
%struct.anon.0 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ImGui_ImplOpenGL3_Data = type <{ i32, [32 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, i8, [6 x i8] }>

@imgl3wProcs = external dso_local global %union.GL3WProcs, align 8
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [117 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc = external hidden unnamed_addr constant [42 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @imgl3wInit() #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z22ImGui_ImplOpenGL3_InitPKc(ptr noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.ImNewWrapper, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %17 = call noundef nonnull align 8 dereferenceable(14264) ptr @_ZN5ImGui5GetIOEv()
  store ptr %17, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ImGuiIO, ptr %18, i32 0, i32 32
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %1
  br label %23

23:                                               ; preds = %22, %1
  %24 = phi i1 [ false, %1 ], [ true, %22 ]
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  br label %28

26:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 252, ptr noundef @__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc) #9
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  %29 = call i32 @imgl3wInit()
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.3) #8
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %133

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %35 = call noundef ptr @_ZN5ImGui8MemAllocEm(i64 noundef 96)
  %36 = call noundef ptr @_Znwm12ImNewWrapperPv(i64 noundef 96, ptr noundef %35)
  invoke void @_ZN22ImGui_ImplOpenGL3_DataC2Ev(ptr noundef nonnull align 8 dereferenceable(90) %36)
          to label %37 unwind label %55

37:                                               ; preds = %34
  store ptr %36, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGuiIO, ptr %39, i32 0, i32 32
  store ptr %38, ptr %40, align 8, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ImGuiIO, ptr %41, i32 0, i32 30
  store ptr @.str.4, ptr %42, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !18
  %43 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 34), align 8, !tbaa !19
  call void %43(i32 noundef 33307, ptr noundef %10)
  %44 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 34), align 8, !tbaa !19
  call void %44(i32 noundef 33308, ptr noundef %11)
  %45 = load i32, ptr %10, align 4, !tbaa !18
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %59

47:                                               ; preds = %37
  %48 = load i32, ptr %11, align 4, !tbaa !18
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %59

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %51 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 39), align 8, !tbaa !19
  %52 = call noundef ptr %51(i32 noundef 7938)
  store ptr %52, ptr %12, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %53, ptr noundef @.str.5, ptr noundef %10, ptr noundef %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %59

55:                                               ; preds = %34
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %8, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %9, align 4
  call void @_ZdlPv12ImNewWrapperS_(ptr noundef %36, ptr noundef %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %135

59:                                               ; preds = %50, %47, %37
  %60 = load i32, ptr %10, align 4, !tbaa !18
  %61 = mul nsw i32 %60, 100
  %62 = load i32, ptr %11, align 4, !tbaa !18
  %63 = mul nsw i32 %62, 10
  %64 = add nsw i32 %61, %63
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %65, i32 0, i32 0
  store i32 %64, ptr %66, align 8, !tbaa !20
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %67, i32 0, i32 14
  store i8 0, ptr %68, align 1, !tbaa !23
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !20
  %72 = icmp uge i32 %71, 320
  br i1 %72, label %73, label %78

73:                                               ; preds = %59
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ImGuiIO, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !24
  %77 = or i32 %76, 8
  store i32 %77, ptr %75, align 4, !tbaa !24
  br label %78

78:                                               ; preds = %73, %59
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = icmp eq ptr %79, null
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  store ptr @.str.6, ptr %3, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %81, %78
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = call i64 @strlen(ptr noundef %83) #10
  %85 = trunc i64 %84 to i32
  %86 = add nsw i32 %85, 2
  %87 = icmp slt i32 %86, 32
  br i1 %87, label %88, label %89

88:                                               ; preds = %82
  br label %91

89:                                               ; preds = %82
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 318, ptr noundef @__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc) #9
  unreachable

90:                                               ; No predecessors!
  br label %91

91:                                               ; preds = %90, %88
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds [32 x i8], ptr %93, i64 0, i64 0
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = call ptr @strcpy(ptr noundef %94, ptr noundef %95) #8
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds [32 x i8], ptr %98, i64 0, i64 0
  %100 = call ptr @strcat(ptr noundef %99, ptr noundef @.str.8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %101 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 34), align 8, !tbaa !19
  call void %101(i32 noundef 32873, ptr noundef %13)
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !20
  %105 = icmp uge i32 %104, 450
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %106, i32 0, i32 13
  %108 = zext i1 %105 to i8
  store i8 %108, ptr %107, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !18
  %109 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 34), align 8, !tbaa !19
  call void %109(i32 noundef 33309, ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !18
  br label %110

110:                                              ; preds = %129, %91
  %111 = load i32, ptr %15, align 4, !tbaa !18
  %112 = load i32, ptr %14, align 4, !tbaa !18
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %132

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %116 = load ptr, ptr getelementptr inbounds (%struct.anon.0, ptr @imgl3wProcs, i32 0, i32 40), align 8, !tbaa !19
  %117 = load i32, ptr %15, align 4, !tbaa !18
  %118 = call noundef ptr %116(i32 noundef 7939, i32 noundef %117)
  store ptr %118, ptr %16, align 8, !tbaa !5
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %128

121:                                              ; preds = %115
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = call i32 @strcmp(ptr noundef %122, ptr noundef @.str.9) #10
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ImGui_ImplOpenGL3_Data, ptr %126, i32 0, i32 13
  store i8 1, ptr %127, align 8, !tbaa !25
  br label %128

128:                                              ; preds = %125, %121, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %15, align 4, !tbaa !18
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %15, align 4, !tbaa !18
  br label %110, !llvm.loop !26

132:                                              ; preds = %114
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  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 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %133

133:                                              ; preds = %132, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  %134 = load i1, ptr %2, align 1
  ret i1 %134

135:                                              ; preds = %55
  %136 = load ptr, ptr %8, align 8
  %137 = load i32, ptr %9, align 4
  %138 = insertvalue { ptr, i32 } poison, ptr %136, 0
  %139 = insertvalue { ptr, i32 } %138, i32 %137, 1
  resume { ptr, i32 } %139
}

declare noundef nonnull align 8 dereferenceable(14264) ptr @_ZN5ImGui5GetIOEv() #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

declare noundef ptr @_ZN5ImGui8MemAllocEm(i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_Znwm12ImNewWrapperPv(i64 noundef, ptr noundef) #5

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZdlPv12ImNewWrapperS_(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #7

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

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 152}
!10 = !{!"_ZTS7ImGuiIO", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !14, i64 92, !6, i64 96, !12, i64 104, !14, i64 112, !14, i64 113, !14, i64 114, !14, i64 115, !14, i64 116, !14, i64 117, !14, i64 118, !14, i64 119, !13, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !14, i64 208, !14, i64 209, !14, i64 210, !14, i64 211, !14, i64 212, !14, i64 213, !14, i64 214, !13, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !12, i64 240, !7, i64 248, !7, i64 2856, !7, i64 3508, !12, i64 3572, !7, i64 3580, !13, i64 3588, !13, i64 3592, !14, i64 3596, !14, i64 3597, !14, i64 3598, !14, i64 3599, !11, i64 3600, !7, i64 3604, !14, i64 14036, !12, i64 14040, !7, i64 14048, !7, i64 14088, !7, i64 14128, !7, i64 14133, !7, i64 14138, !7, i64 14148, !7, i64 14158, !7, i64 14163, !7, i64 14168, !7, i64 14176, !7, i64 14196, !7, i64 14216, !13, i64 14236, !14, i64 14240, !14, i64 14241, !7, i64 14242, !14, i64 14243, !15, i64 14244, !16, i64 14248}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{!10, !6, i64 136}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !11, i64 0}
!21 = !{!"_ZTS22ImGui_ImplOpenGL3_Data", !11, i64 0, !7, i64 4, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !22, i64 72, !22, i64 80, !14, i64 88, !14, i64 89}
!22 = !{!"long", !7, i64 0}
!23 = !{!21, !14, i64 89}
!24 = !{!10, !11, i64 4}
!25 = !{!21, !14, i64 88}
!26 = distinct !{!26, !27}
!27 = !{!"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"

%union.GL3WProcs = type { [58 x ptr] }

@imgl3wProcs = external dso_local local_unnamed_addr global %union.GL3WProcs, align 8
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [117 x i8], align 1
@__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc = external hidden unnamed_addr constant [42 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @imgl3wInit() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z22ImGui_ImplOpenGL3_InitPKc(ptr noundef readonly %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef nonnull align 8 dereferenceable(14264) ptr @_ZN5ImGui5GetIOEv()
  %7 = getelementptr inbounds i8, ptr %6, i64 152
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %11, label %10

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 252, ptr noundef nonnull @__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc) #9
  unreachable

11:                                               ; preds = %1
  %12 = tail call i32 @imgl3wInit()
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %16, label %13

13:                                               ; preds = %11
  %14 = load ptr, ptr @stderr, align 8, !tbaa !16
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.3) #10
  br label %70

16:                                               ; preds = %11
  %17 = tail call noundef ptr @_ZN5ImGui8MemAllocEm(i64 noundef 96)
  %18 = tail call noundef ptr @_Znwm12ImNewWrapperPv(i64 noundef 96, ptr noundef %17)
  tail call void @_ZN22ImGui_ImplOpenGL3_DataC2Ev(ptr noundef nonnull align 8 dereferenceable(90) %18)
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 136
  store ptr @.str.4, ptr %19, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #11
  store i32 0, ptr %2, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #11
  store i32 0, ptr %3, align 4, !tbaa !18
  %20 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 272), align 8, !tbaa !19
  call void %20(i32 noundef 33307, ptr noundef nonnull %2)
  %21 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 272), align 8, !tbaa !19
  call void %21(i32 noundef 33308, ptr noundef nonnull %3)
  %22 = load i32, ptr %2, align 4, !tbaa !18
  %23 = icmp eq i32 %22, 0
  %24 = load i32, ptr %3, align 4
  %25 = icmp eq i32 %24, 0
  %or.cond = select i1 %23, i1 %25, i1 false
  br i1 %or.cond, label %26, label %30

26:                                               ; preds = %16
  %27 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 312), align 8, !tbaa !19
  %28 = call noundef ptr %27(i32 noundef 7938)
  %29 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %28, ptr noundef nonnull @.str.5, ptr noundef nonnull %2, ptr noundef nonnull %3) #11
  %.pre = load i32, ptr %2, align 4, !tbaa !18
  %.pre27 = load i32, ptr %3, align 4, !tbaa !18
  br label %30

30:                                               ; preds = %26, %16
  %31 = phi i32 [ %.pre27, %26 ], [ %24, %16 ]
  %32 = phi i32 [ %.pre, %26 ], [ %22, %16 ]
  %33 = mul nsw i32 %32, 100
  %34 = mul nsw i32 %31, 10
  %35 = add nsw i32 %34, %33
  store i32 %35, ptr %18, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %18, i64 89
  store i8 0, ptr %36, align 1, !tbaa !23
  %37 = icmp ugt i32 %35, 319
  br i1 %37, label %38, label %42

38:                                               ; preds = %30
  %39 = getelementptr inbounds i8, ptr %6, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !24
  %41 = or i32 %40, 8
  store i32 %41, ptr %39, align 4, !tbaa !24
  br label %42

42:                                               ; preds = %38, %30
  %43 = icmp eq ptr %0, null
  %spec.store.select = select i1 %43, ptr @.str.6, ptr %0
  %44 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %spec.store.select) #12
  %45 = trunc i64 %44 to i32
  %46 = icmp slt i32 %45, 30
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 318, ptr noundef nonnull @__PRETTY_FUNCTION__._Z22ImGui_ImplOpenGL3_InitPKc) #9
  unreachable

48:                                               ; preds = %42
  %49 = getelementptr inbounds i8, ptr %18, i64 4
  %50 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %49, ptr noundef nonnull dereferenceable(1) %spec.store.select) #11
  %51 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %49, ptr noundef nonnull dereferenceable(1) @.str.8) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #11
  %52 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 272), align 8, !tbaa !19
  call void %52(i32 noundef 32873, ptr noundef nonnull %4)
  %53 = load i32, ptr %18, align 8, !tbaa !20
  %54 = icmp ugt i32 %53, 449
  %55 = getelementptr inbounds i8, ptr %18, i64 88
  %56 = zext i1 %54 to i8
  store i8 %56, ptr %55, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #11
  store i32 0, ptr %5, align 4, !tbaa !18
  %57 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 272), align 8, !tbaa !19
  call void %57(i32 noundef 33309, ptr noundef nonnull %5)
  %58 = load i32, ptr %5, align 4, !tbaa !18
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %66, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #11
  br label %70

.lr.ph:                                           ; preds = %48, %66
  %.02326 = phi i32 [ %67, %66 ], [ 0, %48 ]
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @imgl3wProcs, i64 320), align 8, !tbaa !19
  %61 = call noundef ptr %60(i32 noundef 7939, i32 noundef %.02326)
  %.not25 = icmp eq ptr %61, null
  br i1 %.not25, label %66, label %62

62:                                               ; preds = %.lr.ph
  %63 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %61, ptr noundef nonnull dereferenceable(1) @.str.9) #12
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  store i8 1, ptr %55, align 8, !tbaa !25
  br label %66

66:                                               ; preds = %65, %62, %.lr.ph
  %67 = add nuw nsw i32 %.02326, 1
  %68 = load i32, ptr %5, align 4, !tbaa !18
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %.lr.ph, label %._crit_edge, !llvm.loop !26

70:                                               ; preds = %._crit_edge, %13
  ret i1 %.not
}

declare noundef nonnull align 8 dereferenceable(14264) ptr @_ZN5ImGui5GetIOEv() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

declare noundef ptr @_ZN5ImGui8MemAllocEm(i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_Znwm12ImNewWrapperPv(i64 noundef, ptr noundef) local_unnamed_addr #5

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7

; 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 #8

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

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

!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, !12, i64 152}
!6 = !{!"_ZTS7ImGuiIO", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !12, i64 72, !12, i64 80, !11, i64 88, !13, i64 92, !12, i64 96, !10, i64 104, !13, i64 112, !13, i64 113, !13, i64 114, !13, i64 115, !13, i64 116, !13, i64 117, !13, i64 118, !13, i64 119, !11, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !13, i64 208, !13, i64 209, !13, i64 210, !13, i64 211, !13, i64 212, !13, i64 213, !13, i64 214, !11, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !10, i64 240, !8, i64 248, !8, i64 2856, !8, i64 3508, !10, i64 3572, !8, i64 3580, !11, i64 3588, !11, i64 3592, !13, i64 3596, !13, i64 3597, !13, i64 3598, !13, i64 3599, !7, i64 3600, !8, i64 3604, !13, i64 14036, !10, i64 14040, !8, i64 14048, !8, i64 14088, !8, i64 14128, !8, i64 14133, !8, i64 14138, !8, i64 14148, !8, i64 14158, !8, i64 14163, !8, i64 14168, !8, i64 14176, !8, i64 14196, !8, i64 14216, !11, i64 14236, !13, i64 14240, !13, i64 14241, !8, i64 14242, !13, i64 14243, !14, i64 14244, !15, i64 14248}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS6ImVec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!"_ZTS8ImVectorItE", !7, i64 0, !7, i64 4, !12, i64 8}
!16 = !{!12, !12, i64 0}
!17 = !{!6, !12, i64 136}
!18 = !{!7, !7, i64 0}
!19 = !{!8, !8, i64 0}
!20 = !{!21, !7, i64 0}
!21 = !{!"_ZTS22ImGui_ImplOpenGL3_Data", !7, i64 0, !8, i64 4, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !22, i64 72, !22, i64 80, !13, i64 88, !13, i64 89}
!22 = !{!"long", !8, i64 0}
!23 = !{!21, !13, i64 89}
!24 = !{!6, !7, i64 4}
!25 = !{!21, !13, i64 88}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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