; LLVM IR from sfu-dis/mosaicdb :: benchmarks/egen/EGenLoader.ll (Z16ParseCommandLineiPPc)

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

@iStartFromCustomer = external dso_local global i64, align 8
@iCustomerCount = external dso_local global i64, align 8
@iTotalCustomerCount = external dso_local global i64, align 8
@iScaleFactor = external dso_local global i32, align 4
@iDaysOfInitialTrades = external dso_local global i32, align 4
@bTableGenerationFlagNotSpecified = external dso_local global i8, align 1
@bGenerateFixedTables = external dso_local global i8, align 1
@bGenerateGrowingTables = external dso_local global i8, align 1
@bGenerateScalingTables = external dso_local global i8, align 1
@bGenerateUsingCache = external dso_local global i8, align 1
@szInDir = external dso_local global [512 x i8], align 16
@LoadType = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5Usagev() #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16ParseCommandLineiPPc(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [20 x [100 x i8]], align 16
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 2000, ptr %8) #9
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %30, %2
  %12 = load i32, ptr %5, align 4, !tbaa !5
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %15, label %33

15:                                               ; preds = %11
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [20 x [100 x i8]], ptr %8, i64 0, i64 %17
  %19 = getelementptr inbounds [100 x i8], ptr %18, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 4 %19, i8 0, i64 100, i1 false)
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [20 x [100 x i8]], ptr %8, i64 0, i64 %21
  %23 = getelementptr inbounds [100 x i8], ptr %22, i64 0, i64 0
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %24, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call ptr @strcpy(ptr noundef %23, ptr noundef %28) #9
  br label %30

30:                                               ; preds = %15
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %5, align 4, !tbaa !5
  br label %11, !llvm.loop !11

33:                                               ; preds = %11
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %174, %33
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %177

38:                                               ; preds = %34
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [20 x [100 x i8]], ptr %8, i64 0, i64 %40
  %42 = getelementptr inbounds [100 x i8], ptr %41, i64 0, i64 0
  store ptr %42, ptr %6, align 8, !tbaa !9
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 45
  br i1 %46, label %47, label %50

47:                                               ; preds = %38
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %48, i32 1
  store ptr %49, ptr %6, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %47, %38
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = sext i8 %52 to i32
  %54 = call i32 @tolower(i32 noundef %53) #10
  %55 = trunc i32 %54 to i8
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  store i8 %55, ptr %56, align 1, !tbaa !13
  %57 = load ptr, ptr %6, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %57, i64 1
  store ptr %58, ptr %7, align 8, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  %60 = load i8, ptr %59, align 1, !tbaa !13
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %83

63:                                               ; preds = %50
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %83

68:                                               ; preds = %63
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [20 x [100 x i8]], ptr %8, i64 0, i64 %71
  %73 = getelementptr inbounds [100 x i8], ptr %72, i64 0, i64 0
  %74 = load i8, ptr %73, align 4, !tbaa !13
  %75 = sext i8 %74 to i32
  %76 = icmp ne i32 %75, 45
  br i1 %76, label %77, label %83

77:                                               ; preds = %68
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [20 x [100 x i8]], ptr %8, i64 0, i64 %80
  %82 = getelementptr inbounds [100 x i8], ptr %81, i64 0, i64 0
  store ptr %82, ptr %7, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %77, %68, %63, %50
  %84 = load ptr, ptr %6, align 8, !tbaa !9
  %85 = load i8, ptr %84, align 1, !tbaa !13
  %86 = sext i8 %85 to i32
  switch i32 %86, label %169 [
    i32 98, label %87
    i32 99, label %94
    i32 116, label %97
    i32 102, label %100
    i32 119, label %103
    i32 105, label %106
    i32 108, label %127
    i32 103, label %133
    i32 120, label %134
  ]

87:                                               ; preds = %83
  %88 = load ptr, ptr %7, align 8, !tbaa !9
  %89 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %88, ptr noundef @.str.22, ptr noundef @iStartFromCustomer) #9
  %90 = load i64, ptr @iStartFromCustomer, align 8, !tbaa !14
  %91 = icmp sle i64 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %87
  store i64 1, ptr @iStartFromCustomer, align 8, !tbaa !14
  br label %93

93:                                               ; preds = %92, %87
  br label %173

94:                                               ; preds = %83
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %95, ptr noundef @.str.22, ptr noundef @iCustomerCount) #9
  br label %173

97:                                               ; preds = %83
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  %99 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %98, ptr noundef @.str.22, ptr noundef @iTotalCustomerCount) #9
  br label %173

100:                                              ; preds = %83
  %101 = load ptr, ptr %7, align 8, !tbaa !9
  %102 = call i32 @atoi(ptr noundef %101) #10
  store i32 %102, ptr @iScaleFactor, align 4, !tbaa !5
  br label %173

103:                                              ; preds = %83
  %104 = load ptr, ptr %7, align 8, !tbaa !9
  %105 = call i32 @atoi(ptr noundef %104) #10
  store i32 %105, ptr @iDaysOfInitialTrades, align 4, !tbaa !5
  br label %173

106:                                              ; preds = %83
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  %108 = call ptr @strncpy(ptr noundef @szInDir, ptr noundef %107, i64 noundef 512) #9
  %109 = call i64 @strlen(ptr noundef @szInDir) #10
  %110 = sub i64 %109, 1
  %111 = getelementptr inbounds [512 x i8], ptr @szInDir, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !13
  %113 = sext i8 %112 to i32
  %114 = icmp ne i32 47, %113
  br i1 %114, label %115, label %126

115:                                              ; preds = %106
  %116 = call i64 @strlen(ptr noundef @szInDir) #10
  %117 = sub i64 %116, 1
  %118 = getelementptr inbounds [512 x i8], ptr @szInDir, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !13
  %120 = sext i8 %119 to i32
  %121 = icmp ne i32 92, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  store i64 512, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  store i64 511, ptr %10, align 8, !tbaa !16
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %124 = load i64, ptr %123, align 8, !tbaa !16
  %125 = call ptr @strncat(ptr noundef @szInDir, ptr noundef @.str.23, i64 noundef %124) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %126

126:                                              ; preds = %122, %115, %106
  br label %173

127:                                              ; preds = %83
  %128 = load ptr, ptr %7, align 8, !tbaa !9
  %129 = call i32 @strcmp(ptr noundef %128, ptr noundef @.str.24) #10
  %130 = icmp eq i32 0, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %127
  store i32 0, ptr @LoadType, align 4, !tbaa !18
  br label %173

132:                                              ; preds = %127
  call void @_Z5Usagev()
  call void @exit(i32 noundef 1) #11
  unreachable

133:                                              ; preds = %83
  store i8 0, ptr @bGenerateUsingCache, align 1, !tbaa !20
  br label %173

134:                                              ; preds = %83
  store i8 0, ptr @bTableGenerationFlagNotSpecified, align 1, !tbaa !20
  %135 = load ptr, ptr %7, align 8, !tbaa !9
  %136 = icmp eq ptr null, %135
  br i1 %136, label %142, label %137

137:                                              ; preds = %134
  %138 = load ptr, ptr %7, align 8, !tbaa !9
  %139 = load i8, ptr %138, align 1, !tbaa !13
  %140 = sext i8 %139 to i32
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %137, %134
  store i8 1, ptr @bGenerateFixedTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %168

143:                                              ; preds = %137
  %144 = load ptr, ptr %7, align 8, !tbaa !9
  %145 = call i32 @strcmp(ptr noundef %144, ptr noundef @.str.25) #10
  %146 = icmp eq i32 0, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %143
  store i8 1, ptr @bGenerateFixedTables, align 1, !tbaa !20
  br label %167

148:                                              ; preds = %143
  %149 = load ptr, ptr %7, align 8, !tbaa !9
  %150 = call i32 @strcmp(ptr noundef %149, ptr noundef @.str.26) #10
  %151 = icmp eq i32 0, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %148
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  br label %166

153:                                              ; preds = %148
  %154 = load ptr, ptr %7, align 8, !tbaa !9
  %155 = call i32 @strcmp(ptr noundef %154, ptr noundef @.str.27) #10
  %156 = icmp eq i32 0, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %153
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %165

158:                                              ; preds = %153
  %159 = load ptr, ptr %7, align 8, !tbaa !9
  %160 = call i32 @strcmp(ptr noundef %159, ptr noundef @.str.28) #10
  %161 = icmp eq i32 0, %160
  br i1 %161, label %162, label %163

162:                                              ; preds = %158
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %164

163:                                              ; preds = %158
  call void @_Z5Usagev()
  call void @exit(i32 noundef 1) #11
  unreachable

164:                                              ; preds = %162
  br label %165

165:                                              ; preds = %164, %157
  br label %166

166:                                              ; preds = %165, %152
  br label %167

167:                                              ; preds = %166, %147
  br label %168

168:                                              ; preds = %167, %142
  br label %173

169:                                              ; preds = %83
  call void @_Z5Usagev()
  %170 = load ptr, ptr @stderr, align 8, !tbaa !9
  %171 = load ptr, ptr %6, align 8, !tbaa !9
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.29, ptr noundef %171) #9
  call void @exit(i32 noundef 1) #11
  unreachable

173:                                              ; preds = %168, %133, %131, %126, %103, %100, %97, %94, %93
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %5, align 4, !tbaa !5
  br label %34, !llvm.loop !22

177:                                              ; preds = %34
  call void @llvm.lifetime.end.p0(i64 2000, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) #5

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #6

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind
declare ptr @strncat(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

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

attributes #0 = { mustprogress 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 = { 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 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind willreturn memory(read) 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 #7 = { inlinehint mustprogress 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 #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 = { nounwind willreturn memory(read) }
attributes #11 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS19eLoadImplementation", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = distinct !{!22, !12}


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

@iStartFromCustomer = external dso_local global i64, align 8
@iCustomerCount = external dso_local global i64, align 8
@iTotalCustomerCount = external dso_local global i64, align 8
@iScaleFactor = external dso_local local_unnamed_addr global i32, align 4
@iDaysOfInitialTrades = external dso_local local_unnamed_addr global i32, align 4
@bTableGenerationFlagNotSpecified = external dso_local local_unnamed_addr global i8, align 1
@bGenerateFixedTables = external dso_local local_unnamed_addr global i8, align 1
@bGenerateGrowingTables = external dso_local local_unnamed_addr global i8, align 1
@bGenerateScalingTables = external dso_local local_unnamed_addr global i8, align 1
@bGenerateUsingCache = external dso_local local_unnamed_addr global i8, align 1
@szInDir = external dso_local global [512 x i8], align 16
@LoadType = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5Usagev() local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z16ParseCommandLineiPPc(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [20 x [100 x i8]], align 16
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %3) #10
  %6 = icmp sgt i32 %0, 1
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

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

.preheader:                                       ; preds = %.lr.ph
  br i1 %6, label %.lr.ph49, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %7 = getelementptr inbounds [20 x [100 x i8]], ptr %3, i64 0, i64 %indvars.iv
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(100) %7, i8 0, i64 100, i1 false)
  %8 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %9) #10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !9

.lr.ph49:                                         ; preds = %.preheader, %84
  %.148 = phi i32 [ %85, %84 ], [ 1, %.preheader ]
  %11 = sext i32 %.148 to i64
  %12 = getelementptr inbounds [20 x [100 x i8]], ptr %3, i64 0, i64 %11
  %13 = load i8, ptr %12, align 4, !tbaa !11
  %14 = icmp eq i8 %13, 45
  %15 = getelementptr inbounds i8, ptr %12, i64 1
  %spec.select = select i1 %14, ptr %15, ptr %12
  %16 = load i8, ptr %spec.select, align 1, !tbaa !11
  %17 = sext i8 %16 to i32
  %18 = call i32 @tolower(i32 noundef %17) #11
  %19 = trunc i32 %18 to i8
  store i8 %19, ptr %spec.select, align 1, !tbaa !11
  %.sroa.gep = getelementptr inbounds i8, ptr %12, i64 2
  %spec.select.sroa.sel = select i1 %14, ptr %.sroa.gep, ptr %15
  %20 = load i8, ptr %spec.select.sroa.sel, align 1, !tbaa !11
  %21 = icmp eq i8 %20, 0
  br i1 %21, label %22, label %30

22:                                               ; preds = %.lr.ph49
  %23 = add nsw i32 %.148, 1
  %24 = icmp slt i32 %23, %0
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = sext i32 %23 to i64
  %27 = getelementptr inbounds [20 x [100 x i8]], ptr %3, i64 0, i64 %26
  %28 = load i8, ptr %27, align 4, !tbaa !11
  %.not = icmp eq i8 %28, 45
  %spec.select42 = select i1 %.not, i32 %.148, i32 %23
  %29 = select i1 %.not, i8 0, i8 %28
  %spec.select43 = select i1 %.not, ptr %spec.select.sroa.sel, ptr %27
  br label %30

30:                                               ; preds = %25, %22, %.lr.ph49
  %31 = phi i8 [ 0, %22 ], [ %20, %.lr.ph49 ], [ %29, %25 ]
  %.2 = phi i32 [ %.148, %22 ], [ %.148, %.lr.ph49 ], [ %spec.select42, %25 ]
  %.0 = phi ptr [ %spec.select.sroa.sel, %22 ], [ %spec.select.sroa.sel, %.lr.ph49 ], [ %spec.select43, %25 ]
  switch i8 %19, label %81 [
    i8 98, label %32
    i8 99, label %37
    i8 116, label %39
    i8 102, label %41
    i8 119, label %43
    i8 105, label %45
    i8 108, label %55
    i8 103, label %60
    i8 120, label %61
  ]

32:                                               ; preds = %30
  %33 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.0, ptr noundef nonnull @.str.22, ptr noundef nonnull @iStartFromCustomer) #10
  %34 = load i64, ptr @iStartFromCustomer, align 8, !tbaa !12
  %35 = icmp slt i64 %34, 1
  br i1 %35, label %36, label %84

36:                                               ; preds = %32
  store i64 1, ptr @iStartFromCustomer, align 8, !tbaa !12
  br label %84

37:                                               ; preds = %30
  %38 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.0, ptr noundef nonnull @.str.22, ptr noundef nonnull @iCustomerCount) #10
  br label %84

39:                                               ; preds = %30
  %40 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.0, ptr noundef nonnull @.str.22, ptr noundef nonnull @iTotalCustomerCount) #10
  br label %84

41:                                               ; preds = %30
  %42 = call i32 @atoi(ptr nocapture noundef %.0) #11
  store i32 %42, ptr @iScaleFactor, align 4, !tbaa !14
  br label %84

43:                                               ; preds = %30
  %44 = call i32 @atoi(ptr nocapture noundef %.0) #11
  store i32 %44, ptr @iDaysOfInitialTrades, align 4, !tbaa !14
  br label %84

45:                                               ; preds = %30
  %46 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) @szInDir, ptr noundef nonnull dereferenceable(1) %.0, i64 noundef 512) #10
  %47 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @szInDir) #11
  %48 = add i64 %47, -1
  %49 = getelementptr inbounds [512 x i8], ptr @szInDir, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  switch i8 %50, label %51 [
    i8 47, label %84
    i8 92, label %84
  ]

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  store i64 512, ptr %4, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  store i64 511, ptr %5, align 8, !tbaa !16
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %53 = load i64, ptr %52, align 8, !tbaa !16
  %54 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) @szInDir, ptr noundef nonnull @.str.23, i64 noundef %53) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  br label %84

55:                                               ; preds = %30
  %56 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.0, ptr noundef nonnull dereferenceable(1) @.str.24) #11
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %55
  store i32 0, ptr @LoadType, align 4, !tbaa !18
  br label %84

59:                                               ; preds = %55
  call void @_Z5Usagev()
  call void @exit(i32 noundef 1) #12
  unreachable

60:                                               ; preds = %30
  store i8 0, ptr @bGenerateUsingCache, align 1, !tbaa !20
  br label %84

61:                                               ; preds = %30
  store i8 0, ptr @bTableGenerationFlagNotSpecified, align 1, !tbaa !20
  %62 = icmp eq i8 %31, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %61
  store i8 1, ptr @bGenerateFixedTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %84

64:                                               ; preds = %61
  %65 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.0, ptr noundef nonnull dereferenceable(1) @.str.25) #11
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %64
  store i8 1, ptr @bGenerateFixedTables, align 1, !tbaa !20
  br label %84

68:                                               ; preds = %64
  %69 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.0, ptr noundef nonnull dereferenceable(1) @.str.26) #11
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  br label %84

72:                                               ; preds = %68
  %73 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.0, ptr noundef nonnull dereferenceable(1) @.str.27) #11
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %72
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %84

76:                                               ; preds = %72
  %77 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.0, ptr noundef nonnull dereferenceable(1) @.str.28) #11
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  store i8 1, ptr @bGenerateGrowingTables, align 1, !tbaa !20
  store i8 1, ptr @bGenerateScalingTables, align 1, !tbaa !20
  br label %84

80:                                               ; preds = %76
  call void @_Z5Usagev()
  call void @exit(i32 noundef 1) #12
  unreachable

81:                                               ; preds = %30
  call void @_Z5Usagev()
  %82 = load ptr, ptr @stderr, align 8, !tbaa !5
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.29, ptr noundef nonnull %spec.select) #13
  call void @exit(i32 noundef 1) #12
  unreachable

84:                                               ; preds = %45, %45, %37, %39, %41, %43, %58, %60, %36, %32, %51, %67, %75, %79, %71, %63
  %85 = add nsw i32 %.2, 1
  %86 = icmp slt i32 %85, %0
  br i1 %86, label %.lr.ph49, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %84, %2, %.preheader
  call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %3) #10
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #8

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

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

attributes #0 = { mustprogress 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint mustprogress 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { noreturn nounwind }
attributes #13 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS19eLoadImplementation", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = distinct !{!22, !10}


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