; LLVM IR from 0intro/wmii :: cmd/strut (win)

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

@scr = external global %struct.Screen, align 8
@direction = external global i32, align 4
@ZR = external constant %struct.Rectangle, align 4

; Function Attrs: nounwind uwtable
define dso_local void @restrut(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x %struct.Rectangle], align 16
  %4 = alloca %struct.Rectangle, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.Window, ptr %5, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !9
  %7 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 64, i1 false)
  %8 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %9 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 0
  %10 = load i32, ptr %9, align 4, !tbaa !12
  %11 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %12 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %13 = load i32, ptr %12, align 4, !tbaa !15
  %14 = sub nsw i32 %10, %13
  %15 = load i32, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 8, !tbaa !16
  %16 = load i32, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), align 8, !tbaa !22
  %17 = sub nsw i32 %15, %16
  %18 = sdiv i32 %17, 2
  %19 = icmp slt i32 %14, %18
  br i1 %19, label %20, label %58

20:                                               ; preds = %1
  %21 = load i32, ptr @direction, align 4, !tbaa !10
  %22 = icmp ne i32 %21, 2
  br i1 %22, label %23, label %58

23:                                               ; preds = %20
  %24 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %25 = getelementptr inbounds %struct.Point, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 4, !tbaa !15
  %27 = load i32, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), align 8, !tbaa !22
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %29, label %40

29:                                               ; preds = %23
  %30 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !9
  %31 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %32 = getelementptr inbounds %struct.Rectangle, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.Point, ptr %32, i32 0, i32 0
  store i32 0, ptr %33, align 16, !tbaa !15
  %34 = load i32, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), align 8, !tbaa !22
  %35 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %36 = getelementptr inbounds %struct.Rectangle, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds %struct.Point, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !12
  %39 = sub nsw i32 %38, %34
  store i32 %39, ptr %37, align 8, !tbaa !12
  br label %40

40:                                               ; preds = %29, %23
  %41 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %42 = getelementptr inbounds %struct.Point, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 4, !tbaa !12
  %44 = load i32, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 8, !tbaa !16
  %45 = icmp sge i32 %43, %44
  br i1 %45, label %46, label %57

46:                                               ; preds = %40
  %47 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !9
  %48 = load i32, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 8, !tbaa !16
  %49 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %50 = getelementptr inbounds %struct.Rectangle, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.Point, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 16, !tbaa !15
  %53 = sub nsw i32 %52, %48
  store i32 %53, ptr %51, align 16, !tbaa !15
  %54 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %55 = getelementptr inbounds %struct.Rectangle, ptr %54, i32 0, i32 1
  %56 = getelementptr inbounds %struct.Point, ptr %55, i32 0, i32 0
  store i32 0, ptr %56, align 8, !tbaa !12
  br label %57

57:                                               ; preds = %46, %40
  br label %58

58:                                               ; preds = %57, %20, %1
  %59 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %60 = getelementptr inbounds %struct.Point, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !23
  %62 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %63 = getelementptr inbounds %struct.Point, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !24
  %65 = sub nsw i32 %61, %64
  %66 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !25
  %67 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 4, !tbaa !26
  %68 = sub nsw i32 %66, %67
  %69 = sdiv i32 %68, 2
  %70 = icmp slt i32 %65, %69
  br i1 %70, label %71, label %109

71:                                               ; preds = %58
  %72 = load i32, ptr @direction, align 4, !tbaa !10
  %73 = icmp ne i32 %72, 1
  br i1 %73, label %74, label %109

74:                                               ; preds = %71
  %75 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %76 = getelementptr inbounds %struct.Point, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !24
  %78 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 4, !tbaa !26
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %80, label %91

80:                                               ; preds = %74
  %81 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %81, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !9
  %82 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %83 = getelementptr inbounds %struct.Rectangle, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.Point, ptr %83, i32 0, i32 1
  store i32 0, ptr %84, align 4, !tbaa !24
  %85 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), align 4, !tbaa !26
  %86 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %87 = getelementptr inbounds %struct.Rectangle, ptr %86, i32 0, i32 1
  %88 = getelementptr inbounds %struct.Point, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !23
  %90 = sub nsw i32 %89, %85
  store i32 %90, ptr %88, align 4, !tbaa !23
  br label %91

91:                                               ; preds = %80, %74
  %92 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %93 = getelementptr inbounds %struct.Point, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !23
  %95 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !25
  %96 = icmp sge i32 %94, %95
  br i1 %96, label %97, label %108

97:                                               ; preds = %91
  %98 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %98, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !9
  %99 = load i32, ptr getelementptr inbounds (%struct.Point, ptr getelementptr inbounds (%struct.Rectangle, ptr getelementptr inbounds (%struct.Screen, ptr @scr, i32 0, i32 7), i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !25
  %100 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %101 = getelementptr inbounds %struct.Rectangle, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.Point, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !24
  %104 = sub nsw i32 %103, %99
  store i32 %104, ptr %102, align 4, !tbaa !24
  %105 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %106 = getelementptr inbounds %struct.Rectangle, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds %struct.Point, ptr %106, i32 0, i32 1
  store i32 0, ptr %107, align 4, !tbaa !23
  br label %108

108:                                              ; preds = %97, %91
  br label %109

109:                                              ; preds = %108, %71, %58
  %110 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %111 = getelementptr inbounds %struct.Rectangle, ptr %110, i32 0, i32 1
  %112 = getelementptr inbounds %struct.Point, ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !23
  %114 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %115 = getelementptr inbounds %struct.Rectangle, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %struct.Point, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !24
  %118 = sub nsw i32 %113, %117
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %193

120:                                              ; preds = %109
  %121 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %122 = getelementptr inbounds %struct.Rectangle, ptr %121, i32 0, i32 1
  %123 = getelementptr inbounds %struct.Point, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !12
  %125 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %126 = getelementptr inbounds %struct.Rectangle, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.Point, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 16, !tbaa !15
  %129 = sub nsw i32 %124, %128
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %156

131:                                              ; preds = %120
  %132 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %133 = getelementptr inbounds %struct.Rectangle, ptr %132, i32 0, i32 1
  %134 = getelementptr inbounds %struct.Point, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !23
  %136 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %137 = getelementptr inbounds %struct.Rectangle, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds %struct.Point, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !24
  %140 = sub nsw i32 %135, %139
  %141 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %142 = getelementptr inbounds %struct.Rectangle, ptr %141, i32 0, i32 1
  %143 = getelementptr inbounds %struct.Point, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !12
  %145 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %146 = getelementptr inbounds %struct.Rectangle, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.Point, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 16, !tbaa !15
  %149 = sub nsw i32 %144, %148
  %150 = icmp slt i32 %140, %149
  br i1 %150, label %151, label %153

151:                                              ; preds = %131
  %152 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %152, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %155

153:                                              ; preds = %131
  %154 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %154, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %155

155:                                              ; preds = %153, %151
  br label %156

156:                                              ; preds = %155, %120
  %157 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %158 = getelementptr inbounds %struct.Rectangle, ptr %157, i32 0, i32 1
  %159 = getelementptr inbounds %struct.Point, ptr %158, i32 0, i32 0
  %160 = load i32, ptr %159, align 8, !tbaa !12
  %161 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %162 = getelementptr inbounds %struct.Rectangle, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.Point, ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 16, !tbaa !15
  %165 = sub nsw i32 %160, %164
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %192

167:                                              ; preds = %156
  %168 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %169 = getelementptr inbounds %struct.Rectangle, ptr %168, i32 0, i32 1
  %170 = getelementptr inbounds %struct.Point, ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 4, !tbaa !23
  %172 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  %173 = getelementptr inbounds %struct.Rectangle, ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds %struct.Point, ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !24
  %176 = sub nsw i32 %171, %175
  %177 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %178 = getelementptr inbounds %struct.Rectangle, ptr %177, i32 0, i32 1
  %179 = getelementptr inbounds %struct.Point, ptr %178, i32 0, i32 0
  %180 = load i32, ptr %179, align 8, !tbaa !12
  %181 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %182 = getelementptr inbounds %struct.Rectangle, ptr %181, i32 0, i32 0
  %183 = getelementptr inbounds %struct.Point, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 16, !tbaa !15
  %185 = sub nsw i32 %180, %184
  %186 = icmp slt i32 %176, %185
  br i1 %186, label %187, label %189

187:                                              ; preds = %167
  %188 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %188, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %191

189:                                              ; preds = %167
  %190 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %190, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %191

191:                                              ; preds = %189, %187
  br label %192

192:                                              ; preds = %191, %156
  br label %193

193:                                              ; preds = %192, %109
  %194 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %195 = getelementptr inbounds %struct.Rectangle, ptr %194, i32 0, i32 1
  %196 = getelementptr inbounds %struct.Point, ptr %195, i32 0, i32 1
  %197 = load i32, ptr %196, align 4, !tbaa !23
  %198 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %199 = getelementptr inbounds %struct.Rectangle, ptr %198, i32 0, i32 0
  %200 = getelementptr inbounds %struct.Point, ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !24
  %202 = sub nsw i32 %197, %201
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %277

204:                                              ; preds = %193
  %205 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %206 = getelementptr inbounds %struct.Rectangle, ptr %205, i32 0, i32 1
  %207 = getelementptr inbounds %struct.Point, ptr %206, i32 0, i32 0
  %208 = load i32, ptr %207, align 8, !tbaa !12
  %209 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %210 = getelementptr inbounds %struct.Rectangle, ptr %209, i32 0, i32 0
  %211 = getelementptr inbounds %struct.Point, ptr %210, i32 0, i32 0
  %212 = load i32, ptr %211, align 16, !tbaa !15
  %213 = sub nsw i32 %208, %212
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %215, label %240

215:                                              ; preds = %204
  %216 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %217 = getelementptr inbounds %struct.Rectangle, ptr %216, i32 0, i32 1
  %218 = getelementptr inbounds %struct.Point, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !23
  %220 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %221 = getelementptr inbounds %struct.Rectangle, ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds %struct.Point, ptr %221, i32 0, i32 1
  %223 = load i32, ptr %222, align 4, !tbaa !24
  %224 = sub nsw i32 %219, %223
  %225 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %226 = getelementptr inbounds %struct.Rectangle, ptr %225, i32 0, i32 1
  %227 = getelementptr inbounds %struct.Point, ptr %226, i32 0, i32 0
  %228 = load i32, ptr %227, align 8, !tbaa !12
  %229 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  %230 = getelementptr inbounds %struct.Rectangle, ptr %229, i32 0, i32 0
  %231 = getelementptr inbounds %struct.Point, ptr %230, i32 0, i32 0
  %232 = load i32, ptr %231, align 16, !tbaa !15
  %233 = sub nsw i32 %228, %232
  %234 = icmp slt i32 %224, %233
  br i1 %234, label %235, label %237

235:                                              ; preds = %215
  %236 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %236, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %239

237:                                              ; preds = %215
  %238 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %238, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %239

239:                                              ; preds = %237, %235
  br label %240

240:                                              ; preds = %239, %204
  %241 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %242 = getelementptr inbounds %struct.Rectangle, ptr %241, i32 0, i32 1
  %243 = getelementptr inbounds %struct.Point, ptr %242, i32 0, i32 0
  %244 = load i32, ptr %243, align 8, !tbaa !12
  %245 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %246 = getelementptr inbounds %struct.Rectangle, ptr %245, i32 0, i32 0
  %247 = getelementptr inbounds %struct.Point, ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 16, !tbaa !15
  %249 = sub nsw i32 %244, %248
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %251, label %276

251:                                              ; preds = %240
  %252 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %253 = getelementptr inbounds %struct.Rectangle, ptr %252, i32 0, i32 1
  %254 = getelementptr inbounds %struct.Point, ptr %253, i32 0, i32 1
  %255 = load i32, ptr %254, align 4, !tbaa !23
  %256 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  %257 = getelementptr inbounds %struct.Rectangle, ptr %256, i32 0, i32 0
  %258 = getelementptr inbounds %struct.Point, ptr %257, i32 0, i32 1
  %259 = load i32, ptr %258, align 4, !tbaa !24
  %260 = sub nsw i32 %255, %259
  %261 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %262 = getelementptr inbounds %struct.Rectangle, ptr %261, i32 0, i32 1
  %263 = getelementptr inbounds %struct.Point, ptr %262, i32 0, i32 0
  %264 = load i32, ptr %263, align 8, !tbaa !12
  %265 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  %266 = getelementptr inbounds %struct.Rectangle, ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds %struct.Point, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 16, !tbaa !15
  %269 = sub nsw i32 %264, %268
  %270 = icmp slt i32 %260, %269
  br i1 %270, label %271, label %273

271:                                              ; preds = %251
  %272 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %272, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %275

273:                                              ; preds = %251
  %274 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %274, ptr align 4 @ZR, i64 16, i1 false), !tbaa.struct !9
  br label %275

275:                                              ; preds = %273, %271
  br label %276

276:                                              ; preds = %275, %240
  br label %277

277:                                              ; preds = %276, %193
  %278 = load ptr, ptr %2, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.Window, ptr %278, i32 0, i32 18
  %280 = load ptr, ptr %279, align 8, !tbaa !27
  %281 = getelementptr inbounds [4 x %struct.Rectangle], ptr %3, i64 0, i64 0
  call void @ewmh_setstrut(ptr noundef %280, ptr noundef %281)
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #5
  ret void
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @ewmh_setstrut(ptr noundef, ptr noundef) #4

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10, i64 12, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"Rectangle", !14, i64 0, !14, i64 8}
!14 = !{!"Point", !11, i64 0, !11, i64 4}
!15 = !{!13, !11, i64 0}
!16 = !{!17, !11, i64 248}
!17 = !{!"Screen", !11, i64 0, !18, i64 8, !6, i64 200, !19, i64 208, !19, i64 216, !6, i64 224, !6, i64 232, !13, i64 240, !11, i64 256, !11, i64 260, !6, i64 264}
!18 = !{!"Window", !11, i64 0, !19, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !19, 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, !20, i64 128, !19, i64 152, !6, i64 160, !6, i64 168, !21, i64 176, !11, i64 180, !11, i64 184}
!19 = !{!"long", !7, i64 0}
!20 = !{!"Ewmh", !19, i64 0, !19, i64 8, !19, i64 16}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!17, !11, i64 240}
!23 = !{!13, !11, i64 12}
!24 = !{!13, !11, i64 4}
!25 = !{!17, !11, i64 252}
!26 = !{!17, !11, i64 244}
!27 = !{!18, !6, i64 168}


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

@scr = external local_unnamed_addr global %struct.Screen, align 8
@direction = external local_unnamed_addr global i32, align 4
@ZR = external local_unnamed_addr constant %struct.Rectangle, align 4

; Function Attrs: nounwind uwtable
define dso_local void @restrut(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [4 x %struct.Rectangle], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #5
  %3 = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.0.0.copyload = load i32, ptr %3, align 8, !tbaa !5
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 60
  %.sroa.9.0.copyload = load i32, ptr %.sroa.9.0..sroa_idx, align 4, !tbaa !5
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.11.0.copyload = load i32, ptr %.sroa.11.0..sroa_idx, align 8, !tbaa !5
  %.sroa.13.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 68
  %.sroa.13.0.copyload = load i32, ptr %.sroa.13.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %2, i8 0, i64 64, i1 false)
  %4 = sub nsw i32 %.sroa.11.0.copyload, %.sroa.0.0.copyload
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @scr, i64 248), align 8, !tbaa !9
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @scr, i64 240), align 8, !tbaa !18
  %7 = sub nsw i32 %5, %6
  %8 = sdiv i32 %7, 2
  %9 = icmp slt i32 %4, %8
  %10 = load i32, ptr @direction, align 4
  %11 = icmp ne i32 %10, 2
  %or.cond = select i1 %9, i1 %11, i1 false
  br i1 %or.cond, label %12, label %20

12:                                               ; preds = %1
  %.not = icmp sgt i32 %.sroa.0.0.copyload, %6
  br i1 %.not, label %15, label %13

13:                                               ; preds = %12
  %.sroa.9.0..sroa_idx9 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %.sroa.9.0.copyload, ptr %.sroa.9.0..sroa_idx9, align 4, !tbaa !5
  %.sroa.11.0..sroa_idx18 = getelementptr inbounds i8, ptr %2, i64 8
  %.sroa.13.0..sroa_idx27 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 %.sroa.13.0.copyload, ptr %.sroa.13.0..sroa_idx27, align 4, !tbaa !5
  store i32 0, ptr %2, align 16, !tbaa !19
  %14 = sub nsw i32 %.sroa.11.0.copyload, %6
  store i32 %14, ptr %.sroa.11.0..sroa_idx18, align 8, !tbaa !20
  br label %15

15:                                               ; preds = %13, %12
  %16 = phi i32 [ %14, %13 ], [ 0, %12 ]
  %.not42 = icmp slt i32 %.sroa.11.0.copyload, %5
  br i1 %.not42, label %20, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  %.sroa.9.0..sroa_idx11 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 %.sroa.9.0.copyload, ptr %.sroa.9.0..sroa_idx11, align 4, !tbaa !5
  %.sroa.11.0..sroa_idx20 = getelementptr inbounds i8, ptr %2, i64 24
  %.sroa.13.0..sroa_idx29 = getelementptr inbounds i8, ptr %2, i64 28
  store i32 %.sroa.13.0.copyload, ptr %.sroa.13.0..sroa_idx29, align 4, !tbaa !5
  %19 = sub nsw i32 %.sroa.0.0.copyload, %5
  store i32 %19, ptr %18, align 16, !tbaa !19
  store i32 0, ptr %.sroa.11.0..sroa_idx20, align 8, !tbaa !20
  br label %20

20:                                               ; preds = %15, %17, %1
  %21 = phi i32 [ 0, %15 ], [ %19, %17 ], [ 0, %1 ]
  %22 = phi i32 [ %16, %15 ], [ %16, %17 ], [ 0, %1 ]
  %23 = sub nsw i32 %.sroa.13.0.copyload, %.sroa.9.0.copyload
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @scr, i64 252), align 4, !tbaa !21
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @scr, i64 244), align 4, !tbaa !22
  %26 = sub nsw i32 %24, %25
  %27 = sdiv i32 %26, 2
  %28 = icmp slt i32 %23, %27
  %29 = icmp ne i32 %10, 1
  %or.cond3 = select i1 %28, i1 %29, i1 false
  br i1 %or.cond3, label %30, label %.thread52

30:                                               ; preds = %20
  %.not43 = icmp sgt i32 %.sroa.9.0.copyload, %25
  br i1 %.not43, label %34, label %31

31:                                               ; preds = %30
  %32 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 %.sroa.0.0.copyload, ptr %32, align 16, !tbaa !5
  %.sroa.9.0..sroa_idx13 = getelementptr inbounds i8, ptr %2, i64 36
  %.sroa.11.0..sroa_idx22 = getelementptr inbounds i8, ptr %2, i64 40
  store i32 %.sroa.11.0.copyload, ptr %.sroa.11.0..sroa_idx22, align 8, !tbaa !5
  %.sroa.13.0..sroa_idx31 = getelementptr inbounds i8, ptr %2, i64 44
  store i32 0, ptr %.sroa.9.0..sroa_idx13, align 4, !tbaa !23
  %33 = sub nsw i32 %.sroa.13.0.copyload, %25
  store i32 %33, ptr %.sroa.13.0..sroa_idx31, align 4, !tbaa !24
  br label %34

34:                                               ; preds = %31, %30
  %35 = phi i32 [ %33, %31 ], [ 0, %30 ]
  %.not44 = icmp slt i32 %.sroa.13.0.copyload, %24
  br i1 %.not44, label %39, label %36

36:                                               ; preds = %34
  %37 = getelementptr inbounds i8, ptr %2, i64 48
  store i32 %.sroa.0.0.copyload, ptr %37, align 16, !tbaa !5
  %.sroa.9.0..sroa_idx15 = getelementptr inbounds i8, ptr %2, i64 52
  %.sroa.11.0..sroa_idx24 = getelementptr inbounds i8, ptr %2, i64 56
  store i32 %.sroa.11.0.copyload, ptr %.sroa.11.0..sroa_idx24, align 8, !tbaa !5
  %.sroa.13.0..sroa_idx33 = getelementptr inbounds i8, ptr %2, i64 60
  %38 = sub nsw i32 %.sroa.9.0.copyload, %24
  store i32 %38, ptr %.sroa.9.0..sroa_idx15, align 4, !tbaa !23
  store i32 0, ptr %.sroa.13.0..sroa_idx33, align 4, !tbaa !24
  br label %39

39:                                               ; preds = %34, %36
  %40 = phi i32 [ 0, %34 ], [ %38, %36 ]
  %41 = getelementptr inbounds i8, ptr %2, i64 32
  %42 = getelementptr inbounds i8, ptr %2, i64 44
  %43 = getelementptr inbounds i8, ptr %2, i64 36
  %.not45 = icmp eq i32 %35, 0
  br i1 %.not45, label %53, label %44

44:                                               ; preds = %39
  %.not46 = icmp eq i32 %22, 0
  br i1 %.not46, label %46, label %.sink.split

.sink.split:                                      ; preds = %44
  %45 = icmp slt i32 %35, %22
  %. = select i1 %45, ptr %2, ptr %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %., ptr noundef nonnull align 4 dereferenceable(16) @ZR, i64 16, i1 false)
  br label %46

46:                                               ; preds = %.sink.split, %44
  %.not47 = icmp eq i32 %21, 0
  br i1 %.not47, label %53, label %.sink.split54

.sink.split54:                                    ; preds = %46
  %47 = getelementptr inbounds i8, ptr %2, i64 16
  %48 = sub nsw i32 0, %21
  %49 = load i32, ptr %42, align 4, !tbaa !24
  %50 = load i32, ptr %43, align 4, !tbaa !23
  %51 = sub nsw i32 %49, %50
  %52 = icmp slt i32 %51, %48
  %.59 = select i1 %52, ptr %47, ptr %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %.59, ptr noundef nonnull align 4 dereferenceable(16) @ZR, i64 16, i1 false)
  br label %53

53:                                               ; preds = %.sink.split54, %46, %39
  %54 = getelementptr inbounds i8, ptr %2, i64 48
  %55 = getelementptr inbounds i8, ptr %2, i64 60
  %56 = getelementptr inbounds i8, ptr %2, i64 52
  %57 = sub nsw i32 0, %40
  %.not48 = icmp eq i32 %40, 0
  br i1 %.not48, label %.thread52, label %58

58:                                               ; preds = %53
  %59 = getelementptr inbounds i8, ptr %2, i64 8
  %60 = load i32, ptr %59, align 8, !tbaa !20
  %61 = load i32, ptr %2, align 16, !tbaa !19
  %.not49 = icmp eq i32 %60, %61
  br i1 %.not49, label %64, label %.sink.split56

.sink.split56:                                    ; preds = %58
  %62 = sub nsw i32 %60, %61
  %63 = icmp sgt i32 %62, %57
  %.60 = select i1 %63, ptr %2, ptr %54
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %.60, ptr noundef nonnull align 4 dereferenceable(16) @ZR, i64 16, i1 false)
  br label %64

64:                                               ; preds = %.sink.split56, %58
  %65 = getelementptr inbounds i8, ptr %2, i64 16
  %66 = getelementptr inbounds i8, ptr %2, i64 24
  %67 = load i32, ptr %66, align 8, !tbaa !20
  %68 = load i32, ptr %65, align 16, !tbaa !19
  %.not50 = icmp eq i32 %67, %68
  br i1 %.not50, label %.thread52, label %.thread52.sink.split

.thread52.sink.split:                             ; preds = %64
  %69 = sub nsw i32 %67, %68
  %70 = load i32, ptr %55, align 4, !tbaa !24
  %71 = load i32, ptr %56, align 4, !tbaa !23
  %72 = sub nsw i32 %70, %71
  %73 = icmp slt i32 %72, %69
  %.61 = select i1 %73, ptr %65, ptr %54
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %.61, ptr noundef nonnull align 4 dereferenceable(16) @ZR, i64 16, i1 false)
  br label %.thread52

.thread52:                                        ; preds = %.thread52.sink.split, %20, %64, %53
  %74 = getelementptr inbounds i8, ptr %0, i64 168
  %75 = load ptr, ptr %74, align 8, !tbaa !25
  call void @ewmh_setstrut(ptr noundef %75, ptr noundef nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 64, 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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @ewmh_setstrut(ptr noundef, ptr noundef) local_unnamed_addr #4

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 248}
!10 = !{!"Screen", !6, i64 0, !11, i64 8, !13, i64 200, !12, i64 208, !12, i64 216, !13, i64 224, !13, i64 232, !14, i64 240, !6, i64 256, !6, i64 260, !13, i64 264}
!11 = !{!"Window", !6, i64 0, !12, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !12, i64 40, !13, i64 48, !14, i64 56, !6, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !16, i64 128, !12, i64 152, !13, i64 160, !13, i64 168, !17, i64 176, !6, i64 180, !6, i64 184}
!12 = !{!"long", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"Rectangle", !15, i64 0, !15, i64 8}
!15 = !{!"Point", !6, i64 0, !6, i64 4}
!16 = !{!"Ewmh", !12, i64 0, !12, i64 8, !12, i64 16}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!10, !6, i64 240}
!19 = !{!14, !6, i64 0}
!20 = !{!14, !6, i64 8}
!21 = !{!10, !6, i64 252}
!22 = !{!10, !6, i64 244}
!23 = !{!14, !6, i64 4}
!24 = !{!14, !6, i64 12}
!25 = !{!11, !13, i64 168}


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