; LLVM IR from leonmavr/gfx-v4 :: src (gfx)

; 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.XSetWindowAttributes = type { i64, i64, i64, i64, i32, i32, i32, i64, i64, i32, i64, i64, i32, i64, i64 }
%union._XEvent = type { [24 x i64] }
%struct.anon = type { ptr, ptr, i32, i32, i32, i32, ptr, i64, i64, i64, i32, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, ptr, i64, i64, i32, i32, ptr, ptr, i32, ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }
%struct.Visual = type { ptr, i64, i32, i64, i64, i64, i32, i32 }

@gfx_display = external hidden global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [47 x i8], align 1
@gfx_fast_color_mode = external hidden global i32, align 4
@gfx_window = external hidden global i64, align 8
@gfx_gc = external hidden global ptr, align 8
@gfx_colormap = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local void @gfx_open(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.XSetWindowAttributes, align 8
  %11 = alloca %union._XEvent, align 8
  %12 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  %13 = call ptr @XOpenDisplay(ptr noundef null)
  store ptr %13, ptr @gfx_display, align 8, !tbaa !9
  %14 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %19, label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str) #5
  call void @exit(i32 noundef 1) #6
  unreachable

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %20 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.anon, ptr %20, i32 0, i32 35
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.Screen, ptr %22, i64 0
  %24 = getelementptr inbounds %struct.Screen, ptr %23, i32 0, i32 10
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  store ptr %25, ptr %7, align 8, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %34

28:                                               ; preds = %19
  %29 = load ptr, ptr %7, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.Visual, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 8, !tbaa !16
  %32 = icmp eq i32 %31, 4
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  store i32 1, ptr @gfx_fast_color_mode, align 4, !tbaa !5
  br label %35

34:                                               ; preds = %28, %19
  store i32 0, ptr @gfx_fast_color_mode, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %34, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %36 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.anon, ptr %36, i32 0, i32 35
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.anon, ptr %39, i32 0, i32 33
  %41 = load i32, ptr %40, align 8, !tbaa !18
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.Screen, ptr %38, i64 %42
  %44 = getelementptr inbounds %struct.Screen, ptr %43, i32 0, i32 14
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = trunc i64 %45 to i32
  store i32 %46, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %47 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.anon, ptr %47, i32 0, i32 35
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.anon, ptr %50, i32 0, i32 33
  %52 = load i32, ptr %51, align 8, !tbaa !18
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds %struct.Screen, ptr %49, i64 %53
  %55 = getelementptr inbounds %struct.Screen, ptr %54, i32 0, i32 13
  %56 = load i64, ptr %55, align 8, !tbaa !20
  %57 = trunc i64 %56 to i32
  store i32 %57, ptr %9, align 4, !tbaa !5
  %58 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %59 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 35
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.anon, ptr %62, i32 0, i32 33
  %64 = load i32, ptr %63, align 8, !tbaa !18
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.Screen, ptr %61, i64 %65
  %67 = getelementptr inbounds %struct.Screen, ptr %66, i32 0, i32 2
  %68 = load i64, ptr %67, align 8, !tbaa !21
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = call i64 @XCreateSimpleWindow(ptr noundef %58, i64 noundef %68, i32 noundef 0, i32 noundef 0, i32 noundef %69, i32 noundef %70, i32 noundef 0, i64 noundef %72, i64 noundef %74)
  store i64 %75, ptr @gfx_window, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 112, ptr %10) #5
  %76 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %10, i32 0, i32 6
  store i32 2, ptr %76, align 8, !tbaa !23
  %77 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %78 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %79 = call i32 @XChangeWindowAttributes(ptr noundef %77, i64 noundef %78, i64 noundef 64, ptr noundef %10)
  %80 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %81 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %82 = load ptr, ptr %6, align 8, !tbaa !9
  %83 = call i32 @XStoreName(ptr noundef %80, i64 noundef %81, ptr noundef %82)
  %84 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %85 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %86 = call i32 @XSelectInput(ptr noundef %84, i64 noundef %85, i64 noundef 131077)
  %87 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %88 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %89 = call i32 @XMapWindow(ptr noundef %87, i64 noundef %88)
  %90 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %91 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %92 = call ptr @XCreateGC(ptr noundef %90, i64 noundef %91, i64 noundef 0, ptr noundef null)
  store ptr %92, ptr @gfx_gc, align 8, !tbaa !9
  %93 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.anon, ptr %93, i32 0, i32 35
  %95 = load ptr, ptr %94, align 8, !tbaa !11
  %96 = getelementptr inbounds %struct.Screen, ptr %95, i64 0
  %97 = getelementptr inbounds %struct.Screen, ptr %96, i32 0, i32 12
  %98 = load i64, ptr %97, align 8, !tbaa !25
  store i64 %98, ptr @gfx_colormap, align 8, !tbaa !22
  %99 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %100 = load ptr, ptr @gfx_gc, align 8, !tbaa !9
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = call i32 @XSetForeground(ptr noundef %99, ptr noundef %100, i64 noundef %102)
  br label %104

104:                                              ; preds = %113, %35
  call void @llvm.lifetime.start.p0(i64 192, ptr %11) #5
  %105 = load ptr, ptr @gfx_display, align 8, !tbaa !9
  %106 = call i32 @XNextEvent(ptr noundef %105, ptr noundef %11)
  %107 = load i32, ptr %11, align 8, !tbaa !26
  %108 = icmp eq i32 %107, 19
  br i1 %108, label %109, label %110

109:                                              ; preds = %104
  store i32 2, ptr %12, align 4
  br label %111

110:                                              ; preds = %104
  store i32 0, ptr %12, align 4
  br label %111

111:                                              ; preds = %110, %109
  call void @llvm.lifetime.end.p0(i64 192, ptr %11) #5
  %112 = load i32, ptr %12, align 4
  switch i32 %112, label %115 [
    i32 0, label %113
    i32 2, label %114
  ]

113:                                              ; preds = %111
  br label %104

114:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 112, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

115:                                              ; preds = %111
  unreachable
}

declare ptr @XOpenDisplay(ptr noundef) #1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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

declare i64 @XCreateSimpleWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef) #1

declare i32 @XChangeWindowAttributes(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

declare i32 @XStoreName(ptr noundef, i64 noundef, ptr noundef) #1

declare i32 @XSelectInput(ptr noundef, i64 noundef, i64 noundef) #1

declare i32 @XMapWindow(ptr noundef, i64 noundef) #1

declare ptr @XCreateGC(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

declare i32 @XSetForeground(ptr noundef, ptr noundef, i64 noundef) #1

declare i32 @XNextEvent(ptr noundef, ptr noundef) #1

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !10, i64 232}
!12 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !10, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !10, i64 104, !6, i64 112, !6, i64 116, !10, i64 120, !10, i64 128, !6, i64 136, !13, i64 144, !13, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !6, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !6, i64 224, !6, i64 228, !10, i64 232, !13, i64 240, !13, i64 248, !6, i64 256, !6, i64 260, !10, i64 264, !10, i64 272, !6, i64 280, !10, i64 288}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 64}
!15 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !10, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !13, i64 120}
!16 = !{!17, !6, i64 16}
!17 = !{!"", !10, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !6, i64 48, !6, i64 52}
!18 = !{!12, !6, i64 224}
!19 = !{!15, !13, i64 96}
!20 = !{!15, !13, i64 88}
!21 = !{!15, !13, i64 16}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !6, i64 40}
!24 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !13, i64 48, !13, i64 56, !6, i64 64, !13, i64 72, !13, i64 80, !6, i64 88, !13, i64 96, !13, i64 104}
!25 = !{!15, !13, i64 80}
!26 = !{!7, !7, i64 0}


; 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.XSetWindowAttributes = type { i64, i64, i64, i64, i32, i32, i32, i64, i64, i32, i64, i64, i32, i64, i64 }
%union._XEvent = type { [24 x i64] }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

@gfx_display = external hidden local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [47 x i8], align 1
@gfx_fast_color_mode = external hidden local_unnamed_addr global i32, align 4
@gfx_window = external hidden local_unnamed_addr global i64, align 8
@gfx_gc = external hidden local_unnamed_addr global ptr, align 8
@gfx_colormap = external hidden local_unnamed_addr global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local void @gfx_open(i32 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.XSetWindowAttributes, align 8
  %5 = alloca %union._XEvent, align 8
  %6 = tail call ptr @XOpenDisplay(ptr noundef null) #5
  store ptr %6, ptr @gfx_display, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %10

7:                                                ; preds = %3
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %6, i64 232
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %12, i64 64
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %.not10 = icmp eq ptr %14, null
  br i1 %.not10, label %19, label %15

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %14, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !15
  %18 = icmp eq i32 %17, 4
  br i1 %18, label %20, label %19

19:                                               ; preds = %15, %10
  br label %20

20:                                               ; preds = %15, %19
  %storemerge = phi i32 [ 0, %19 ], [ 1, %15 ]
  store i32 %storemerge, ptr @gfx_fast_color_mode, align 4, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %6, i64 224
  %22 = load i32, ptr %21, align 8, !tbaa !18
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds %struct.Screen, ptr %12, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 96
  %26 = load i64, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %24, i64 88
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %24, i64 16
  %30 = load i64, ptr %29, align 8, !tbaa !21
  %sext = shl i64 %26, 32
  %31 = ashr exact i64 %sext, 32
  %32 = tail call i64 @XCreateSimpleWindow(ptr noundef nonnull %6, i64 noundef %30, i32 noundef 0, i32 noundef 0, i32 noundef %0, i32 noundef %1, i32 noundef 0, i64 noundef %31, i64 noundef %31) #5
  store i64 %32, ptr @gfx_window, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %4) #5
  %33 = getelementptr inbounds i8, ptr %4, i64 40
  store i32 2, ptr %33, align 8, !tbaa !23
  %34 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %35 = call i32 @XChangeWindowAttributes(ptr noundef %34, i64 noundef %32, i64 noundef 64, ptr noundef nonnull %4) #5
  %36 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %37 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %38 = call i32 @XStoreName(ptr noundef %36, i64 noundef %37, ptr noundef %2) #5
  %39 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %40 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %41 = call i32 @XSelectInput(ptr noundef %39, i64 noundef %40, i64 noundef 131077) #5
  %42 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %43 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %44 = call i32 @XMapWindow(ptr noundef %42, i64 noundef %43) #5
  %45 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %46 = load i64, ptr @gfx_window, align 8, !tbaa !22
  %47 = call ptr @XCreateGC(ptr noundef %45, i64 noundef %46, i64 noundef 0, ptr noundef null) #5
  store ptr %47, ptr @gfx_gc, align 8, !tbaa !5
  %48 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 232
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %50, i64 80
  %52 = load i64, ptr %51, align 8, !tbaa !25
  store i64 %52, ptr @gfx_colormap, align 8, !tbaa !22
  %sext11 = shl i64 %28, 32
  %53 = ashr exact i64 %sext11, 32
  %54 = call i32 @XSetForeground(ptr noundef %48, ptr noundef %47, i64 noundef %53) #5
  br label %55

55:                                               ; preds = %55, %20
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %5) #5
  %56 = load ptr, ptr @gfx_display, align 8, !tbaa !5
  %57 = call i32 @XNextEvent(ptr noundef %56, ptr noundef nonnull %5) #5
  %58 = load i32, ptr %5, align 8, !tbaa !26
  %59 = icmp eq i32 %58, 19
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %5) #5
  br i1 %59, label %60, label %55

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %4) #5
  ret void
}

declare ptr @XOpenDisplay(ptr noundef) local_unnamed_addr #1

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

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

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

declare i64 @XCreateSimpleWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare i32 @XChangeWindowAttributes(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XStoreName(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XSelectInput(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

declare i32 @XMapWindow(ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @XCreateGC(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XSetForeground(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @XNextEvent(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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, !6, i64 232}
!10 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !6, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !11, i64 64, !6, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !6, i64 120, !6, i64 128, !11, i64 136, !12, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !11, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !11, i64 224, !11, i64 228, !6, i64 232, !12, i64 240, !12, i64 248, !11, i64 256, !11, i64 260, !6, i64 264, !6, i64 272, !11, i64 280, !6, i64 288}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 64}
!14 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !6, i64 48, !11, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !12, i64 120}
!15 = !{!16, !11, i64 16}
!16 = !{!"", !6, i64 0, !12, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !11, i64 48, !11, i64 52}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !11, i64 224}
!19 = !{!14, !12, i64 96}
!20 = !{!14, !12, i64 88}
!21 = !{!14, !12, i64 16}
!22 = !{!12, !12, i64 0}
!23 = !{!24, !11, i64 40}
!24 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !12, i64 56, !11, i64 64, !12, i64 72, !12, i64 80, !11, i64 88, !12, i64 96, !12, i64 104}
!25 = !{!14, !12, i64 80}
!26 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass