; LLVM IR from 0intro/wmii :: lib/libstuff/x11/windows (createwindow_visual)

; 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.Rectangle = type { %struct.Point, %struct.Point }
%struct.Point = type { i32, i32 }
%struct.XSetWindowAttributes = type { i64, i64, i64, i64, i32, i32, i32, i64, i64, i32, i64, i64, i32, i64, i64 }
%struct.Window = type { i32, i64, ptr, ptr, ptr, i64, ptr, %struct.Rectangle, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Ewmh, i64, ptr, ptr, i8, i32, i32 }
%struct.Ewmh = type { i64, i64, i64 }

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.createwindow_visual = external hidden unnamed_addr constant [89 x i8], align 1
@display = external global ptr, align 8
@pid = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@hostname = external hidden global [65 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @createwindow_visual(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7) #0 {
  %9 = alloca %struct.Rectangle, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %struct.XSetWindowAttributes, align 8
  %18 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  store i64 %1, ptr %18, align 4
  %19 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  store i64 %2, ptr %19, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !5
  store i32 %7, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %17) #7
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Window, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %8
  br label %26

25:                                               ; preds = %8
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 18, ptr noundef @__PRETTY_FUNCTION__.createwindow_visual) #8
  unreachable

26:                                               ; preds = %24
  %27 = load ptr, ptr %14, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  store ptr %17, ptr %14, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %29, %26
  %31 = call ptr @emallocz(i32 noundef 192)
  store ptr %31, ptr %16, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %16, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Window, ptr %33, i32 0, i32 4
  store ptr %32, ptr %34, align 8, !tbaa !18
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Window, ptr %35, i32 0, i32 0
  store i32 0, ptr %36, align 8, !tbaa !11
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load ptr, ptr %16, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Window, ptr %38, i32 0, i32 9
  store ptr %37, ptr %39, align 8, !tbaa !19
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = and i64 %41, 8192
  %43 = icmp ne i64 %42, 0
  br i1 %43, label %44, label %50

44:                                               ; preds = %30
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %45, i32 0, i32 13
  %47 = load i64, ptr %46, align 8, !tbaa !20
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Window, ptr %48, i32 0, i32 5
  store i64 %47, ptr %49, align 8, !tbaa !22
  br label %50

50:                                               ; preds = %44, %30
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = and i64 %52, 2048
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %61

55:                                               ; preds = %50
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.XSetWindowAttributes, ptr %56, i32 0, i32 10
  %58 = load i64, ptr %57, align 8, !tbaa !23
  %59 = load ptr, ptr %16, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Window, ptr %59, i32 0, i32 16
  store i64 %58, ptr %60, align 8, !tbaa !24
  br label %61

61:                                               ; preds = %55, %50
  %62 = load ptr, ptr @display, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Window, ptr %63, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !25
  %66 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %67 = getelementptr inbounds %struct.Point, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 4, !tbaa !26
  %69 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %70 = getelementptr inbounds %struct.Point, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !27
  %72 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 1
  %73 = getelementptr inbounds %struct.Point, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !28
  %75 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %76 = getelementptr inbounds %struct.Point, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !26
  %78 = sub nsw i32 %74, %77
  %79 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 1
  %80 = getelementptr inbounds %struct.Point, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !29
  %82 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %83 = getelementptr inbounds %struct.Point, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !27
  %85 = sub nsw i32 %81, %84
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = call i64 @XCreateWindow(ptr noundef %62, i64 noundef %65, i32 noundef %68, i32 noundef %71, i32 noundef %78, i32 noundef %85, i32 noundef 0, i32 noundef %86, i32 noundef %87, ptr noundef %88, i64 noundef %90, ptr noundef %91)
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Window, ptr %93, i32 0, i32 1
  store i64 %92, ptr %94, align 8, !tbaa !25
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = icmp ne i32 %95, 2
  br i1 %96, label %97, label %105

97:                                               ; preds = %61
  %98 = load ptr, ptr @display, align 8, !tbaa !5
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Window, ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !25
  %102 = call ptr @XCreateGC(ptr noundef %98, i64 noundef %101, i64 noundef 0, ptr noundef null)
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Window, ptr %103, i32 0, i32 3
  store ptr %102, ptr %104, align 8, !tbaa !30
  br label %105

105:                                              ; preds = %97, %61
  %106 = load i64, ptr @pid, align 8, !tbaa !31
  %107 = icmp eq i64 %106, 0
  br i1 %107, label %108, label %111

108:                                              ; preds = %105
  %109 = call i32 @getpid() #7
  %110 = sext i32 %109 to i64
  store i64 %110, ptr @pid, align 8, !tbaa !31
  br label %111

111:                                              ; preds = %108, %105
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  call void @changeprop_long(ptr noundef %112, ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef @pid, i32 noundef 1)
  %113 = load i8, ptr @hostname, align 16, !tbaa !32
  %114 = icmp ne i8 %113, 0
  br i1 %114, label %117, label %115

115:                                              ; preds = %111
  %116 = call i32 @gethostname(ptr noundef @hostname, i64 noundef 64) #7
  br label %117

117:                                              ; preds = %115, %111
  %118 = load i8, ptr @hostname, align 16, !tbaa !32
  %119 = icmp ne i8 %118, 0
  br i1 %119, label %120, label %124

120:                                              ; preds = %117
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = call i64 @strlen(ptr noundef @hostname) #9
  %123 = trunc i64 %122 to i32
  call void @changeprop_char(ptr noundef %121, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @hostname, i32 noundef %123)
  br label %124

124:                                              ; preds = %120, %117
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.Window, ptr %125, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %126, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !33
  %127 = load i32, ptr %11, align 4, !tbaa !9
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.Window, ptr %128, i32 0, i32 21
  store i32 %127, ptr %129, align 8, !tbaa !34
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 112, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  ret ptr %130
}

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

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

declare ptr @emallocz(i32 noundef) #3

declare i64 @XCreateWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @getpid() #4

declare void @changeprop_long(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare i32 @gethostname(ptr noundef, i64 noundef) #4

declare void @changeprop_char(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(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) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"Window", !10, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !14, i64 56, !10, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !16, i64 128, !13, i64 152, !6, i64 160, !6, i64 168, !17, i64 176, !10, i64 180, !10, i64 184}
!13 = !{!"long", !7, i64 0}
!14 = !{!"Rectangle", !15, i64 0, !15, i64 8}
!15 = !{!"Point", !10, i64 0, !10, i64 4}
!16 = !{!"Ewmh", !13, i64 0, !13, i64 8, !13, i64 16}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!12, !6, i64 32}
!19 = !{!12, !6, i64 80}
!20 = !{!21, !13, i64 96}
!21 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !13, i64 48, !13, i64 56, !10, i64 64, !13, i64 72, !13, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!22 = !{!12, !13, i64 40}
!23 = !{!21, !13, i64 72}
!24 = !{!12, !13, i64 152}
!25 = !{!12, !13, i64 8}
!26 = !{!14, !10, i64 0}
!27 = !{!14, !10, i64 4}
!28 = !{!14, !10, i64 8}
!29 = !{!14, !10, i64 12}
!30 = !{!12, !6, i64 24}
!31 = !{!13, !13, i64 0}
!32 = !{!7, !7, i64 0}
!33 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!34 = !{!12, !10, i64 184}


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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.createwindow_visual = external hidden unnamed_addr constant [89 x i8], align 1
@display = external local_unnamed_addr global ptr, align 8
@pid = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@hostname = external hidden global [65 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @createwindow_visual(ptr noundef %0, i64 %1, i64 %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = alloca %struct.XSetWindowAttributes, align 8
  %.sroa.0.sroa.0.0.extract.trunc = trunc i64 %1 to i32
  %.sroa.0.sroa.4.0.extract.shift = lshr i64 %1, 32
  %.sroa.0.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.0.sroa.4.0.extract.shift to i32
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %9) #6
  %10 = load i32, ptr %0, align 8, !tbaa !5
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 18, ptr noundef nonnull @__PRETTY_FUNCTION__.createwindow_visual) #7
  unreachable

13:                                               ; preds = %8
  %14 = icmp eq ptr %6, null
  %spec.store.select = select i1 %14, ptr %9, ptr %6
  %15 = tail call ptr @emallocz(i32 noundef 192) #6
  %16 = getelementptr inbounds i8, ptr %15, i64 32
  store ptr %4, ptr %16, align 8, !tbaa !16
  store i32 0, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %15, i64 80
  store ptr %0, ptr %17, align 8, !tbaa !17
  %18 = sext i32 %7 to i64
  %19 = and i64 %18, 8192
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %23, label %20

20:                                               ; preds = %13
  %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel.v = select i1 %14, ptr %9, ptr %6
  %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel.v, i64 96
  %21 = load i64, ptr %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %15, i64 40
  store i64 %21, ptr %22, align 8, !tbaa !20
  br label %23

23:                                               ; preds = %20, %13
  %24 = and i64 %18, 2048
  %.not31 = icmp eq i64 %24, 0
  br i1 %.not31, label %28, label %25

25:                                               ; preds = %23
  %spec.store.select.sroa.sel38.v.sroa.sel.v.sroa.sel.v = select i1 %14, ptr %9, ptr %6
  %spec.store.select.sroa.sel38.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel38.v.sroa.sel.v.sroa.sel.v, i64 72
  %26 = load i64, ptr %spec.store.select.sroa.sel38.v.sroa.sel.v.sroa.sel, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %15, i64 152
  store i64 %26, ptr %27, align 8, !tbaa !22
  br label %28

28:                                               ; preds = %25, %23
  %29 = load ptr, ptr @display, align 8, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load i64, ptr %30, align 8, !tbaa !24
  %.sroa.6.8.extract.trunc = trunc i64 %2 to i32
  %32 = sub nsw i32 %.sroa.6.8.extract.trunc, %.sroa.0.sroa.0.0.extract.trunc
  %.sroa.6.12.extract.shift = lshr i64 %2, 32
  %.sroa.6.12.extract.trunc = trunc nuw i64 %.sroa.6.12.extract.shift to i32
  %33 = sub nsw i32 %.sroa.6.12.extract.trunc, %.sroa.0.sroa.4.0.extract.trunc
  %34 = call i64 @XCreateWindow(ptr noundef %29, i64 noundef %31, i32 noundef %.sroa.0.sroa.0.0.extract.trunc, i32 noundef %.sroa.0.sroa.4.0.extract.trunc, i32 noundef %32, i32 noundef %33, i32 noundef 0, i32 noundef %3, i32 noundef %5, ptr noundef %4, i64 noundef %18, ptr noundef nonnull %spec.store.select) #6
  %35 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 %34, ptr %35, align 8, !tbaa !24
  %.not32 = icmp eq i32 %5, 2
  br i1 %.not32, label %40, label %36

36:                                               ; preds = %28
  %37 = load ptr, ptr @display, align 8, !tbaa !23
  %38 = call ptr @XCreateGC(ptr noundef %37, i64 noundef %34, i64 noundef 0, ptr noundef null) #6
  %39 = getelementptr inbounds i8, ptr %15, i64 24
  store ptr %38, ptr %39, align 8, !tbaa !25
  br label %40

40:                                               ; preds = %36, %28
  %41 = load i64, ptr @pid, align 8, !tbaa !26
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = call i32 @getpid() #6
  %45 = sext i32 %44 to i64
  store i64 %45, ptr @pid, align 8, !tbaa !26
  br label %46

46:                                               ; preds = %43, %40
  call void @changeprop_long(ptr noundef nonnull %15, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef nonnull @pid, i32 noundef 1) #6
  %47 = load i8, ptr @hostname, align 16, !tbaa !27
  %.not33 = icmp eq i8 %47, 0
  br i1 %.not33, label %48, label %.thread

48:                                               ; preds = %46
  %49 = call i32 @gethostname(ptr noundef nonnull @hostname, i64 noundef 64) #6
  %.pr = load i8, ptr @hostname, align 16, !tbaa !27
  %.not34 = icmp eq i8 %.pr, 0
  br i1 %.not34, label %52, label %.thread

.thread:                                          ; preds = %46, %48
  %50 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @hostname) #8
  %51 = trunc i64 %50 to i32
  call void @changeprop_char(ptr noundef nonnull %15, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @hostname, i32 noundef %51) #6
  br label %52

52:                                               ; preds = %.thread, %48
  %53 = getelementptr inbounds i8, ptr %15, i64 56
  store i64 %1, ptr %53, align 8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 64
  store i64 %2, ptr %.sroa.6.0..sroa_idx, align 8
  %54 = getelementptr inbounds i8, ptr %15, i64 184
  store i32 %3, ptr %54, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %9) #6
  ret ptr %15
}

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

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

declare ptr @emallocz(i32 noundef) local_unnamed_addr #3

declare i64 @XCreateWindow(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind
declare i32 @getpid() local_unnamed_addr #4

declare void @changeprop_long(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @gethostname(ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @changeprop_char(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture 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) #1

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 = { 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 #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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"Window", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !11, i64 48, !12, i64 56, !7, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !14, i64 128, !10, i64 152, !11, i64 160, !11, i64 168, !15, i64 176, !7, i64 180, !7, i64 184}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"Rectangle", !13, i64 0, !13, i64 8}
!13 = !{!"Point", !7, i64 0, !7, i64 4}
!14 = !{!"Ewmh", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!6, !11, i64 32}
!17 = !{!6, !11, i64 80}
!18 = !{!19, !10, i64 96}
!19 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !10, i64 96, !10, i64 104}
!20 = !{!6, !10, i64 40}
!21 = !{!19, !10, i64 72}
!22 = !{!6, !10, i64 152}
!23 = !{!11, !11, i64 0}
!24 = !{!6, !10, i64 8}
!25 = !{!6, !11, i64 24}
!26 = !{!10, !10, i64 0}
!27 = !{!8, !8, i64 0}
!28 = !{!6, !7, i64 184}


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