; LLVM IR from rantala/string-sorting :: src (sortstring)

; 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 { ptr, ptr, i8, i32 }
%struct.option = type { ptr, i32, ptr, i32 }

@opts = external hidden global %struct.anon, align 8
@stderr = external global ptr, align 8
@main.long_options = external hidden constant [13 x %struct.option], align 16
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@optarg = external global ptr, align 8
@optind = external global i32, align 4
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [39 x i8], align 1
@log_file = external hidden global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [12 x i8], align 1

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

; 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 i32 @fprintf(ptr noundef, ptr 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
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 2
  br i1 %17, label %18, label %19

18:                                               ; preds = %2
  call void @usage()
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %200

19:                                               ; preds = %2
  br label %20

20:                                               ; preds = %78, %19
  br label %21

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = call i32 @getopt_long(i32 noundef %22, ptr noundef %23, ptr noundef @.str.14, ptr noundef @main.long_options, ptr noundef null) #6
  store i32 %24, ptr %8, align 4, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = icmp eq i32 %25, -1
  br i1 %26, label %27, label %28

27:                                               ; preds = %21
  store i32 3, ptr %7, align 4
  br label %76

28:                                               ; preds = %21
  %29 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %29, label %74 [
    i32 104, label %30
    i32 1000, label %30
    i32 65, label %31
    i32 76, label %32
    i32 1003, label %33
    i32 1004, label %37
    i32 1005, label %41
    i32 1007, label %50
    i32 1008, label %54
    i32 1009, label %58
    i32 1010, label %62
    i32 1011, label %66
    i32 1012, label %70
    i32 63, label %73
  ]

30:                                               ; preds = %28, %28
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %76

31:                                               ; preds = %28
  call void @print_alg_names_and_descs()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %76

32:                                               ; preds = %28
  call void @print_alg_names()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %76

33:                                               ; preds = %28
  %34 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %35 = and i8 %34, -3
  %36 = or i8 %35, 2
  store i8 %36, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

37:                                               ; preds = %28
  %38 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %39 = and i8 %38, -2
  %40 = or i8 %39, 1
  store i8 %40, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

41:                                               ; preds = %28
  %42 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %43 = and i8 %42, -9
  %44 = or i8 %43, 8
  store i8 %44, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %45 = load ptr, ptr @optarg, align 8, !tbaa !9
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %41
  %48 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %48, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 1), align 8, !tbaa !11
  br label %49

49:                                               ; preds = %47, %41
  br label %75

50:                                               ; preds = %28
  %51 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %52 = and i8 %51, -5
  %53 = or i8 %52, 4
  store i8 %53, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

54:                                               ; preds = %28
  %55 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %56 = and i8 %55, -17
  %57 = or i8 %56, 16
  store i8 %57, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

58:                                               ; preds = %28
  %59 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %60 = and i8 %59, -33
  %61 = or i8 %60, 32
  store i8 %61, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

62:                                               ; preds = %28
  %63 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %64 = and i8 %63, -65
  %65 = or i8 %64, 64
  store i8 %65, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

66:                                               ; preds = %28
  %67 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %68 = and i8 %67, 127
  %69 = or i8 %68, -128
  store i8 %69, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  br label %75

70:                                               ; preds = %28
  %71 = load ptr, ptr @optarg, align 8, !tbaa !9
  %72 = call i32 @atoi(ptr noundef %71) #7
  store i32 %72, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 3), align 4, !tbaa !13
  br label %75

73:                                               ; preds = %28
  br label %74

74:                                               ; preds = %73, %28
  br label %75

75:                                               ; preds = %74, %70, %66, %62, %58, %54, %50, %49, %37, %33
  store i32 0, ptr %7, align 4
  br label %76

76:                                               ; preds = %75, %32, %31, %30, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %77 = load i32, ptr %7, align 4
  switch i32 %77, label %200 [
    i32 0, label %78
    i32 3, label %79
  ]

78:                                               ; preds = %76
  br label %20

79:                                               ; preds = %76
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sub nsw i32 %80, 2
  %82 = load i32, ptr @optind, align 4, !tbaa !5
  %83 = icmp ne i32 %81, %82
  br i1 %83, label %84, label %87

84:                                               ; preds = %79
  %85 = load ptr, ptr @stderr, align 8, !tbaa !9
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.15) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %200

87:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = load i32, ptr @optind, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  store ptr %92, ptr %9, align 8, !tbaa !9
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %99

95:                                               ; preds = %87
  %96 = load ptr, ptr %9, align 8, !tbaa !9
  %97 = call i64 @strlen(ptr noundef %96) #7
  %98 = icmp eq i64 %97, 0
  br i1 %98, label %99, label %102

99:                                               ; preds = %95, %87
  %100 = load ptr, ptr @stderr, align 8, !tbaa !9
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.16) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %199

102:                                              ; preds = %95
  %103 = load ptr, ptr %9, align 8, !tbaa !9
  %104 = call ptr @routine_from_name(ptr noundef %103)
  store ptr %104, ptr @opts, align 8, !tbaa !14
  %105 = load ptr, ptr @opts, align 8, !tbaa !14
  %106 = icmp ne ptr %105, null
  br i1 %106, label %111, label %107

107:                                              ; preds = %102
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.17, ptr noundef %109) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %199

111:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %112 = load ptr, ptr %5, align 8, !tbaa !9
  %113 = load i32, ptr @optind, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %112, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  store ptr %117, ptr %10, align 8, !tbaa !9
  %118 = load ptr, ptr %10, align 8, !tbaa !9
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %124

120:                                              ; preds = %111
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  %122 = call i64 @strlen(ptr noundef %121) #7
  %123 = icmp eq i64 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %120, %111
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.18) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %198

127:                                              ; preds = %120
  call void @open_log_file()
  %128 = load ptr, ptr @log_file, align 8, !tbaa !9
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %133

130:                                              ; preds = %127
  %131 = load ptr, ptr @log_file, align 8, !tbaa !9
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.19) #6
  br label %133

133:                                              ; preds = %130, %127
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = load ptr, ptr @log_file, align 8, !tbaa !9
  call void @print_cmdline(i32 noundef %134, ptr noundef %135, ptr noundef %136)
  %137 = load ptr, ptr @opts, align 8, !tbaa !14
  call void @routine_information(ptr noundef %137)
  call void @cpu_information()
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %138 = call i32 @getpid() #6
  %139 = sext i32 %138 to i64
  %140 = call i64 @time(ptr noundef null) #6
  %141 = mul nsw i64 %139, %140
  store i64 %141, ptr %11, align 8, !tbaa !15
  %142 = load i64, ptr %11, align 8, !tbaa !15
  call void @srand48(i64 noundef %142) #6
  %143 = load ptr, ptr @log_file, align 8, !tbaa !9
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %149

145:                                              ; preds = %133
  %146 = load ptr, ptr @log_file, align 8, !tbaa !9
  %147 = load i64, ptr %11, align 8, !tbaa !15
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.20, i64 noundef %147) #6
  br label %149

149:                                              ; preds = %145, %133
  %150 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %151 = lshr i8 %150, 7
  %152 = zext i8 %151 to i32
  %153 = icmp ne i32 %152, 0
  %154 = zext i1 %153 to i64
  %155 = select i1 %153, ptr @.str.22, ptr @.str.23
  %156 = load ptr, ptr %10, align 8, !tbaa !9
  %157 = call ptr @bazename(ptr noundef %156)
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %155, ptr noundef %157)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %159 = load ptr, ptr %10, align 8, !tbaa !9
  call void @readbytes(ptr noundef %159, ptr noundef %12, ptr noundef %14)
  %160 = load i8, ptr getelementptr inbounds (%struct.anon, ptr @opts, i32 0, i32 2), align 8
  %161 = and i8 %160, 1
  %162 = zext i8 %161 to i32
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %173

164:                                              ; preds = %149
  %165 = load ptr, ptr @log_file, align 8, !tbaa !9
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %170

167:                                              ; preds = %164
  %168 = load ptr, ptr @log_file, align 8, !tbaa !9
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef @.str.24) #6
  br label %170

170:                                              ; preds = %167, %164
  %171 = load ptr, ptr %12, align 8, !tbaa !9
  %172 = load i64, ptr %14, align 8, !tbaa !15
  call void @create_suffixes(ptr noundef %171, i64 noundef %172, ptr noundef %13, ptr noundef %15)
  br label %176

173:                                              ; preds = %149
  %174 = load ptr, ptr %12, align 8, !tbaa !9
  %175 = load i64, ptr %14, align 8, !tbaa !15
  call void @create_strings(ptr noundef %174, i64 noundef %175, ptr noundef %13, ptr noundef %15)
  br label %176

176:                                              ; preds = %173, %170
  %177 = load ptr, ptr %12, align 8, !tbaa !9
  %178 = load i64, ptr %14, align 8, !tbaa !15
  %179 = load ptr, ptr %13, align 8, !tbaa !9
  %180 = load i64, ptr %15, align 8, !tbaa !15
  call void @input_information(ptr noundef %177, i64 noundef %178, ptr noundef %179, i64 noundef %180)
  %181 = load ptr, ptr @opts, align 8, !tbaa !14
  %182 = load ptr, ptr %13, align 8, !tbaa !9
  %183 = load i64, ptr %15, align 8, !tbaa !15
  %184 = call i32 @run(ptr noundef %181, ptr noundef %182, i64 noundef %183)
  store i32 %184, ptr %6, align 4, !tbaa !5
  %185 = load ptr, ptr %12, align 8, !tbaa !9
  %186 = load i64, ptr %14, align 8, !tbaa !15
  call void @free_text(ptr noundef %185, i64 noundef %186)
  %187 = load ptr, ptr %13, align 8, !tbaa !9
  %188 = load i64, ptr %15, align 8, !tbaa !15
  call void @free_pointers(ptr noundef %187, i64 noundef %188)
  %189 = load ptr, ptr @log_file, align 8, !tbaa !9
  %190 = icmp ne ptr %189, null
  br i1 %190, label %191, label %196

191:                                              ; preds = %176
  %192 = load ptr, ptr @log_file, align 8, !tbaa !9
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.25) #6
  %194 = load ptr, ptr @log_file, align 8, !tbaa !9
  %195 = call i32 @fclose(ptr noundef %194)
  br label %196

196:                                              ; preds = %191, %176
  %197 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %197, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %198

198:                                              ; preds = %196, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %199

199:                                              ; preds = %198, %107, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %200

200:                                              ; preds = %199, %84, %76, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %201 = load i32, ptr %3, align 4
  ret i32 %201
}

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

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

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

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

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

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

declare ptr @routine_from_name(ptr noundef) #5

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @srand48(i64 noundef) #2

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

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

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

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

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

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

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

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

declare i32 @fclose(ptr noundef) #5

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

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

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


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

%struct.anon = type { ptr, ptr, i8, i32 }
%struct.option = type { ptr, i32, ptr, i32 }

@opts = external hidden local_unnamed_addr global %struct.anon, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@main.long_options = external hidden constant [13 x %struct.option], align 16
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@optind = external local_unnamed_addr global i32, align 4
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [39 x i8], align 1
@log_file = external hidden local_unnamed_addr global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @run(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) 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
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = icmp slt i32 %0, 2
  br i1 %7, label %8, label %.preheader

8:                                                ; preds = %2
  tail call void @usage()
  br label %.thread

.preheader:                                       ; preds = %2, %.preheader.backedge
  %9 = tail call i32 @getopt_long(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.14, ptr noundef nonnull @main.long_options, ptr noundef null) #6
  switch i32 %9, label %.preheader.backedge [
    i32 -1, label %42
    i32 104, label %10
    i32 1000, label %10
    i32 65, label %11
    i32 76, label %12
    i32 1003, label %13
    i32 1004, label %16
    i32 1005, label %19
    i32 1007, label %24
    i32 1008, label %27
    i32 1009, label %30
    i32 1010, label %33
    i32 1011, label %36
    i32 1012, label %39
  ]

10:                                               ; preds = %.preheader, %.preheader
  tail call void @usage()
  br label %.thread

11:                                               ; preds = %.preheader
  tail call void @print_alg_names_and_descs()
  br label %.thread

12:                                               ; preds = %.preheader
  tail call void @print_alg_names()
  br label %.thread

13:                                               ; preds = %.preheader
  %14 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %15 = or i8 %14, 2
  store i8 %15, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

.preheader.backedge:                              ; preds = %13, %16, %24, %27, %30, %33, %36, %39, %23, %19, %.preheader
  br label %.preheader

16:                                               ; preds = %.preheader
  %17 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %18 = or i8 %17, 1
  store i8 %18, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

19:                                               ; preds = %.preheader
  %20 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %21 = or i8 %20, 8
  store i8 %21, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %22 = load ptr, ptr @optarg, align 8, !tbaa !5
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.preheader.backedge, label %23

23:                                               ; preds = %19
  store ptr %22, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !9
  br label %.preheader.backedge

24:                                               ; preds = %.preheader
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %26 = or i8 %25, 4
  store i8 %26, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

27:                                               ; preds = %.preheader
  %28 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %29 = or i8 %28, 16
  store i8 %29, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

30:                                               ; preds = %.preheader
  %31 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %32 = or i8 %31, 32
  store i8 %32, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

33:                                               ; preds = %.preheader
  %34 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %35 = or i8 %34, 64
  store i8 %35, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

36:                                               ; preds = %.preheader
  %37 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %38 = or i8 %37, -128
  store i8 %38, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  br label %.preheader.backedge

39:                                               ; preds = %.preheader
  %40 = load ptr, ptr @optarg, align 8, !tbaa !5
  %41 = tail call i32 @atoi(ptr nocapture noundef %40) #7
  store i32 %41, ptr getelementptr inbounds (i8, ptr @opts, i64 20), align 4, !tbaa !12
  br label %.preheader.backedge

42:                                               ; preds = %.preheader
  %43 = add nsw i32 %0, -2
  %44 = load i32, ptr @optind, align 4, !tbaa !13
  %.not32 = icmp eq i32 %43, %44
  br i1 %.not32, label %48, label %45

45:                                               ; preds = %42
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.15) #8
  br label %.thread

48:                                               ; preds = %42
  %49 = sext i32 %43 to i64
  %50 = getelementptr inbounds ptr, ptr %1, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %.not33 = icmp eq ptr %51, null
  br i1 %.not33, label %54, label %52

52:                                               ; preds = %48
  %char0 = load i8, ptr %51, align 1
  %53 = icmp eq i8 %char0, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %52, %48
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.16) #8
  br label %.thread

57:                                               ; preds = %52
  %58 = tail call ptr @routine_from_name(ptr noundef nonnull %51) #6
  store ptr %58, ptr @opts, align 8, !tbaa !14
  %.not34 = icmp eq ptr %58, null
  br i1 %.not34, label %59, label %62

59:                                               ; preds = %57
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.17, ptr noundef nonnull %51) #8
  br label %.thread

62:                                               ; preds = %57
  %63 = load i32, ptr @optind, align 4, !tbaa !13
  %64 = sext i32 %63 to i64
  %65 = getelementptr ptr, ptr %1, i64 %64
  %66 = getelementptr i8, ptr %65, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %.not35 = icmp eq ptr %67, null
  br i1 %.not35, label %70, label %68

68:                                               ; preds = %62
  %char036 = load i8, ptr %67, align 1
  %69 = icmp eq i8 %char036, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %68, %62
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.18) #8
  br label %.thread

73:                                               ; preds = %68
  tail call void @open_log_file()
  %74 = load ptr, ptr @log_file, align 8, !tbaa !5
  %.not37 = icmp eq ptr %74, null
  br i1 %.not37, label %77, label %75

75:                                               ; preds = %73
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %74, ptr noundef nonnull @.str.19) #6
  %.pre = load ptr, ptr @log_file, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %75, %73
  %78 = phi ptr [ %.pre, %75 ], [ null, %73 ]
  tail call void @print_cmdline(i32 noundef %0, ptr noundef nonnull %1, ptr noundef %78)
  %79 = load ptr, ptr @opts, align 8, !tbaa !14
  tail call void @routine_information(ptr noundef %79)
  tail call void @cpu_information()
  %80 = tail call i32 @getpid() #6
  %81 = sext i32 %80 to i64
  %82 = tail call i64 @time(ptr noundef null) #6
  %83 = mul nsw i64 %82, %81
  tail call void @srand48(i64 noundef %83) #6
  %84 = load ptr, ptr @log_file, align 8, !tbaa !5
  %.not38 = icmp eq ptr %84, null
  br i1 %.not38, label %87, label %85

85:                                               ; preds = %77
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %84, ptr noundef nonnull @.str.20, i64 noundef %83) #6
  br label %87

87:                                               ; preds = %85, %77
  %88 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %.not39 = icmp sgt i8 %88, -1
  %89 = select i1 %.not39, ptr @.str.23, ptr @.str.22
  %90 = tail call ptr @bazename(ptr noundef nonnull %67)
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef nonnull %89, ptr noundef %90)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @readbytes(ptr noundef nonnull %67, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %92 = load i8, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8
  %93 = and i8 %92, 1
  %.not40 = icmp eq i8 %93, 0
  br i1 %.not40, label %101, label %94

94:                                               ; preds = %87
  %95 = load ptr, ptr @log_file, align 8, !tbaa !5
  %.not41 = icmp eq ptr %95, null
  br i1 %.not41, label %98, label %96

96:                                               ; preds = %94
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %95, ptr noundef nonnull @.str.24) #6
  br label %98

98:                                               ; preds = %96, %94
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = load i64, ptr %5, align 8, !tbaa !15
  call void @create_suffixes(ptr noundef %99, i64 noundef %100, ptr noundef nonnull %4, ptr noundef nonnull %6)
  br label %104

101:                                              ; preds = %87
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = load i64, ptr %5, align 8, !tbaa !15
  call void @create_strings(ptr noundef %102, i64 noundef %103, ptr noundef nonnull %4, ptr noundef nonnull %6)
  br label %104

104:                                              ; preds = %101, %98
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load i64, ptr %5, align 8, !tbaa !15
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load i64, ptr %6, align 8, !tbaa !15
  call void @input_information(ptr noundef %105, i64 noundef %106, ptr noundef %107, i64 noundef %108)
  %109 = load ptr, ptr @opts, align 8, !tbaa !14
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load i64, ptr %6, align 8, !tbaa !15
  %112 = call i32 @run(ptr noundef %109, ptr noundef %110, i64 noundef %111)
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = load i64, ptr %5, align 8, !tbaa !15
  call void @free_text(ptr noundef %113, i64 noundef %114)
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i64, ptr %6, align 8, !tbaa !15
  call void @free_pointers(ptr noundef %115, i64 noundef %116)
  %117 = load ptr, ptr @log_file, align 8, !tbaa !5
  %.not42 = icmp eq ptr %117, null
  br i1 %.not42, label %122, label %118

118:                                              ; preds = %104
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %117, ptr noundef nonnull @.str.25) #6
  %120 = load ptr, ptr @log_file, align 8, !tbaa !5
  %121 = call i32 @fclose(ptr noundef %120)
  br label %122

122:                                              ; preds = %118, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %.thread

.thread:                                          ; preds = %10, %11, %12, %54, %59, %122, %70, %45, %8
  %.4 = phi i32 [ 1, %8 ], [ 1, %45 ], [ 1, %54 ], [ 1, %59 ], [ 1, %70 ], [ %112, %122 ], [ 0, %12 ], [ 0, %11 ], [ 0, %10 ]
  ret i32 %.4
}

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

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

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

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

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

declare ptr @routine_from_name(ptr noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: nounwind
declare i32 @getpid() local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @srand48(i64 noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

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 = { 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 #3 = { 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 = { 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 #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 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !6, i64 8}
!10 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 16, !11, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 20}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass