; LLVM IR from PyCee/NUS_library :: src/io (NUS_window)

; 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.xcb_screen_iterator_t = type { ptr, i32, i32 }
%struct.xcb_void_cookie_t = type { i32 }
%struct.xcb_intern_atom_cookie_t = type { i32 }
%struct.NUS_window = type { ptr, i16, i16, ptr, ptr, i32, %struct.xcb_intern_atom_cookie_t, ptr, %struct.xcb_intern_atom_cookie_t, ptr }
%struct.xcb_screen_t = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i32, i8, i8, i8, i8 }
%struct.xcb_intern_atom_reply_t = type { i8, i8, i16, i32, i32 }

@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @nus_window_build(ptr noundef %0, i16 noundef zeroext %1, i16 noundef zeroext %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca [2 x i32], align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.xcb_screen_iterator_t, align 8
  %14 = alloca %struct.xcb_void_cookie_t, align 4
  %15 = alloca %struct.xcb_void_cookie_t, align 4
  %16 = alloca %struct.xcb_intern_atom_cookie_t, align 4
  %17 = alloca %struct.xcb_intern_atom_cookie_t, align 4
  %18 = alloca %struct.xcb_void_cookie_t, align 4
  %19 = alloca %struct.xcb_void_cookie_t, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i16 %1, ptr %7, align 2, !tbaa !9
  store i16 %2, ptr %8, align 2, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call i64 @strlen(ptr noundef %20) #7
  %22 = add i64 %21, 1
  %23 = mul i64 8, %22
  %24 = call noalias ptr @malloc(i64 noundef %23) #8
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.NUS_window, ptr %25, i32 0, i32 0
  store ptr %24, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.NUS_window, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call ptr @strcpy(ptr noundef %29, ptr noundef %30) #9
  %32 = load i16, ptr %7, align 2, !tbaa !9
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.NUS_window, ptr %33, i32 0, i32 1
  store i16 %32, ptr %34, align 8, !tbaa !15
  %35 = load i16, ptr %8, align 2, !tbaa !9
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.NUS_window, ptr %36, i32 0, i32 2
  store i16 %35, ptr %37, align 2, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %38 = call ptr @xcb_connect(ptr noundef null, ptr noundef null)
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.NUS_window, ptr %39, i32 0, i32 3
  store ptr %38, ptr %40, align 8, !tbaa !17
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.NUS_window, ptr %41, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = call i32 @xcb_connection_has_error(ptr noundef %43)
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %4
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %170

48:                                               ; preds = %4
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.NUS_window, ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = call ptr @xcb_get_setup(ptr noundef %51)
  %53 = call { ptr, i64 } @xcb_setup_roots_iterator(ptr noundef %52)
  %54 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %55 = extractvalue { ptr, i64 } %53, 0
  store ptr %55, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %57 = extractvalue { ptr, i64 } %53, 1
  store i64 %57, ptr %56, align 8
  %58 = getelementptr inbounds %struct.xcb_screen_iterator_t, ptr %13, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.NUS_window, ptr %60, i32 0, i32 4
  store ptr %59, ptr %61, align 8, !tbaa !20
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.NUS_window, ptr %62, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = call i32 @xcb_generate_id(ptr noundef %64)
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.NUS_window, ptr %66, i32 0, i32 5
  store i32 %65, ptr %67, align 8, !tbaa !21
  store i32 2048, ptr %10, align 4, !tbaa !22
  %68 = getelementptr inbounds [2 x i32], ptr %11, i64 0, i64 0
  store i32 41039, ptr %68, align 4, !tbaa !22
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NUS_window, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.NUS_window, ptr %72, i32 0, i32 5
  %74 = load i32, ptr %73, align 8, !tbaa !21
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.NUS_window, ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = getelementptr inbounds %struct.xcb_screen_t, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !23
  %80 = load i16, ptr %7, align 2, !tbaa !9
  %81 = load i16, ptr %8, align 2, !tbaa !9
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.NUS_window, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !20
  %85 = getelementptr inbounds %struct.xcb_screen_t, ptr %84, i32 0, i32 11
  %86 = load i32, ptr %85, align 4, !tbaa !25
  %87 = load i32, ptr %10, align 4, !tbaa !22
  %88 = getelementptr inbounds [2 x i32], ptr %11, i64 0, i64 0
  %89 = call i32 @xcb_create_window(ptr noundef %71, i8 noundef zeroext 0, i32 noundef %74, i32 noundef %79, i16 noundef signext 0, i16 noundef signext 0, i16 noundef zeroext %80, i16 noundef zeroext %81, i16 noundef zeroext 10, i16 noundef zeroext 1, i32 noundef %86, i32 noundef %87, ptr noundef %88)
  %90 = getelementptr inbounds %struct.xcb_void_cookie_t, ptr %14, i32 0, i32 0
  store i32 %89, ptr %90, align 4
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.NUS_window, ptr %91, i32 0, i32 3
  %93 = load ptr, ptr %92, align 8, !tbaa !17
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.NUS_window, ptr %94, i32 0, i32 5
  %96 = load i32, ptr %95, align 8, !tbaa !21
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.NUS_window, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  %100 = call i64 @strlen(ptr noundef %99) #7
  %101 = trunc i64 %100 to i32
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.NUS_window, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = call i32 @xcb_change_property(ptr noundef %93, i8 noundef zeroext 0, i32 noundef %96, i32 noundef 39, i32 noundef 31, i8 noundef zeroext 8, i32 noundef %101, ptr noundef %104)
  %106 = getelementptr inbounds %struct.xcb_void_cookie_t, ptr %15, i32 0, i32 0
  store i32 %105, ptr %106, align 4
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.NUS_window, ptr %107, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.NUS_window, ptr %109, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !17
  %112 = call i32 @xcb_intern_atom(ptr noundef %111, i8 noundef zeroext 1, i16 noundef zeroext 12, ptr noundef @.str.1)
  %113 = getelementptr inbounds %struct.xcb_intern_atom_cookie_t, ptr %16, i32 0, i32 0
  store i32 %112, ptr %113, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %108, ptr align 4 %16, i64 4, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.NUS_window, ptr %114, i32 0, i32 3
  %116 = load ptr, ptr %115, align 8, !tbaa !17
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.NUS_window, ptr %117, i32 0, i32 6
  %119 = getelementptr inbounds %struct.xcb_intern_atom_cookie_t, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4
  %121 = call ptr @xcb_intern_atom_reply(ptr noundef %116, i32 %120, ptr noundef null)
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.NUS_window, ptr %122, i32 0, i32 7
  store ptr %121, ptr %123, align 8, !tbaa !27
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.NUS_window, ptr %124, i32 0, i32 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.NUS_window, ptr %126, i32 0, i32 3
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %129 = call i32 @xcb_intern_atom(ptr noundef %128, i8 noundef zeroext 0, i16 noundef zeroext 16, ptr noundef @.str.2)
  %130 = getelementptr inbounds %struct.xcb_intern_atom_cookie_t, ptr %17, i32 0, i32 0
  store i32 %129, ptr %130, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %125, ptr align 4 %17, i64 4, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.NUS_window, ptr %131, i32 0, i32 3
  %133 = load ptr, ptr %132, align 8, !tbaa !17
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.NUS_window, ptr %134, i32 0, i32 8
  %136 = getelementptr inbounds %struct.xcb_intern_atom_cookie_t, ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 8
  %138 = call ptr @xcb_intern_atom_reply(ptr noundef %133, i32 %137, ptr noundef null)
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.NUS_window, ptr %139, i32 0, i32 9
  store ptr %138, ptr %140, align 8, !tbaa !28
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.NUS_window, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.NUS_window, ptr %144, i32 0, i32 5
  %146 = load i32, ptr %145, align 8, !tbaa !21
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.NUS_window, ptr %147, i32 0, i32 7
  %149 = load ptr, ptr %148, align 8, !tbaa !27
  %150 = getelementptr inbounds %struct.xcb_intern_atom_reply_t, ptr %149, i32 0, i32 4
  %151 = load i32, ptr %150, align 4, !tbaa !29
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.NUS_window, ptr %152, i32 0, i32 9
  %154 = load ptr, ptr %153, align 8, !tbaa !28
  %155 = getelementptr inbounds %struct.xcb_intern_atom_reply_t, ptr %154, i32 0, i32 4
  %156 = call i32 @xcb_change_property(ptr noundef %143, i8 noundef zeroext 0, i32 noundef %146, i32 noundef %151, i32 noundef 4, i8 noundef zeroext 32, i32 noundef 1, ptr noundef %155)
  %157 = getelementptr inbounds %struct.xcb_void_cookie_t, ptr %18, i32 0, i32 0
  store i32 %156, ptr %157, align 4
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.NUS_window, ptr %158, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !17
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.NUS_window, ptr %161, i32 0, i32 5
  %163 = load i32, ptr %162, align 8, !tbaa !21
  %164 = call i32 @xcb_map_window(ptr noundef %160, i32 noundef %163)
  %165 = getelementptr inbounds %struct.xcb_void_cookie_t, ptr %19, i32 0, i32 0
  store i32 %164, ptr %165, align 4
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.NUS_window, ptr %166, i32 0, i32 3
  %168 = load ptr, ptr %167, align 8, !tbaa !17
  %169 = call i32 @xcb_flush(ptr noundef %168)
  store i32 0, ptr %12, align 4
  br label %170

170:                                              ; preds = %48, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  %171 = load i32, ptr %12, align 4
  switch i32 %171, label %175 [
    i32 0, label %172
    i32 1, label %173
  ]

172:                                              ; preds = %170
  store i32 1, ptr %5, align 4
  br label %173

173:                                              ; preds = %172, %170
  %174 = load i32, ptr %5, align 4
  ret i32 %174

175:                                              ; preds = %170
  unreachable
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

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

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

declare ptr @xcb_connect(ptr noundef, ptr noundef) #5

declare i32 @xcb_connection_has_error(ptr noundef) #5

declare i32 @printf(ptr noundef, ...) #5

declare { ptr, i64 } @xcb_setup_roots_iterator(ptr noundef) #5

declare ptr @xcb_get_setup(ptr noundef) #5

declare i32 @xcb_generate_id(ptr noundef) #5

declare i32 @xcb_create_window(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i16 noundef signext, i16 noundef signext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i32 noundef, i32 noundef, ptr noundef) #5

declare i32 @xcb_change_property(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, ptr noundef) #5

declare i32 @xcb_intern_atom(ptr noundef, i8 noundef zeroext, i16 noundef zeroext, ptr noundef) #5

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

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

declare ptr @xcb_intern_atom_reply(ptr noundef, i32, ptr noundef) #5

declare i32 @xcb_map_window(ptr noundef, i32 noundef) #5

declare i32 @xcb_flush(ptr noundef) #5

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 = { nounwind allocsize(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 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 #3 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"NUS_window", !6, i64 0, !10, i64 8, !10, i64 10, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 36, !6, i64 40, !14, i64 48, !6, i64 56}
!13 = !{!"int", !7, i64 0}
!14 = !{!"xcb_intern_atom_cookie_t", !13, i64 0}
!15 = !{!12, !10, i64 8}
!16 = !{!12, !10, i64 10}
!17 = !{!12, !6, i64 16}
!18 = !{!19, !6, i64 0}
!19 = !{!"xcb_screen_iterator_t", !6, i64 0, !13, i64 8, !13, i64 12}
!20 = !{!12, !6, i64 24}
!21 = !{!12, !13, i64 32}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !13, i64 0}
!24 = !{!"xcb_screen_t", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !13, i64 32, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39}
!25 = !{!24, !13, i64 32}
!26 = !{i64 0, i64 4, !22}
!27 = !{!12, !6, i64 40}
!28 = !{!12, !6, i64 56}
!29 = !{!30, !13, i64 8}
!30 = !{!"xcb_intern_atom_reply_t", !7, i64 0, !7, i64 1, !10, i64 2, !13, i64 4, !13, i64 8}


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

@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @nus_window_build(ptr nocapture noundef readonly %0, i16 noundef zeroext %1, i16 noundef zeroext %2, ptr nocapture noundef %3) local_unnamed_addr #0 {
  %5 = alloca [2 x i32], align 4
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #7
  %7 = shl i64 %6, 3
  %8 = add i64 %7, 8
  %9 = tail call noalias ptr @malloc(i64 noundef %8) #8
  store ptr %9, ptr %3, align 8, !tbaa !5
  %10 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) %0) #9
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  store i16 %1, ptr %11, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %3, i64 10
  store i16 %2, ptr %12, align 2, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %13 = tail call ptr @xcb_connect(ptr noundef null, ptr noundef null) #9
  %14 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %13, ptr %14, align 8, !tbaa !15
  %15 = tail call i32 @xcb_connection_has_error(ptr noundef %13) #9
  %16 = icmp slt i32 %15, 1
  br i1 %16, label %19, label %17

17:                                               ; preds = %4
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %64

19:                                               ; preds = %4
  %20 = load ptr, ptr %14, align 8, !tbaa !15
  %21 = tail call ptr @xcb_get_setup(ptr noundef %20) #9
  %22 = tail call { ptr, i64 } @xcb_setup_roots_iterator(ptr noundef %21) #9
  %23 = extractvalue { ptr, i64 } %22, 0
  %24 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %23, ptr %24, align 8, !tbaa !16
  %25 = load ptr, ptr %14, align 8, !tbaa !15
  %26 = tail call i32 @xcb_generate_id(ptr noundef %25) #9
  %27 = getelementptr inbounds i8, ptr %3, i64 32
  store i32 %26, ptr %27, align 8, !tbaa !17
  store i32 41039, ptr %5, align 4, !tbaa !18
  %28 = load ptr, ptr %14, align 8, !tbaa !15
  %29 = load ptr, ptr %24, align 8, !tbaa !16
  %30 = load i32, ptr %29, align 4, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %29, i64 32
  %32 = load i32, ptr %31, align 4, !tbaa !21
  %33 = call i32 @xcb_create_window(ptr noundef %28, i8 noundef zeroext 0, i32 noundef %26, i32 noundef %30, i16 noundef signext 0, i16 noundef signext 0, i16 noundef zeroext %1, i16 noundef zeroext %2, i16 noundef zeroext 10, i16 noundef zeroext 1, i32 noundef %32, i32 noundef 2048, ptr noundef nonnull %5) #9
  %34 = load ptr, ptr %14, align 8, !tbaa !15
  %35 = load i32, ptr %27, align 8, !tbaa !17
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %36) #7
  %38 = trunc i64 %37 to i32
  %39 = call i32 @xcb_change_property(ptr noundef %34, i8 noundef zeroext 0, i32 noundef %35, i32 noundef 39, i32 noundef 31, i8 noundef zeroext 8, i32 noundef %38, ptr noundef %36) #9
  %40 = getelementptr inbounds i8, ptr %3, i64 36
  %41 = load ptr, ptr %14, align 8, !tbaa !15
  %42 = call i32 @xcb_intern_atom(ptr noundef %41, i8 noundef zeroext 1, i16 noundef zeroext 12, ptr noundef nonnull @.str.1) #9
  store i32 %42, ptr %40, align 4, !tbaa !18
  %43 = load ptr, ptr %14, align 8, !tbaa !15
  %44 = call ptr @xcb_intern_atom_reply(ptr noundef %43, i32 %42, ptr noundef null) #9
  %45 = getelementptr inbounds i8, ptr %3, i64 40
  store ptr %44, ptr %45, align 8, !tbaa !22
  %46 = getelementptr inbounds i8, ptr %3, i64 48
  %47 = load ptr, ptr %14, align 8, !tbaa !15
  %48 = call i32 @xcb_intern_atom(ptr noundef %47, i8 noundef zeroext 0, i16 noundef zeroext 16, ptr noundef nonnull @.str.2) #9
  store i32 %48, ptr %46, align 8, !tbaa !18
  %49 = load ptr, ptr %14, align 8, !tbaa !15
  %50 = call ptr @xcb_intern_atom_reply(ptr noundef %49, i32 %48, ptr noundef null) #9
  %51 = getelementptr inbounds i8, ptr %3, i64 56
  store ptr %50, ptr %51, align 8, !tbaa !23
  %52 = load ptr, ptr %14, align 8, !tbaa !15
  %53 = load i32, ptr %27, align 8, !tbaa !17
  %54 = load ptr, ptr %45, align 8, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load i32, ptr %55, align 4, !tbaa !24
  %57 = getelementptr inbounds i8, ptr %50, i64 8
  %58 = call i32 @xcb_change_property(ptr noundef %52, i8 noundef zeroext 0, i32 noundef %53, i32 noundef %56, i32 noundef 4, i8 noundef zeroext 32, i32 noundef 1, ptr noundef nonnull %57) #9
  %59 = load ptr, ptr %14, align 8, !tbaa !15
  %60 = load i32, ptr %27, align 8, !tbaa !17
  %61 = call i32 @xcb_map_window(ptr noundef %59, i32 noundef %60) #9
  %62 = load ptr, ptr %14, align 8, !tbaa !15
  %63 = call i32 @xcb_flush(ptr noundef %62) #9
  br label %64

64:                                               ; preds = %19, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  %spec.select = zext i1 %16 to i32
  ret i32 %spec.select
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

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

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

declare ptr @xcb_connect(ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @xcb_connection_has_error(ptr noundef) local_unnamed_addr #5

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

declare { ptr, i64 } @xcb_setup_roots_iterator(ptr noundef) local_unnamed_addr #5

declare ptr @xcb_get_setup(ptr noundef) local_unnamed_addr #5

declare i32 @xcb_generate_id(ptr noundef) local_unnamed_addr #5

declare i32 @xcb_create_window(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i16 noundef signext, i16 noundef signext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare i32 @xcb_change_property(ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext, i32 noundef, ptr noundef) local_unnamed_addr #5

declare i32 @xcb_intern_atom(ptr noundef, i8 noundef zeroext, i16 noundef zeroext, ptr noundef) local_unnamed_addr #5

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

declare ptr @xcb_intern_atom_reply(ptr noundef, i32, ptr noundef) local_unnamed_addr #5

declare i32 @xcb_map_window(ptr noundef, i32 noundef) local_unnamed_addr #5

declare i32 @xcb_flush(ptr noundef) local_unnamed_addr #5

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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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, !7, i64 0}
!6 = !{!"NUS_window", !7, i64 0, !10, i64 8, !10, i64 10, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 36, !7, i64 40, !12, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"xcb_intern_atom_cookie_t", !11, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !10, i64 10}
!15 = !{!6, !7, i64 16}
!16 = !{!6, !7, i64 24}
!17 = !{!6, !11, i64 32}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"xcb_screen_t", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !11, i64 32, !8, i64 36, !8, i64 37, !8, i64 38, !8, i64 39}
!21 = !{!20, !11, i64 32}
!22 = !{!6, !7, i64 40}
!23 = !{!6, !7, i64 56}
!24 = !{!25, !11, i64 8}
!25 = !{!"xcb_intern_atom_reply_t", !8, i64 0, !8, i64 1, !10, i64 2, !11, i64 4, !11, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass