; LLVM IR from holzschu/ios_system :: text_cmds/comm (comm)

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

@tabs = external dso_local global [3 x ptr], align 16
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@optind = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [2049 x i32], align 16
  %22 = alloca [2049 x i32], align 16
  %23 = alloca ptr, align 8
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8196, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8196, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  store i32 1, ptr %13, align 4, !tbaa !5
  store i32 1, ptr %12, align 4, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !5
  %24 = call ptr @setlocale(i32 noundef 6, ptr noundef @.str.3) #6
  br label %25

25:                                               ; preds = %38, %2
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call i32 @getopt(i32 noundef %26, ptr noundef %27, ptr noundef @.str.4) #6
  store i32 %28, ptr %11, align 4, !tbaa !5
  %29 = icmp ne i32 %28, -1
  br i1 %29, label %30, label %39

30:                                               ; preds = %25
  %31 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %31, label %37 [
    i32 49, label %32
    i32 50, label %33
    i32 51, label %34
    i32 105, label %35
    i32 63, label %36
  ]

32:                                               ; preds = %30
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %38

33:                                               ; preds = %30
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %38

34:                                               ; preds = %30
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %38

35:                                               ; preds = %30
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %38

36:                                               ; preds = %30
  br label %37

37:                                               ; preds = %36, %30
  call void @usage()
  br label %38

38:                                               ; preds = %37, %35, %34, %33, %32
  br label %25, !llvm.loop !11

39:                                               ; preds = %25
  %40 = load i32, ptr @optind, align 4, !tbaa !5
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sub nsw i32 %41, %40
  store i32 %42, ptr %4, align 4, !tbaa !5
  %43 = load i32, ptr @optind, align 4, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds ptr, ptr %44, i64 %45
  store ptr %46, ptr %5, align 8, !tbaa !9
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = icmp ne i32 %47, 2
  br i1 %48, label %59, label %49

49:                                               ; preds = %39
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %59

54:                                               ; preds = %49
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds ptr, ptr %55, i64 1
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = icmp ne ptr %57, null
  br i1 %58, label %60, label %59

59:                                               ; preds = %54, %49, %39
  call void @usage()
  br label %60

60:                                               ; preds = %59, %54
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 0
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call ptr @file(ptr noundef %63)
  store ptr %64, ptr %16, align 8, !tbaa !9
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = getelementptr inbounds ptr, ptr %65, i64 1
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = call ptr @file(ptr noundef %67)
  store ptr %68, ptr %17, align 8, !tbaa !9
  store ptr @tabs, ptr %23, align 8, !tbaa !9
  store ptr null, ptr %20, align 8, !tbaa !9
  store ptr null, ptr %19, align 8, !tbaa !9
  store ptr null, ptr %18, align 8, !tbaa !9
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %60
  %72 = load ptr, ptr %23, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %72, i32 1
  store ptr %73, ptr %23, align 8, !tbaa !9
  %74 = load ptr, ptr %72, align 8, !tbaa !9
  store ptr %74, ptr %18, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %71, %60
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %82

78:                                               ; preds = %75
  %79 = load ptr, ptr %23, align 8, !tbaa !9
  %80 = getelementptr inbounds ptr, ptr %79, i32 1
  store ptr %80, ptr %23, align 8, !tbaa !9
  %81 = load ptr, ptr %79, align 8, !tbaa !9
  store ptr %81, ptr %19, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %78, %75
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = load ptr, ptr %23, align 8, !tbaa !9
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  store ptr %87, ptr %20, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %85, %82
  store i32 1, ptr %10, align 4, !tbaa !5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %206, %186, %88
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %110

92:                                               ; preds = %89
  %93 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  %94 = load ptr, ptr %16, align 8, !tbaa !9
  %95 = call ptr @fgetws(ptr noundef %93, i32 noundef 2049, ptr noundef %94)
  %96 = icmp ne ptr %95, null
  %97 = xor i1 %96, true
  %98 = zext i1 %97 to i32
  store i32 %98, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %109

101:                                              ; preds = %92
  %102 = load ptr, ptr %16, align 8, !tbaa !9
  %103 = call i32 @ferror(ptr noundef %102) #6
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %101
  %106 = load ptr, ptr %5, align 8, !tbaa !9
  %107 = getelementptr inbounds ptr, ptr %106, i64 0
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.5, ptr noundef %108) #7
  unreachable

109:                                              ; preds = %101, %92
  br label %110

110:                                              ; preds = %109, %89
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %131

113:                                              ; preds = %110
  %114 = getelementptr inbounds [2049 x i32], ptr %22, i64 0, i64 0
  %115 = load ptr, ptr %17, align 8, !tbaa !9
  %116 = call ptr @fgetws(ptr noundef %114, i32 noundef 2049, ptr noundef %115)
  %117 = icmp ne ptr %116, null
  %118 = xor i1 %117, true
  %119 = zext i1 %118 to i32
  store i32 %119, ptr %8, align 4, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %130

122:                                              ; preds = %113
  %123 = load ptr, ptr %17, align 8, !tbaa !9
  %124 = call i32 @ferror(ptr noundef %123) #6
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %122
  %127 = load ptr, ptr %5, align 8, !tbaa !9
  %128 = getelementptr inbounds ptr, ptr %127, i64 1
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.5, ptr noundef %129) #7
  unreachable

130:                                              ; preds = %122, %113
  br label %131

131:                                              ; preds = %130, %110
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %148

134:                                              ; preds = %131
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %147, label %137

137:                                              ; preds = %134
  %138 = load ptr, ptr %19, align 8, !tbaa !9
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %147

140:                                              ; preds = %137
  %141 = load ptr, ptr %17, align 8, !tbaa !9
  %142 = load ptr, ptr %5, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %142, i64 1
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = load ptr, ptr %19, align 8, !tbaa !9
  %146 = getelementptr inbounds [2049 x i32], ptr %22, i64 0, i64 0
  call void @show(ptr noundef %141, ptr noundef %144, ptr noundef %145, ptr noundef %146)
  br label %147

147:                                              ; preds = %140, %137, %134
  br label %207

148:                                              ; preds = %131
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %165

151:                                              ; preds = %148
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %164, label %154

154:                                              ; preds = %151
  %155 = load ptr, ptr %18, align 8, !tbaa !9
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %164

157:                                              ; preds = %154
  %158 = load ptr, ptr %16, align 8, !tbaa !9
  %159 = load ptr, ptr %5, align 8, !tbaa !9
  %160 = getelementptr inbounds ptr, ptr %159, i64 0
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = load ptr, ptr %18, align 8, !tbaa !9
  %163 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  call void @show(ptr noundef %158, ptr noundef %161, ptr noundef %162, ptr noundef %163)
  br label %164

164:                                              ; preds = %157, %154, %151
  br label %207

165:                                              ; preds = %148
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %172

168:                                              ; preds = %165
  %169 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  %170 = getelementptr inbounds [2049 x i32], ptr %22, i64 0, i64 0
  %171 = call i32 @wcsicoll(ptr noundef %169, ptr noundef %170)
  store i32 %171, ptr %6, align 4, !tbaa !5
  br label %176

172:                                              ; preds = %165
  %173 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  %174 = getelementptr inbounds [2049 x i32], ptr %22, i64 0, i64 0
  %175 = call i32 @wcscoll(ptr noundef %173, ptr noundef %174) #6
  store i32 %175, ptr %6, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %172, %168
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %187, label %179

179:                                              ; preds = %176
  store i32 1, ptr %10, align 4, !tbaa !5
  store i32 1, ptr %9, align 4, !tbaa !5
  %180 = load ptr, ptr %20, align 8, !tbaa !9
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %186

182:                                              ; preds = %179
  %183 = load ptr, ptr %20, align 8, !tbaa !9
  %184 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %183, ptr noundef %184)
  br label %186

186:                                              ; preds = %182, %179
  br label %89

187:                                              ; preds = %176
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = icmp slt i32 %188, 0
  br i1 %189, label %190, label %198

190:                                              ; preds = %187
  store i32 1, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !5
  %191 = load ptr, ptr %18, align 8, !tbaa !9
  %192 = icmp ne ptr %191, null
  br i1 %192, label %193, label %197

193:                                              ; preds = %190
  %194 = load ptr, ptr %18, align 8, !tbaa !9
  %195 = getelementptr inbounds [2049 x i32], ptr %21, i64 0, i64 0
  %196 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %194, ptr noundef %195)
  br label %197

197:                                              ; preds = %193, %190
  br label %206

198:                                              ; preds = %187
  store i32 0, ptr %9, align 4, !tbaa !5
  store i32 1, ptr %10, align 4, !tbaa !5
  %199 = load ptr, ptr %19, align 8, !tbaa !9
  %200 = icmp ne ptr %199, null
  br i1 %200, label %201, label %205

201:                                              ; preds = %198
  %202 = load ptr, ptr %19, align 8, !tbaa !9
  %203 = getelementptr inbounds [2049 x i32], ptr %22, i64 0, i64 0
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %202, ptr noundef %203)
  br label %205

205:                                              ; preds = %201, %198
  br label %206

206:                                              ; preds = %205, %197
  br label %89

207:                                              ; preds = %164, %147
  call void @exit(i32 noundef 0) #8
  unreachable
}

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

; Function Attrs: nounwind
declare ptr @setlocale(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @usage() #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @file(ptr noundef) #0

declare ptr @fgetws(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @ferror(ptr noundef) #2

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare dso_local void @show(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind
declare i32 @wcscoll(ptr noundef, ptr noundef) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { noreturn "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 = { noreturn 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 = { noreturn }
attributes #8 = { noreturn nounwind }

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

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


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

@tabs = external dso_local local_unnamed_addr global [3 x ptr], align 16
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [2049 x i32], align 16
  %4 = alloca [2049 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 8196, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8196, ptr nonnull %4) #9
  %5 = tail call ptr @setlocale(i32 noundef 6, ptr noundef nonnull @.str.3) #9
  br label %.outer

.outer:                                           ; preds = %6, %2
  %.not73 = phi i1 [ false, %2 ], [ true, %6 ]
  %.056.ph = phi i32 [ 1, %2 ], [ %.056.ph236, %6 ]
  %.054.ph = phi i32 [ 1, %2 ], [ %.054.ph240, %6 ]
  %.052.ph = phi i32 [ 0, %2 ], [ %.052.ph243, %6 ]
  br label %.outer235

.outer235:                                        ; preds = %.outer, %8
  %.056.ph236 = phi i32 [ %.056.ph, %.outer ], [ 0, %8 ]
  %.054.ph237 = phi i32 [ %.054.ph, %.outer ], [ %.054.ph240, %8 ]
  %.052.ph238 = phi i32 [ %.052.ph, %.outer ], [ %.052.ph243, %8 ]
  br label %.outer239

.outer239:                                        ; preds = %.outer235, %9
  %.054.ph240 = phi i32 [ %.054.ph237, %.outer235 ], [ 0, %9 ]
  %.052.ph241 = phi i32 [ %.052.ph238, %.outer235 ], [ %.052.ph243, %9 ]
  br label %.outer242

.outer242:                                        ; preds = %.outer239, %10
  %.052.ph243 = phi i32 [ %.052.ph241, %.outer239 ], [ 1, %10 ]
  br label %6

6:                                                ; preds = %.outer242, %11
  %7 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.4) #9
  switch i32 %7, label %11 [
    i32 -1, label %12
    i32 49, label %.outer
    i32 50, label %8
    i32 51, label %9
    i32 105, label %10
  ], !llvm.loop !5

8:                                                ; preds = %6
  br label %.outer235, !llvm.loop !5

9:                                                ; preds = %6
  br label %.outer239, !llvm.loop !5

10:                                               ; preds = %6
  br label %.outer242, !llvm.loop !5

11:                                               ; preds = %6
  tail call void @usage()
  br label %6, !llvm.loop !5

12:                                               ; preds = %6
  %13 = load i32, ptr @optind, align 4, !tbaa !7
  %14 = sub nsw i32 %0, %13
  %15 = sext i32 %13 to i64
  %16 = getelementptr inbounds ptr, ptr %1, i64 %15
  %.not70 = icmp eq i32 %14, 2
  br i1 %.not70, label %17, label %22

17:                                               ; preds = %12
  %18 = load ptr, ptr %16, align 8, !tbaa !11
  %.not71 = icmp eq ptr %18, null
  br i1 %.not71, label %22, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %16, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %.not72 = icmp eq ptr %21, null
  br i1 %.not72, label %22, label %23

22:                                               ; preds = %19, %17, %12
  tail call void @usage()
  %.pre = load ptr, ptr %16, align 8, !tbaa !11
  br label %23

23:                                               ; preds = %22, %19
  %24 = phi ptr [ %.pre, %22 ], [ %18, %19 ]
  %25 = tail call ptr @file(ptr noundef %24)
  %26 = getelementptr inbounds i8, ptr %16, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = tail call ptr @file(ptr noundef %27)
  %29 = load ptr, ptr @tabs, align 16
  %.051 = select i1 %.not73, ptr null, ptr %29
  %.0 = select i1 %.not73, ptr @tabs, ptr getelementptr inbounds (i8, ptr @tabs, i64 8)
  %.not74 = icmp eq i32 %.056.ph236, 0
  br i1 %.not74, label %34, label %30

30:                                               ; preds = %23
  %31 = select i1 %.not73, ptr getelementptr inbounds (i8, ptr @tabs, i64 8), ptr getelementptr inbounds (i8, ptr @tabs, i64 16)
  %32 = load ptr, ptr %.0, align 8, !tbaa !11
  %33 = freeze ptr %32
  br label %34

34:                                               ; preds = %30, %23
  %.050 = phi ptr [ %33, %30 ], [ null, %23 ]
  %.1 = phi ptr [ %31, %30 ], [ %.0, %23 ]
  %.not75 = icmp eq i32 %.054.ph240, 0
  br i1 %.not75, label %37, label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %.1, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %35, %34
  %.049 = phi ptr [ %36, %35 ], [ null, %34 ]
  %.not82 = icmp eq i32 %.052.ph243, 0
  %.not85 = icmp eq ptr %.050, null
  %.not86 = icmp eq ptr %.051, null
  %.not84 = icmp eq ptr %.049, null
  br i1 %.not82, label %.split.us, label %.split

.split.us:                                        ; preds = %37, %.split.us.backedge
  %.not76.us = phi i1 [ %.not76.us.be, %.split.us.backedge ], [ false, %37 ]
  %.not79.us141 = phi i1 [ %.not79.us141.be, %.split.us.backedge ], [ false, %37 ]
  br i1 %.not76.us, label %.thread94.us, label %38

38:                                               ; preds = %.split.us
  %39 = call ptr @fgetws(ptr noundef nonnull %3, i32 noundef 2049, ptr noundef %25) #9
  %.not77.us = icmp eq ptr %39, null
  br i1 %.not77.us, label %40, label %.thread140

40:                                               ; preds = %38
  %41 = call i32 @ferror(ptr noundef %25) #9
  %.not78.us = icmp eq i32 %41, 0
  br i1 %.not78.us, label %42, label %.split101.us

42:                                               ; preds = %40
  br i1 %.not79.us141, label %.split103.us, label %43

.thread140:                                       ; preds = %38
  br i1 %.not79.us141, label %.thread92.us, label %43

.thread94.us:                                     ; preds = %.split.us
  br i1 %.not79.us141, label %.thread92.us, label %.thread152

43:                                               ; preds = %.thread140, %42
  %44 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80.us = icmp eq ptr %44, null
  br i1 %.not80.us, label %46, label %.thread142

.thread152:                                       ; preds = %.thread94.us
  %45 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80.us154 = icmp eq ptr %45, null
  br i1 %.not80.us154, label %.thread181, label %.thread92.us

46:                                               ; preds = %43
  %47 = call i32 @ferror(ptr noundef %28) #9
  %.not81.us = icmp eq i32 %47, 0
  br i1 %.not81.us, label %49, label %.split105.us

.thread181:                                       ; preds = %.thread152
  %48 = call i32 @ferror(ptr noundef %28) #9
  %.not81.us183 = icmp eq i32 %48, 0
  br i1 %.not81.us183, label %.split107.us, label %.split105.us

49:                                               ; preds = %46
  %brmerge211 = select i1 %.not77.us, i1 true, i1 %.not86
  br i1 %brmerge211, label %.split103.us.thread, label %.split103.us.thread.sink.split

.thread142:                                       ; preds = %43
  br i1 %.not77.us, label %.split103.us, label %.thread92.us

.thread92.us:                                     ; preds = %.thread152, %.thread142, %.thread140, %.thread94.us
  %50 = call i32 @wcscoll(ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %.not83.us = icmp eq i32 %50, 0
  br i1 %.not83.us, label %59, label %51

51:                                               ; preds = %.thread92.us
  %52 = icmp slt i32 %50, 0
  br i1 %52, label %56, label %53

53:                                               ; preds = %51
  br i1 %.not85, label %.split.us.backedge, label %54

54:                                               ; preds = %53
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.050, ptr noundef nonnull %4)
  br label %.split.us.backedge

56:                                               ; preds = %51
  br i1 %.not86, label %.split.us.backedge, label %57

57:                                               ; preds = %56
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.051, ptr noundef nonnull %3)
  br label %.split.us.backedge

59:                                               ; preds = %.thread92.us
  br i1 %.not84, label %.split.us.backedge, label %60

.split.us.backedge:                               ; preds = %59, %60, %53, %54, %56, %57
  %.not76.us.be = phi i1 [ false, %57 ], [ false, %56 ], [ true, %54 ], [ true, %53 ], [ false, %60 ], [ false, %59 ]
  %.not79.us141.be = phi i1 [ true, %57 ], [ true, %56 ], [ false, %54 ], [ false, %53 ], [ false, %60 ], [ false, %59 ]
  br label %.split.us

60:                                               ; preds = %59
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.049, ptr noundef nonnull %3)
  br label %.split.us.backedge

.split:                                           ; preds = %37
  br i1 %.not85, label %.split.split.us, label %.split.split

.split.split.us:                                  ; preds = %.split, %.split.split.us.backedge
  %.063.us108 = phi i1 [ %.063.us108.be, %.split.split.us.backedge ], [ false, %.split ]
  %.061.us109 = phi i32 [ %.061.us109.be, %.split.split.us.backedge ], [ 1, %.split ]
  br i1 %.063.us108, label %.thread94.us115, label %62

62:                                               ; preds = %.split.split.us
  %63 = call ptr @fgetws(ptr noundef nonnull %3, i32 noundef 2049, ptr noundef %25) #9
  %.not77.us111 = icmp eq ptr %63, null
  br i1 %.not77.us111, label %64, label %.thread144

64:                                               ; preds = %62
  %65 = call i32 @ferror(ptr noundef %25) #9
  %.not78.us112 = icmp eq i32 %65, 0
  br i1 %.not78.us112, label %66, label %.split101.us

66:                                               ; preds = %64
  %.not79.us113 = icmp eq i32 %.061.us109, 0
  br i1 %.not79.us113, label %.split103.us, label %67

.thread144:                                       ; preds = %62
  %.not79.us113145 = icmp eq i32 %.061.us109, 0
  br i1 %.not79.us113145, label %.thread92.us120, label %67

.thread94.us115:                                  ; preds = %.split.split.us
  %.not7996.us116 = icmp eq i32 %.061.us109, 0
  br i1 %.not7996.us116, label %.thread92.us120, label %.thread161

67:                                               ; preds = %.thread144, %66
  %68 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80.us118 = icmp eq ptr %68, null
  br i1 %.not80.us118, label %70, label %.thread146

.thread161:                                       ; preds = %.thread94.us115
  %69 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80.us118163 = icmp eq ptr %69, null
  br i1 %.not80.us118163, label %.thread187, label %.thread92.us120

70:                                               ; preds = %67
  %71 = call i32 @ferror(ptr noundef %28) #9
  %.not81.us119 = icmp eq i32 %71, 0
  br i1 %.not81.us119, label %73, label %.split105.us

.thread187:                                       ; preds = %.thread161
  %72 = call i32 @ferror(ptr noundef %28) #9
  %.not81.us119189 = icmp eq i32 %72, 0
  br i1 %.not81.us119189, label %.split107.us, label %.split105.us

73:                                               ; preds = %70
  %brmerge210 = select i1 %.not77.us111, i1 true, i1 %.not86
  br i1 %brmerge210, label %.split103.us.thread, label %.split103.us.thread.sink.split

.thread146:                                       ; preds = %67
  br i1 %.not77.us111, label %.split103.us, label %.thread92.us120

.thread92.us120:                                  ; preds = %.thread161, %.thread146, %.thread144, %.thread94.us115
  %74 = call i32 @wcsicoll(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.not83.us121 = icmp eq i32 %74, 0
  br i1 %.not83.us121, label %77, label %75

75:                                               ; preds = %.thread92.us120
  %76 = icmp sgt i32 %74, -1
  %brmerge = select i1 %76, i1 true, i1 %.not86
  %.mux129 = zext i1 %76 to i32
  br i1 %brmerge, label %.split.split.us.backedge, label %.backedge.us124.sink.split

77:                                               ; preds = %.thread92.us120
  br i1 %.not84, label %.split.split.us.backedge, label %.backedge.us124.sink.split

.backedge.us124.sink.split:                       ; preds = %77, %75
  %.049.sink = phi ptr [ %.051, %75 ], [ %.049, %77 ]
  %.061.be.us126.ph = phi i32 [ 0, %75 ], [ 1, %77 ]
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.049.sink, ptr noundef nonnull %3)
  br label %.split.split.us.backedge

.split.split.us.backedge:                         ; preds = %.backedge.us124.sink.split, %77, %75
  %.063.us108.be = phi i1 [ %76, %75 ], [ false, %77 ], [ false, %.backedge.us124.sink.split ]
  %.061.us109.be = phi i32 [ %.mux129, %75 ], [ 1, %77 ], [ %.061.be.us126.ph, %.backedge.us124.sink.split ]
  br label %.split.split.us

.split.split:                                     ; preds = %.split, %.split.split.backedge
  %.not76 = phi i1 [ %.not76.be, %.split.split.backedge ], [ false, %.split ]
  %.not79149 = phi i1 [ %.not79149.be, %.split.split.backedge ], [ false, %.split ]
  br i1 %.not76, label %.thread94, label %79

79:                                               ; preds = %.split.split
  %80 = call ptr @fgetws(ptr noundef nonnull %3, i32 noundef 2049, ptr noundef %25) #9
  %.not77 = icmp eq ptr %80, null
  br i1 %.not77, label %81, label %.thread148

81:                                               ; preds = %79
  %82 = call i32 @ferror(ptr noundef %25) #9
  %.not78 = icmp eq i32 %82, 0
  br i1 %.not78, label %84, label %.split101.us

.split101.us:                                     ; preds = %81, %64, %40
  %83 = load ptr, ptr %16, align 8, !tbaa !11
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.5, ptr noundef %83) #10
  unreachable

84:                                               ; preds = %81
  br i1 %.not79149, label %.split103.us, label %85

.thread148:                                       ; preds = %79
  br i1 %.not79149, label %.thread92, label %85

.thread94:                                        ; preds = %.split.split
  br i1 %.not79149, label %.thread92, label %.thread170

85:                                               ; preds = %.thread148, %84
  %86 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80 = icmp eq ptr %86, null
  br i1 %.not80, label %88, label %.thread150

.thread170:                                       ; preds = %.thread94
  %87 = call ptr @fgetws(ptr noundef nonnull %4, i32 noundef 2049, ptr noundef %28) #9
  %.not80172 = icmp eq ptr %87, null
  br i1 %.not80172, label %.thread193, label %.thread92

88:                                               ; preds = %85
  %89 = call i32 @ferror(ptr noundef %28) #9
  %.not81 = icmp eq i32 %89, 0
  br i1 %.not81, label %92, label %.split105.us

.thread193:                                       ; preds = %.thread170
  %90 = call i32 @ferror(ptr noundef %28) #9
  %.not81195 = icmp eq i32 %90, 0
  br i1 %.not81195, label %.split107.us, label %.split105.us

.split105.us:                                     ; preds = %.thread193, %.thread187, %.thread181, %88, %70, %46
  %91 = load ptr, ptr %26, align 8, !tbaa !11
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.5, ptr noundef %91) #10
  unreachable

92:                                               ; preds = %88
  %brmerge209 = select i1 %.not77, i1 true, i1 %.not86
  br i1 %brmerge209, label %.split103.us.thread, label %.split103.us.thread.sink.split

.thread150:                                       ; preds = %85
  br i1 %.not77, label %.split103.us, label %.thread92

.split103.us:                                     ; preds = %.thread150, %84, %66, %.thread146, %42, %.thread142
  br i1 %.not85, label %.split103.us.thread, label %.split103.us.thread.sink.split

.split107.us:                                     ; preds = %.thread193, %.thread187, %.thread181
  br i1 %.not86, label %.split103.us.thread, label %.split103.us.thread.sink.split

.thread92:                                        ; preds = %.thread170, %.thread150, %.thread148, %.thread94
  %93 = call i32 @wcsicoll(ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.not83 = icmp eq i32 %93, 0
  br i1 %.not83, label %94, label %97

94:                                               ; preds = %.thread92
  br i1 %.not84, label %.split.split.backedge, label %95

95:                                               ; preds = %94
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.049, ptr noundef nonnull %3)
  br label %.split.split.backedge

97:                                               ; preds = %.thread92
  %98 = icmp slt i32 %93, 0
  br i1 %98, label %99, label %102

99:                                               ; preds = %97
  br i1 %.not86, label %.split.split.backedge, label %100

100:                                              ; preds = %99
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.051, ptr noundef nonnull %3)
  br label %.split.split.backedge

.split.split.backedge:                            ; preds = %100, %99, %102, %94, %95
  %.not76.be = phi i1 [ false, %95 ], [ false, %94 ], [ false, %100 ], [ false, %99 ], [ true, %102 ]
  %.not79149.be = phi i1 [ false, %95 ], [ false, %94 ], [ true, %100 ], [ true, %99 ], [ false, %102 ]
  br label %.split.split

102:                                              ; preds = %97
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %.050, ptr noundef nonnull %4)
  br label %.split.split.backedge

.split103.us.thread.sink.split:                   ; preds = %.split107.us, %92, %73, %49, %.split103.us
  %.sink214 = phi ptr [ %26, %.split103.us ], [ %16, %49 ], [ %16, %73 ], [ %16, %92 ], [ %16, %.split107.us ]
  %.sink213 = phi ptr [ %4, %.split103.us ], [ %3, %49 ], [ %3, %73 ], [ %3, %92 ], [ %3, %.split107.us ]
  %.051.sink = phi ptr [ %.050, %.split103.us ], [ %.051, %49 ], [ %.051, %73 ], [ %.051, %92 ], [ %.051, %.split107.us ]
  %.sink = phi ptr [ %28, %.split103.us ], [ %25, %49 ], [ %25, %73 ], [ %25, %92 ], [ %25, %.split107.us ]
  %104 = load ptr, ptr %.sink214, align 8, !tbaa !11
  call void @show(ptr noundef %.sink, ptr noundef %104, ptr noundef nonnull %.051.sink, ptr noundef nonnull %.sink213)
  br label %.split103.us.thread

.split103.us.thread:                              ; preds = %.split103.us.thread.sink.split, %49, %73, %92, %.split107.us, %.split103.us
  call void @exit(i32 noundef 0) #10
  unreachable
}

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

; Function Attrs: nounwind
declare ptr @setlocale(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @usage() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @file(ptr noundef) local_unnamed_addr #3

declare ptr @fgetws(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @show(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @wcsicoll(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @wcscoll(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8

attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { "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 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 #6 = { noreturn "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 = { 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 #8 = { noreturn 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 #9 = { nounwind }
attributes #10 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !9, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass