; LLVM IR from niessner/Matterport :: code/gaps/pkgs/fglut (freeglut_gamemode)

; 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.tagSFG_State = type { %struct.tagSFG_XYUse, %struct.tagSFG_XYUse, i32, i8, i32, i8, i8, i8, i8, i32, i32, i32, i32, i32, i64, %struct.tagSFG_List, %struct.tagSFG_List, ptr, i32, ptr, ptr, %struct.tagSFG_XYUse, i32, i32, i32, i32, ptr, i8, i8, i32, i32, i32, i32, i32, i32 }
%struct.tagSFG_List = type { ptr, ptr }
%struct.tagSFG_XYUse = type { i32, i32, i8 }
%struct.tagSFG_Structure = type { %struct.tagSFG_List, %struct.tagSFG_List, %struct.tagSFG_List, ptr, ptr, ptr, ptr, i32, i32 }
%struct.tagSFG_Display = type { ptr, i32, i64, i32, i64, i64, i64, i32, i32, i32, i32 }
%struct.tagSFG_Window = type { %struct.tagSFG_Node, i32, %struct.tagSFG_Context, %struct.tagSFG_WindowState, [24 x ptr], ptr, [3 x ptr], ptr, ptr, %struct.tagSFG_List, i8 }
%struct.tagSFG_Node = type { ptr, ptr }
%struct.tagSFG_Context = type { i64, ptr, ptr, i32 }
%struct.tagSFG_WindowState = type { i32, i32, i32, i32, i8, i8, i32, i64, i64, i32, i32, i8, i8, i8, i8 }

@fgState = external global %struct.tagSFG_State, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@fgStructure = external global %struct.tagSFG_Structure, align 8
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@fgDisplay = external global %struct.tagSFG_Display, align 8

declare void @fgError(ptr noundef, ...) #0

declare void @fgWarning(ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @glutEnterGameMode() #1 {
  %1 = alloca i32, align 4
  %2 = load i8, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 3), align 4, !tbaa !5
  %3 = icmp ne i8 %2, 0
  br i1 %3, label %5, label %4

4:                                                ; preds = %0
  call void (ptr, ...) @fgError(ptr noundef @.str, ptr noundef @.str.10)
  br label %5

5:                                                ; preds = %4, %0
  %6 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %10

8:                                                ; preds = %5
  %9 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  call void @fgAddToWindowDestroyList(ptr noundef %9)
  br label %11

10:                                               ; preds = %5
  call void @fghRememberState()
  br label %11

11:                                               ; preds = %10, %8
  %12 = call zeroext i8 @fghChangeDisplayMode(i8 noundef zeroext 0)
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void (ptr, ...) @fgWarning(ptr noundef @.str.11)
  store i32 0, ptr %1, align 4
  br label %69

15:                                               ; preds = %11
  %16 = load i32, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), align 8, !tbaa !16
  %17 = load i32, ptr getelementptr inbounds (%struct.tagSFG_XYUse, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), i32 0, i32 1), align 4, !tbaa !17
  %18 = call ptr @fgCreateWindow(ptr noundef null, ptr noundef @.str.12, i8 noundef zeroext 1, i32 noundef 0, i32 noundef 0, i8 noundef zeroext 1, i32 noundef %16, i32 noundef %17, i8 noundef zeroext 1, i8 noundef zeroext 0)
  store ptr %18, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %19 = load i32, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), align 8, !tbaa !16
  %20 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %21 = getelementptr inbounds %struct.tagSFG_Window, ptr %20, i32 0, i32 3
  %22 = getelementptr inbounds %struct.tagSFG_WindowState, ptr %21, i32 0, i32 0
  store i32 %19, ptr %22, align 8, !tbaa !18
  %23 = load i32, ptr getelementptr inbounds (%struct.tagSFG_XYUse, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), i32 0, i32 1), align 4, !tbaa !17
  %24 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %25 = getelementptr inbounds %struct.tagSFG_Window, ptr %24, i32 0, i32 3
  %26 = getelementptr inbounds %struct.tagSFG_WindowState, ptr %25, i32 0, i32 1
  store i32 %23, ptr %26, align 4, !tbaa !23
  %27 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %28 = getelementptr inbounds %struct.tagSFG_Window, ptr %27, i32 0, i32 3
  %29 = getelementptr inbounds %struct.tagSFG_WindowState, ptr %28, i32 0, i32 13
  store i8 1, ptr %29, align 2, !tbaa !24
  %30 = load ptr, ptr @fgDisplay, align 8, !tbaa !25
  %31 = call i32 @XSync(ptr noundef %30, i32 noundef 0)
  br label %32

32:                                               ; preds = %44, %15
  %33 = load ptr, ptr @fgDisplay, align 8, !tbaa !25
  %34 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %35 = getelementptr inbounds %struct.tagSFG_Window, ptr %34, i32 0, i32 2
  %36 = getelementptr inbounds %struct.tagSFG_Context, ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !27
  %38 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %39 = getelementptr inbounds %struct.tagSFG_Window, ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %struct.tagSFG_Context, ptr %39, i32 0, i32 0
  %41 = load i64, ptr %40, align 8, !tbaa !27
  %42 = call i32 @XGrabPointer(ptr noundef %33, i64 noundef %37, i32 noundef 1, i32 noundef 8268, i32 noundef 1, i32 noundef 1, i64 noundef %41, i64 noundef 0, i64 noundef 0)
  %43 = icmp ne i32 0, %42
  br i1 %43, label %44, label %46

44:                                               ; preds = %32
  %45 = call i32 @usleep(i32 noundef 100)
  br label %32, !llvm.loop !28

46:                                               ; preds = %32
  %47 = load ptr, ptr @fgDisplay, align 8, !tbaa !25
  %48 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %49 = getelementptr inbounds %struct.tagSFG_Window, ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds %struct.tagSFG_Context, ptr %49, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !27
  %52 = call i32 @XSetInputFocus(ptr noundef %47, i64 noundef %51, i32 noundef 0, i64 noundef 0)
  %53 = load ptr, ptr @fgDisplay, align 8, !tbaa !25
  %54 = load i64, ptr getelementptr inbounds (%struct.tagSFG_Display, ptr @fgDisplay, i32 0, i32 2), align 8, !tbaa !30
  %55 = load i32, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), align 8, !tbaa !16
  %56 = sdiv i32 %55, 2
  %57 = load i32, ptr getelementptr inbounds (%struct.tagSFG_XYUse, ptr getelementptr inbounds (%struct.tagSFG_State, ptr @fgState, i32 0, i32 21), i32 0, i32 1), align 4, !tbaa !17
  %58 = sdiv i32 %57, 2
  %59 = call i32 @XWarpPointer(ptr noundef %53, i64 noundef 0, i64 noundef %54, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %56, i32 noundef %58)
  %60 = load ptr, ptr @fgDisplay, align 8, !tbaa !25
  %61 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %62 = getelementptr inbounds %struct.tagSFG_Window, ptr %61, i32 0, i32 2
  %63 = getelementptr inbounds %struct.tagSFG_Context, ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !27
  %65 = call i32 @XGrabKeyboard(ptr noundef %60, i64 noundef %64, i32 noundef 0, i32 noundef 1, i32 noundef 1, i64 noundef 0)
  %66 = load ptr, ptr getelementptr inbounds (%struct.tagSFG_Structure, ptr @fgStructure, i32 0, i32 6), align 8, !tbaa !14
  %67 = getelementptr inbounds %struct.tagSFG_Window, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !31
  store i32 %68, ptr %1, align 4
  br label %69

69:                                               ; preds = %46, %14
  %70 = load i32, ptr %1, align 4
  ret i32 %70
}

declare void @fgAddToWindowDestroyList(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @fghRememberState() #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @fghChangeDisplayMode(i8 noundef zeroext) #1

declare ptr @fgCreateWindow(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i8 noundef zeroext) #0

declare i32 @XSync(ptr noundef, i32 noundef) #0

declare i32 @XGrabPointer(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef) #0

declare i32 @usleep(i32 noundef) #0

declare i32 @XSetInputFocus(ptr noundef, i64 noundef, i32 noundef, i64 noundef) #0

declare i32 @XWarpPointer(ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

declare i32 @XGrabKeyboard(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #0

attributes #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 = { 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" }

!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, !9, i64 28}
!6 = !{!"tagSFG_State", !7, i64 0, !7, i64 12, !8, i64 24, !9, i64 28, !8, i64 32, !9, i64 36, !9, i64 37, !9, i64 38, !9, i64 39, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !11, i64 64, !12, i64 72, !12, i64 88, !13, i64 104, !8, i64 112, !13, i64 120, !13, i64 128, !7, i64 136, !8, i64 148, !8, i64 152, !8, i64 156, !8, i64 160, !13, i64 168, !9, i64 176, !9, i64 177, !8, i64 180, !8, i64 184, !8, i64 188, !8, i64 192, !8, i64 196, !8, i64 200}
!7 = !{!"tagSFG_XYUse", !8, i64 0, !8, i64 4, !9, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"tagSFG_List", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!15, !13, i64 72}
!15 = !{!"tagSFG_Structure", !12, i64 0, !12, i64 16, !12, i64 32, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !8, i64 80, !8, i64 84}
!16 = !{!6, !8, i64 136}
!17 = !{!6, !8, i64 140}
!18 = !{!19, !8, i64 56}
!19 = !{!"tagSFG_Window", !20, i64 0, !8, i64 16, !21, i64 24, !22, i64 56, !9, i64 112, !13, i64 304, !9, i64 312, !13, i64 336, !13, i64 344, !12, i64 352, !9, i64 368}
!20 = !{!"tagSFG_Node", !13, i64 0, !13, i64 8}
!21 = !{!"tagSFG_Context", !11, i64 0, !13, i64 8, !13, i64 16, !8, i64 24}
!22 = !{!"tagSFG_WindowState", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !9, i64 16, !9, i64 17, !8, i64 20, !11, i64 24, !11, i64 32, !8, i64 40, !8, i64 44, !9, i64 48, !9, i64 49, !9, i64 50, !9, i64 51}
!23 = !{!19, !8, i64 60}
!24 = !{!19, !9, i64 106}
!25 = !{!26, !13, i64 0}
!26 = !{!"tagSFG_Display", !13, i64 0, !8, i64 8, !11, i64 16, !8, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68}
!27 = !{!19, !11, i64 24}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!26, !11, i64 16}
!31 = !{!19, !8, i64 16}


; 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.tagSFG_State = type { %struct.tagSFG_XYUse, %struct.tagSFG_XYUse, i32, i8, i32, i8, i8, i8, i8, i32, i32, i32, i32, i32, i64, %struct.tagSFG_List, %struct.tagSFG_List, ptr, i32, ptr, ptr, %struct.tagSFG_XYUse, i32, i32, i32, i32, ptr, i8, i8, i32, i32, i32, i32, i32, i32 }
%struct.tagSFG_List = type { ptr, ptr }
%struct.tagSFG_XYUse = type { i32, i32, i8 }
%struct.tagSFG_Structure = type { %struct.tagSFG_List, %struct.tagSFG_List, %struct.tagSFG_List, ptr, ptr, ptr, ptr, i32, i32 }
%struct.tagSFG_Display = type { ptr, i32, i64, i32, i64, i64, i64, i32, i32, i32, i32 }

@fgState = external local_unnamed_addr global %struct.tagSFG_State, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@fgStructure = external local_unnamed_addr global %struct.tagSFG_Structure, align 8
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@fgDisplay = external local_unnamed_addr global %struct.tagSFG_Display, align 8

declare void @fgError(ptr noundef, ...) local_unnamed_addr #0

declare void @fgWarning(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @glutEnterGameMode() local_unnamed_addr #1 {
  %1 = load i8, ptr getelementptr inbounds (i8, ptr @fgState, i64 28), align 4, !tbaa !5
  %.not = icmp eq i8 %1, 0
  br i1 %.not, label %2, label %3

2:                                                ; preds = %0
  tail call void (ptr, ...) @fgError(ptr noundef nonnull @.str, ptr noundef nonnull @.str.10) #2
  br label %3

3:                                                ; preds = %2, %0
  %4 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %.not2 = icmp eq ptr %4, null
  br i1 %.not2, label %6, label %5

5:                                                ; preds = %3
  tail call void @fgAddToWindowDestroyList(ptr noundef nonnull %4) #2
  br label %7

6:                                                ; preds = %3
  tail call void @fghRememberState()
  br label %7

7:                                                ; preds = %6, %5
  %8 = tail call zeroext i8 @fghChangeDisplayMode(i8 noundef zeroext 0)
  %.not3 = icmp eq i8 %8, 0
  br i1 %.not3, label %9, label %10

9:                                                ; preds = %7
  tail call void (ptr, ...) @fgWarning(ptr noundef nonnull @.str.11) #2
  br label %50

10:                                               ; preds = %7
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @fgState, i64 136), align 8, !tbaa !16
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @fgState, i64 140), align 4, !tbaa !17
  %13 = tail call ptr @fgCreateWindow(ptr noundef null, ptr noundef nonnull @.str.12, i8 noundef zeroext 1, i32 noundef 0, i32 noundef 0, i8 noundef zeroext 1, i32 noundef %11, i32 noundef %12, i8 noundef zeroext 1, i8 noundef zeroext 0) #2
  store ptr %13, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %13, i64 56
  %15 = load <2 x i32>, ptr getelementptr inbounds (i8, ptr @fgState, i64 136), align 8, !tbaa !18
  store <2 x i32> %15, ptr %14, align 8, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %13, i64 106
  store i8 1, ptr %16, align 2, !tbaa !19
  %17 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %18 = tail call i32 @XSync(ptr noundef %17, i32 noundef 0) #2
  %19 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %20 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %20, i64 24
  %22 = load i64, ptr %21, align 8, !tbaa !26
  %23 = tail call i32 @XGrabPointer(ptr noundef %19, i64 noundef %22, i32 noundef 1, i32 noundef 8268, i32 noundef 1, i32 noundef 1, i64 noundef %22, i64 noundef 0, i64 noundef 0) #2
  %.not45 = icmp eq i32 %23, 0
  br i1 %.not45, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10, %.lr.ph
  %24 = tail call i32 @usleep(i32 noundef 100) #2
  %25 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %26 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = load i64, ptr %27, align 8, !tbaa !26
  %29 = tail call i32 @XGrabPointer(ptr noundef %25, i64 noundef %28, i32 noundef 1, i32 noundef 8268, i32 noundef 1, i32 noundef 1, i64 noundef %28, i64 noundef 0, i64 noundef 0) #2
  %.not4 = icmp eq i32 %29, 0
  br i1 %.not4, label %._crit_edge, label %.lr.ph, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph, %10
  %30 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load i64, ptr %32, align 8, !tbaa !26
  %34 = tail call i32 @XSetInputFocus(ptr noundef %30, i64 noundef %33, i32 noundef 0, i64 noundef 0) #2
  %35 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %36 = load i64, ptr getelementptr inbounds (i8, ptr @fgDisplay, i64 16), align 8, !tbaa !29
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @fgState, i64 136), align 8, !tbaa !16
  %38 = sdiv i32 %37, 2
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @fgState, i64 140), align 4, !tbaa !17
  %40 = sdiv i32 %39, 2
  %41 = tail call i32 @XWarpPointer(ptr noundef %35, i64 noundef 0, i64 noundef %36, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %38, i32 noundef %40) #2
  %42 = load ptr, ptr @fgDisplay, align 8, !tbaa !24
  %43 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %44 = getelementptr inbounds i8, ptr %43, i64 24
  %45 = load i64, ptr %44, align 8, !tbaa !26
  %46 = tail call i32 @XGrabKeyboard(ptr noundef %42, i64 noundef %45, i32 noundef 0, i32 noundef 1, i32 noundef 1, i64 noundef 0) #2
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @fgStructure, i64 72), align 8, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %49 = load i32, ptr %48, align 8, !tbaa !30
  br label %50

50:                                               ; preds = %._crit_edge, %9
  %.0 = phi i32 [ %49, %._crit_edge ], [ 0, %9 ]
  ret i32 %.0
}

declare void @fgAddToWindowDestroyList(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @fghRememberState() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @fghChangeDisplayMode(i8 noundef zeroext) local_unnamed_addr #1

declare ptr @fgCreateWindow(ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

declare i32 @XSync(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @XGrabPointer(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare i32 @usleep(i32 noundef) local_unnamed_addr #0

declare i32 @XSetInputFocus(ptr noundef, i64 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

declare i32 @XWarpPointer(ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @XGrabKeyboard(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

attributes #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 = { 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 #2 = { 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, !9, i64 28}
!6 = !{!"tagSFG_State", !7, i64 0, !7, i64 12, !8, i64 24, !9, i64 28, !8, i64 32, !9, i64 36, !9, i64 37, !9, i64 38, !9, i64 39, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !11, i64 64, !12, i64 72, !12, i64 88, !13, i64 104, !8, i64 112, !13, i64 120, !13, i64 128, !7, i64 136, !8, i64 148, !8, i64 152, !8, i64 156, !8, i64 160, !13, i64 168, !9, i64 176, !9, i64 177, !8, i64 180, !8, i64 184, !8, i64 188, !8, i64 192, !8, i64 196, !8, i64 200}
!7 = !{!"tagSFG_XYUse", !8, i64 0, !8, i64 4, !9, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"tagSFG_List", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!15, !13, i64 72}
!15 = !{!"tagSFG_Structure", !12, i64 0, !12, i64 16, !12, i64 32, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !8, i64 80, !8, i64 84}
!16 = !{!6, !8, i64 136}
!17 = !{!6, !8, i64 140}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !9, i64 106}
!20 = !{!"tagSFG_Window", !21, i64 0, !8, i64 16, !22, i64 24, !23, i64 56, !9, i64 112, !13, i64 304, !9, i64 312, !13, i64 336, !13, i64 344, !12, i64 352, !9, i64 368}
!21 = !{!"tagSFG_Node", !13, i64 0, !13, i64 8}
!22 = !{!"tagSFG_Context", !11, i64 0, !13, i64 8, !13, i64 16, !8, i64 24}
!23 = !{!"tagSFG_WindowState", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !9, i64 16, !9, i64 17, !8, i64 20, !11, i64 24, !11, i64 32, !8, i64 40, !8, i64 44, !9, i64 48, !9, i64 49, !9, i64 50, !9, i64 51}
!24 = !{!25, !13, i64 0}
!25 = !{!"tagSFG_Display", !13, i64 0, !8, i64 8, !11, i64 16, !8, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68}
!26 = !{!20, !11, i64 24}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!25, !11, i64 16}
!30 = !{!20, !8, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass