; LLVM IR from 0intro/wmii :: lib/libstuff/x11/text (loadfont)

; 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.Screen = type { i32, %struct.Window, ptr, i64, i64, ptr, ptr, %struct.Rectangle, i32, i32, ptr }
%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 }
%struct.Rectangle = type { %struct.Point, %struct.Point }
%struct.Point = type { i32, i32 }
%struct.Font = type { i32, %union.anon, %struct.Rectangle, i32, i32, i32, ptr }
%union.anon = type { ptr }
%struct.Xft = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.XftFont = type { i32, i32, i32, i32, ptr, ptr }
%struct.XFontStruct = type { ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.XCharStruct, %struct.XCharStruct, ptr, i32, i32 }
%struct.XCharStruct = type { i16, i16, i16, i16, i16, i16 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@xft = external global ptr, align 8
@display = external global ptr, align 8
@scr = external global %struct.Screen, align 8
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@argv0 = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @loadfont(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  %12 = call ptr @emallocz(i32 noundef 56)
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call ptr @estrdup(ptr noundef %13)
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Font, ptr %15, i32 0, i32 6
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.Font, ptr %17, i32 0, i32 6
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call i32 @strncmp(ptr noundef %19, ptr noundef @.str, i64 noundef 4) #5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %78, label %22

22:                                               ; preds = %1
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Font, ptr %23, i32 0, i32 0
  store i32 3, ptr %24, align 8, !tbaa !14
  %25 = call zeroext i1 @havexft()
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  br label %154

27:                                               ; preds = %22
  %28 = load ptr, ptr @xft, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.Xft, ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load ptr, ptr @display, align 8, !tbaa !5
  %32 = load i32, ptr @scr, align 8, !tbaa !17
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Font, ptr %33, i32 0, i32 6
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = call ptr %30(ptr noundef %31, i32 noundef %32, ptr noundef %36)
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Font, ptr %38, i32 0, i32 1
  store ptr %37, ptr %39, align 8, !tbaa !23
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Font, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  %43 = icmp ne ptr %42, null
  br i1 %43, label %57, label %44

44:                                               ; preds = %27
  %45 = load ptr, ptr @xft, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Xft, ptr %45, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !24
  %48 = load ptr, ptr @display, align 8, !tbaa !5
  %49 = load i32, ptr @scr, align 8, !tbaa !17
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Font, ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = call ptr %47(ptr noundef %48, i32 noundef %49, ptr noundef %53)
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Font, ptr %55, i32 0, i32 1
  store ptr %54, ptr %56, align 8, !tbaa !23
  br label %57

57:                                               ; preds = %44, %27
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Font, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = icmp ne ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %57
  br label %154

63:                                               ; preds = %57
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Font, ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !23
  %67 = getelementptr inbounds %struct.XftFont, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !25
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Font, ptr %69, i32 0, i32 3
  store i32 %68, ptr %70, align 8, !tbaa !27
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Font, ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = getelementptr inbounds %struct.XftFont, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !28
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Font, ptr %76, i32 0, i32 4
  store i32 %75, ptr %77, align 4, !tbaa !29
  br label %143

78:                                               ; preds = %1
  %79 = load ptr, ptr @display, align 8, !tbaa !5
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = call ptr @XCreateFontSet(ptr noundef %79, ptr noundef %80, ptr noundef %5, ptr noundef %9, ptr noundef null)
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Font, ptr %82, i32 0, i32 1
  store ptr %81, ptr %83, align 8, !tbaa !23
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %88

86:                                               ; preds = %78
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  call void @freestringlist(ptr noundef %87)
  br label %88

88:                                               ; preds = %86, %78
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Font, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !23
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %114

93:                                               ; preds = %88
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.Font, ptr %94, i32 0, i32 0
  store i32 2, ptr %95, align 8, !tbaa !14
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Font, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  %99 = call i32 @XFontsOfFontSet(ptr noundef %98, ptr noundef %4, ptr noundef %6)
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds ptr, ptr %100, i64 0
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.XFontStruct, ptr %102, i32 0, i32 14
  %104 = load i32, ptr %103, align 8, !tbaa !30
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Font, ptr %105, i32 0, i32 3
  store i32 %104, ptr %106, align 8, !tbaa !27
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds ptr, ptr %107, i64 0
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.XFontStruct, ptr %109, i32 0, i32 15
  %111 = load i32, ptr %110, align 4, !tbaa !34
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.Font, ptr %112, i32 0, i32 4
  store i32 %111, ptr %113, align 4, !tbaa !29
  br label %142

114:                                              ; preds = %88
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.Font, ptr %115, i32 0, i32 0
  store i32 1, ptr %116, align 8, !tbaa !14
  %117 = load ptr, ptr @display, align 8, !tbaa !5
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = call ptr @XLoadQueryFont(ptr noundef %117, ptr noundef %118)
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.Font, ptr %120, i32 0, i32 1
  store ptr %119, ptr %121, align 8, !tbaa !23
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.Font, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  %125 = icmp ne ptr %124, null
  br i1 %125, label %127, label %126

126:                                              ; preds = %114
  br label %154

127:                                              ; preds = %114
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.Font, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !23
  %131 = getelementptr inbounds %struct.XFontStruct, ptr %130, i32 0, i32 14
  %132 = load i32, ptr %131, align 8, !tbaa !30
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.Font, ptr %133, i32 0, i32 3
  store i32 %132, ptr %134, align 8, !tbaa !27
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Font, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !23
  %138 = getelementptr inbounds %struct.XFontStruct, ptr %137, i32 0, i32 15
  %139 = load i32, ptr %138, align 4, !tbaa !34
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Font, ptr %140, i32 0, i32 4
  store i32 %139, ptr %141, align 4, !tbaa !29
  br label %142

142:                                              ; preds = %127, %93
  br label %143

143:                                              ; preds = %142, %63
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.Font, ptr %144, i32 0, i32 3
  %146 = load i32, ptr %145, align 8, !tbaa !27
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.Font, ptr %147, i32 0, i32 4
  %149 = load i32, ptr %148, align 4, !tbaa !29
  %150 = add nsw i32 %146, %149
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.Font, ptr %151, i32 0, i32 5
  store i32 %150, ptr %152, align 8, !tbaa !35
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %153, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %161

154:                                              ; preds = %126, %62, %26
  %155 = load ptr, ptr @argv0, align 8, !tbaa !5
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = call i32 (i32, ptr, ...) @fprint(i32 noundef 2, ptr noundef @.str.1, ptr noundef %155, ptr noundef %156)
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.Font, ptr %158, i32 0, i32 0
  store i32 0, ptr %159, align 8, !tbaa !14
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  call void @freefont(ptr noundef %160)
  store ptr null, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %161

161:                                              ; preds = %154, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %162 = load ptr, ptr %2, align 8
  ret ptr %162
}

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

declare ptr @emallocz(i32 noundef) #2

declare ptr @estrdup(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #3

declare zeroext i1 @havexft() #2

declare ptr @XCreateFontSet(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @freestringlist(ptr noundef) #2

declare i32 @XFontsOfFontSet(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @XLoadQueryFont(ptr noundef, ptr noundef) #2

declare i32 @fprint(i32 noundef, ptr noundef, ...) #2

declare void @freefont(ptr noundef) #2

; 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 = { "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 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 #4 = { nounwind }
attributes #5 = { 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, !6, i64 48}
!10 = !{!"Font", !11, i64 0, !7, i64 8, !12, i64 16, !11, i64 32, !11, i64 36, !11, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Rectangle", !13, i64 0, !13, i64 8}
!13 = !{!"Point", !11, i64 0, !11, i64 4}
!14 = !{!10, !11, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"Xft", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!18, !11, i64 0}
!18 = !{!"Screen", !11, i64 0, !19, i64 8, !6, i64 200, !20, i64 208, !20, i64 216, !6, i64 224, !6, i64 232, !12, i64 240, !11, i64 256, !11, i64 260, !6, i64 264}
!19 = !{!"Window", !11, i64 0, !20, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !20, i64 40, !6, i64 48, !12, i64 56, !11, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !21, i64 128, !20, i64 152, !6, i64 160, !6, i64 168, !22, i64 176, !11, i64 180, !11, i64 184}
!20 = !{!"long", !7, i64 0}
!21 = !{!"Ewmh", !20, i64 0, !20, i64 8, !20, i64 16}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!16, !6, i64 24}
!25 = !{!26, !11, i64 0}
!26 = !{!"XftFont", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!27 = !{!10, !11, i64 32}
!28 = !{!26, !11, i64 4}
!29 = !{!10, !11, i64 36}
!30 = !{!31, !11, i64 88}
!31 = !{!"", !6, i64 0, !20, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !6, i64 48, !32, i64 56, !32, i64 68, !6, i64 80, !11, i64 88, !11, i64 92}
!32 = !{!"", !33, i64 0, !33, i64 2, !33, i64 4, !33, i64 6, !33, i64 8, !33, i64 10}
!33 = !{!"short", !7, i64 0}
!34 = !{!31, !11, i64 92}
!35 = !{!10, !11, i64 40}


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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@xft = external local_unnamed_addr global ptr, align 8
@display = external local_unnamed_addr global ptr, align 8
@scr = external local_unnamed_addr global %struct.Screen, align 8
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@argv0 = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @loadfont(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  %6 = tail call ptr @emallocz(i32 noundef 56) #4
  %7 = tail call ptr @estrdup(ptr noundef %0) #4
  %8 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr %7, ptr %8, align 8, !tbaa !9
  %9 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef 4) #5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %35

10:                                               ; preds = %1
  store i32 3, ptr %6, align 8, !tbaa !14
  %11 = tail call zeroext i1 @havexft() #4
  br i1 %11, label %12, label %65

12:                                               ; preds = %10
  %13 = load ptr, ptr @xft, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = load ptr, ptr @display, align 8, !tbaa !5
  %17 = load i32, ptr @scr, align 8, !tbaa !17
  %18 = load ptr, ptr %8, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  %20 = tail call ptr %15(ptr noundef %16, i32 noundef %17, ptr noundef nonnull %19) #4
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !23
  %.not40 = icmp eq ptr %20, null
  br i1 %.not40, label %22, label %.thread

22:                                               ; preds = %12
  %23 = load ptr, ptr @xft, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !24
  %26 = load ptr, ptr @display, align 8, !tbaa !5
  %27 = load i32, ptr @scr, align 8, !tbaa !17
  %28 = load ptr, ptr %8, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  %30 = tail call ptr %25(ptr noundef %26, i32 noundef %27, ptr noundef nonnull %29) #4
  store ptr %30, ptr %21, align 8, !tbaa !23
  %.not41 = icmp eq ptr %30, null
  br i1 %.not41, label %65, label %.thread

.thread:                                          ; preds = %12, %22
  %31 = phi ptr [ %30, %22 ], [ %20, %12 ]
  %32 = load i32, ptr %31, align 8, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %32, ptr %33, align 8, !tbaa !27
  %34 = getelementptr inbounds i8, ptr %31, i64 4
  br label %59

35:                                               ; preds = %1
  %36 = load ptr, ptr @display, align 8, !tbaa !5
  %37 = call ptr @XCreateFontSet(ptr noundef %36, ptr noundef %0, ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef null) #4
  %38 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %37, ptr %38, align 8, !tbaa !23
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %.not42 = icmp eq ptr %39, null
  br i1 %.not42, label %41, label %40

40:                                               ; preds = %35
  call void @freestringlist(ptr noundef nonnull %39) #4
  %.pr = load ptr, ptr %38, align 8, !tbaa !23
  br label %41

41:                                               ; preds = %40, %35
  %42 = phi ptr [ %.pr, %40 ], [ %37, %35 ]
  %.not43 = icmp eq ptr %42, null
  br i1 %.not43, label %51, label %43

43:                                               ; preds = %41
  store i32 2, ptr %6, align 8, !tbaa !14
  %44 = call i32 @XFontsOfFontSet(ptr noundef nonnull %42, ptr noundef nonnull %2, ptr noundef nonnull %4) #4
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 88
  %48 = load i32, ptr %47, align 8, !tbaa !28
  %49 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %48, ptr %49, align 8, !tbaa !27
  %50 = getelementptr inbounds i8, ptr %46, i64 92
  br label %59

51:                                               ; preds = %41
  store i32 1, ptr %6, align 8, !tbaa !14
  %52 = load ptr, ptr @display, align 8, !tbaa !5
  %53 = call ptr @XLoadQueryFont(ptr noundef %52, ptr noundef %0) #4
  store ptr %53, ptr %38, align 8, !tbaa !23
  %.not44 = icmp eq ptr %53, null
  br i1 %.not44, label %65, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %53, i64 88
  %56 = load i32, ptr %55, align 8, !tbaa !28
  %57 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %56, ptr %57, align 8, !tbaa !27
  %58 = getelementptr inbounds i8, ptr %53, i64 92
  br label %59

59:                                               ; preds = %43, %54, %.thread
  %.sink47 = phi ptr [ %50, %43 ], [ %58, %54 ], [ %34, %.thread ]
  %60 = phi i32 [ %48, %43 ], [ %56, %54 ], [ %32, %.thread ]
  %61 = load i32, ptr %.sink47, align 4, !tbaa !32
  %62 = getelementptr inbounds i8, ptr %6, i64 36
  store i32 %61, ptr %62, align 4, !tbaa !33
  %63 = add nsw i32 %61, %60
  %64 = getelementptr inbounds i8, ptr %6, i64 40
  store i32 %63, ptr %64, align 8, !tbaa !34
  br label %68

65:                                               ; preds = %51, %22, %10
  %66 = load ptr, ptr @argv0, align 8, !tbaa !5
  %67 = call i32 (i32, ptr, ...) @fprint(i32 noundef 2, ptr noundef nonnull @.str.1, ptr noundef %66, ptr noundef %0) #4
  store i32 0, ptr %6, align 8, !tbaa !14
  call void @freefont(ptr noundef nonnull %6) #4
  br label %68

68:                                               ; preds = %65, %59
  %.0 = phi ptr [ %6, %59 ], [ null, %65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret ptr %.0
}

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

declare ptr @emallocz(i32 noundef) local_unnamed_addr #2

declare ptr @estrdup(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

declare zeroext i1 @havexft() local_unnamed_addr #2

declare ptr @XCreateFontSet(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @freestringlist(ptr noundef) local_unnamed_addr #2

declare i32 @XFontsOfFontSet(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @XLoadQueryFont(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @fprint(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare void @freefont(ptr noundef) local_unnamed_addr #2

; 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 = { "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: 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 #4 = { nounwind }
attributes #5 = { 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, !6, i64 48}
!10 = !{!"Font", !11, i64 0, !7, i64 8, !12, i64 16, !11, i64 32, !11, i64 36, !11, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Rectangle", !13, i64 0, !13, i64 8}
!13 = !{!"Point", !11, i64 0, !11, i64 4}
!14 = !{!10, !11, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"Xft", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!18, !11, i64 0}
!18 = !{!"Screen", !11, i64 0, !19, i64 8, !6, i64 200, !20, i64 208, !20, i64 216, !6, i64 224, !6, i64 232, !12, i64 240, !11, i64 256, !11, i64 260, !6, i64 264}
!19 = !{!"Window", !11, i64 0, !20, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !20, i64 40, !6, i64 48, !12, i64 56, !11, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !21, i64 128, !20, i64 152, !6, i64 160, !6, i64 168, !22, i64 176, !11, i64 180, !11, i64 184}
!20 = !{!"long", !7, i64 0}
!21 = !{!"Ewmh", !20, i64 0, !20, i64 8, !20, i64 16}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!16, !6, i64 24}
!25 = !{!26, !11, i64 0}
!26 = !{!"XftFont", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!27 = !{!10, !11, i64 32}
!28 = !{!29, !11, i64 88}
!29 = !{!"", !6, i64 0, !20, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !6, i64 48, !30, i64 56, !30, i64 68, !6, i64 80, !11, i64 88, !11, i64 92}
!30 = !{!"", !31, i64 0, !31, i64 2, !31, i64 4, !31, i64 6, !31, i64 8, !31, i64 10}
!31 = !{!"short", !7, i64 0}
!32 = !{!11, !11, i64 0}
!33 = !{!10, !11, i64 36}
!34 = !{!10, !11, i64 40}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass