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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Rectangle = type { %struct.Point, %struct.Point }
%struct.Point = type { i32, i32 }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @ewmh_setstrut(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [12 x i64], align 16
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.Rectangle, ptr %7, i64 0
  %9 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 0
  %10 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 1
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 4
  store i64 %12, ptr %13, align 16, !tbaa !13
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.Rectangle, ptr %14, i64 0
  %16 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 1
  %17 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 4, !tbaa !15
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 0
  store i64 %19, ptr %20, align 16, !tbaa !13
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Rectangle, ptr %21, i64 0
  %23 = getelementptr inbounds %struct.Rectangle, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds %struct.Point, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !16
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 5
  store i64 %26, ptr %27, align 8, !tbaa !13
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.Rectangle, ptr %28, i64 1
  %30 = getelementptr inbounds %struct.Rectangle, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct.Point, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 6
  store i64 %33, ptr %34, align 16, !tbaa !13
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Rectangle, ptr %35, i64 1
  %37 = getelementptr inbounds %struct.Rectangle, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %struct.Point, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !17
  %40 = sub nsw i32 0, %39
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 1
  store i64 %41, ptr %42, align 8, !tbaa !13
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Rectangle, ptr %43, i64 1
  %45 = getelementptr inbounds %struct.Rectangle, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.Point, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 7
  store i64 %48, ptr %49, align 8, !tbaa !13
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Rectangle, ptr %50, i64 2
  %52 = getelementptr inbounds %struct.Rectangle, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %struct.Point, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 8
  store i64 %55, ptr %56, align 16, !tbaa !13
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.Rectangle, ptr %57, i64 2
  %59 = getelementptr inbounds %struct.Rectangle, ptr %58, i32 0, i32 1
  %60 = getelementptr inbounds %struct.Point, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !16
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 2
  store i64 %62, ptr %63, align 16, !tbaa !13
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Rectangle, ptr %64, i64 2
  %66 = getelementptr inbounds %struct.Rectangle, ptr %65, i32 0, i32 1
  %67 = getelementptr inbounds %struct.Point, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 4, !tbaa !15
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 9
  store i64 %69, ptr %70, align 8, !tbaa !13
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Rectangle, ptr %71, i64 3
  %73 = getelementptr inbounds %struct.Rectangle, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.Point, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 4, !tbaa !17
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 10
  store i64 %76, ptr %77, align 16, !tbaa !13
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Rectangle, ptr %78, i64 3
  %80 = getelementptr inbounds %struct.Rectangle, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.Point, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sub nsw i32 0, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 3
  store i64 %84, ptr %85, align 8, !tbaa !13
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Rectangle, ptr %86, i64 3
  %88 = getelementptr inbounds %struct.Rectangle, ptr %87, i32 0, i32 1
  %89 = getelementptr inbounds %struct.Point, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 11
  store i64 %91, ptr %92, align 8, !tbaa !13
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %93

93:                                               ; preds = %107, %2
  %94 = load i32, ptr %6, align 4, !tbaa !18
  %95 = icmp slt i32 %94, 12
  br i1 %95, label %96, label %110

96:                                               ; preds = %93
  %97 = load i32, ptr %6, align 4, !tbaa !18
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !13
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %96
  %103 = load i32, ptr %6, align 4, !tbaa !18
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 %104
  store i64 0, ptr %105, align 8, !tbaa !13
  br label %106

106:                                              ; preds = %102, %96
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %6, align 4, !tbaa !18
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %6, align 4, !tbaa !18
  br label %93, !llvm.loop !19

110:                                              ; preds = %93
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds [12 x i64], ptr %5, i64 0, i64 0
  call void @changeprop_long(ptr noundef %111, ptr noundef @.str, ptr noundef @.str.1, ptr noundef %112, i32 noundef 12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %5) #3
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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, !12, i64 4}
!10 = !{!"Rectangle", !11, i64 0, !11, i64 8}
!11 = !{!"Point", !12, i64 0, !12, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !12, i64 8}
!16 = !{!10, !12, i64 12}
!17 = !{!10, !12, i64 0}
!18 = !{!12, !12, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @ewmh_setstrut(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = alloca [12 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %3) #3
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i8, ptr %3, i64 32
  store i64 %6, ptr %7, align 16, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load i32, ptr %8, align 4, !tbaa !13
  %10 = sext i32 %9 to i64
  store i64 %10, ptr %3, align 16, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %1, i64 12
  %12 = load i32, ptr %11, align 4, !tbaa !14
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i8, ptr %3, i64 40
  store i64 %13, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = getelementptr inbounds i8, ptr %1, i64 20
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds i8, ptr %3, i64 48
  store i64 %18, ptr %19, align 16, !tbaa !11
  %20 = load i32, ptr %15, align 4, !tbaa !15
  %21 = sub nsw i32 0, %20
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 %22, ptr %23, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %1, i64 28
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %3, i64 56
  store i64 %26, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds i8, ptr %1, i64 32
  %29 = load i32, ptr %28, align 4, !tbaa !15
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %3, i64 64
  store i64 %30, ptr %31, align 16, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %1, i64 40
  %33 = getelementptr inbounds i8, ptr %1, i64 44
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %3, i64 16
  store i64 %35, ptr %36, align 16, !tbaa !11
  %37 = load i32, ptr %32, align 4, !tbaa !13
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %3, i64 72
  store i64 %38, ptr %39, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %1, i64 48
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %3, i64 80
  store i64 %42, ptr %43, align 16, !tbaa !11
  %44 = getelementptr inbounds i8, ptr %1, i64 52
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sub nsw i32 0, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %3, i64 24
  store i64 %47, ptr %48, align 8, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %1, i64 56
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %3, i64 88
  store i64 %51, ptr %52, align 8, !tbaa !11
  %53 = icmp slt i32 %9, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %2
  store i64 0, ptr %3, align 16, !tbaa !11
  br label %55

55:                                               ; preds = %2, %54
  %56 = icmp sgt i32 %20, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %55
  store i64 0, ptr %23, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %57, %55
  %59 = icmp slt i32 %34, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %58
  store i64 0, ptr %36, align 16, !tbaa !11
  br label %61

61:                                               ; preds = %60, %58
  %62 = icmp sgt i32 %45, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %61
  store i64 0, ptr %48, align 8, !tbaa !11
  br label %64

64:                                               ; preds = %63, %61
  %65 = icmp slt i32 %5, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  store i64 0, ptr %7, align 16, !tbaa !11
  br label %67

67:                                               ; preds = %66, %64
  %68 = icmp slt i32 %12, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %67
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %70

70:                                               ; preds = %69, %67
  %71 = icmp slt i32 %17, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %70
  store i64 0, ptr %19, align 16, !tbaa !11
  br label %73

73:                                               ; preds = %72, %70
  %74 = icmp slt i32 %25, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  store i64 0, ptr %27, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %75, %73
  %77 = icmp slt i32 %29, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %76
  store i64 0, ptr %31, align 16, !tbaa !11
  br label %79

79:                                               ; preds = %78, %76
  %80 = icmp slt i32 %37, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %79
  store i64 0, ptr %39, align 8, !tbaa !11
  br label %82

82:                                               ; preds = %81, %79
  %83 = icmp slt i32 %41, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %82
  store i64 0, ptr %43, align 16, !tbaa !11
  br label %85

85:                                               ; preds = %84, %82
  %86 = icmp slt i32 %50, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %85
  store i64 0, ptr %52, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %87, %85
  call void @changeprop_long(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull %3, i32 noundef 12) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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, !8, i64 4}
!6 = !{!"Rectangle", !7, i64 0, !7, i64 8}
!7 = !{!"Point", !8, i64 0, !8, i64 4}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!6, !8, i64 8}
!14 = !{!6, !8, i64 12}
!15 = !{!6, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass