; LLVM IR from danginsburg/opengles3-book :: Common/Source (esUtil)

; 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.ESContext = type { ptr, ptr, i32, i32, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@__const.esCreateWindow.contextAttribs = external hidden unnamed_addr constant [3 x i32], align 4

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @esCreateWindow(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %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 [3 x i32], align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca [17 x i32], align 16
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 @__const.esCreateWindow.contextAttribs, i64 12, i1 false)
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %5
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

22:                                               ; preds = %5
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ESContext, ptr %24, i32 0, i32 2
  store i32 %23, ptr %25, align 8, !tbaa !11
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ESContext, ptr %27, i32 0, i32 3
  store i32 %26, ptr %28, align 4, !tbaa !14
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = call zeroext i8 @WinCreate(ptr noundef %29, ptr noundef %30)
  %32 = icmp ne i8 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %22
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

34:                                               ; preds = %22
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ESContext, ptr %35, i32 0, i32 4
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = call ptr @eglGetDisplay(ptr noundef %37)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ESContext, ptr %39, i32 0, i32 6
  store ptr %38, ptr %40, align 8, !tbaa !16
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ESContext, ptr %41, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %46

45:                                               ; preds = %34
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

46:                                               ; preds = %34
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ESContext, ptr %47, i32 0, i32 6
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = call i32 @eglInitialize(ptr noundef %49, ptr noundef %13, ptr noundef %14)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 68, ptr %18) #4
  store i32 12324, ptr %18, align 4, !tbaa !9
  %54 = getelementptr inbounds i32, ptr %18, i64 1
  store i32 5, ptr %54, align 4, !tbaa !9
  %55 = getelementptr inbounds i32, ptr %18, i64 2
  store i32 12323, ptr %55, align 4, !tbaa !9
  %56 = getelementptr inbounds i32, ptr %18, i64 3
  store i32 6, ptr %56, align 4, !tbaa !9
  %57 = getelementptr inbounds i32, ptr %18, i64 4
  store i32 12322, ptr %57, align 4, !tbaa !9
  %58 = getelementptr inbounds i32, ptr %18, i64 5
  store i32 5, ptr %58, align 4, !tbaa !9
  %59 = getelementptr inbounds i32, ptr %18, i64 6
  store i32 12321, ptr %59, align 4, !tbaa !9
  %60 = getelementptr inbounds i32, ptr %18, i64 7
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = and i32 %61, 1
  %63 = icmp ne i32 %62, 0
  %64 = zext i1 %63 to i64
  %65 = select i1 %63, i32 8, i32 -1
  store i32 %65, ptr %60, align 4, !tbaa !9
  %66 = getelementptr inbounds i32, ptr %18, i64 8
  store i32 12325, ptr %66, align 4, !tbaa !9
  %67 = getelementptr inbounds i32, ptr %18, i64 9
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = and i32 %68, 2
  %70 = icmp ne i32 %69, 0
  %71 = zext i1 %70 to i64
  %72 = select i1 %70, i32 8, i32 -1
  store i32 %72, ptr %67, align 4, !tbaa !9
  %73 = getelementptr inbounds i32, ptr %18, i64 10
  store i32 12326, ptr %73, align 4, !tbaa !9
  %74 = getelementptr inbounds i32, ptr %18, i64 11
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = and i32 %75, 4
  %77 = icmp ne i32 %76, 0
  %78 = zext i1 %77 to i64
  %79 = select i1 %77, i32 8, i32 -1
  store i32 %79, ptr %74, align 4, !tbaa !9
  %80 = getelementptr inbounds i32, ptr %18, i64 12
  store i32 12338, ptr %80, align 4, !tbaa !9
  %81 = getelementptr inbounds i32, ptr %18, i64 13
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = and i32 %82, 8
  %84 = icmp ne i32 %83, 0
  %85 = zext i1 %84 to i64
  %86 = select i1 %84, i32 1, i32 0
  store i32 %86, ptr %81, align 4, !tbaa !9
  %87 = getelementptr inbounds i32, ptr %18, i64 14
  store i32 12352, ptr %87, align 4, !tbaa !9
  %88 = getelementptr inbounds i32, ptr %18, i64 15
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ESContext, ptr %89, i32 0, i32 6
  %91 = load ptr, ptr %90, align 8, !tbaa !16
  %92 = call i32 @GetContextRenderableType(ptr noundef %91)
  store i32 %92, ptr %88, align 4, !tbaa !9
  %93 = getelementptr inbounds i32, ptr %18, i64 16
  store i32 12344, ptr %93, align 4, !tbaa !9
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ESContext, ptr %94, i32 0, i32 6
  %96 = load ptr, ptr %95, align 8, !tbaa !16
  %97 = getelementptr inbounds [17 x i32], ptr %18, i64 0, i64 0
  %98 = call i32 @eglChooseConfig(ptr noundef %96, ptr noundef %97, ptr noundef %12, i32 noundef 1, ptr noundef %17)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %101, label %100

100:                                              ; preds = %53
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %106

101:                                              ; preds = %53
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = icmp slt i32 %102, 1
  br i1 %103, label %104, label %105

104:                                              ; preds = %101
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %106

105:                                              ; preds = %101
  store i32 0, ptr %16, align 4
  br label %106

106:                                              ; preds = %105, %104, %100
  call void @llvm.lifetime.end.p0(i64 68, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %107 = load i32, ptr %16, align 4
  switch i32 %107, label %155 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ESContext, ptr %109, i32 0, i32 6
  %111 = load ptr, ptr %110, align 8, !tbaa !16
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ESContext, ptr %113, i32 0, i32 5
  %115 = load i64, ptr %114, align 8, !tbaa !17
  %116 = call ptr @eglCreateWindowSurface(ptr noundef %111, ptr noundef %112, i64 noundef %115, ptr noundef null)
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.ESContext, ptr %117, i32 0, i32 8
  store ptr %116, ptr %118, align 8, !tbaa !18
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ESContext, ptr %119, i32 0, i32 8
  %121 = load ptr, ptr %120, align 8, !tbaa !18
  %122 = icmp eq ptr %121, null
  br i1 %122, label %123, label %124

123:                                              ; preds = %108
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

124:                                              ; preds = %108
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ESContext, ptr %125, i32 0, i32 6
  %127 = load ptr, ptr %126, align 8, !tbaa !16
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 0
  %130 = call ptr @eglCreateContext(ptr noundef %127, ptr noundef %128, ptr noundef null, ptr noundef %129)
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ESContext, ptr %131, i32 0, i32 7
  store ptr %130, ptr %132, align 8, !tbaa !19
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ESContext, ptr %133, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !19
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %138

137:                                              ; preds = %124
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

138:                                              ; preds = %124
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ESContext, ptr %139, i32 0, i32 6
  %141 = load ptr, ptr %140, align 8, !tbaa !16
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ESContext, ptr %142, i32 0, i32 8
  %144 = load ptr, ptr %143, align 8, !tbaa !18
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.ESContext, ptr %145, i32 0, i32 8
  %147 = load ptr, ptr %146, align 8, !tbaa !18
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ESContext, ptr %148, i32 0, i32 7
  %150 = load ptr, ptr %149, align 8, !tbaa !19
  %151 = call i32 @eglMakeCurrent(ptr noundef %141, ptr noundef %144, ptr noundef %147, ptr noundef %150)
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %154, label %153

153:                                              ; preds = %138
  store i8 0, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

154:                                              ; preds = %138
  store i8 1, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %155

155:                                              ; preds = %154, %153, %137, %123, %106, %52, %45, %33, %21
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %156 = load i8, ptr %6, align 1
  ret i8 %156
}

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

declare zeroext i8 @WinCreate(ptr noundef, ptr noundef) #3

declare ptr @eglGetDisplay(ptr noundef) #3

declare i32 @eglInitialize(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @eglChooseConfig(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare ptr @eglCreateWindowSurface(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #3

declare ptr @eglCreateContext(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @eglMakeCurrent(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree 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 = { nounwind }

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

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


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

@__const.esCreateWindow.contextAttribs = external hidden unnamed_addr constant [3 x i32], align 4

; Function Attrs: nounwind uwtable
declare dso_local i32 @GetContextRenderableType(ptr 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) #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: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @esCreateWindow(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [3 x i32], align 4
  %10 = alloca i32, align 4
  %11 = alloca [17 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) @__const.esCreateWindow.contextAttribs, i64 12, i1 false)
  %12 = icmp eq ptr %0, null
  br i1 %12, label %71, label %13

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %2, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %3, ptr %15, align 4, !tbaa !12
  %16 = tail call zeroext i8 @WinCreate(ptr noundef nonnull %0, ptr noundef %1) #4
  %.not = icmp eq i8 %16, 0
  br i1 %.not, label %71, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = tail call ptr @eglGetDisplay(ptr noundef %19) #4
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %20, ptr %21, align 8, !tbaa !14
  %22 = icmp eq ptr %20, null
  br i1 %22, label %71, label %23

23:                                               ; preds = %17
  %24 = call i32 @eglInitialize(ptr noundef nonnull %20, ptr noundef nonnull %7, ptr noundef nonnull %8) #4
  %.not33 = icmp eq i32 %24, 0
  br i1 %.not33, label %71, label %25

25:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 0, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 68, ptr nonnull %11) #4
  store <4 x i32> <i32 12324, i32 5, i32 12323, i32 6>, ptr %11, align 16, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %11, i64 16
  store i32 12322, ptr %26, align 16, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %11, i64 20
  store i32 5, ptr %27, align 4, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %11, i64 24
  store i32 12321, ptr %28, align 8, !tbaa !15
  %29 = getelementptr inbounds i8, ptr %11, i64 28
  %30 = and i32 %4, 1
  %.not34 = icmp eq i32 %30, 0
  %31 = select i1 %.not34, i32 -1, i32 8
  store i32 %31, ptr %29, align 4, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %11, i64 32
  store i32 12325, ptr %32, align 16, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %11, i64 36
  %34 = and i32 %4, 2
  %.not35 = icmp eq i32 %34, 0
  %35 = select i1 %.not35, i32 -1, i32 8
  store i32 %35, ptr %33, align 4, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %11, i64 40
  store i32 12326, ptr %36, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %11, i64 44
  %38 = and i32 %4, 4
  %.not36 = icmp eq i32 %38, 0
  %39 = select i1 %.not36, i32 -1, i32 8
  store i32 %39, ptr %37, align 4, !tbaa !15
  %40 = getelementptr inbounds i8, ptr %11, i64 48
  store i32 12338, ptr %40, align 16, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %11, i64 52
  %42 = lshr i32 %4, 3
  %.lobit = and i32 %42, 1
  store i32 %.lobit, ptr %41, align 4, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %11, i64 56
  store i32 12352, ptr %43, align 8, !tbaa !15
  %44 = getelementptr inbounds i8, ptr %11, i64 60
  %45 = load ptr, ptr %21, align 8, !tbaa !14
  %46 = call i32 @GetContextRenderableType(ptr noundef %45)
  store i32 %46, ptr %44, align 4, !tbaa !15
  %47 = getelementptr inbounds i8, ptr %11, i64 64
  store i32 12344, ptr %47, align 16, !tbaa !15
  %48 = load ptr, ptr %21, align 8, !tbaa !14
  %49 = call i32 @eglChooseConfig(ptr noundef %48, ptr noundef nonnull %11, ptr noundef nonnull %6, i32 noundef 1, ptr noundef nonnull %10) #4
  %.not38 = icmp eq i32 %49, 0
  br i1 %.not38, label %.critedge, label %50

50:                                               ; preds = %25
  %51 = load i32, ptr %10, align 4, !tbaa !15
  %52 = icmp sgt i32 %51, 0
  call void @llvm.lifetime.end.p0(i64 68, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br i1 %52, label %53, label %71

53:                                               ; preds = %50
  %54 = load ptr, ptr %21, align 8, !tbaa !14
  %55 = load ptr, ptr %6, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %0, i64 32
  %57 = load i64, ptr %56, align 8, !tbaa !17
  %58 = call ptr @eglCreateWindowSurface(ptr noundef %54, ptr noundef %55, i64 noundef %57, ptr noundef null) #4
  %59 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %58, ptr %59, align 8, !tbaa !18
  %60 = icmp eq ptr %58, null
  br i1 %60, label %71, label %61

61:                                               ; preds = %53
  %62 = load ptr, ptr %21, align 8, !tbaa !14
  %63 = load ptr, ptr %6, align 8, !tbaa !16
  %64 = call ptr @eglCreateContext(ptr noundef %62, ptr noundef %63, ptr noundef null, ptr noundef nonnull %9) #4
  %65 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %64, ptr %65, align 8, !tbaa !19
  %66 = icmp eq ptr %64, null
  br i1 %66, label %71, label %67

67:                                               ; preds = %61
  %68 = load ptr, ptr %21, align 8, !tbaa !14
  %69 = load ptr, ptr %59, align 8, !tbaa !18
  %70 = call i32 @eglMakeCurrent(ptr noundef %68, ptr noundef %69, ptr noundef %69, ptr noundef nonnull %64) #4
  %.not39 = icmp ne i32 %70, 0
  %.40 = zext i1 %.not39 to i8
  br label %71

.critedge:                                        ; preds = %25
  call void @llvm.lifetime.end.p0(i64 68, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %71

71:                                               ; preds = %67, %61, %53, %.critedge, %23, %17, %13, %5, %50
  %.1 = phi i8 [ 0, %50 ], [ 0, %5 ], [ 0, %13 ], [ 0, %17 ], [ 0, %23 ], [ 0, %.critedge ], [ 0, %53 ], [ 0, %61 ], [ %.40, %67 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret i8 %.1
}

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

declare zeroext i8 @WinCreate(ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @eglGetDisplay(ptr noundef) local_unnamed_addr #3

declare i32 @eglInitialize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @eglChooseConfig(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @eglCreateWindowSurface(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @eglCreateContext(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @eglMakeCurrent(ptr noundef, ptr noundef, ptr noundef, ptr noundef) 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree 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 = { 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, !10, i64 16}
!6 = !{!"ESContext", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !10, i64 20}
!13 = !{!6, !7, i64 24}
!14 = !{!6, !7, i64 40}
!15 = !{!10, !10, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !11, i64 32}
!18 = !{!6, !7, i64 56}
!19 = !{!6, !7, i64 48}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass