; LLVM IR from erincatto/box2d :: test (main)

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

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %14

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  %15 = call i32 @BitSetTest()
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %20

18:                                               ; preds = %14
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %23

20:                                               ; preds = %14
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %22

22:                                               ; preds = %20
  store i32 0, ptr %3, align 4
  br label %23

23:                                               ; preds = %22, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %24 = load i32, ptr %3, align 4
  switch i32 %24, label %135 [
    i32 0, label %25
    i32 1, label %133
  ]

25:                                               ; preds = %23
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %28 = call i32 @CollisionTest()
  store i32 %28, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %33

31:                                               ; preds = %27
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %36

33:                                               ; preds = %27
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %35

35:                                               ; preds = %33
  store i32 0, ptr %3, align 4
  br label %36

36:                                               ; preds = %35, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %37 = load i32, ptr %3, align 4
  switch i32 %37, label %135 [
    i32 0, label %38
    i32 1, label %133
  ]

38:                                               ; preds = %36
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %41 = call i32 @DeterminismTest()
  store i32 %41, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %46

44:                                               ; preds = %40
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %49

46:                                               ; preds = %40
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %48

48:                                               ; preds = %46
  store i32 0, ptr %3, align 4
  br label %49

49:                                               ; preds = %48, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  %50 = load i32, ptr %3, align 4
  switch i32 %50, label %135 [
    i32 0, label %51
    i32 1, label %133
  ]

51:                                               ; preds = %49
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %54 = call i32 @DistanceTest()
  store i32 %54, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = icmp eq i32 %55, 1
  br i1 %56, label %57, label %59

57:                                               ; preds = %53
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %62

59:                                               ; preds = %53
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %61

61:                                               ; preds = %59
  store i32 0, ptr %3, align 4
  br label %62

62:                                               ; preds = %61, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %63 = load i32, ptr %3, align 4
  switch i32 %63, label %135 [
    i32 0, label %64
    i32 1, label %133
  ]

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %67 = call i32 @IdTest()
  store i32 %67, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %75

72:                                               ; preds = %66
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %74

74:                                               ; preds = %72
  store i32 0, ptr %3, align 4
  br label %75

75:                                               ; preds = %74, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %76 = load i32, ptr %3, align 4
  switch i32 %76, label %135 [
    i32 0, label %77
    i32 1, label %133
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %80 = call i32 @MathTest()
  store i32 %80, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %83, label %85

83:                                               ; preds = %79
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %88

85:                                               ; preds = %79
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %87

87:                                               ; preds = %85
  store i32 0, ptr %3, align 4
  br label %88

88:                                               ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %89 = load i32, ptr %3, align 4
  switch i32 %89, label %135 [
    i32 0, label %90
    i32 1, label %133
  ]

90:                                               ; preds = %88
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %93 = call i32 @ShapeTest()
  store i32 %93, ptr %9, align 4, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %98

96:                                               ; preds = %92
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %101

98:                                               ; preds = %92
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %100

100:                                              ; preds = %98
  store i32 0, ptr %3, align 4
  br label %101

101:                                              ; preds = %100, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %102 = load i32, ptr %3, align 4
  switch i32 %102, label %135 [
    i32 0, label %103
    i32 1, label %133
  ]

103:                                              ; preds = %101
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %106 = call i32 @TableTest()
  store i32 %106, ptr %10, align 4, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %111

109:                                              ; preds = %105
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %114

111:                                              ; preds = %105
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  br label %113

113:                                              ; preds = %111
  store i32 0, ptr %3, align 4
  br label %114

114:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %115 = load i32, ptr %3, align 4
  switch i32 %115, label %135 [
    i32 0, label %116
    i32 1, label %133
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %119 = call i32 @WorldTest()
  store i32 %119, ptr %11, align 4, !tbaa !5
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = icmp eq i32 %120, 1
  br i1 %121, label %122, label %124

122:                                              ; preds = %118
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %127

124:                                              ; preds = %118
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  br label %126

126:                                              ; preds = %124
  store i32 0, ptr %3, align 4
  br label %127

127:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %128 = load i32, ptr %3, align 4
  switch i32 %128, label %135 [
    i32 0, label %129
    i32 1, label %133
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  store i32 0, ptr %1, align 4
  br label %133

133:                                              ; preds = %130, %127, %114, %101, %88, %75, %62, %49, %36, %23
  %134 = load i32, ptr %1, align 4
  ret i32 %134

135:                                              ; preds = %127, %114, %101, %88, %75, %62, %49, %36, %23
  unreachable
}

declare i32 @printf(ptr noundef, ...) #1

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

declare i32 @BitSetTest() #1

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

declare i32 @CollisionTest() #1

declare i32 @DeterminismTest() #1

declare i32 @DistanceTest() #1

declare i32 @IdTest() #1

declare i32 @MathTest() #1

declare i32 @ShapeTest() #1

declare i32 @TableTest() #1

declare i32 @WorldTest() #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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; 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 [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %3 = tail call i32 @BitSetTest() #3
  %4 = icmp eq i32 %3, 1
  br i1 %4, label %40, label %5

5:                                                ; preds = %0
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %7 = tail call i32 @CollisionTest() #3
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %40, label %9

9:                                                ; preds = %5
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %11 = tail call i32 @DeterminismTest() #3
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %40, label %13

13:                                               ; preds = %9
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %15 = tail call i32 @DistanceTest() #3
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %40, label %17

17:                                               ; preds = %13
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %19 = tail call i32 @IdTest() #3
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %40, label %21

21:                                               ; preds = %17
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %23 = tail call i32 @MathTest() #3
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %40, label %25

25:                                               ; preds = %21
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %27 = tail call i32 @ShapeTest() #3
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %40, label %29

29:                                               ; preds = %25
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %31 = tail call i32 @TableTest() #3
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %40, label %33

33:                                               ; preds = %29
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %35 = tail call i32 @WorldTest() #3
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %40, label %37

37:                                               ; preds = %33
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %40

40:                                               ; preds = %33, %29, %25, %21, %17, %13, %9, %5, %0, %37
  %.str.18.sink = phi ptr [ @.str.20, %37 ], [ @.str.2, %0 ], [ @.str.4, %5 ], [ @.str.6, %9 ], [ @.str.8, %13 ], [ @.str.10, %17 ], [ @.str.12, %21 ], [ @.str.14, %25 ], [ @.str.16, %29 ], [ @.str.18, %33 ]
  %.9 = phi i32 [ 0, %37 ], [ 1, %0 ], [ 1, %5 ], [ 1, %9 ], [ 1, %13 ], [ 1, %17 ], [ 1, %21 ], [ 1, %25 ], [ 1, %29 ], [ 1, %33 ]
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.18.sink)
  ret i32 %.9
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare i32 @BitSetTest() local_unnamed_addr #2

declare i32 @CollisionTest() local_unnamed_addr #2

declare i32 @DeterminismTest() local_unnamed_addr #2

declare i32 @DistanceTest() local_unnamed_addr #2

declare i32 @IdTest() local_unnamed_addr #2

declare i32 @MathTest() local_unnamed_addr #2

declare i32 @ShapeTest() local_unnamed_addr #2

declare i32 @TableTest() local_unnamed_addr #2

declare i32 @WorldTest() local_unnamed_addr #2

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 = { nofree 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 #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)"}


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