; LLVM IR from aws/s2n-tls :: tests/viz (s2n_state_machine_viz)

; 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.state = type { ptr, [21 x i32] }

@message_names = external hidden global [21 x ptr], align 16
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [63 x i8], align 1
@__const.traverse_handshakes.initial = external hidden unnamed_addr constant %struct.state, align 8
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [2 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; 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: nounwind uwtable
define dso_local i32 @traverse_handshakes(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [255 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca [21 x %struct.state], align 16
  %13 = alloca %struct.state, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.state, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 255, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr @.str.20, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds [255 x i8], ptr %9, i64 0, i64 0
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %22, i64 noundef 255, ptr noundef %23, ptr noundef %24) #6
  %26 = getelementptr inbounds [255 x i8], ptr %9, i64 0, i64 0
  %27 = call noalias ptr @popen(ptr noundef %26, ptr noundef @.str.21)
  store ptr %27, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %33, label %30

30:                                               ; preds = %3
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.22) #6
  store i32 1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %203

33:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2016, ptr %12) #6
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 2016, i1 false)
  call void @llvm.lifetime.start.p0(i64 96, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 @__const.traverse_handshakes.initial, i64 96, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %48, %33
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 21
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %51

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 96, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 96, i1 false)
  %39 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [21 x ptr], ptr @message_names, i64 0, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  store ptr %43, ptr %39, align 8, !tbaa !11
  %44 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %45 = load i32, ptr %14, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %46
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 8 %15, i64 96, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 96, ptr %15) #6
  br label %48

48:                                               ; preds = %38
  %49 = load i32, ptr %14, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %14, align 4, !tbaa !9
  br label %34, !llvm.loop !15

51:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %117, %51
  %53 = load i32, ptr %16, align 4, !tbaa !9
  %54 = icmp slt i32 %53, 256
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %120

56:                                               ; preds = %52
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i32, ptr %16, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [32 x i32], ptr %57, i64 %59
  %61 = getelementptr inbounds [32 x i32], ptr %60, i64 0, i64 1
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %56
  br label %117

65:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %113, %65
  %67 = load i32, ptr %17, align 4, !tbaa !9
  %68 = icmp slt i32 %67, 32
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %116

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load i32, ptr %16, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [32 x i32], ptr %71, i64 %73
  %75 = load i32, ptr %17, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [32 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !9
  store i32 %78, ptr %18, align 4, !tbaa !9
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %85

81:                                               ; preds = %70
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  store i32 10, ptr %11, align 4
  br label %110

85:                                               ; preds = %81, %70
  %86 = load i32, ptr %17, align 4, !tbaa !9
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %93

88:                                               ; preds = %85
  %89 = getelementptr inbounds %struct.state, ptr %13, i32 0, i32 1
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds [21 x i32], ptr %89, i64 0, i64 %91
  store i32 1, ptr %92, align 4, !tbaa !9
  br label %109

93:                                               ; preds = %85
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i32, ptr %16, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [32 x i32], ptr %94, i64 %96
  %98 = load i32, ptr %17, align 4, !tbaa !9
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [32 x i32], ptr %97, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.state, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %18, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds [21 x i32], ptr %105, i64 0, i64 %107
  store i32 1, ptr %108, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %93, %88
  store i32 0, ptr %11, align 4
  br label %110

110:                                              ; preds = %109, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %111 = load i32, ptr %11, align 4
  switch i32 %111, label %205 [
    i32 0, label %112
    i32 10, label %113
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112, %110
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %17, align 4, !tbaa !9
  br label %66, !llvm.loop !17

116:                                              ; preds = %69
  br label %117

117:                                              ; preds = %116, %64
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %16, align 4, !tbaa !9
  br label %52, !llvm.loop !18

120:                                              ; preds = %55
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.23) #6
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.24) #6
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.25, ptr noundef %126) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %150, %120
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = icmp slt i32 %129, 21
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %153

132:                                              ; preds = %128
  %133 = getelementptr inbounds %struct.state, ptr %13, i32 0, i32 1
  %134 = load i32, ptr %19, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [21 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %140, label %139

139:                                              ; preds = %132
  br label %150

140:                                              ; preds = %132
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.state, ptr %13, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = load i32, ptr %19, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.state, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 16, !tbaa !11
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.26, ptr noundef %143, ptr noundef %148) #6
  br label %150

150:                                              ; preds = %140, %139
  %151 = load i32, ptr %19, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %19, align 4, !tbaa !9
  br label %128, !llvm.loop !19

153:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %191, %153
  %155 = load i32, ptr %20, align 4, !tbaa !9
  %156 = icmp slt i32 %155, 21
  br i1 %156, label %158, label %157

157:                                              ; preds = %154
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %194

158:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %187, %158
  %160 = load i32, ptr %21, align 4, !tbaa !9
  %161 = icmp slt i32 %160, 21
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %190

163:                                              ; preds = %159
  %164 = load i32, ptr %20, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %165
  %167 = getelementptr inbounds %struct.state, ptr %166, i32 0, i32 1
  %168 = load i32, ptr %21, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [21 x i32], ptr %167, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %174, label %173

173:                                              ; preds = %163
  br label %187

174:                                              ; preds = %163
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = load i32, ptr %20, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %177
  %179 = getelementptr inbounds %struct.state, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 16, !tbaa !11
  %181 = load i32, ptr %21, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [21 x %struct.state], ptr %12, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.state, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 16, !tbaa !11
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.26, ptr noundef %180, ptr noundef %185) #6
  br label %187

187:                                              ; preds = %174, %173
  %188 = load i32, ptr %21, align 4, !tbaa !9
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %21, align 4, !tbaa !9
  br label %159, !llvm.loop !20

190:                                              ; preds = %162
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %20, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %20, align 4, !tbaa !9
  br label %154, !llvm.loop !21

194:                                              ; preds = %157
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef @.str.27) #6
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %197, ptr noundef @.str.28) #6
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %199, ptr noundef @.str.29) #6
  %201 = load ptr, ptr %8, align 8, !tbaa !5
  %202 = call i32 @pclose(ptr noundef %201)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 96, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 2016, ptr %12) #6
  br label %203

203:                                              ; preds = %194, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 255, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %204 = load i32, ptr %4, align 4
  ret i32 %204

205:                                              ; preds = %110
  unreachable
}

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

declare noalias ptr @popen(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @pclose(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { "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 #6 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"state", !6, i64 0, !7, i64 8}
!13 = !{i64 0, i64 8, !5, i64 8, i64 84, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}


; 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.state = type { ptr, [21 x i32] }

@message_names = external hidden local_unnamed_addr global [21 x ptr], align 16
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [63 x i8], align 1
@__const.traverse_handshakes.initial = external hidden unnamed_addr constant %struct.state, align 8
@.str.23 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [2 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; 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: nofree nounwind uwtable
define dso_local range(i32 0, 2) i32 @traverse_handshakes(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca [255 x i8], align 16
  %5 = alloca [21 x %struct.state], align 16
  %6 = alloca %struct.state, align 8
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %4) #5
  %7 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 255, ptr noundef nonnull @.str.20, ptr noundef %2) #5
  %8 = call noalias ptr @popen(ptr noundef nonnull %4, ptr noundef nonnull @.str.21)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %.preheader59

9:                                                ; preds = %3
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.22) #5
  br label %336

.preheader59:                                     ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2016, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %6, ptr noundef nonnull align 8 dereferenceable(96) @__const.traverse_handshakes.initial, i64 96, i1 false)
  %12 = load ptr, ptr @message_names, align 16, !tbaa !5
  store ptr %12, ptr %5, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx, i8 0, i64 88, i1 false)
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 8), align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %5, i64 96
  store ptr %13, ptr %14, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.1 = getelementptr inbounds i8, ptr %5, i64 104
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.1, i8 0, i64 88, i1 false)
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 16), align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %5, i64 192
  store ptr %15, ptr %16, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.2 = getelementptr inbounds i8, ptr %5, i64 200
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.2, i8 0, i64 88, i1 false)
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 24), align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %5, i64 288
  store ptr %17, ptr %18, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.3 = getelementptr inbounds i8, ptr %5, i64 296
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.3, i8 0, i64 88, i1 false)
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 32), align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %5, i64 384
  store ptr %19, ptr %20, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.4 = getelementptr inbounds i8, ptr %5, i64 392
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.4, i8 0, i64 88, i1 false)
  %21 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 40), align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 480
  store ptr %21, ptr %22, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.5 = getelementptr inbounds i8, ptr %5, i64 488
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.5, i8 0, i64 88, i1 false)
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 48), align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %5, i64 576
  store ptr %23, ptr %24, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.6 = getelementptr inbounds i8, ptr %5, i64 584
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.6, i8 0, i64 88, i1 false)
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 56), align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %5, i64 672
  store ptr %25, ptr %26, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.7 = getelementptr inbounds i8, ptr %5, i64 680
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.7, i8 0, i64 88, i1 false)
  %27 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 64), align 16, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %5, i64 768
  store ptr %27, ptr %28, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.8 = getelementptr inbounds i8, ptr %5, i64 776
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.8, i8 0, i64 88, i1 false)
  %29 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 72), align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %5, i64 864
  store ptr %29, ptr %30, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.9 = getelementptr inbounds i8, ptr %5, i64 872
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.9, i8 0, i64 88, i1 false)
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 80), align 16, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %5, i64 960
  store ptr %31, ptr %32, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.10 = getelementptr inbounds i8, ptr %5, i64 968
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.10, i8 0, i64 88, i1 false)
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 88), align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 1056
  store ptr %33, ptr %34, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.11 = getelementptr inbounds i8, ptr %5, i64 1064
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.11, i8 0, i64 88, i1 false)
  %35 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 96), align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %5, i64 1152
  store ptr %35, ptr %36, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.12 = getelementptr inbounds i8, ptr %5, i64 1160
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.12, i8 0, i64 88, i1 false)
  %37 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 104), align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %5, i64 1248
  store ptr %37, ptr %38, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.13 = getelementptr inbounds i8, ptr %5, i64 1256
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.13, i8 0, i64 88, i1 false)
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 112), align 16, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %5, i64 1344
  store ptr %39, ptr %40, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.14 = getelementptr inbounds i8, ptr %5, i64 1352
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.14, i8 0, i64 88, i1 false)
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 120), align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %5, i64 1440
  store ptr %41, ptr %42, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.15 = getelementptr inbounds i8, ptr %5, i64 1448
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.15, i8 0, i64 88, i1 false)
  %43 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 128), align 16, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %5, i64 1536
  store ptr %43, ptr %44, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.16 = getelementptr inbounds i8, ptr %5, i64 1544
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.16, i8 0, i64 88, i1 false)
  %45 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 136), align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %5, i64 1632
  store ptr %45, ptr %46, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.17 = getelementptr inbounds i8, ptr %5, i64 1640
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.17, i8 0, i64 88, i1 false)
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 144), align 16, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %5, i64 1728
  store ptr %47, ptr %48, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.18 = getelementptr inbounds i8, ptr %5, i64 1736
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.18, i8 0, i64 88, i1 false)
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 152), align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %5, i64 1824
  store ptr %49, ptr %50, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.19 = getelementptr inbounds i8, ptr %5, i64 1832
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.19, i8 0, i64 88, i1 false)
  %51 = load ptr, ptr getelementptr inbounds (i8, ptr @message_names, i64 160), align 16, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %5, i64 1920
  store ptr %51, ptr %52, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx.20 = getelementptr inbounds i8, ptr %5, i64 1928
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %.sroa.5.0..sroa_idx.20, i8 0, i64 88, i1 false)
  %53 = getelementptr inbounds i8, ptr %6, i64 8
  br label %60

54:                                               ; preds = %.loopexit
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.23) #5
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.24) #5
  %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.25, ptr noundef %1) #5
  %58 = load ptr, ptr %6, align 8
  %59 = load i32, ptr %53, align 8, !tbaa !9
  %.not55 = icmp eq i32 %59, 0
  br i1 %.not55, label %87, label %84

60:                                               ; preds = %.preheader59, %.loopexit
  %indvars.iv69 = phi i64 [ 0, %.preheader59 ], [ %indvars.iv.next70, %.loopexit ]
  %61 = getelementptr inbounds [32 x i32], ptr %0, i64 %indvars.iv69, i64 1
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %.not56 = icmp eq i32 %62, 0
  br i1 %.not56, label %.loopexit, label %.preheader58.peel.next

.preheader58.peel.next:                           ; preds = %60
  %63 = getelementptr inbounds [32 x i32], ptr %0, i64 %indvars.iv69, i64 0
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds [21 x i32], ptr %53, i64 0, i64 %65
  store i32 1, ptr %66, align 4, !tbaa !9
  br label %.preheader58

.preheader58:                                     ; preds = %83, %.preheader58.peel.next
  %indvars.iv = phi i64 [ 1, %.preheader58.peel.next ], [ %indvars.iv.next.1, %83 ]
  %67 = getelementptr inbounds [32 x i32], ptr %0, i64 %indvars.iv69, i64 %indvars.iv
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %.not85 = icmp eq i32 %68, 0
  br i1 %.not85, label %76, label %69

69:                                               ; preds = %.preheader58
  %70 = add nsw i64 %indvars.iv, -1
  %71 = getelementptr inbounds [32 x i32], ptr %0, i64 %indvars.iv69, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = zext i32 %68 to i64
  %75 = getelementptr inbounds [21 x %struct.state], ptr %5, i64 0, i64 %73, i32 1, i64 %74
  store i32 1, ptr %75, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %69, %.preheader58
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 32
  br i1 %exitcond.not, label %.loopexit, label %.preheader58.1, !llvm.loop !11

.preheader58.1:                                   ; preds = %76
  %77 = getelementptr inbounds [32 x i32], ptr %0, i64 %indvars.iv69, i64 %indvars.iv.next
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %.not85.1 = icmp eq i32 %78, 0
  br i1 %.not85.1, label %83, label %79

79:                                               ; preds = %.preheader58.1
  %80 = zext i32 %68 to i64
  %81 = zext i32 %78 to i64
  %82 = getelementptr inbounds [21 x %struct.state], ptr %5, i64 0, i64 %80, i32 1, i64 %81
  store i32 1, ptr %82, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %79, %.preheader58.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %.preheader58

.loopexit:                                        ; preds = %76, %60
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next70, 256
  br i1 %exitcond72.not, label %54, label %60, !llvm.loop !14

84:                                               ; preds = %54
  %85 = load ptr, ptr %5, align 16, !tbaa !15
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %85) #5
  br label %87

87:                                               ; preds = %54, %84
  %88 = getelementptr inbounds i8, ptr %6, i64 12
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %.not55.1 = icmp eq i32 %89, 0
  br i1 %.not55.1, label %93, label %90

90:                                               ; preds = %87
  %91 = load ptr, ptr %14, align 16, !tbaa !15
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %91) #5
  br label %93

93:                                               ; preds = %90, %87
  %94 = getelementptr inbounds i8, ptr %6, i64 16
  %95 = load i32, ptr %94, align 8, !tbaa !9
  %.not55.2 = icmp eq i32 %95, 0
  br i1 %.not55.2, label %99, label %96

96:                                               ; preds = %93
  %97 = load ptr, ptr %16, align 16, !tbaa !15
  %98 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %97) #5
  br label %99

99:                                               ; preds = %96, %93
  %100 = getelementptr inbounds i8, ptr %6, i64 20
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %.not55.3 = icmp eq i32 %101, 0
  br i1 %.not55.3, label %105, label %102

102:                                              ; preds = %99
  %103 = load ptr, ptr %18, align 16, !tbaa !15
  %104 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %103) #5
  br label %105

105:                                              ; preds = %102, %99
  %106 = getelementptr inbounds i8, ptr %6, i64 24
  %107 = load i32, ptr %106, align 8, !tbaa !9
  %.not55.4 = icmp eq i32 %107, 0
  br i1 %.not55.4, label %111, label %108

108:                                              ; preds = %105
  %109 = load ptr, ptr %20, align 16, !tbaa !15
  %110 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %109) #5
  br label %111

111:                                              ; preds = %108, %105
  %112 = getelementptr inbounds i8, ptr %6, i64 28
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %.not55.5 = icmp eq i32 %113, 0
  br i1 %.not55.5, label %117, label %114

114:                                              ; preds = %111
  %115 = load ptr, ptr %22, align 16, !tbaa !15
  %116 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %115) #5
  br label %117

117:                                              ; preds = %114, %111
  %118 = getelementptr inbounds i8, ptr %6, i64 32
  %119 = load i32, ptr %118, align 8, !tbaa !9
  %.not55.6 = icmp eq i32 %119, 0
  br i1 %.not55.6, label %123, label %120

120:                                              ; preds = %117
  %121 = load ptr, ptr %24, align 16, !tbaa !15
  %122 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %121) #5
  br label %123

123:                                              ; preds = %120, %117
  %124 = getelementptr inbounds i8, ptr %6, i64 36
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %.not55.7 = icmp eq i32 %125, 0
  br i1 %.not55.7, label %129, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %26, align 16, !tbaa !15
  %128 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %127) #5
  br label %129

129:                                              ; preds = %126, %123
  %130 = getelementptr inbounds i8, ptr %6, i64 40
  %131 = load i32, ptr %130, align 8, !tbaa !9
  %.not55.8 = icmp eq i32 %131, 0
  br i1 %.not55.8, label %135, label %132

132:                                              ; preds = %129
  %133 = load ptr, ptr %28, align 16, !tbaa !15
  %134 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %133) #5
  br label %135

135:                                              ; preds = %132, %129
  %136 = getelementptr inbounds i8, ptr %6, i64 44
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %.not55.9 = icmp eq i32 %137, 0
  br i1 %.not55.9, label %140, label %138

138:                                              ; preds = %135
  %139 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %29) #5
  br label %140

140:                                              ; preds = %138, %135
  %141 = getelementptr inbounds i8, ptr %6, i64 48
  %142 = load i32, ptr %141, align 8, !tbaa !9
  %.not55.10 = icmp eq i32 %142, 0
  br i1 %.not55.10, label %145, label %143

143:                                              ; preds = %140
  %144 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %31) #5
  br label %145

145:                                              ; preds = %143, %140
  %146 = getelementptr inbounds i8, ptr %6, i64 52
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %.not55.11 = icmp eq i32 %147, 0
  br i1 %.not55.11, label %150, label %148

148:                                              ; preds = %145
  %149 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %33) #5
  br label %150

150:                                              ; preds = %148, %145
  %151 = getelementptr inbounds i8, ptr %6, i64 56
  %152 = load i32, ptr %151, align 8, !tbaa !9
  %.not55.12 = icmp eq i32 %152, 0
  br i1 %.not55.12, label %155, label %153

153:                                              ; preds = %150
  %154 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %35) #5
  br label %155

155:                                              ; preds = %153, %150
  %156 = getelementptr inbounds i8, ptr %6, i64 60
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %.not55.13 = icmp eq i32 %157, 0
  br i1 %.not55.13, label %160, label %158

158:                                              ; preds = %155
  %159 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %37) #5
  br label %160

160:                                              ; preds = %158, %155
  %161 = getelementptr inbounds i8, ptr %6, i64 64
  %162 = load i32, ptr %161, align 8, !tbaa !9
  %.not55.14 = icmp eq i32 %162, 0
  br i1 %.not55.14, label %165, label %163

163:                                              ; preds = %160
  %164 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %39) #5
  br label %165

165:                                              ; preds = %163, %160
  %166 = getelementptr inbounds i8, ptr %6, i64 68
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %.not55.15 = icmp eq i32 %167, 0
  br i1 %.not55.15, label %170, label %168

168:                                              ; preds = %165
  %169 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %41) #5
  br label %170

170:                                              ; preds = %168, %165
  %171 = getelementptr inbounds i8, ptr %6, i64 72
  %172 = load i32, ptr %171, align 8, !tbaa !9
  %.not55.16 = icmp eq i32 %172, 0
  br i1 %.not55.16, label %175, label %173

173:                                              ; preds = %170
  %174 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %43) #5
  br label %175

175:                                              ; preds = %173, %170
  %176 = getelementptr inbounds i8, ptr %6, i64 76
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %.not55.17 = icmp eq i32 %177, 0
  br i1 %.not55.17, label %180, label %178

178:                                              ; preds = %175
  %179 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %45) #5
  br label %180

180:                                              ; preds = %178, %175
  %181 = getelementptr inbounds i8, ptr %6, i64 80
  %182 = load i32, ptr %181, align 8, !tbaa !9
  %.not55.18 = icmp eq i32 %182, 0
  br i1 %.not55.18, label %185, label %183

183:                                              ; preds = %180
  %184 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %47) #5
  br label %185

185:                                              ; preds = %183, %180
  %186 = getelementptr inbounds i8, ptr %6, i64 84
  %187 = load i32, ptr %186, align 4, !tbaa !9
  %.not55.19 = icmp eq i32 %187, 0
  br i1 %.not55.19, label %190, label %188

188:                                              ; preds = %185
  %189 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %49) #5
  br label %190

190:                                              ; preds = %188, %185
  %191 = getelementptr inbounds i8, ptr %6, i64 88
  %192 = load i32, ptr %191, align 8, !tbaa !9
  %.not55.20 = icmp eq i32 %192, 0
  br i1 %.not55.20, label %.preheader.preheader, label %193

193:                                              ; preds = %190
  %194 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %58, ptr noundef %51) #5
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %193, %190
  %195 = load ptr, ptr %5, align 16
  %196 = load ptr, ptr %14, align 16
  %197 = load ptr, ptr %16, align 16
  %198 = load ptr, ptr %18, align 16
  %199 = load ptr, ptr %20, align 16
  %200 = load ptr, ptr %22, align 16
  %201 = load ptr, ptr %24, align 16
  %202 = load ptr, ptr %26, align 16
  %203 = load ptr, ptr %28, align 16
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %335
  %indvars.iv81 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next82, %335 ]
  %204 = getelementptr inbounds [21 x %struct.state], ptr %5, i64 0, i64 %indvars.iv81
  %205 = getelementptr inbounds i8, ptr %204, i64 8
  %206 = load i32, ptr %205, align 8, !tbaa !9
  %.not54 = icmp eq i32 %206, 0
  br i1 %.not54, label %215, label %212

207:                                              ; preds = %335
  %208 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.27) #5
  %209 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.28) #5
  %210 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.29) #5
  %211 = tail call i32 @pclose(ptr noundef nonnull %8)
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 2016, ptr nonnull %5) #5
  br label %336

212:                                              ; preds = %.preheader
  %213 = load ptr, ptr %204, align 16, !tbaa !15
  %214 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %213, ptr noundef %195) #5
  br label %215

215:                                              ; preds = %.preheader, %212
  %216 = getelementptr inbounds i8, ptr %204, i64 12
  %217 = load i32, ptr %216, align 4, !tbaa !9
  %.not54.1 = icmp eq i32 %217, 0
  br i1 %.not54.1, label %221, label %218

218:                                              ; preds = %215
  %219 = load ptr, ptr %204, align 16, !tbaa !15
  %220 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %219, ptr noundef %196) #5
  br label %221

221:                                              ; preds = %218, %215
  %222 = getelementptr inbounds i8, ptr %204, i64 16
  %223 = load i32, ptr %222, align 16, !tbaa !9
  %.not54.2 = icmp eq i32 %223, 0
  br i1 %.not54.2, label %227, label %224

224:                                              ; preds = %221
  %225 = load ptr, ptr %204, align 16, !tbaa !15
  %226 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %225, ptr noundef %197) #5
  br label %227

227:                                              ; preds = %224, %221
  %228 = getelementptr inbounds i8, ptr %204, i64 20
  %229 = load i32, ptr %228, align 4, !tbaa !9
  %.not54.3 = icmp eq i32 %229, 0
  br i1 %.not54.3, label %233, label %230

230:                                              ; preds = %227
  %231 = load ptr, ptr %204, align 16, !tbaa !15
  %232 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %231, ptr noundef %198) #5
  br label %233

233:                                              ; preds = %230, %227
  %234 = getelementptr inbounds i8, ptr %204, i64 24
  %235 = load i32, ptr %234, align 8, !tbaa !9
  %.not54.4 = icmp eq i32 %235, 0
  br i1 %.not54.4, label %239, label %236

236:                                              ; preds = %233
  %237 = load ptr, ptr %204, align 16, !tbaa !15
  %238 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %237, ptr noundef %199) #5
  br label %239

239:                                              ; preds = %236, %233
  %240 = getelementptr inbounds i8, ptr %204, i64 28
  %241 = load i32, ptr %240, align 4, !tbaa !9
  %.not54.5 = icmp eq i32 %241, 0
  br i1 %.not54.5, label %245, label %242

242:                                              ; preds = %239
  %243 = load ptr, ptr %204, align 16, !tbaa !15
  %244 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %243, ptr noundef %200) #5
  br label %245

245:                                              ; preds = %242, %239
  %246 = getelementptr inbounds i8, ptr %204, i64 32
  %247 = load i32, ptr %246, align 16, !tbaa !9
  %.not54.6 = icmp eq i32 %247, 0
  br i1 %.not54.6, label %251, label %248

248:                                              ; preds = %245
  %249 = load ptr, ptr %204, align 16, !tbaa !15
  %250 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %249, ptr noundef %201) #5
  br label %251

251:                                              ; preds = %248, %245
  %252 = getelementptr inbounds i8, ptr %204, i64 36
  %253 = load i32, ptr %252, align 4, !tbaa !9
  %.not54.7 = icmp eq i32 %253, 0
  br i1 %.not54.7, label %257, label %254

254:                                              ; preds = %251
  %255 = load ptr, ptr %204, align 16, !tbaa !15
  %256 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %255, ptr noundef %202) #5
  br label %257

257:                                              ; preds = %254, %251
  %258 = getelementptr inbounds i8, ptr %204, i64 40
  %259 = load i32, ptr %258, align 8, !tbaa !9
  %.not54.8 = icmp eq i32 %259, 0
  br i1 %.not54.8, label %263, label %260

260:                                              ; preds = %257
  %261 = load ptr, ptr %204, align 16, !tbaa !15
  %262 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %261, ptr noundef %203) #5
  br label %263

263:                                              ; preds = %260, %257
  %264 = getelementptr inbounds i8, ptr %204, i64 44
  %265 = load i32, ptr %264, align 4, !tbaa !9
  %.not54.9 = icmp eq i32 %265, 0
  br i1 %.not54.9, label %269, label %266

266:                                              ; preds = %263
  %267 = load ptr, ptr %204, align 16, !tbaa !15
  %268 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %267, ptr noundef %29) #5
  br label %269

269:                                              ; preds = %266, %263
  %270 = getelementptr inbounds i8, ptr %204, i64 48
  %271 = load i32, ptr %270, align 16, !tbaa !9
  %.not54.10 = icmp eq i32 %271, 0
  br i1 %.not54.10, label %275, label %272

272:                                              ; preds = %269
  %273 = load ptr, ptr %204, align 16, !tbaa !15
  %274 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %273, ptr noundef %31) #5
  br label %275

275:                                              ; preds = %272, %269
  %276 = getelementptr inbounds i8, ptr %204, i64 52
  %277 = load i32, ptr %276, align 4, !tbaa !9
  %.not54.11 = icmp eq i32 %277, 0
  br i1 %.not54.11, label %281, label %278

278:                                              ; preds = %275
  %279 = load ptr, ptr %204, align 16, !tbaa !15
  %280 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %279, ptr noundef %33) #5
  br label %281

281:                                              ; preds = %278, %275
  %282 = getelementptr inbounds i8, ptr %204, i64 56
  %283 = load i32, ptr %282, align 8, !tbaa !9
  %.not54.12 = icmp eq i32 %283, 0
  br i1 %.not54.12, label %287, label %284

284:                                              ; preds = %281
  %285 = load ptr, ptr %204, align 16, !tbaa !15
  %286 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %285, ptr noundef %35) #5
  br label %287

287:                                              ; preds = %284, %281
  %288 = getelementptr inbounds i8, ptr %204, i64 60
  %289 = load i32, ptr %288, align 4, !tbaa !9
  %.not54.13 = icmp eq i32 %289, 0
  br i1 %.not54.13, label %293, label %290

290:                                              ; preds = %287
  %291 = load ptr, ptr %204, align 16, !tbaa !15
  %292 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %291, ptr noundef %37) #5
  br label %293

293:                                              ; preds = %290, %287
  %294 = getelementptr inbounds i8, ptr %204, i64 64
  %295 = load i32, ptr %294, align 16, !tbaa !9
  %.not54.14 = icmp eq i32 %295, 0
  br i1 %.not54.14, label %299, label %296

296:                                              ; preds = %293
  %297 = load ptr, ptr %204, align 16, !tbaa !15
  %298 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %297, ptr noundef %39) #5
  br label %299

299:                                              ; preds = %296, %293
  %300 = getelementptr inbounds i8, ptr %204, i64 68
  %301 = load i32, ptr %300, align 4, !tbaa !9
  %.not54.15 = icmp eq i32 %301, 0
  br i1 %.not54.15, label %305, label %302

302:                                              ; preds = %299
  %303 = load ptr, ptr %204, align 16, !tbaa !15
  %304 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %303, ptr noundef %41) #5
  br label %305

305:                                              ; preds = %302, %299
  %306 = getelementptr inbounds i8, ptr %204, i64 72
  %307 = load i32, ptr %306, align 8, !tbaa !9
  %.not54.16 = icmp eq i32 %307, 0
  br i1 %.not54.16, label %311, label %308

308:                                              ; preds = %305
  %309 = load ptr, ptr %204, align 16, !tbaa !15
  %310 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %309, ptr noundef %43) #5
  br label %311

311:                                              ; preds = %308, %305
  %312 = getelementptr inbounds i8, ptr %204, i64 76
  %313 = load i32, ptr %312, align 4, !tbaa !9
  %.not54.17 = icmp eq i32 %313, 0
  br i1 %.not54.17, label %317, label %314

314:                                              ; preds = %311
  %315 = load ptr, ptr %204, align 16, !tbaa !15
  %316 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %315, ptr noundef %45) #5
  br label %317

317:                                              ; preds = %314, %311
  %318 = getelementptr inbounds i8, ptr %204, i64 80
  %319 = load i32, ptr %318, align 16, !tbaa !9
  %.not54.18 = icmp eq i32 %319, 0
  br i1 %.not54.18, label %323, label %320

320:                                              ; preds = %317
  %321 = load ptr, ptr %204, align 16, !tbaa !15
  %322 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %321, ptr noundef %47) #5
  br label %323

323:                                              ; preds = %320, %317
  %324 = getelementptr inbounds i8, ptr %204, i64 84
  %325 = load i32, ptr %324, align 4, !tbaa !9
  %.not54.19 = icmp eq i32 %325, 0
  br i1 %.not54.19, label %329, label %326

326:                                              ; preds = %323
  %327 = load ptr, ptr %204, align 16, !tbaa !15
  %328 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %327, ptr noundef %49) #5
  br label %329

329:                                              ; preds = %326, %323
  %330 = getelementptr inbounds i8, ptr %204, i64 88
  %331 = load i32, ptr %330, align 8, !tbaa !9
  %.not54.20 = icmp eq i32 %331, 0
  br i1 %.not54.20, label %335, label %332

332:                                              ; preds = %329
  %333 = load ptr, ptr %204, align 16, !tbaa !15
  %334 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.26, ptr noundef %333, ptr noundef %51) #5
  br label %335

335:                                              ; preds = %332, %329
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next82, 21
  br i1 %exitcond84.not, label %207, label %.preheader, !llvm.loop !17

336:                                              ; preds = %207, %9
  %.049 = phi i32 [ 0, %207 ], [ 1, %9 ]
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %4) #5
  ret i32 %.049
}

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noalias noundef ptr @popen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @pclose(ptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12}
!15 = !{!16, !6, i64 0}
!16 = !{!"state", !6, i64 0, !7, i64 8}
!17 = distinct !{!17, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass