; LLVM IR from 0intro/wmii :: lib/libstuff/x11/insanity (gethints)

; 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.WinHints = type { %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Rectangle, i64, i8, i8 }
%struct.Point = type { i32, i32 }
%struct.Rectangle = type { %struct.Point, %struct.Point }
%struct.XSizeHints = type { i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon, %struct.anon, i32, i32, i32 }
%struct.anon = type { i32, i32 }
%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.XWMHints = type { i64, i32, i32, i64, i64, i32, i32, i64, i64 }

@ZWinHints = external constant %struct.WinHints, align 8
@display = external global ptr, align 8
@ZP = external constant %struct.Point, align 4

; Function Attrs: nounwind uwtable
define dso_local void @gethints(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.XSizeHints, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.Point, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.Window, ptr %9, i32 0, i32 14
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %17

13:                                               ; preds = %1
  %14 = call ptr @emalloc(i32 noundef 80)
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Window, ptr %15, i32 0, i32 14
  store ptr %14, ptr %16, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %13, %1
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.Window, ptr %18, i32 0, i32 14
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %20, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 @ZWinHints, i64 80, i1 false), !tbaa.struct !17
  %22 = load ptr, ptr @display, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Window, ptr %23, i32 0, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !21
  %26 = call ptr @XGetWMHints(ptr noundef %22, i64 noundef %25)
  store ptr %26, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %43

29:                                               ; preds = %17
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.XWMHints, ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !22
  %33 = and i64 %32, 64
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %41

35:                                               ; preds = %29
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.XWMHints, ptr %36, i32 0, i32 8
  %38 = load i64, ptr %37, align 8, !tbaa !24
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.WinHints, ptr %39, i32 0, i32 7
  store i64 %38, ptr %40, align 8, !tbaa !25
  br label %41

41:                                               ; preds = %35, %29
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %42) #5
  br label %43

43:                                               ; preds = %41, %17
  %44 = load ptr, ptr @display, align 8, !tbaa !5
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Window, ptr %45, i32 0, i32 1
  %47 = load i64, ptr %46, align 8, !tbaa !21
  %48 = call i32 @XGetWMNormalHints(ptr noundef %44, i64 noundef %47, ptr noundef %3, ptr noundef %7)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %43
  store i32 1, ptr %8, align 4
  br label %228

51:                                               ; preds = %43
  %52 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %53 = load i64, ptr %52, align 8, !tbaa !27
  %54 = and i64 %53, 16
  %55 = icmp ne i64 %54, 0
  br i1 %55, label %56, label %67

56:                                               ; preds = %51
  %57 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 5
  %58 = load i32, ptr %57, align 8, !tbaa !30
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.WinHints, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.Point, ptr %60, i32 0, i32 0
  store i32 %58, ptr %61, align 8, !tbaa !31
  %62 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 6
  %63 = load i32, ptr %62, align 4, !tbaa !32
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.WinHints, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.Point, ptr %65, i32 0, i32 1
  store i32 %63, ptr %66, align 4, !tbaa !33
  br label %67

67:                                               ; preds = %56, %51
  %68 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %69 = load i64, ptr %68, align 8, !tbaa !27
  %70 = and i64 %69, 32
  %71 = icmp ne i64 %70, 0
  br i1 %71, label %72, label %83

72:                                               ; preds = %67
  %73 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 7
  %74 = load i32, ptr %73, align 8, !tbaa !34
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.WinHints, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %struct.Point, ptr %76, i32 0, i32 0
  store i32 %74, ptr %77, align 8, !tbaa !35
  %78 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 8
  %79 = load i32, ptr %78, align 4, !tbaa !36
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.WinHints, ptr %80, i32 0, i32 1
  %82 = getelementptr inbounds %struct.Point, ptr %81, i32 0, i32 1
  store i32 %79, ptr %82, align 4, !tbaa !37
  br label %83

83:                                               ; preds = %72, %67
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.WinHints, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds %struct.Point, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !35
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.WinHints, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.Point, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !31
  %92 = icmp slt i32 %87, %91
  br i1 %92, label %93, label %101

93:                                               ; preds = %83
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.WinHints, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.Point, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 8, !tbaa !31
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.WinHints, ptr %98, i32 0, i32 1
  %100 = getelementptr inbounds %struct.Point, ptr %99, i32 0, i32 0
  store i32 %97, ptr %100, align 8, !tbaa !35
  br label %101

101:                                              ; preds = %93, %83
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.WinHints, ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %struct.Point, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !37
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.WinHints, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %struct.Point, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !33
  %110 = icmp slt i32 %105, %109
  br i1 %110, label %111, label %119

111:                                              ; preds = %101
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.WinHints, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds %struct.Point, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !33
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.WinHints, ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds %struct.Point, ptr %117, i32 0, i32 1
  store i32 %115, ptr %118, align 4, !tbaa !37
  br label %119

119:                                              ; preds = %111, %101
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.WinHints, ptr %120, i32 0, i32 2
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.WinHints, ptr %122, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %121, ptr align 8 %123, i64 8, i1 false), !tbaa.struct !38
  %124 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %125 = load i64, ptr %124, align 8, !tbaa !27
  %126 = and i64 %125, 256
  %127 = icmp ne i64 %126, 0
  br i1 %127, label %128, label %139

128:                                              ; preds = %119
  %129 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 13
  %130 = load i32, ptr %129, align 8, !tbaa !39
  %131 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 0
  store i32 %130, ptr %131, align 4, !tbaa !40
  %132 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 14
  %133 = load i32, ptr %132, align 4, !tbaa !41
  %134 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 1
  store i32 %133, ptr %134, align 4, !tbaa !42
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.WinHints, ptr %135, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %136, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !38
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.WinHints, ptr %137, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %138, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !38
  br label %139

139:                                              ; preds = %128, %119
  %140 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %141 = load i64, ptr %140, align 8, !tbaa !27
  %142 = and i64 %141, 64
  %143 = icmp ne i64 %142, 0
  br i1 %143, label %144, label %157

144:                                              ; preds = %139
  %145 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 9
  %146 = load i32, ptr %145, align 8, !tbaa !43
  %147 = call i32 @max(i32 noundef %146, i32 noundef 1)
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.WinHints, ptr %148, i32 0, i32 4
  %150 = getelementptr inbounds %struct.Point, ptr %149, i32 0, i32 0
  store i32 %147, ptr %150, align 8, !tbaa !44
  %151 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 10
  %152 = load i32, ptr %151, align 4, !tbaa !45
  %153 = call i32 @max(i32 noundef %152, i32 noundef 1)
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.WinHints, ptr %154, i32 0, i32 4
  %156 = getelementptr inbounds %struct.Point, ptr %155, i32 0, i32 1
  store i32 %153, ptr %156, align 4, !tbaa !46
  br label %157

157:                                              ; preds = %144, %139
  %158 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %159 = load i64, ptr %158, align 8, !tbaa !27
  %160 = and i64 %159, 128
  %161 = icmp ne i64 %160, 0
  br i1 %161, label %162, label %191

162:                                              ; preds = %157
  %163 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 11
  %164 = getelementptr inbounds %struct.anon, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 8, !tbaa !47
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.WinHints, ptr %166, i32 0, i32 6
  %168 = getelementptr inbounds %struct.Rectangle, ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds %struct.Point, ptr %168, i32 0, i32 0
  store i32 %165, ptr %169, align 8, !tbaa !48
  %170 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 11
  %171 = getelementptr inbounds %struct.anon, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !49
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.WinHints, ptr %173, i32 0, i32 6
  %175 = getelementptr inbounds %struct.Rectangle, ptr %174, i32 0, i32 0
  %176 = getelementptr inbounds %struct.Point, ptr %175, i32 0, i32 1
  store i32 %172, ptr %176, align 4, !tbaa !50
  %177 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 12
  %178 = getelementptr inbounds %struct.anon, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !51
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.WinHints, ptr %180, i32 0, i32 6
  %182 = getelementptr inbounds %struct.Rectangle, ptr %181, i32 0, i32 1
  %183 = getelementptr inbounds %struct.Point, ptr %182, i32 0, i32 0
  store i32 %179, ptr %183, align 8, !tbaa !52
  %184 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 12
  %185 = getelementptr inbounds %struct.anon, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !53
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.WinHints, ptr %187, i32 0, i32 6
  %189 = getelementptr inbounds %struct.Rectangle, ptr %188, i32 0, i32 1
  %190 = getelementptr inbounds %struct.Point, ptr %189, i32 0, i32 1
  store i32 %186, ptr %190, align 4, !tbaa !54
  br label %191

191:                                              ; preds = %162, %157
  %192 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %193 = load i64, ptr %192, align 8, !tbaa !27
  %194 = and i64 %193, 5
  %195 = icmp ne i64 %194, 0
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.WinHints, ptr %196, i32 0, i32 9
  %198 = zext i1 %195 to i8
  store i8 %198, ptr %197, align 1, !tbaa !55
  %199 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 0
  %200 = load i64, ptr %199, align 8, !tbaa !27
  %201 = and i64 %200, 512
  %202 = icmp ne i64 %201, 0
  br i1 %202, label %205, label %203

203:                                              ; preds = %191
  %204 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 15
  store i32 1, ptr %204, align 8, !tbaa !56
  br label %205

205:                                              ; preds = %203, %191
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 @ZP, i64 8, i1 false), !tbaa.struct !38
  %206 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 15
  %207 = load i32, ptr %206, align 8, !tbaa !56
  switch i32 %207, label %212 [
    i32 6, label %208
    i32 5, label %208
    i32 4, label %208
    i32 9, label %210
    i32 8, label %210
    i32 7, label %210
  ]

208:                                              ; preds = %205, %205, %205
  %209 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 1
  store i32 1, ptr %209, align 4, !tbaa !42
  br label %212

210:                                              ; preds = %205, %205, %205
  %211 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 1
  store i32 2, ptr %211, align 4, !tbaa !42
  br label %212

212:                                              ; preds = %210, %208, %205
  %213 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 15
  %214 = load i32, ptr %213, align 8, !tbaa !56
  switch i32 %214, label %219 [
    i32 2, label %215
    i32 5, label %215
    i32 8, label %215
    i32 3, label %217
    i32 6, label %217
    i32 9, label %217
  ]

215:                                              ; preds = %212, %212, %212
  %216 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 0
  store i32 1, ptr %216, align 4, !tbaa !40
  br label %219

217:                                              ; preds = %212, %212, %212
  %218 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 0
  store i32 2, ptr %218, align 4, !tbaa !40
  br label %219

219:                                              ; preds = %217, %215, %212
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.WinHints, ptr %220, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %221, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !38
  %222 = getelementptr inbounds %struct.XSizeHints, ptr %3, i32 0, i32 15
  %223 = load i32, ptr %222, align 8, !tbaa !56
  %224 = icmp eq i32 %223, 10
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.WinHints, ptr %225, i32 0, i32 8
  %227 = zext i1 %224 to i8
  store i8 %227, ptr %226, align 8, !tbaa !57
  store i32 0, ptr %8, align 4
  br label %228

228:                                              ; preds = %219, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  %229 = load i32, ptr %8, align 4
  switch i32 %229, label %231 [
    i32 0, label %230
    i32 1, label %230
  ]

230:                                              ; preds = %228, %228
  ret void

231:                                              ; preds = %228
  unreachable
}

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

declare ptr @emalloc(i32 noundef) #2

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

declare ptr @XGetWMHints(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare i32 @XGetWMNormalHints(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #2

declare i32 @max(i32 noundef, i32 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 120}
!10 = !{!"Window", !11, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !6, i64 48, !13, i64 56, !11, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !15, i64 128, !12, i64 152, !6, i64 160, !6, i64 168, !16, i64 176, !11, i64 180, !11, i64 184}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"Rectangle", !14, i64 0, !14, i64 8}
!14 = !{!"Point", !11, i64 0, !11, i64 4}
!15 = !{!"Ewmh", !12, i64 0, !12, i64 8, !12, i64 16}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i64 0, i64 4, !18, i64 4, i64 4, !18, i64 8, i64 4, !18, i64 12, i64 4, !18, i64 16, i64 4, !18, i64 20, i64 4, !18, i64 24, i64 4, !18, i64 28, i64 4, !18, i64 32, i64 4, !18, i64 36, i64 4, !18, i64 40, i64 4, !18, i64 44, i64 4, !18, i64 48, i64 4, !18, i64 52, i64 4, !18, i64 56, i64 4, !18, i64 60, i64 4, !18, i64 64, i64 8, !19, i64 72, i64 1, !20, i64 73, i64 1, !20}
!18 = !{!11, !11, i64 0}
!19 = !{!12, !12, i64 0}
!20 = !{!16, !16, i64 0}
!21 = !{!10, !12, i64 8}
!22 = !{!23, !12, i64 0}
!23 = !{!"", !12, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !12, i64 40, !12, i64 48}
!24 = !{!23, !12, i64 48}
!25 = !{!26, !12, i64 64}
!26 = !{!"WinHints", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !13, i64 48, !12, i64 64, !16, i64 72, !16, i64 73}
!27 = !{!28, !12, i64 0}
!28 = !{!"", !12, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !29, i64 48, !29, i64 56, !11, i64 64, !11, i64 68, !11, i64 72}
!29 = !{!"", !11, i64 0, !11, i64 4}
!30 = !{!28, !11, i64 24}
!31 = !{!26, !11, i64 0}
!32 = !{!28, !11, i64 28}
!33 = !{!26, !11, i64 4}
!34 = !{!28, !11, i64 32}
!35 = !{!26, !11, i64 8}
!36 = !{!28, !11, i64 36}
!37 = !{!26, !11, i64 12}
!38 = !{i64 0, i64 4, !18, i64 4, i64 4, !18}
!39 = !{!28, !11, i64 64}
!40 = !{!14, !11, i64 0}
!41 = !{!28, !11, i64 68}
!42 = !{!14, !11, i64 4}
!43 = !{!28, !11, i64 40}
!44 = !{!26, !11, i64 32}
!45 = !{!28, !11, i64 44}
!46 = !{!26, !11, i64 36}
!47 = !{!28, !11, i64 48}
!48 = !{!26, !11, i64 48}
!49 = !{!28, !11, i64 52}
!50 = !{!26, !11, i64 52}
!51 = !{!28, !11, i64 56}
!52 = !{!26, !11, i64 56}
!53 = !{!28, !11, i64 60}
!54 = !{!26, !11, i64 60}
!55 = !{!26, !16, i64 73}
!56 = !{!28, !11, i64 72}
!57 = !{!26, !16, i64 72}


; 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.WinHints = type { %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Point, %struct.Rectangle, i64, i8, i8 }
%struct.Point = type { i32, i32 }
%struct.Rectangle = type { %struct.Point, %struct.Point }
%struct.XSizeHints = type { i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon, %struct.anon, i32, i32, i32 }
%struct.anon = type { i32, i32 }

@ZWinHints = external local_unnamed_addr constant %struct.WinHints, align 8
@display = external local_unnamed_addr global ptr, align 8
@ZP = external local_unnamed_addr constant %struct.Point, align 4
@switch.table.gethints = private unnamed_addr constant [6 x i32] [i32 1, i32 1, i32 1, i32 2, i32 2, i32 2], align 4

; Function Attrs: nounwind uwtable
define dso_local void @gethints(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.XSizeHints, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %9

7:                                                ; preds = %1
  %8 = tail call ptr @emalloc(i32 noundef 80) #5
  store ptr %8, ptr %4, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %7, %1
  %10 = phi ptr [ %8, %7 ], [ %5, %1 ]
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(80) @ZWinHints, i64 80, i1 false), !tbaa.struct !16
  %11 = load ptr, ptr @display, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !21
  %14 = tail call ptr @XGetWMHints(ptr noundef %11, i64 noundef %13) #5
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %23, label %15

15:                                               ; preds = %9
  %16 = load i64, ptr %14, align 8, !tbaa !22
  %17 = and i64 %16, 64
  %.not46 = icmp eq i64 %17, 0
  br i1 %.not46, label %22, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %14, i64 48
  %20 = load i64, ptr %19, align 8, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %10, i64 64
  store i64 %20, ptr %21, align 8, !tbaa !25
  br label %22

22:                                               ; preds = %18, %15
  tail call void @free(ptr noundef nonnull %14) #5
  br label %23

23:                                               ; preds = %22, %9
  %24 = load ptr, ptr @display, align 8, !tbaa !20
  %25 = load i64, ptr %12, align 8, !tbaa !21
  %26 = call i32 @XGetWMNormalHints(ptr noundef %24, i64 noundef %25, ptr noundef nonnull %2, ptr noundef nonnull %3) #5
  %.not47 = icmp eq i32 %26, 0
  br i1 %.not47, label %96, label %27

27:                                               ; preds = %23
  %28 = load i64, ptr %2, align 8, !tbaa !27
  %29 = and i64 %28, 16
  %.not48 = icmp eq i64 %29, 0
  br i1 %.not48, label %33, label %30

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %2, i64 24
  %32 = load <2 x i32>, ptr %31, align 8, !tbaa !17
  store <2 x i32> %32, ptr %10, align 8, !tbaa !17
  br label %33

33:                                               ; preds = %30, %27
  %34 = and i64 %28, 32
  %.not49 = icmp eq i64 %34, 0
  br i1 %.not49, label %._crit_edge, label %35

._crit_edge:                                      ; preds = %33
  %.phi.trans.insert = getelementptr inbounds i8, ptr %10, i64 8
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !30
  br label %40

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %2, i64 32
  %37 = getelementptr inbounds i8, ptr %10, i64 8
  %38 = load <2 x i32>, ptr %36, align 8, !tbaa !17
  store <2 x i32> %38, ptr %37, align 8, !tbaa !17
  %39 = extractelement <2 x i32> %38, i64 0
  br label %40

40:                                               ; preds = %._crit_edge, %35
  %41 = phi i32 [ %.pre, %._crit_edge ], [ %39, %35 ]
  %42 = load i32, ptr %10, align 8, !tbaa !31
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %46

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %42, ptr %45, align 8, !tbaa !30
  br label %46

46:                                               ; preds = %44, %40
  %47 = getelementptr inbounds i8, ptr %10, i64 12
  %48 = load i32, ptr %47, align 4, !tbaa !32
  %49 = getelementptr inbounds i8, ptr %10, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !33
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %46
  store i32 %50, ptr %47, align 4, !tbaa !32
  br label %53

53:                                               ; preds = %52, %46
  %54 = getelementptr inbounds i8, ptr %10, i64 16
  %55 = load i64, ptr %10, align 8
  store i64 %55, ptr %54, align 8
  %56 = and i64 %28, 256
  %.not50 = icmp eq i64 %56, 0
  br i1 %.not50, label %61, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds i8, ptr %2, i64 64
  %59 = load <2 x i32>, ptr %58, align 8, !tbaa !17
  %60 = shufflevector <2 x i32> %59, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
  store <4 x i32> %60, ptr %54, align 8, !tbaa !17
  br label %61

61:                                               ; preds = %57, %53
  %62 = and i64 %28, 64
  %.not51 = icmp eq i64 %62, 0
  br i1 %.not51, label %72, label %63

63:                                               ; preds = %61
  %64 = getelementptr inbounds i8, ptr %2, i64 40
  %65 = load i32, ptr %64, align 8, !tbaa !34
  %66 = call i32 @max(i32 noundef %65, i32 noundef 1) #5
  %67 = getelementptr inbounds i8, ptr %10, i64 32
  store i32 %66, ptr %67, align 8, !tbaa !35
  %68 = getelementptr inbounds i8, ptr %2, i64 44
  %69 = load i32, ptr %68, align 4, !tbaa !36
  %70 = call i32 @max(i32 noundef %69, i32 noundef 1) #5
  %71 = getelementptr inbounds i8, ptr %10, i64 36
  store i32 %70, ptr %71, align 4, !tbaa !37
  %.pre54 = load i64, ptr %2, align 8, !tbaa !27
  br label %72

72:                                               ; preds = %63, %61
  %73 = phi i64 [ %.pre54, %63 ], [ %28, %61 ]
  %74 = and i64 %73, 128
  %.not52 = icmp eq i64 %74, 0
  br i1 %.not52, label %79, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %2, i64 48
  %77 = getelementptr inbounds i8, ptr %10, i64 48
  %78 = load <4 x i32>, ptr %76, align 8, !tbaa !17
  store <4 x i32> %78, ptr %77, align 8, !tbaa !17
  br label %79

79:                                               ; preds = %75, %72
  %80 = and i64 %73, 5
  %81 = icmp ne i64 %80, 0
  %82 = getelementptr inbounds i8, ptr %10, i64 73
  %83 = zext i1 %81 to i8
  store i8 %83, ptr %82, align 1, !tbaa !38
  %84 = and i64 %73, 512
  %.not53 = icmp eq i64 %84, 0
  br i1 %.not53, label %.thread61, label %85

.thread61:                                        ; preds = %79
  %.sroa.0.0.copyload258 = load i32, ptr @ZP, align 4, !tbaa !17
  %.sroa.9.0.copyload659 = load i32, ptr getelementptr inbounds (i8, ptr @ZP, i64 4), align 4, !tbaa !17
  br label %90

85:                                               ; preds = %79
  %.phi.trans.insert56 = getelementptr inbounds i8, ptr %2, i64 72
  %.pre57 = load i32, ptr %.phi.trans.insert56, align 8, !tbaa !39
  %.sroa.0.0.copyload2 = load i32, ptr @ZP, align 4, !tbaa !17
  %switch.tableidx = add i32 %.pre57, -4
  %86 = icmp ult i32 %switch.tableidx, 6
  %87 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [6 x i32], ptr @switch.table.gethints, i64 0, i64 %87
  %.sroa.9.0.in = select i1 %86, ptr %switch.gep, ptr getelementptr inbounds (i8, ptr @ZP, i64 4)
  %.sroa.9.0 = load i32, ptr %.sroa.9.0.in, align 4
  switch i32 %.pre57, label %90 [
    i32 2, label %88
    i32 5, label %88
    i32 8, label %88
    i32 3, label %89
    i32 6, label %89
    i32 9, label %89
  ]

88:                                               ; preds = %85, %85, %85
  br label %90

89:                                               ; preds = %85, %85, %85
  br label %90

90:                                               ; preds = %.thread61, %89, %88, %85
  %.sroa.9.064 = phi i32 [ %.sroa.9.0, %85 ], [ %.sroa.9.0, %89 ], [ %.sroa.9.0, %88 ], [ %.sroa.9.0.copyload659, %.thread61 ]
  %91 = phi i32 [ %.pre57, %85 ], [ %.pre57, %89 ], [ %.pre57, %88 ], [ 1, %.thread61 ]
  %.sroa.0.0 = phi i32 [ %.sroa.0.0.copyload2, %85 ], [ 2, %89 ], [ 1, %88 ], [ %.sroa.0.0.copyload258, %.thread61 ]
  %92 = getelementptr inbounds i8, ptr %10, i64 40
  store i32 %.sroa.0.0, ptr %92, align 8, !tbaa !17
  %.sroa.9.0..sroa_idx7 = getelementptr inbounds i8, ptr %10, i64 44
  store i32 %.sroa.9.064, ptr %.sroa.9.0..sroa_idx7, align 4, !tbaa !17
  %93 = icmp eq i32 %91, 10
  %94 = getelementptr inbounds i8, ptr %10, i64 72
  %95 = zext i1 %93 to i8
  store i8 %95, ptr %94, align 8, !tbaa !40
  br label %96

96:                                               ; preds = %23, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #5
  ret void
}

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

declare ptr @emalloc(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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) #3

declare ptr @XGetWMHints(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

declare i32 @XGetWMNormalHints(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @max(i32 noundef, i32 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #5 = { 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, !11, i64 120}
!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 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17, i64 12, i64 4, !17, i64 16, i64 4, !17, i64 20, i64 4, !17, i64 24, i64 4, !17, i64 28, i64 4, !17, i64 32, i64 4, !17, i64 36, i64 4, !17, i64 40, i64 4, !17, i64 44, i64 4, !17, i64 48, i64 4, !17, i64 52, i64 4, !17, i64 56, i64 4, !17, i64 60, i64 4, !17, i64 64, i64 8, !18, i64 72, i64 1, !19, i64 73, i64 1, !19}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !10, i64 0}
!19 = !{!15, !15, i64 0}
!20 = !{!11, !11, i64 0}
!21 = !{!6, !10, i64 8}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !10, i64 40, !10, i64 48}
!24 = !{!23, !10, i64 48}
!25 = !{!26, !10, i64 64}
!26 = !{!"WinHints", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !12, i64 48, !10, i64 64, !15, i64 72, !15, i64 73}
!27 = !{!28, !10, i64 0}
!28 = !{!"", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !29, i64 48, !29, i64 56, !7, i64 64, !7, i64 68, !7, i64 72}
!29 = !{!"", !7, i64 0, !7, i64 4}
!30 = !{!26, !7, i64 8}
!31 = !{!26, !7, i64 0}
!32 = !{!26, !7, i64 12}
!33 = !{!26, !7, i64 4}
!34 = !{!28, !7, i64 40}
!35 = !{!26, !7, i64 32}
!36 = !{!28, !7, i64 44}
!37 = !{!26, !7, i64 36}
!38 = !{!26, !15, i64 73}
!39 = !{!28, !7, i64 72}
!40 = !{!26, !15, i64 72}


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