; LLVM IR from DanEngelbrecht/longtail :: cmd (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"

%struct.anon = type { i32, [256 x %struct._kgflags_flag], i32, [512 x ptr], i32, [512 x %struct._kgflags_error], ptr, i32, i32, ptr, ptr }
%struct._kgflags_flag = type { ptr, ptr, %union.anon, %union.anon.0, i8, i8, i8, i32 }
%union.anon = type { ptr }
%union.anon.0 = type { ptr }
%struct._kgflags_error = type { ptr, ptr, i32 }

@_kgflags_g = external hidden global %struct.anon, align 8
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.30 = 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @kgflags_print_usage() #2 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 10), align 8, !tbaa !5
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %11

5:                                                ; preds = %0
  %6 = load ptr, ptr @stderr, align 8, !tbaa !11
  %7 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 9), align 8, !tbaa !12
  %8 = getelementptr inbounds ptr, ptr %7, i64 0
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef @.str.12, ptr noundef %9) #3
  br label %15

11:                                               ; preds = %0
  %12 = load ptr, ptr @stderr, align 8, !tbaa !11
  %13 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 10), align 8, !tbaa !5
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef @.str.13, ptr noundef %13) #3
  br label %15

15:                                               ; preds = %11, %5
  %16 = load ptr, ptr @stderr, align 8, !tbaa !11
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str.14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !13
  br label %18

18:                                               ; preds = %187, %15
  %19 = load i32, ptr %1, align 4, !tbaa !13
  %20 = load i32, ptr @_kgflags_g, align 8, !tbaa !14
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %190

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  %24 = load i32, ptr %1, align 4, !tbaa !13
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [256 x %struct._kgflags_flag], ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 1), i64 0, i64 %25
  store ptr %26, ptr %2, align 8, !tbaa !11
  %27 = load ptr, ptr %2, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct._kgflags_flag, ptr %27, i32 0, i32 7
  %29 = load i32, ptr %28, align 4, !tbaa !15
  switch i32 %29, label %172 [
    i32 1, label %30
    i32 2, label %54
    i32 3, label %85
    i32 4, label %109
    i32 5, label %133
    i32 6, label %146
    i32 7, label %159
  ]

30:                                               ; preds = %23
  %31 = load ptr, ptr @stderr, align 8, !tbaa !11
  %32 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %33 = load ptr, ptr %2, align 8, !tbaa !11
  %34 = getelementptr inbounds %struct._kgflags_flag, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = load ptr, ptr %2, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct._kgflags_flag, ptr %36, i32 0, i32 6
  %38 = load i8, ptr %37, align 2, !tbaa !20, !range !21, !noundef !22
  %39 = trunc i8 %38 to i1
  %40 = zext i1 %39 to i64
  %41 = select i1 %39, ptr @.str.16, ptr @.str.17
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.15, ptr noundef %32, ptr noundef %35, ptr noundef %41) #3
  %43 = load ptr, ptr %2, align 8, !tbaa !11
  %44 = getelementptr inbounds %struct._kgflags_flag, ptr %43, i32 0, i32 6
  %45 = load i8, ptr %44, align 2, !tbaa !20, !range !21, !noundef !22
  %46 = trunc i8 %45 to i1
  br i1 %46, label %53, label %47

47:                                               ; preds = %30
  %48 = load ptr, ptr @stderr, align 8, !tbaa !11
  %49 = load ptr, ptr %2, align 8, !tbaa !11
  %50 = getelementptr inbounds %struct._kgflags_flag, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.18, ptr noundef %51) #3
  br label %53

53:                                               ; preds = %47, %30
  br label %173

54:                                               ; preds = %23
  %55 = load ptr, ptr @stderr, align 8, !tbaa !11
  %56 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %57 = load ptr, ptr %2, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct._kgflags_flag, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %61 = load ptr, ptr %2, align 8, !tbaa !11
  %62 = getelementptr inbounds %struct._kgflags_flag, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !19
  %64 = load ptr, ptr %2, align 8, !tbaa !11
  %65 = getelementptr inbounds %struct._kgflags_flag, ptr %64, i32 0, i32 6
  %66 = load i8, ptr %65, align 2, !tbaa !20, !range !21, !noundef !22
  %67 = trunc i8 %66 to i1
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, ptr @.str.16, ptr @.str.17
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.19, ptr noundef %56, ptr noundef %59, ptr noundef %60, ptr noundef %63, ptr noundef %69) #3
  %71 = load ptr, ptr %2, align 8, !tbaa !11
  %72 = getelementptr inbounds %struct._kgflags_flag, ptr %71, i32 0, i32 6
  %73 = load i8, ptr %72, align 2, !tbaa !20, !range !21, !noundef !22
  %74 = trunc i8 %73 to i1
  br i1 %74, label %84, label %75

75:                                               ; preds = %54
  %76 = load ptr, ptr @stderr, align 8, !tbaa !11
  %77 = load ptr, ptr %2, align 8, !tbaa !11
  %78 = getelementptr inbounds %struct._kgflags_flag, ptr %77, i32 0, i32 2
  %79 = load i8, ptr %78, align 8, !tbaa !23, !range !21, !noundef !22
  %80 = trunc i8 %79 to i1
  %81 = zext i1 %80 to i64
  %82 = select i1 %80, ptr @.str.20, ptr @.str.21
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.18, ptr noundef %82) #3
  br label %84

84:                                               ; preds = %75, %54
  br label %173

85:                                               ; preds = %23
  %86 = load ptr, ptr @stderr, align 8, !tbaa !11
  %87 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %88 = load ptr, ptr %2, align 8, !tbaa !11
  %89 = getelementptr inbounds %struct._kgflags_flag, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !19
  %91 = load ptr, ptr %2, align 8, !tbaa !11
  %92 = getelementptr inbounds %struct._kgflags_flag, ptr %91, i32 0, i32 6
  %93 = load i8, ptr %92, align 2, !tbaa !20, !range !21, !noundef !22
  %94 = trunc i8 %93 to i1
  %95 = zext i1 %94 to i64
  %96 = select i1 %94, ptr @.str.16, ptr @.str.17
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.22, ptr noundef %87, ptr noundef %90, ptr noundef %96) #3
  %98 = load ptr, ptr %2, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct._kgflags_flag, ptr %98, i32 0, i32 6
  %100 = load i8, ptr %99, align 2, !tbaa !20, !range !21, !noundef !22
  %101 = trunc i8 %100 to i1
  br i1 %101, label %108, label %102

102:                                              ; preds = %85
  %103 = load ptr, ptr @stderr, align 8, !tbaa !11
  %104 = load ptr, ptr %2, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct._kgflags_flag, ptr %104, i32 0, i32 2
  %106 = load i32, ptr %105, align 8, !tbaa !23
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.23, i32 noundef %106) #3
  br label %108

108:                                              ; preds = %102, %85
  br label %173

109:                                              ; preds = %23
  %110 = load ptr, ptr @stderr, align 8, !tbaa !11
  %111 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %112 = load ptr, ptr %2, align 8, !tbaa !11
  %113 = getelementptr inbounds %struct._kgflags_flag, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = load ptr, ptr %2, align 8, !tbaa !11
  %116 = getelementptr inbounds %struct._kgflags_flag, ptr %115, i32 0, i32 6
  %117 = load i8, ptr %116, align 2, !tbaa !20, !range !21, !noundef !22
  %118 = trunc i8 %117 to i1
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, ptr @.str.16, ptr @.str.17
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.24, ptr noundef %111, ptr noundef %114, ptr noundef %120) #3
  %122 = load ptr, ptr %2, align 8, !tbaa !11
  %123 = getelementptr inbounds %struct._kgflags_flag, ptr %122, i32 0, i32 6
  %124 = load i8, ptr %123, align 2, !tbaa !20, !range !21, !noundef !22
  %125 = trunc i8 %124 to i1
  br i1 %125, label %132, label %126

126:                                              ; preds = %109
  %127 = load ptr, ptr @stderr, align 8, !tbaa !11
  %128 = load ptr, ptr %2, align 8, !tbaa !11
  %129 = getelementptr inbounds %struct._kgflags_flag, ptr %128, i32 0, i32 2
  %130 = load double, ptr %129, align 8, !tbaa !23
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.25, double noundef %130) #3
  br label %132

132:                                              ; preds = %126, %109
  br label %173

133:                                              ; preds = %23
  %134 = load ptr, ptr @stderr, align 8, !tbaa !11
  %135 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %136 = load ptr, ptr %2, align 8, !tbaa !11
  %137 = getelementptr inbounds %struct._kgflags_flag, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !19
  %139 = load ptr, ptr %2, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct._kgflags_flag, ptr %139, i32 0, i32 6
  %141 = load i8, ptr %140, align 2, !tbaa !20, !range !21, !noundef !22
  %142 = trunc i8 %141 to i1
  %143 = zext i1 %142 to i64
  %144 = select i1 %142, ptr @.str.16, ptr @.str.17
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.26, ptr noundef %135, ptr noundef %138, ptr noundef %144) #3
  br label %173

146:                                              ; preds = %23
  %147 = load ptr, ptr @stderr, align 8, !tbaa !11
  %148 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %149 = load ptr, ptr %2, align 8, !tbaa !11
  %150 = getelementptr inbounds %struct._kgflags_flag, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !19
  %152 = load ptr, ptr %2, align 8, !tbaa !11
  %153 = getelementptr inbounds %struct._kgflags_flag, ptr %152, i32 0, i32 6
  %154 = load i8, ptr %153, align 2, !tbaa !20, !range !21, !noundef !22
  %155 = trunc i8 %154 to i1
  %156 = zext i1 %155 to i64
  %157 = select i1 %155, ptr @.str.16, ptr @.str.17
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.27, ptr noundef %148, ptr noundef %151, ptr noundef %157) #3
  br label %173

159:                                              ; preds = %23
  %160 = load ptr, ptr @stderr, align 8, !tbaa !11
  %161 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @_kgflags_g, i32 0, i32 6), align 8, !tbaa !18
  %162 = load ptr, ptr %2, align 8, !tbaa !11
  %163 = getelementptr inbounds %struct._kgflags_flag, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !19
  %165 = load ptr, ptr %2, align 8, !tbaa !11
  %166 = getelementptr inbounds %struct._kgflags_flag, ptr %165, i32 0, i32 6
  %167 = load i8, ptr %166, align 2, !tbaa !20, !range !21, !noundef !22
  %168 = trunc i8 %167 to i1
  %169 = zext i1 %168 to i64
  %170 = select i1 %168, ptr @.str.16, ptr @.str.17
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.28, ptr noundef %161, ptr noundef %164, ptr noundef %170) #3
  br label %173

172:                                              ; preds = %23
  br label %173

173:                                              ; preds = %172, %159, %146, %133, %132, %108, %84, %53
  %174 = load ptr, ptr %2, align 8, !tbaa !11
  %175 = getelementptr inbounds %struct._kgflags_flag, ptr %174, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8, !tbaa !24
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %184

178:                                              ; preds = %173
  %179 = load ptr, ptr @stderr, align 8, !tbaa !11
  %180 = load ptr, ptr %2, align 8, !tbaa !11
  %181 = getelementptr inbounds %struct._kgflags_flag, ptr %180, i32 0, i32 1
  %182 = load ptr, ptr %181, align 8, !tbaa !24
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.29, ptr noundef %182) #3
  br label %184

184:                                              ; preds = %178, %173
  %185 = load ptr, ptr @stderr, align 8, !tbaa !11
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  br label %187

187:                                              ; preds = %184
  %188 = load i32, ptr %1, align 4, !tbaa !13
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %1, align 4, !tbaa !13
  br label %18, !llvm.loop !25

190:                                              ; preds = %22
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 26672}
!6 = !{!"", !7, i64 0, !8, i64 8, !7, i64 10248, !8, i64 10256, !7, i64 14352, !8, i64 14360, !10, i64 26648, !7, i64 26656, !7, i64 26660, !10, i64 26664, !10, i64 26672}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!6, !10, i64 26664}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !7, i64 36}
!16 = !{!"_kgflags_flag", !10, i64 0, !10, i64 8, !8, i64 16, !8, i64 24, !17, i64 32, !17, i64 33, !17, i64 34, !7, i64 36}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!6, !10, i64 26648}
!19 = !{!16, !10, i64 0}
!20 = !{!16, !17, i64 34}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!8, !8, i64 0}
!24 = !{!16, !10, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"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"

%struct.anon = type { i32, [256 x %struct._kgflags_flag], i32, [512 x ptr], i32, [512 x %struct._kgflags_error], ptr, i32, i32, ptr, ptr }
%struct._kgflags_flag = type { ptr, ptr, %union.anon, %union.anon.0, i8, i8, i8, i32 }
%union.anon = type { ptr }
%union.anon.0 = type { ptr }
%struct._kgflags_error = type { ptr, ptr, i32 }

@_kgflags_g = external hidden local_unnamed_addr global %struct.anon, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @kgflags_print_usage() local_unnamed_addr #1 {
  %1 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26672), align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  %3 = load ptr, ptr @stderr, align 8, !tbaa !11
  br i1 %2, label %4, label %8

4:                                                ; preds = %0
  %5 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26664), align 8, !tbaa !12
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str.12, ptr noundef %6) #2
  br label %10

8:                                                ; preds = %0
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str.13, ptr noundef nonnull %1) #2
  br label %10

10:                                               ; preds = %8, %4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !11
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.14) #2
  %13 = load i32, ptr @_kgflags_g, align 8, !tbaa !13
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %117, %10
  ret void

.lr.ph:                                           ; preds = %10, %117
  %indvars.iv = phi i64 [ %indvars.iv.next, %117 ], [ 0, %10 ]
  %15 = getelementptr inbounds [256 x %struct._kgflags_flag], ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 8), i64 0, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 36
  %17 = load i32, ptr %16, align 4, !tbaa !14
  switch i32 %17, label %111 [
    i32 1, label %18
    i32 2, label %34
    i32 3, label %52
    i32 4, label %68
    i32 5, label %84
    i32 6, label %93
    i32 7, label %102
  ]

18:                                               ; preds = %.lr.ph
  %19 = load ptr, ptr @stderr, align 8, !tbaa !11
  %20 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %21 = load ptr, ptr %15, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %15, i64 34
  %23 = load i8, ptr %22, align 2, !tbaa !19, !range !20, !noundef !21
  %24 = trunc nuw i8 %23 to i1
  %25 = select i1 %24, ptr @.str.16, ptr @.str.17
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.15, ptr noundef %20, ptr noundef %21, ptr noundef nonnull %25) #2
  %27 = load i8, ptr %22, align 2, !tbaa !19, !range !20, !noundef !21
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %111, label %29

29:                                               ; preds = %18
  %30 = load ptr, ptr @stderr, align 8, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %15, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.18, ptr noundef %32) #2
  br label %111

34:                                               ; preds = %.lr.ph
  %35 = load ptr, ptr @stderr, align 8, !tbaa !11
  %36 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %37 = load ptr, ptr %15, align 8, !tbaa !18
  %38 = getelementptr inbounds i8, ptr %15, i64 34
  %39 = load i8, ptr %38, align 2, !tbaa !19, !range !20, !noundef !21
  %40 = trunc nuw i8 %39 to i1
  %41 = select i1 %40, ptr @.str.16, ptr @.str.17
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.19, ptr noundef %36, ptr noundef %37, ptr noundef %36, ptr noundef %37, ptr noundef nonnull %41) #2
  %43 = load i8, ptr %38, align 2, !tbaa !19, !range !20, !noundef !21
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %111, label %45

45:                                               ; preds = %34
  %46 = load ptr, ptr @stderr, align 8, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %15, i64 16
  %48 = load i8, ptr %47, align 8, !tbaa !22, !range !20, !noundef !21
  %49 = trunc nuw i8 %48 to i1
  %50 = select i1 %49, ptr @.str.20, ptr @.str.21
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.18, ptr noundef nonnull %50) #2
  br label %111

52:                                               ; preds = %.lr.ph
  %53 = load ptr, ptr @stderr, align 8, !tbaa !11
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %55 = load ptr, ptr %15, align 8, !tbaa !18
  %56 = getelementptr inbounds i8, ptr %15, i64 34
  %57 = load i8, ptr %56, align 2, !tbaa !19, !range !20, !noundef !21
  %58 = trunc nuw i8 %57 to i1
  %59 = select i1 %58, ptr @.str.16, ptr @.str.17
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.22, ptr noundef %54, ptr noundef %55, ptr noundef nonnull %59) #2
  %61 = load i8, ptr %56, align 2, !tbaa !19, !range !20, !noundef !21
  %62 = trunc nuw i8 %61 to i1
  br i1 %62, label %111, label %63

63:                                               ; preds = %52
  %64 = load ptr, ptr @stderr, align 8, !tbaa !11
  %65 = getelementptr inbounds i8, ptr %15, i64 16
  %66 = load i32, ptr %65, align 8, !tbaa !22
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.23, i32 noundef %66) #2
  br label %111

68:                                               ; preds = %.lr.ph
  %69 = load ptr, ptr @stderr, align 8, !tbaa !11
  %70 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %71 = load ptr, ptr %15, align 8, !tbaa !18
  %72 = getelementptr inbounds i8, ptr %15, i64 34
  %73 = load i8, ptr %72, align 2, !tbaa !19, !range !20, !noundef !21
  %74 = trunc nuw i8 %73 to i1
  %75 = select i1 %74, ptr @.str.16, ptr @.str.17
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.24, ptr noundef %70, ptr noundef %71, ptr noundef nonnull %75) #2
  %77 = load i8, ptr %72, align 2, !tbaa !19, !range !20, !noundef !21
  %78 = trunc nuw i8 %77 to i1
  br i1 %78, label %111, label %79

79:                                               ; preds = %68
  %80 = load ptr, ptr @stderr, align 8, !tbaa !11
  %81 = getelementptr inbounds i8, ptr %15, i64 16
  %82 = load double, ptr %81, align 8, !tbaa !22
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.25, double noundef %82) #2
  br label %111

84:                                               ; preds = %.lr.ph
  %85 = load ptr, ptr @stderr, align 8, !tbaa !11
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %87 = load ptr, ptr %15, align 8, !tbaa !18
  %88 = getelementptr inbounds i8, ptr %15, i64 34
  %89 = load i8, ptr %88, align 2, !tbaa !19, !range !20, !noundef !21
  %90 = trunc nuw i8 %89 to i1
  %91 = select i1 %90, ptr @.str.16, ptr @.str.17
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.26, ptr noundef %86, ptr noundef %87, ptr noundef nonnull %91) #2
  br label %111

93:                                               ; preds = %.lr.ph
  %94 = load ptr, ptr @stderr, align 8, !tbaa !11
  %95 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %96 = load ptr, ptr %15, align 8, !tbaa !18
  %97 = getelementptr inbounds i8, ptr %15, i64 34
  %98 = load i8, ptr %97, align 2, !tbaa !19, !range !20, !noundef !21
  %99 = trunc nuw i8 %98 to i1
  %100 = select i1 %99, ptr @.str.16, ptr @.str.17
  %101 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.27, ptr noundef %95, ptr noundef %96, ptr noundef nonnull %100) #2
  br label %111

102:                                              ; preds = %.lr.ph
  %103 = load ptr, ptr @stderr, align 8, !tbaa !11
  %104 = load ptr, ptr getelementptr inbounds (i8, ptr @_kgflags_g, i64 26648), align 8, !tbaa !17
  %105 = load ptr, ptr %15, align 8, !tbaa !18
  %106 = getelementptr inbounds i8, ptr %15, i64 34
  %107 = load i8, ptr %106, align 2, !tbaa !19, !range !20, !noundef !21
  %108 = trunc nuw i8 %107 to i1
  %109 = select i1 %108, ptr @.str.16, ptr @.str.17
  %110 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.28, ptr noundef %104, ptr noundef %105, ptr noundef nonnull %109) #2
  br label %111

111:                                              ; preds = %.lr.ph, %68, %79, %52, %63, %34, %45, %18, %29, %102, %93, %84
  %112 = getelementptr inbounds i8, ptr %15, i64 8
  %113 = load ptr, ptr %112, align 8, !tbaa !23
  %.not = icmp eq ptr %113, null
  br i1 %.not, label %117, label %114

114:                                              ; preds = %111
  %115 = load ptr, ptr @stderr, align 8, !tbaa !11
  %116 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.29, ptr noundef nonnull %113) #2
  br label %117

117:                                              ; preds = %114, %111
  %118 = load ptr, ptr @stderr, align 8, !tbaa !11
  %119 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.30) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %120 = load i32, ptr @_kgflags_g, align 8, !tbaa !13
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next, %121
  br i1 %122, label %.lr.ph, label %._crit_edge, !llvm.loop !24
}

attributes #0 = { 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 #1 = { 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 #2 = { 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, !10, i64 26672}
!6 = !{!"", !7, i64 0, !8, i64 8, !7, i64 10248, !8, i64 10256, !7, i64 14352, !8, i64 14360, !10, i64 26648, !7, i64 26656, !7, i64 26660, !10, i64 26664, !10, i64 26672}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!6, !10, i64 26664}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !7, i64 36}
!15 = !{!"_kgflags_flag", !10, i64 0, !10, i64 8, !8, i64 16, !8, i64 24, !16, i64 32, !16, i64 33, !16, i64 34, !7, i64 36}
!16 = !{!"_Bool", !8, i64 0}
!17 = !{!6, !10, i64 26648}
!18 = !{!15, !10, i64 0}
!19 = !{!15, !16, i64 34}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!8, !8, i64 0}
!23 = !{!15, !10, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass