; LLVM IR from howerj/shrink :: main (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"

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@main.inb = external hidden global [8192 x i8], align 16
@main.outb = external hidden global [8192 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %21 = load ptr, ptr @stdin, align 8, !tbaa !9
  call void @binary(ptr noundef %21)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !9
  call void @binary(ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %23 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %23, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %24, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %90, %2
  %26 = load i32, ptr %10, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %93

29:                                               ; preds = %25
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds ptr, ptr %30, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp ne i32 %37, 45
  br i1 %38, label %39, label %40

39:                                               ; preds = %29
  br label %93

40:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %84, %40
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load i32, ptr %14, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %46, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  store i32 %51, ptr %15, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %54, label %53

53:                                               ; preds = %41
  store i32 5, ptr %16, align 4
  br label %87

54:                                               ; preds = %41
  %55 = load i32, ptr %15, align 4, !tbaa !5
  switch i32 %55, label %82 [
    i32 45, label %56
    i32 116, label %59
    i32 104, label %62
    i32 118, label %68
    i32 100, label %71
    i32 99, label %72
    i32 108, label %73
    i32 114, label %74
    i32 101, label %75
    i32 109, label %76
    i32 122, label %77
    i32 115, label %78
    i32 72, label %79
  ]

56:                                               ; preds = %54
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %10, align 4, !tbaa !5
  store i32 9, ptr %16, align 4
  br label %87

59:                                               ; preds = %54
  %60 = call i32 @shrink_tests()
  %61 = sub nsw i32 0, %60
  store i32 %61, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %87

62:                                               ; preds = %54
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i64 0
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = call i32 @usage(ptr noundef %63, ptr noundef %66)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %87

68:                                               ; preds = %54
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %11, align 4, !tbaa !5
  br label %83

71:                                               ; preds = %54
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %83

72:                                               ; preds = %54
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %83

73:                                               ; preds = %54
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %83

74:                                               ; preds = %54
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %83

75:                                               ; preds = %54
  store i32 2, ptr %9, align 4, !tbaa !5
  br label %83

76:                                               ; preds = %54
  store i32 3, ptr %9, align 4, !tbaa !5
  br label %83

77:                                               ; preds = %54
  store i32 4, ptr %9, align 4, !tbaa !5
  br label %83

78:                                               ; preds = %54
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %83

79:                                               ; preds = %54
  store i32 1, ptr %13, align 4, !tbaa !5
  %80 = load i32, ptr %11, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !5
  br label %83

82:                                               ; preds = %54
  store i32 9, ptr %16, align 4
  br label %87

83:                                               ; preds = %79, %78, %77, %76, %75, %74, %73, %72, %71, %68
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %14, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %14, align 4, !tbaa !5
  br label %41, !llvm.loop !12

87:                                               ; preds = %82, %62, %59, %56, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %88 = load i32, ptr %16, align 4
  switch i32 %88, label %197 [
    i32 5, label %89
    i32 9, label %94
  ]

89:                                               ; preds = %87
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %10, align 4, !tbaa !5
  br label %25, !llvm.loop !14

93:                                               ; preds = %39, %25
  br label %94

94:                                               ; preds = %93, %87
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %140

97:                                               ; preds = %94
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %134

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds ptr, ptr %102, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = call ptr @duplicate(ptr noundef %106)
  store ptr %107, ptr %17, align 8, !tbaa !9
  %108 = load ptr, ptr %17, align 8, !tbaa !9
  %109 = icmp ne ptr %108, null
  br i1 %109, label %111, label %110

110:                                              ; preds = %101
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %133

111:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %112 = load ptr, ptr %17, align 8, !tbaa !9
  %113 = call i64 @strlen(ptr noundef %112) #7
  %114 = add i64 %113, 1
  store i64 %114, ptr %18, align 8, !tbaa !15
  %115 = load ptr, ptr %17, align 8, !tbaa !9
  %116 = call i32 @unescape(ptr noundef %115, ptr noundef %18)
  %117 = icmp slt i32 %116, 0
  br i1 %117, label %118, label %122

118:                                              ; preds = %111
  %119 = load ptr, ptr @stderr, align 8, !tbaa !9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str) #6
  %121 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %121) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %132

122:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = load ptr, ptr %17, align 8, !tbaa !9
  %127 = load i64, ptr %18, align 8, !tbaa !15
  %128 = load ptr, ptr @stdout, align 8, !tbaa !9
  %129 = call i32 @string_op(i32 noundef %123, i32 noundef %124, i32 noundef %125, ptr noundef %126, i64 noundef %127, ptr noundef %128)
  store i32 %129, ptr %19, align 4, !tbaa !5
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %130) #6
  %131 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %131, ptr %3, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %132

132:                                              ; preds = %122, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %133

133:                                              ; preds = %132, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %197

134:                                              ; preds = %97
  %135 = load ptr, ptr @stderr, align 8, !tbaa !9
  %136 = load ptr, ptr %5, align 8, !tbaa !9
  %137 = getelementptr inbounds ptr, ptr %136, i64 0
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = call i32 @usage(ptr noundef %135, ptr noundef %138)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

140:                                              ; preds = %94
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %152

144:                                              ; preds = %140
  %145 = load ptr, ptr %5, align 8, !tbaa !9
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !5
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds ptr, ptr %145, i64 %148
  %150 = load ptr, ptr %149, align 8, !tbaa !9
  %151 = call ptr @fopen_or_die(ptr noundef %150, ptr noundef @.str.1)
  store ptr %151, ptr %6, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %144, %140
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = load i32, ptr %4, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %164

156:                                              ; preds = %152
  %157 = load ptr, ptr %5, align 8, !tbaa !9
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %10, align 4, !tbaa !5
  %160 = sext i32 %158 to i64
  %161 = getelementptr inbounds ptr, ptr %157, i64 %160
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = call ptr @fopen_or_die(ptr noundef %162, ptr noundef @.str.2)
  store ptr %163, ptr %7, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %156, %152
  %165 = load ptr, ptr %6, align 8, !tbaa !9
  %166 = call i32 @setvbuf(ptr noundef %165, ptr noundef @main.inb, i32 noundef 0, i64 noundef 8192) #6
  %167 = icmp slt i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %164
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

169:                                              ; preds = %164
  %170 = load ptr, ptr %6, align 8, !tbaa !9
  %171 = call i32 @setvbuf(ptr noundef %170, ptr noundef @main.outb, i32 noundef 0, i64 noundef 8192) #6
  %172 = icmp slt i32 %171, 0
  br i1 %172, label %173, label %174

173:                                              ; preds = %169
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

174:                                              ; preds = %169
  %175 = load i32, ptr %9, align 4, !tbaa !5
  %176 = load i32, ptr %8, align 4, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = load i32, ptr %11, align 4, !tbaa !5
  %179 = load ptr, ptr %6, align 8, !tbaa !9
  %180 = load ptr, ptr %7, align 8, !tbaa !9
  %181 = call i32 @file_op(i32 noundef %175, i32 noundef %176, i32 noundef %177, i32 noundef %178, ptr noundef %179, ptr noundef %180)
  store i32 %181, ptr %20, align 4, !tbaa !5
  %182 = load ptr, ptr %6, align 8, !tbaa !9
  %183 = call i32 @fclose(ptr noundef %182)
  %184 = icmp slt i32 %183, 0
  br i1 %184, label %185, label %186

185:                                              ; preds = %174
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

186:                                              ; preds = %174
  %187 = load ptr, ptr %7, align 8, !tbaa !9
  %188 = call i32 @fclose(ptr noundef %187)
  %189 = icmp slt i32 %188, 0
  br i1 %189, label %190, label %191

190:                                              ; preds = %186
  store i32 1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

191:                                              ; preds = %186
  %192 = load i32, ptr %20, align 4, !tbaa !5
  %193 = icmp ne i32 %192, 0
  %194 = xor i1 %193, true
  %195 = xor i1 %194, true
  %196 = zext i1 %195 to i32
  store i32 %196, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %197

197:                                              ; preds = %191, %190, %185, %173, %168, %134, %133, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %198 = load i32, ptr %3, align 4
  ret i32 %198
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @binary(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 @shrink_tests() #3

; Function Attrs: nounwind uwtable
declare hidden i32 @usage(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden ptr @duplicate(ptr noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @unescape(ptr noundef, ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @string_op(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @fopen_or_die(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind
declare i32 @setvbuf(ptr noundef, ptr noundef, i32 noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @file_op(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare i32 @fclose(ptr noundef) #3

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


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

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@main.inb = external hidden global [8192 x i8], align 16
@main.outb = external hidden global [8192 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = load ptr, ptr @stdin, align 8, !tbaa !5
  tail call void @binary(ptr noundef %4)
  %5 = load ptr, ptr @stdout, align 8, !tbaa !5
  tail call void @binary(ptr noundef %5)
  %6 = load ptr, ptr @stdin, align 8, !tbaa !5
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = icmp sgt i32 %0, 1
  br i1 %8, label %.lr.ph.preheader, label %.thread87.thread

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %36
  %indvars.iv180 = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next181, %36 ]
  %.054141 = phi i32 [ 0, %.lr.ph.preheader ], [ %.155, %36 ]
  %.058140 = phi i32 [ 0, %.lr.ph.preheader ], [ %.159, %36 ]
  %.062139 = phi i32 [ 0, %.lr.ph.preheader ], [ %.163, %36 ]
  %.070137 = phi i32 [ 1, %.lr.ph.preheader ], [ %.171, %36 ]
  %.074136 = phi i32 [ 1, %.lr.ph.preheader ], [ %.175, %36 ]
  %9 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv180
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = load i8, ptr %10, align 1, !tbaa !9
  %.not = icmp eq i8 %11, 45
  br i1 %.not, label %.preheader, label %.thread87.loopexit195.split.loop.exit220

.preheader:                                       ; preds = %.lr.ph, %35
  %indvars.iv = phi i64 [ %indvars.iv.next, %35 ], [ 1, %.lr.ph ]
  %.175 = phi i32 [ %.276, %35 ], [ %.074136, %.lr.ph ]
  %.171 = phi i32 [ %.272, %35 ], [ %.070137, %.lr.ph ]
  %.163 = phi i32 [ %.264, %35 ], [ %.062139, %.lr.ph ]
  %.159 = phi i32 [ %.260, %35 ], [ %.058140, %.lr.ph ]
  %.155 = phi i32 [ %.256, %35 ], [ %.054141, %.lr.ph ]
  %12 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv
  %13 = load i8, ptr %12, align 1, !tbaa !9
  switch i8 %13, label %.thread87.loopexit [
    i8 0, label %36
    i8 45, label %14
    i8 116, label %17
    i8 104, label %20
    i8 118, label %24
    i8 100, label %35
    i8 99, label %26
    i8 108, label %27
    i8 114, label %28
    i8 101, label %29
    i8 109, label %30
    i8 122, label %31
    i8 115, label %32
    i8 72, label %33
  ]

14:                                               ; preds = %.preheader
  %15 = trunc nuw nsw i64 %indvars.iv180 to i32
  %16 = add nuw nsw i32 %15, 1
  br label %.thread87

17:                                               ; preds = %.preheader
  %18 = tail call i32 @shrink_tests() #7
  %19 = sub nsw i32 0, %18
  br label %.thread

20:                                               ; preds = %.preheader
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = tail call i32 @usage(ptr noundef %21, ptr noundef %22)
  br label %.thread

24:                                               ; preds = %.preheader
  %25 = add nsw i32 %.163, 1
  br label %35

26:                                               ; preds = %.preheader
  br label %35

27:                                               ; preds = %.preheader
  br label %35

28:                                               ; preds = %.preheader
  br label %35

29:                                               ; preds = %.preheader
  br label %35

30:                                               ; preds = %.preheader
  br label %35

31:                                               ; preds = %.preheader
  br label %35

32:                                               ; preds = %.preheader
  br label %35

33:                                               ; preds = %.preheader
  %34 = add nsw i32 %.163, 1
  br label %35

35:                                               ; preds = %.preheader, %24, %26, %27, %28, %29, %30, %31, %32, %33
  %.276 = phi i32 [ %.175, %33 ], [ %.175, %32 ], [ %.175, %31 ], [ %.175, %30 ], [ %.175, %29 ], [ %.175, %28 ], [ %.175, %27 ], [ 1, %26 ], [ %.175, %24 ], [ 0, %.preheader ]
  %.272 = phi i32 [ %.171, %33 ], [ %.171, %32 ], [ 4, %31 ], [ 3, %30 ], [ 2, %29 ], [ 0, %28 ], [ 1, %27 ], [ %.171, %26 ], [ %.171, %24 ], [ %.171, %.preheader ]
  %.264 = phi i32 [ %34, %33 ], [ %.163, %32 ], [ %.163, %31 ], [ %.163, %30 ], [ %.163, %29 ], [ %.163, %28 ], [ %.163, %27 ], [ %.163, %26 ], [ %25, %24 ], [ %.163, %.preheader ]
  %.260 = phi i32 [ %.159, %33 ], [ 1, %32 ], [ %.159, %31 ], [ %.159, %30 ], [ %.159, %29 ], [ %.159, %28 ], [ %.159, %27 ], [ %.159, %26 ], [ %.159, %24 ], [ %.159, %.preheader ]
  %.256 = phi i32 [ 1, %33 ], [ %.155, %32 ], [ %.155, %31 ], [ %.155, %30 ], [ %.155, %29 ], [ %.155, %28 ], [ %.155, %27 ], [ %.155, %26 ], [ %.155, %24 ], [ %.155, %.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %.preheader, !llvm.loop !10

36:                                               ; preds = %.preheader
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count
  br i1 %exitcond.not, label %.thread87, label %.lr.ph, !llvm.loop !12

.thread87.loopexit:                               ; preds = %.preheader
  %37 = trunc nuw nsw i64 %indvars.iv180 to i32
  br label %.thread87

.thread87.loopexit195.split.loop.exit220:         ; preds = %.lr.ph
  %38 = trunc nuw nsw i64 %indvars.iv180 to i32
  br label %.thread87

.thread87:                                        ; preds = %36, %.thread87.loopexit195.split.loop.exit220, %.thread87.loopexit, %14
  %.377 = phi i32 [ %.175, %14 ], [ %.175, %.thread87.loopexit ], [ %.074136, %.thread87.loopexit195.split.loop.exit220 ], [ %.175, %36 ]
  %.373 = phi i32 [ %.171, %14 ], [ %.171, %.thread87.loopexit ], [ %.070137, %.thread87.loopexit195.split.loop.exit220 ], [ %.171, %36 ]
  %.268 = phi i32 [ %16, %14 ], [ %37, %.thread87.loopexit ], [ %38, %.thread87.loopexit195.split.loop.exit220 ], [ %0, %36 ]
  %.365 = phi i32 [ %.163, %14 ], [ %.163, %.thread87.loopexit ], [ %.062139, %.thread87.loopexit195.split.loop.exit220 ], [ %.163, %36 ]
  %.361 = phi i32 [ %.159, %14 ], [ %.159, %.thread87.loopexit ], [ %.058140, %.thread87.loopexit195.split.loop.exit220 ], [ %.159, %36 ]
  %.357 = phi i32 [ %.155, %14 ], [ %.155, %.thread87.loopexit ], [ %.054141, %.thread87.loopexit195.split.loop.exit220 ], [ %.155, %36 ]
  %.not81 = icmp eq i32 %.361, 0
  br i1 %.not81, label %.thread87.thread, label %39

39:                                               ; preds = %.thread87
  %40 = icmp slt i32 %.268, %0
  br i1 %40, label %41, label %59

41:                                               ; preds = %39
  %42 = sext i32 %.268 to i64
  %43 = getelementptr inbounds ptr, ptr %1, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = tail call ptr @duplicate(ptr noundef %44)
  %.not82 = icmp eq ptr %45, null
  br i1 %.not82, label %.thread, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %47 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %45) #8
  %48 = add i64 %47, 1
  store i64 %48, ptr %3, align 8, !tbaa !13
  %49 = call i32 @unescape(ptr noundef nonnull %45, ptr noundef nonnull %3)
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %54

51:                                               ; preds = %46
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str) #9
  br label %58

54:                                               ; preds = %46
  %55 = load i64, ptr %3, align 8, !tbaa !13
  %56 = load ptr, ptr @stdout, align 8, !tbaa !5
  %57 = call i32 @string_op(i32 noundef %.373, i32 noundef %.377, i32 noundef %.365, ptr noundef nonnull %45, i64 noundef %55, ptr noundef %56)
  br label %58

58:                                               ; preds = %54, %51
  %.2 = phi i32 [ 1, %51 ], [ %57, %54 ]
  call void @free(ptr noundef nonnull %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %.thread

59:                                               ; preds = %39
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = load ptr, ptr %1, align 8, !tbaa !5
  %62 = tail call i32 @usage(ptr noundef %60, ptr noundef %61)
  br label %.thread

.thread87.thread:                                 ; preds = %2, %.thread87
  %.357194 = phi i32 [ %.357, %.thread87 ], [ 0, %2 ]
  %.365193 = phi i32 [ %.365, %.thread87 ], [ 0, %2 ]
  %.268192 = phi i32 [ %.268, %.thread87 ], [ 1, %2 ]
  %.373191 = phi i32 [ %.373, %.thread87 ], [ 1, %2 ]
  %.377190 = phi i32 [ %.377, %.thread87 ], [ 1, %2 ]
  %63 = icmp slt i32 %.268192, %0
  br i1 %63, label %64, label %70

64:                                               ; preds = %.thread87.thread
  %65 = add nsw i32 %.268192, 1
  %66 = sext i32 %.268192 to i64
  %67 = getelementptr inbounds ptr, ptr %1, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = tail call ptr @fopen_or_die(ptr noundef %68, ptr noundef nonnull @.str.1)
  br label %70

70:                                               ; preds = %64, %.thread87.thread
  %.369 = phi i32 [ %65, %64 ], [ %.268192, %.thread87.thread ]
  %.050 = phi ptr [ %69, %64 ], [ %6, %.thread87.thread ]
  %71 = icmp slt i32 %.369, %0
  br i1 %71, label %72, label %77

72:                                               ; preds = %70
  %73 = sext i32 %.369 to i64
  %74 = getelementptr inbounds ptr, ptr %1, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = tail call ptr @fopen_or_die(ptr noundef %75, ptr noundef nonnull @.str.2)
  br label %77

77:                                               ; preds = %72, %70
  %.051 = phi ptr [ %76, %72 ], [ %7, %70 ]
  %78 = tail call i32 @setvbuf(ptr noundef %.050, ptr noundef nonnull @main.inb, i32 noundef 0, i64 noundef 8192) #7
  %79 = icmp slt i32 %78, 0
  br i1 %79, label %.thread, label %80

80:                                               ; preds = %77
  %81 = tail call i32 @setvbuf(ptr noundef %.050, ptr noundef nonnull @main.outb, i32 noundef 0, i64 noundef 8192) #7
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %.thread, label %83

83:                                               ; preds = %80
  %84 = tail call i32 @file_op(i32 noundef %.373191, i32 noundef %.377190, i32 noundef %.357194, i32 noundef %.365193, ptr noundef %.050, ptr noundef %.051)
  %85 = tail call i32 @fclose(ptr noundef %.050)
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %.thread, label %87

87:                                               ; preds = %83
  %88 = tail call i32 @fclose(ptr noundef %.051)
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %.thread, label %90

90:                                               ; preds = %87
  %91 = icmp ne i32 %84, 0
  %92 = zext i1 %91 to i32
  br label %.thread

.thread:                                          ; preds = %17, %20, %87, %83, %80, %77, %58, %41, %90, %59
  %.4 = phi i32 [ 1, %59 ], [ %92, %90 ], [ %.2, %58 ], [ 1, %41 ], [ 1, %77 ], [ 1, %80 ], [ 1, %83 ], [ 1, %87 ], [ %19, %17 ], [ 0, %20 ]
  ret i32 %.4
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @binary(ptr noundef) local_unnamed_addr #1

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

declare i32 @shrink_tests() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @usage(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden ptr @duplicate(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @unescape(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @string_op(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @fopen_or_die(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @setvbuf(ptr nocapture noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden i32 @file_op(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { cold 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass