; LLVM IR from vul337/PrIntFuzz :: config/linux/firmware/carl9170fw/config (conf)

; 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.option = type { ptr, i32, ptr, i32 }
%struct.menu = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.timeval = type { i64, i64 }

@input_mode = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [1 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@long_opts = external hidden global [12 x %struct.option], align 16
@optarg = external global ptr, align 8
@optind = external global i32, align 4
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@valid_stdin = external hidden global i32, align 4
@rootmenu = external global %struct.menu, align 8
@rootEntry = external hidden global ptr, align 8
@conf_cnt = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [49 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 ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.stat, align 8
  %11 = alloca %struct.timeval, align 8
  %12 = alloca i32, align 4
  %13 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %14 = load ptr, ptr %5, align 8, !tbaa !9
  %15 = getelementptr inbounds ptr, ptr %14, i64 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 144, ptr %10) #5
  %17 = call ptr @setlocale(i32 noundef 6, ptr noundef @.str) #5
  %18 = call ptr @bindtextdomain(ptr noundef @.str.1, ptr noundef @.str.2) #5
  %19 = call ptr @textdomain(ptr noundef @.str.1) #5
  br label %20

20:                                               ; preds = %44, %2
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = call i32 @getopt_long(i32 noundef %21, ptr noundef %22, ptr noundef @.str, ptr noundef @long_opts, ptr noundef null) #5
  store i32 %23, ptr %7, align 4, !tbaa !5
  %24 = icmp ne i32 %23, -1
  br i1 %24, label %25, label %45

25:                                               ; preds = %20
  %26 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %26, ptr @input_mode, align 4, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %27, label %44 [
    i32 7, label %28
    i32 8, label %28
    i32 6, label %30
    i32 0, label %41
    i32 1, label %41
    i32 2, label %41
    i32 3, label %41
    i32 4, label %41
    i32 5, label %41
    i32 9, label %41
    i32 10, label %41
    i32 63, label %42
  ]

28:                                               ; preds = %25, %25
  %29 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %29, ptr %9, align 8, !tbaa !9
  br label %44

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %31 = call i32 @gettimeofday(ptr noundef %11, ptr noundef null) #5
  %32 = getelementptr inbounds %struct.timeval, ptr %11, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = add nsw i64 %33, 1
  %35 = getelementptr inbounds %struct.timeval, ptr %11, i32 0, i32 1
  %36 = load i64, ptr %35, align 8, !tbaa !14
  %37 = add nsw i64 %36, 1
  %38 = mul nsw i64 %34, %37
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %12, align 4, !tbaa !5
  %40 = load i32, ptr %12, align 4, !tbaa !5
  call void @srand(i32 noundef %40) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %44

41:                                               ; preds = %25, %25, %25, %25, %25, %25, %25, %25
  br label %44

42:                                               ; preds = %25
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  call void @conf_usage(ptr noundef %43)
  call void @exit(i32 noundef 1) #6
  unreachable

44:                                               ; preds = %41, %30, %28, %25
  br label %20, !llvm.loop !15

45:                                               ; preds = %20
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @optind, align 4, !tbaa !5
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %45
  %50 = call ptr @dcgettext(ptr noundef null, ptr noundef @.str.3, i32 noundef 5) #5
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 0
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 (ptr, ...) @printf(ptr noundef %50, ptr noundef %53)
  %55 = load ptr, ptr %6, align 8, !tbaa !9
  call void @conf_usage(ptr noundef %55)
  call void @exit(i32 noundef 1) #6
  unreachable

56:                                               ; preds = %45
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = load i32, ptr @optind, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  store ptr %61, ptr %8, align 8, !tbaa !9
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  call void @conf_parse(ptr noundef %62)
  %63 = load i32, ptr @input_mode, align 4, !tbaa !5
  switch i32 %63, label %113 [
    i32 7, label %64
    i32 8, label %78
    i32 0, label %78
    i32 1, label %78
    i32 9, label %78
    i32 10, label %78
    i32 2, label %80
    i32 3, label %80
    i32 4, label %80
    i32 5, label %80
    i32 6, label %80
  ]

64:                                               ; preds = %56
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = icmp ne ptr %65, null
  br i1 %66, label %69, label %67

67:                                               ; preds = %64
  %68 = call ptr @conf_get_default_confname()
  store ptr %68, ptr %9, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %67, %64
  %70 = load ptr, ptr %9, align 8, !tbaa !9
  %71 = call i32 @conf_read(ptr noundef %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %69
  %74 = call ptr @dcgettext(ptr noundef null, ptr noundef @.str.4, i32 noundef 5) #5
  %75 = load ptr, ptr %9, align 8, !tbaa !9
  %76 = call i32 (ptr, ...) @printf(ptr noundef %74, ptr noundef %75)
  call void @exit(i32 noundef 1) #6
  unreachable

77:                                               ; preds = %69
  br label %114

78:                                               ; preds = %56, %56, %56, %56, %56
  %79 = call i32 @conf_read(ptr noundef null)
  br label %114

80:                                               ; preds = %56, %56, %56, %56, %56
  %81 = call ptr @getenv(ptr noundef @.str.5) #5
  store ptr %81, ptr %8, align 8, !tbaa !9
  %82 = load ptr, ptr %8, align 8, !tbaa !9
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %91

84:                                               ; preds = %80
  %85 = load ptr, ptr %8, align 8, !tbaa !9
  %86 = call i32 @stat(ptr noundef %85, ptr noundef %10) #5
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %91, label %88

88:                                               ; preds = %84
  %89 = load ptr, ptr %8, align 8, !tbaa !9
  %90 = call i32 @conf_read_simple(ptr noundef %89, i32 noundef 0)
  br label %114

91:                                               ; preds = %84, %80
  %92 = load i32, ptr @input_mode, align 4, !tbaa !5
  switch i32 %92, label %98 [
    i32 2, label %93
    i32 3, label %94
    i32 4, label %95
    i32 5, label %96
    i32 6, label %97
  ]

93:                                               ; preds = %91
  store ptr @.str.6, ptr %8, align 8, !tbaa !9
  br label %99

94:                                               ; preds = %91
  store ptr @.str.7, ptr %8, align 8, !tbaa !9
  br label %99

95:                                               ; preds = %91
  store ptr @.str.8, ptr %8, align 8, !tbaa !9
  br label %99

96:                                               ; preds = %91
  store ptr @.str.9, ptr %8, align 8, !tbaa !9
  br label %99

97:                                               ; preds = %91
  store ptr @.str.10, ptr %8, align 8, !tbaa !9
  br label %99

98:                                               ; preds = %91
  br label %99

99:                                               ; preds = %98, %97, %96, %95, %94, %93
  %100 = load ptr, ptr %8, align 8, !tbaa !9
  %101 = call i32 @stat(ptr noundef %100, ptr noundef %10) #5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %106, label %103

103:                                              ; preds = %99
  %104 = load ptr, ptr %8, align 8, !tbaa !9
  %105 = call i32 @conf_read_simple(ptr noundef %104, i32 noundef 0)
  br label %112

106:                                              ; preds = %99
  %107 = call i32 @stat(ptr noundef @.str.11, ptr noundef %10) #5
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %111, label %109

109:                                              ; preds = %106
  %110 = call i32 @conf_read_simple(ptr noundef @.str.11, i32 noundef 0)
  br label %111

111:                                              ; preds = %109, %106
  br label %112

112:                                              ; preds = %111, %103
  br label %114

113:                                              ; preds = %56
  br label %114

114:                                              ; preds = %113, %112, %88, %78, %77
  %115 = call i32 @isatty(i32 noundef 0) #5
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %123

117:                                              ; preds = %114
  %118 = call i32 @isatty(i32 noundef 1) #5
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %123

120:                                              ; preds = %117
  %121 = call i32 @isatty(i32 noundef 2) #5
  %122 = icmp ne i32 %121, 0
  br label %123

123:                                              ; preds = %120, %117, %114
  %124 = phi i1 [ false, %117 ], [ false, %114 ], [ %122, %120 ]
  %125 = zext i1 %124 to i32
  store i32 %125, ptr @valid_stdin, align 4, !tbaa !5
  %126 = load i32, ptr @input_mode, align 4, !tbaa !5
  switch i32 %126, label %150 [
    i32 2, label %127
    i32 3, label %128
    i32 4, label %129
    i32 5, label %130
    i32 6, label %131
    i32 7, label %132
    i32 8, label %150
    i32 0, label %133
    i32 1, label %134
    i32 9, label %134
    i32 10, label %134
  ]

127:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 3)
  br label %150

128:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 1)
  br label %150

129:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 2)
  br label %150

130:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 0)
  br label %150

131:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 4)
  br label %150

132:                                              ; preds = %123
  call void @conf_set_all_new_symbols(i32 noundef 0)
  br label %150

133:                                              ; preds = %123
  store ptr @rootmenu, ptr @rootEntry, align 8, !tbaa !9
  call void @conf(ptr noundef @rootmenu)
  store i32 1, ptr @input_mode, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %133, %123, %123, %123
  br label %135

135:                                              ; preds = %147, %134
  store i32 0, ptr @conf_cnt, align 4, !tbaa !5
  call void @check_conf(ptr noundef @rootmenu)
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr @conf_cnt, align 4, !tbaa !5
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %147

139:                                              ; preds = %136
  %140 = load i32, ptr @input_mode, align 4, !tbaa !5
  %141 = icmp ne i32 %140, 9
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr @input_mode, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 10
  br label %145

145:                                              ; preds = %142, %139
  %146 = phi i1 [ false, %139 ], [ %144, %142 ]
  br label %147

147:                                              ; preds = %145, %136
  %148 = phi i1 [ false, %136 ], [ %146, %145 ]
  br i1 %148, label %135, label %149, !llvm.loop !17

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149, %132, %131, %130, %129, %128, %127, %123, %123
  %151 = load i32, ptr @input_mode, align 4, !tbaa !5
  %152 = icmp eq i32 %151, 8
  br i1 %152, label %153, label %163

153:                                              ; preds = %150
  %154 = load ptr, ptr %9, align 8, !tbaa !9
  %155 = call i32 @conf_write_defconfig(ptr noundef %154)
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %162

157:                                              ; preds = %153
  %158 = load ptr, ptr @stderr, align 8, !tbaa !9
  %159 = call ptr @dcgettext(ptr noundef null, ptr noundef @.str.12, i32 noundef 5) #5
  %160 = load ptr, ptr %9, align 8, !tbaa !9
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef %159, ptr noundef %160) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %183

162:                                              ; preds = %153
  br label %182

163:                                              ; preds = %150
  %164 = load i32, ptr @input_mode, align 4, !tbaa !5
  %165 = icmp ne i32 %164, 9
  br i1 %165, label %166, label %181

166:                                              ; preds = %163
  %167 = call i32 @conf_write(ptr noundef null)
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %173

169:                                              ; preds = %166
  %170 = load ptr, ptr @stderr, align 8, !tbaa !9
  %171 = call ptr @dcgettext(ptr noundef null, ptr noundef @.str.13, i32 noundef 5) #5
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef %171) #5
  call void @exit(i32 noundef 1) #6
  unreachable

173:                                              ; preds = %166
  %174 = call i32 @conf_write_autoconf()
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %180

176:                                              ; preds = %173
  %177 = load ptr, ptr @stderr, align 8, !tbaa !9
  %178 = call ptr @dcgettext(ptr noundef null, ptr noundef @.str.14, i32 noundef 5) #5
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef %178) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %183

180:                                              ; preds = %173
  br label %181

181:                                              ; preds = %180, %163
  br label %182

182:                                              ; preds = %181, %162
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %183

183:                                              ; preds = %182, %176, %157
  call void @llvm.lifetime.end.p0(i64 144, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %184 = load i32, ptr %3, align 4
  ret i32 %184
}

; 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 ptr @bindtextdomain(ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

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

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

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

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

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

declare void @conf_parse(ptr noundef) #4

declare ptr @conf_get_default_confname() #4

declare i32 @conf_read(ptr noundef) #4

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

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

declare i32 @conf_read_simple(ptr noundef, i32 noundef) #4

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

declare void @conf_set_all_new_symbols(i32 noundef) #4

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

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

declare i32 @conf_write_defconfig(ptr noundef) #4

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

declare i32 @conf_write(ptr noundef) #4

declare i32 @conf_write_autoconf() #4

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 = { 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 #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 = { nounwind }
attributes #6 = { 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 = !{!12, !13, i64 0}
!12 = !{!"timeval", !13, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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

%struct.option = type { ptr, i32, ptr, i32 }
%struct.menu = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.timeval = type { i64, i64 }

@input_mode = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [1 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@long_opts = external hidden global [12 x %struct.option], align 16
@optarg = external local_unnamed_addr global ptr, align 8
@optind = external local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@valid_stdin = external hidden local_unnamed_addr global i32, align 4
@rootmenu = external global %struct.menu, align 8
@rootEntry = external hidden local_unnamed_addr global ptr, align 8
@conf_cnt = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [49 x i8], align 1
@switch.table.main = private unnamed_addr constant [5 x ptr] [ptr @.str.6, ptr @.str.7, ptr @.str.8, ptr @.str.9, ptr @.str.10], align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.stat, align 8
  %4 = alloca %struct.timeval, align 8
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %3) #7
  %6 = tail call ptr @setlocale(i32 noundef 6, ptr noundef nonnull @.str) #7
  %7 = tail call ptr @bindtextdomain(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2) #7
  %8 = tail call ptr @textdomain(ptr noundef nonnull @.str.1) #7
  %9 = tail call i32 @getopt_long(i32 noundef %0, ptr noundef nonnull %1, ptr noundef nonnull @.str, ptr noundef nonnull @long_opts, ptr noundef null) #7
  %.not42 = icmp eq i32 %9, -1
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %10 = getelementptr inbounds i8, ptr %4, i64 8
  br label %11

11:                                               ; preds = %.lr.ph, %24
  %12 = phi i32 [ %9, %.lr.ph ], [ %25, %24 ]
  %.02243 = phi ptr [ null, %.lr.ph ], [ %.1, %24 ]
  store i32 %12, ptr @input_mode, align 4, !tbaa !9
  switch i32 %12, label %24 [
    i32 7, label %13
    i32 8, label %13
    i32 6, label %15
    i32 63, label %23
  ]

13:                                               ; preds = %11, %11
  %14 = load ptr, ptr @optarg, align 8, !tbaa !5
  br label %24

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %16 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #7
  %17 = load i64, ptr %4, align 8, !tbaa !11
  %18 = add nsw i64 %17, 1
  %19 = load i64, ptr %10, align 8, !tbaa !14
  %20 = add nsw i64 %19, 1
  %21 = mul nsw i64 %20, %18
  %22 = trunc i64 %21 to i32
  tail call void @srand(i32 noundef %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %24

23:                                               ; preds = %11
  tail call void @conf_usage(ptr noundef %5)
  tail call void @exit(i32 noundef 1) #8
  unreachable

24:                                               ; preds = %15, %13, %11
  %.1 = phi ptr [ %.02243, %11 ], [ %.02243, %15 ], [ %14, %13 ]
  %25 = tail call i32 @getopt_long(i32 noundef %0, ptr noundef nonnull %1, ptr noundef nonnull @.str, ptr noundef nonnull @long_opts, ptr noundef null) #7
  %.not = icmp eq i32 %25, -1
  br i1 %.not, label %._crit_edge, label %11, !llvm.loop !15

._crit_edge:                                      ; preds = %24, %2
  %.022.lcssa = phi ptr [ null, %2 ], [ %.1, %24 ]
  %26 = load i32, ptr @optind, align 4, !tbaa !9
  %27 = icmp eq i32 %26, %0
  br i1 %27, label %28, label %32

28:                                               ; preds = %._crit_edge
  %29 = tail call ptr @dcgettext(ptr noundef null, ptr noundef nonnull @.str.3, i32 noundef 5) #7
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %29, ptr noundef %30)
  tail call void @conf_usage(ptr noundef %5)
  tail call void @exit(i32 noundef 1) #8
  unreachable

32:                                               ; preds = %._crit_edge
  %33 = sext i32 %26 to i64
  %34 = getelementptr inbounds ptr, ptr %1, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  tail call void @conf_parse(ptr noundef %35) #7
  %36 = load i32, ptr @input_mode, align 4, !tbaa !9
  switch i32 %36, label %65 [
    i32 7, label %37
    i32 8, label %45
    i32 0, label %45
    i32 1, label %45
    i32 9, label %45
    i32 10, label %45
    i32 2, label %47
    i32 3, label %47
    i32 4, label %47
    i32 5, label %47
    i32 6, label %47
  ]

37:                                               ; preds = %32
  %.not32 = icmp eq ptr %.022.lcssa, null
  br i1 %.not32, label %38, label %40

38:                                               ; preds = %37
  %39 = tail call ptr @conf_get_default_confname() #7
  br label %40

40:                                               ; preds = %38, %37
  %.2 = phi ptr [ %.022.lcssa, %37 ], [ %39, %38 ]
  %41 = tail call i32 @conf_read(ptr noundef %.2) #7
  %.not33 = icmp eq i32 %41, 0
  br i1 %.not33, label %65, label %42

42:                                               ; preds = %40
  %43 = tail call ptr @dcgettext(ptr noundef null, ptr noundef nonnull @.str.4, i32 noundef 5) #7
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %43, ptr noundef %.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

45:                                               ; preds = %32, %32, %32, %32, %32
  %46 = tail call i32 @conf_read(ptr noundef null) #7
  br label %65

47:                                               ; preds = %32, %32, %32, %32, %32
  %48 = tail call ptr @getenv(ptr noundef nonnull @.str.5) #7
  %.not28 = icmp eq ptr %48, null
  br i1 %.not28, label %53, label %49

49:                                               ; preds = %47
  %50 = call i32 @stat(ptr noundef nonnull %48, ptr noundef nonnull %3) #7
  %.not29 = icmp eq i32 %50, 0
  br i1 %.not29, label %51, label %._crit_edge44

._crit_edge44:                                    ; preds = %49
  %.pre = load i32, ptr @input_mode, align 4, !tbaa !9
  br label %53

51:                                               ; preds = %49
  %52 = tail call i32 @conf_read_simple(ptr noundef nonnull %48, i32 noundef 0) #7
  br label %65

53:                                               ; preds = %._crit_edge44, %47
  %54 = phi i32 [ %.pre, %._crit_edge44 ], [ %36, %47 ]
  %switch.tableidx = add i32 %54, -2
  %55 = icmp ult i32 %switch.tableidx, 5
  br i1 %55, label %switch.lookup, label %57

switch.lookup:                                    ; preds = %53
  %56 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [5 x ptr], ptr @switch.table.main, i64 0, i64 %56
  %switch.load = load ptr, ptr %switch.gep, align 8
  br label %57

57:                                               ; preds = %switch.lookup, %53
  %.023 = phi ptr [ %48, %53 ], [ %switch.load, %switch.lookup ]
  %58 = call i32 @stat(ptr noundef %.023, ptr noundef nonnull %3) #7
  %.not30 = icmp eq i32 %58, 0
  br i1 %.not30, label %59, label %61

59:                                               ; preds = %57
  %60 = tail call i32 @conf_read_simple(ptr noundef %.023, i32 noundef 0) #7
  br label %65

61:                                               ; preds = %57
  %62 = call i32 @stat(ptr noundef nonnull @.str.11, ptr noundef nonnull %3) #7
  %.not31 = icmp eq i32 %62, 0
  br i1 %.not31, label %63, label %65

63:                                               ; preds = %61
  %64 = tail call i32 @conf_read_simple(ptr noundef nonnull @.str.11, i32 noundef 0) #7
  br label %65

65:                                               ; preds = %32, %59, %63, %61, %40, %51, %45
  %.3 = phi ptr [ %.022.lcssa, %32 ], [ %.022.lcssa, %61 ], [ %.022.lcssa, %63 ], [ %.022.lcssa, %59 ], [ %.022.lcssa, %51 ], [ %.022.lcssa, %45 ], [ %.2, %40 ]
  %66 = tail call i32 @isatty(i32 noundef 0) #7
  %.not34 = icmp eq i32 %66, 0
  br i1 %.not34, label %73, label %67

67:                                               ; preds = %65
  %68 = tail call i32 @isatty(i32 noundef 1) #7
  %.not35 = icmp eq i32 %68, 0
  br i1 %.not35, label %73, label %69

69:                                               ; preds = %67
  %70 = tail call i32 @isatty(i32 noundef 2) #7
  %71 = icmp ne i32 %70, 0
  %72 = zext i1 %71 to i32
  br label %73

73:                                               ; preds = %69, %67, %65
  %74 = phi i32 [ 0, %67 ], [ 0, %65 ], [ %72, %69 ]
  store i32 %74, ptr @valid_stdin, align 4, !tbaa !9
  %75 = load i32, ptr @input_mode, align 4, !tbaa !9
  switch i32 %75, label %.critedge [
    i32 2, label %.critedgethread-pre-split.sink.split
    i32 3, label %76
    i32 4, label %77
    i32 5, label %78
    i32 6, label %79
    i32 7, label %80
    i32 10, label %.preheader
    i32 0, label %81
    i32 1, label %.preheader
    i32 9, label %.preheader
  ]

76:                                               ; preds = %73
  br label %.critedgethread-pre-split.sink.split

77:                                               ; preds = %73
  br label %.critedgethread-pre-split.sink.split

78:                                               ; preds = %73
  br label %.critedgethread-pre-split.sink.split

79:                                               ; preds = %73
  br label %.critedgethread-pre-split.sink.split

80:                                               ; preds = %73
  br label %.critedgethread-pre-split.sink.split

81:                                               ; preds = %73
  store ptr @rootmenu, ptr @rootEntry, align 8, !tbaa !5
  tail call void @conf(ptr noundef nonnull @rootmenu)
  store i32 1, ptr @input_mode, align 4, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %81, %73, %73, %73
  br label %82

82:                                               ; preds = %.preheader, %84
  store i32 0, ptr @conf_cnt, align 4, !tbaa !9
  tail call void @check_conf(ptr noundef nonnull @rootmenu)
  %83 = load i32, ptr @conf_cnt, align 4, !tbaa !9
  %.not36 = icmp eq i32 %83, 0
  br i1 %.not36, label %.critedgethread-pre-split, label %84

84:                                               ; preds = %82
  %85 = load i32, ptr @input_mode, align 4
  %86 = add i32 %85, -11
  %87 = icmp ult i32 %86, -2
  br i1 %87, label %82, label %.critedge, !llvm.loop !17

.critedgethread-pre-split.sink.split:             ; preds = %73, %80, %79, %78, %77, %76
  %.sink = phi i32 [ 1, %76 ], [ 2, %77 ], [ 0, %78 ], [ 4, %79 ], [ 0, %80 ], [ 3, %73 ]
  tail call void @conf_set_all_new_symbols(i32 noundef %.sink) #7
  br label %.critedgethread-pre-split

.critedgethread-pre-split:                        ; preds = %82, %.critedgethread-pre-split.sink.split
  %.pr = load i32, ptr @input_mode, align 4, !tbaa !9
  br label %.critedge

.critedge:                                        ; preds = %84, %.critedgethread-pre-split, %73
  %88 = phi i32 [ %.pr, %.critedgethread-pre-split ], [ %75, %73 ], [ %85, %84 ]
  switch i32 %88, label %95 [
    i32 8, label %89
    i32 9, label %107
  ]

89:                                               ; preds = %.critedge
  %90 = tail call i32 @conf_write_defconfig(ptr noundef %.3) #7
  %.not40 = icmp eq i32 %90, 0
  br i1 %.not40, label %107, label %91

91:                                               ; preds = %89
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = tail call ptr @dcgettext(ptr noundef null, ptr noundef nonnull @.str.12, i32 noundef 5) #7
  %94 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef %93, ptr noundef %.3) #9
  br label %107

95:                                               ; preds = %.critedge
  %96 = tail call i32 @conf_write(ptr noundef null) #7
  %.not38 = icmp eq i32 %96, 0
  br i1 %.not38, label %101, label %97

97:                                               ; preds = %95
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = tail call ptr @dcgettext(ptr noundef null, ptr noundef nonnull @.str.13, i32 noundef 5) #7
  %100 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef %99) #9
  tail call void @exit(i32 noundef 1) #8
  unreachable

101:                                              ; preds = %95
  %102 = tail call i32 @conf_write_autoconf() #7
  %.not39 = icmp eq i32 %102, 0
  br i1 %.not39, label %107, label %103

103:                                              ; preds = %101
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = tail call ptr @dcgettext(ptr noundef null, ptr noundef nonnull @.str.14, i32 noundef 5) #7
  %106 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef %105) #9
  br label %107

107:                                              ; preds = %89, %101, %.critedge, %103, %91
  %.0 = phi i32 [ 1, %91 ], [ 1, %103 ], [ 0, %.critedge ], [ 0, %101 ], [ 0, %89 ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %3) #7
  ret i32 %.0
}

; 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 ptr @bindtextdomain(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @textdomain(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @gettimeofday(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

declare void @conf_parse(ptr noundef) local_unnamed_addr #5

declare ptr @conf_get_default_confname() local_unnamed_addr #5

declare i32 @conf_read(ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @stat(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #3

declare i32 @conf_read_simple(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @isatty(i32 noundef) local_unnamed_addr #2

declare void @conf_set_all_new_symbols(i32 noundef) local_unnamed_addr #5

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

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

declare i32 @conf_write_defconfig(ptr noundef) local_unnamed_addr #5

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

declare i32 @conf_write(ptr noundef) local_unnamed_addr #5

declare i32 @conf_write_autoconf() 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 = { 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 = { 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 #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }
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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"timeval", !13, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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