; LLVM IR from GGiecold-zz/Cluster_Ensembles :: src/Cluster_Ensembles/Hypergraph_Partitioning/metis-5.1.0/programs (cmdline)

; 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.gk_option = type { ptr, i32, ptr, i32 }
%struct.gk_StringMap_t = type { ptr, i32 }
%struct.params_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, float, float, float, i64 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@long_options = external hidden global [15 x %struct.gk_option], align 16
@gk_optarg = external global ptr, align 8
@ctype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@iptype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@rtype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@helpstr = external hidden global [77 x [100 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [75 x i8], align 1
@gk_optind = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@shorthelpstr = external hidden global [4 x [100 x i8]], align 16

; Function Attrs: nounwind uwtable
define dso_local ptr @parse_cmdline(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, 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) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %11 = call ptr @gk_malloc(i64 noundef 176, ptr noundef @.str)
  store ptr %11, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %10, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %12, i8 0, i64 176, i1 false)
  %13 = load ptr, ptr %10, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct.params_t, ptr %13, i32 0, i32 2
  store i32 1, ptr %14, align 8, !tbaa !11
  %15 = load ptr, ptr %10, align 8, !tbaa !9
  %16 = getelementptr inbounds %struct.params_t, ptr %15, i32 0, i32 3
  store i32 3, ptr %16, align 4, !tbaa !15
  %17 = load ptr, ptr %10, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.params_t, ptr %17, i32 0, i32 4
  store i32 3, ptr %18, align 8, !tbaa !16
  %19 = load ptr, ptr %10, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.params_t, ptr %19, i32 0, i32 18
  store i32 200, ptr %20, align 8, !tbaa !17
  %21 = load ptr, ptr %10, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.params_t, ptr %21, i32 0, i32 19
  store i32 0, ptr %22, align 4, !tbaa !18
  %23 = load ptr, ptr %10, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.params_t, ptr %23, i32 0, i32 20
  store i32 1, ptr %24, align 8, !tbaa !19
  %25 = load ptr, ptr %10, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.params_t, ptr %25, i32 0, i32 21
  store i32 0, ptr %26, align 4, !tbaa !20
  %27 = load ptr, ptr %10, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.params_t, ptr %27, i32 0, i32 5
  store i32 0, ptr %28, align 4, !tbaa !21
  %29 = load ptr, ptr %10, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.params_t, ptr %29, i32 0, i32 8
  store i32 0, ptr %30, align 8, !tbaa !22
  %31 = load ptr, ptr %10, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.params_t, ptr %31, i32 0, i32 27
  store i32 1, ptr %32, align 8, !tbaa !23
  %33 = load ptr, ptr %10, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.params_t, ptr %33, i32 0, i32 17
  store i32 1, ptr %34, align 4, !tbaa !24
  %35 = load ptr, ptr %10, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.params_t, ptr %35, i32 0, i32 11
  store i32 10, ptr %36, align 4, !tbaa !25
  %37 = load ptr, ptr %10, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.params_t, ptr %37, i32 0, i32 14
  store i32 -1, ptr %38, align 8, !tbaa !26
  %39 = load ptr, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.params_t, ptr %39, i32 0, i32 15
  store i32 0, ptr %40, align 4, !tbaa !27
  %41 = load ptr, ptr %10, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.params_t, ptr %41, i32 0, i32 22
  store ptr null, ptr %42, align 8, !tbaa !28
  %43 = load ptr, ptr %10, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.params_t, ptr %43, i32 0, i32 16
  store i32 1, ptr %44, align 8, !tbaa !29
  %45 = load ptr, ptr %10, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.params_t, ptr %45, i32 0, i32 31
  store float 0.000000e+00, ptr %46, align 8, !tbaa !30
  %47 = load ptr, ptr %10, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.params_t, ptr %47, i32 0, i32 32
  store float 0.000000e+00, ptr %48, align 4, !tbaa !31
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.params_t, ptr %49, i32 0, i32 33
  store float 0.000000e+00, ptr %50, align 8, !tbaa !32
  br label %51

51:                                               ; preds = %201, %2
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = load ptr, ptr %4, align 8, !tbaa !9
  %54 = call i32 @gk_getopt_long_only(i32 noundef %52, ptr noundef %53, ptr noundef @.str.1, ptr noundef @long_options, ptr noundef %9)
  store i32 %54, ptr %8, align 4, !tbaa !5
  %55 = icmp ne i32 %54, -1
  br i1 %55, label %56, label %202

56:                                               ; preds = %51
  %57 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %57, label %197 [
    i32 2, label %58
    i32 3, label %76
    i32 4, label %94
    i32 16, label %112
    i32 14, label %121
    i32 12, label %130
    i32 13, label %133
    i32 9, label %136
    i32 21, label %139
    i32 15, label %142
    i32 6, label %151
    i32 8, label %160
    i32 5, label %169
    i32 18, label %178
    i32 63, label %196
  ]

58:                                               ; preds = %56
  %59 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %75

61:                                               ; preds = %58
  %62 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %63 = call i32 @gk_GetStringID(ptr noundef @ctype_options, ptr noundef %62)
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.params_t, ptr %64, i32 0, i32 2
  store i32 %63, ptr %65, align 8, !tbaa !11
  %66 = icmp eq i32 %63, -1
  br i1 %66, label %67, label %74

67:                                               ; preds = %61
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.gk_option, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 16, !tbaa !33
  %73 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  call void (ptr, ...) @errexit(ptr noundef @.str.2, ptr noundef %72, ptr noundef %73)
  br label %74

74:                                               ; preds = %67, %61
  br label %75

75:                                               ; preds = %74, %58
  br label %201

76:                                               ; preds = %56
  %77 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %93

79:                                               ; preds = %76
  %80 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %81 = call i32 @gk_GetStringID(ptr noundef @iptype_options, ptr noundef %80)
  %82 = load ptr, ptr %10, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.params_t, ptr %82, i32 0, i32 3
  store i32 %81, ptr %83, align 4, !tbaa !15
  %84 = icmp eq i32 %81, -1
  br i1 %84, label %85, label %92

85:                                               ; preds = %79
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.gk_option, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 16, !tbaa !33
  %91 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  call void (ptr, ...) @errexit(ptr noundef @.str.2, ptr noundef %90, ptr noundef %91)
  br label %92

92:                                               ; preds = %85, %79
  br label %93

93:                                               ; preds = %92, %76
  br label %201

94:                                               ; preds = %56
  %95 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %111

97:                                               ; preds = %94
  %98 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %99 = call i32 @gk_GetStringID(ptr noundef @rtype_options, ptr noundef %98)
  %100 = load ptr, ptr %10, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.params_t, ptr %100, i32 0, i32 4
  store i32 %99, ptr %101, align 8, !tbaa !16
  %102 = icmp eq i32 %99, -1
  br i1 %102, label %103, label %110

103:                                              ; preds = %97
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.gk_option, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 16, !tbaa !33
  %109 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  call void (ptr, ...) @errexit(ptr noundef @.str.2, ptr noundef %108, ptr noundef %109)
  br label %110

110:                                              ; preds = %103, %97
  br label %111

111:                                              ; preds = %110, %94
  br label %201

112:                                              ; preds = %56
  %113 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %120

115:                                              ; preds = %112
  %116 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %117 = call i32 @atoi(ptr noundef %116) #8
  %118 = load ptr, ptr %10, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.params_t, ptr %118, i32 0, i32 18
  store i32 %117, ptr %119, align 8, !tbaa !17
  br label %120

120:                                              ; preds = %115, %112
  br label %201

121:                                              ; preds = %56
  %122 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %129

124:                                              ; preds = %121
  %125 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %126 = call i32 @atoi(ptr noundef %125) #8
  %127 = load ptr, ptr %10, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.params_t, ptr %127, i32 0, i32 19
  store i32 %126, ptr %128, align 4, !tbaa !18
  br label %129

129:                                              ; preds = %124, %121
  br label %201

130:                                              ; preds = %56
  %131 = load ptr, ptr %10, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.params_t, ptr %131, i32 0, i32 20
  store i32 0, ptr %132, align 8, !tbaa !19
  br label %201

133:                                              ; preds = %56
  %134 = load ptr, ptr %10, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.params_t, ptr %134, i32 0, i32 21
  store i32 1, ptr %135, align 4, !tbaa !20
  br label %201

136:                                              ; preds = %56
  %137 = load ptr, ptr %10, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.params_t, ptr %137, i32 0, i32 5
  store i32 1, ptr %138, align 4, !tbaa !21
  br label %201

139:                                              ; preds = %56
  %140 = load ptr, ptr %10, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct.params_t, ptr %140, i32 0, i32 8
  store i32 1, ptr %141, align 8, !tbaa !22
  br label %201

142:                                              ; preds = %56
  %143 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %150

145:                                              ; preds = %142
  %146 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %147 = call i32 @atoi(ptr noundef %146) #8
  %148 = load ptr, ptr %10, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.params_t, ptr %148, i32 0, i32 17
  store i32 %147, ptr %149, align 4, !tbaa !24
  br label %150

150:                                              ; preds = %145, %142
  br label %201

151:                                              ; preds = %56
  %152 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %159

154:                                              ; preds = %151
  %155 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %156 = call i32 @atoi(ptr noundef %155) #8
  %157 = load ptr, ptr %10, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct.params_t, ptr %157, i32 0, i32 11
  store i32 %156, ptr %158, align 4, !tbaa !25
  br label %159

159:                                              ; preds = %154, %151
  br label %201

160:                                              ; preds = %56
  %161 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %168

163:                                              ; preds = %160
  %164 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %165 = call i32 @atoi(ptr noundef %164) #8
  %166 = load ptr, ptr %10, align 8, !tbaa !9
  %167 = getelementptr inbounds %struct.params_t, ptr %166, i32 0, i32 14
  store i32 %165, ptr %167, align 8, !tbaa !26
  br label %168

168:                                              ; preds = %163, %160
  br label %201

169:                                              ; preds = %56
  %170 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %177

172:                                              ; preds = %169
  %173 = load ptr, ptr @gk_optarg, align 8, !tbaa !9
  %174 = call i32 @atoi(ptr noundef %173) #8
  %175 = load ptr, ptr %10, align 8, !tbaa !9
  %176 = getelementptr inbounds %struct.params_t, ptr %175, i32 0, i32 15
  store i32 %174, ptr %176, align 4, !tbaa !27
  br label %177

177:                                              ; preds = %172, %169
  br label %201

178:                                              ; preds = %56
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %192, %178
  %180 = load i32, ptr %5, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [77 x [100 x i8]], ptr @helpstr, i64 0, i64 %181
  %183 = getelementptr inbounds [100 x i8], ptr %182, i64 0, i64 0
  %184 = call i64 @strlen(ptr noundef %183) #8
  %185 = icmp ugt i64 %184, 0
  br i1 %185, label %186, label %195

186:                                              ; preds = %179
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [77 x [100 x i8]], ptr @helpstr, i64 0, i64 %188
  %190 = getelementptr inbounds [100 x i8], ptr %189, i64 0, i64 0
  %191 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %190)
  br label %192

192:                                              ; preds = %186
  %193 = load i32, ptr %5, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %5, align 4, !tbaa !5
  br label %179, !llvm.loop !35

195:                                              ; preds = %179
  call void @exit(i32 noundef 0) #9
  unreachable

196:                                              ; preds = %56
  br label %197

197:                                              ; preds = %196, %56
  %198 = load ptr, ptr %4, align 8, !tbaa !9
  %199 = getelementptr inbounds ptr, ptr %198, i64 0
  %200 = load ptr, ptr %199, align 8, !tbaa !9
  call void (ptr, ...) @errexit(ptr noundef @.str.4, ptr noundef %200)
  br label %201

201:                                              ; preds = %197, %177, %168, %159, %150, %139, %136, %133, %130, %129, %120, %111, %93, %75
  br label %51, !llvm.loop !37

202:                                              ; preds = %51
  %203 = load i32, ptr %3, align 4, !tbaa !5
  %204 = load i32, ptr @gk_optind, align 4, !tbaa !5
  %205 = sub nsw i32 %203, %204
  %206 = icmp ne i32 %205, 1
  br i1 %206, label %207, label %226

207:                                              ; preds = %202
  %208 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %222, %207
  %210 = load i32, ptr %5, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [4 x [100 x i8]], ptr @shorthelpstr, i64 0, i64 %211
  %213 = getelementptr inbounds [100 x i8], ptr %212, i64 0, i64 0
  %214 = call i64 @strlen(ptr noundef %213) #8
  %215 = icmp ugt i64 %214, 0
  br i1 %215, label %216, label %225

216:                                              ; preds = %209
  %217 = load i32, ptr %5, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [4 x [100 x i8]], ptr @shorthelpstr, i64 0, i64 %218
  %220 = getelementptr inbounds [100 x i8], ptr %219, i64 0, i64 0
  %221 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %220)
  br label %222

222:                                              ; preds = %216
  %223 = load i32, ptr %5, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %5, align 4, !tbaa !5
  br label %209, !llvm.loop !38

225:                                              ; preds = %209
  call void @exit(i32 noundef 0) #9
  unreachable

226:                                              ; preds = %202
  %227 = load ptr, ptr %4, align 8, !tbaa !9
  %228 = load i32, ptr @gk_optind, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr @gk_optind, align 4, !tbaa !5
  %230 = sext i32 %228 to i64
  %231 = getelementptr inbounds ptr, ptr %227, i64 %230
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = call ptr @gk_strdup(ptr noundef %232)
  %234 = load ptr, ptr %10, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.params_t, ptr %234, i32 0, i32 22
  store ptr %233, ptr %235, align 8, !tbaa !28
  %236 = load ptr, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret ptr %236
}

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

declare ptr @gk_malloc(i64 noundef, ptr noundef) #2

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

declare i32 @gk_getopt_long_only(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @gk_GetStringID(ptr noundef, ptr noundef) #2

declare void @errexit(ptr noundef, ...) #2

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

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

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

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

declare ptr @gk_strdup(ptr noundef) #2

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

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 = { "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 nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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, !6, i64 8}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !6, i64 132, !10, i64 136, !10, i64 144, !13, i64 152, !13, i64 156, !13, i64 160, !14, i64 168}
!13 = !{!"float", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !6, i64 16}
!17 = !{!12, !6, i64 72}
!18 = !{!12, !6, i64 76}
!19 = !{!12, !6, i64 80}
!20 = !{!12, !6, i64 84}
!21 = !{!12, !6, i64 20}
!22 = !{!12, !6, i64 32}
!23 = !{!12, !6, i64 128}
!24 = !{!12, !6, i64 68}
!25 = !{!12, !6, i64 44}
!26 = !{!12, !6, i64 56}
!27 = !{!12, !6, i64 60}
!28 = !{!12, !10, i64 88}
!29 = !{!12, !6, i64 64}
!30 = !{!12, !13, i64 152}
!31 = !{!12, !13, i64 156}
!32 = !{!12, !13, i64 160}
!33 = !{!34, !10, i64 0}
!34 = !{!"gk_option", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@long_options = external hidden global [15 x %struct.gk_option], align 16
@gk_optarg = external local_unnamed_addr global ptr, align 8
@ctype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@iptype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@rtype_options = external hidden global [3 x %struct.gk_StringMap_t], align 16
@helpstr = external hidden global [77 x [100 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [75 x i8], align 1
@gk_optind = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@shorthelpstr = external hidden global [4 x [100 x i8]], align 16

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @parse_cmdline(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %4 = tail call ptr @gk_malloc(i64 noundef 176, ptr noundef nonnull @.str) #7
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(176) %4, i8 0, i64 176, i1 false)
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  %6 = getelementptr inbounds i8, ptr %4, i64 12
  %7 = getelementptr inbounds i8, ptr %4, i64 16
  %8 = getelementptr inbounds i8, ptr %4, i64 72
  store i32 200, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %4, i64 76
  %10 = getelementptr inbounds i8, ptr %4, i64 80
  store i32 1, ptr %10, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %4, i64 84
  %12 = getelementptr inbounds i8, ptr %4, i64 20
  store <4 x i32> <i32 1, i32 3, i32 3, i32 0>, ptr %5, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %4, i64 32
  %14 = getelementptr inbounds i8, ptr %4, i64 128
  store i32 1, ptr %14, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %4, i64 68
  store i32 1, ptr %15, align 4, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %4, i64 44
  store i32 10, ptr %16, align 4, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %4, i64 56
  store i32 -1, ptr %17, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %4, i64 60
  %19 = getelementptr inbounds i8, ptr %4, i64 88
  store ptr null, ptr %19, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %4, i64 64
  store i32 1, ptr %20, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %4, i64 156
  store float 0.000000e+00, ptr %21, align 4, !tbaa !21
  br label %22

22:                                               ; preds = %.backedge, %2
  %23 = call i32 @gk_getopt_long_only(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.1, ptr noundef nonnull @long_options, ptr noundef nonnull %3) #7
  switch i32 %23, label %88 [
    i32 -1, label %90
    i32 2, label %24
    i32 3, label %35
    i32 4, label %46
    i32 16, label %57
    i32 14, label %61
    i32 12, label %65
    i32 13, label %66
    i32 9, label %67
    i32 21, label %68
    i32 15, label %69
    i32 6, label %73
    i32 8, label %77
    i32 5, label %81
    i32 18, label %.preheader
  ]

.preheader:                                       ; preds = %22
  %char05869 = load i8, ptr @helpstr, align 16
  %.not5970 = icmp eq i8 %char05869, 0
  br i1 %.not5970, label %._crit_edge, label %.lr.ph

24:                                               ; preds = %22
  %25 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not68 = icmp eq ptr %25, null
  br i1 %.not68, label %.backedge, label %26

26:                                               ; preds = %24
  %27 = call i32 @gk_GetStringID(ptr noundef nonnull @ctype_options, ptr noundef nonnull %25) #7
  store i32 %27, ptr %5, align 8, !tbaa !23
  %28 = icmp eq i32 %27, -1
  br i1 %28, label %29, label %.backedge

29:                                               ; preds = %26
  %30 = load i32, ptr %3, align 4, !tbaa !14
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %31
  %33 = load ptr, ptr %32, align 16, !tbaa !24
  %34 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.2, ptr noundef %33, ptr noundef %34) #7
  br label %.backedge

35:                                               ; preds = %22
  %36 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not67 = icmp eq ptr %36, null
  br i1 %.not67, label %.backedge, label %37

37:                                               ; preds = %35
  %38 = call i32 @gk_GetStringID(ptr noundef nonnull @iptype_options, ptr noundef nonnull %36) #7
  store i32 %38, ptr %6, align 4, !tbaa !26
  %39 = icmp eq i32 %38, -1
  br i1 %39, label %40, label %.backedge

40:                                               ; preds = %37
  %41 = load i32, ptr %3, align 4, !tbaa !14
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 16, !tbaa !24
  %45 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.2, ptr noundef %44, ptr noundef %45) #7
  br label %.backedge

46:                                               ; preds = %22
  %47 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not66 = icmp eq ptr %47, null
  br i1 %.not66, label %.backedge, label %48

48:                                               ; preds = %46
  %49 = call i32 @gk_GetStringID(ptr noundef nonnull @rtype_options, ptr noundef nonnull %47) #7
  store i32 %49, ptr %7, align 8, !tbaa !27
  %50 = icmp eq i32 %49, -1
  br i1 %50, label %51, label %.backedge

51:                                               ; preds = %48
  %52 = load i32, ptr %3, align 4, !tbaa !14
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [15 x %struct.gk_option], ptr @long_options, i64 0, i64 %53
  %55 = load ptr, ptr %54, align 16, !tbaa !24
  %56 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.2, ptr noundef %55, ptr noundef %56) #7
  br label %.backedge

57:                                               ; preds = %22
  %58 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not65 = icmp eq ptr %58, null
  br i1 %.not65, label %.backedge, label %59

59:                                               ; preds = %57
  %60 = call i32 @atoi(ptr nocapture noundef %58) #8
  store i32 %60, ptr %8, align 8, !tbaa !5
  br label %.backedge

61:                                               ; preds = %22
  %62 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not64 = icmp eq ptr %62, null
  br i1 %.not64, label %.backedge, label %63

63:                                               ; preds = %61
  %64 = call i32 @atoi(ptr nocapture noundef %62) #8
  store i32 %64, ptr %9, align 4, !tbaa !28
  br label %.backedge

65:                                               ; preds = %22
  store i32 0, ptr %10, align 8, !tbaa !13
  br label %.backedge

66:                                               ; preds = %22
  store i32 1, ptr %11, align 4, !tbaa !29
  br label %.backedge

67:                                               ; preds = %22
  store i32 1, ptr %12, align 4, !tbaa !30
  br label %.backedge

68:                                               ; preds = %22
  store i32 1, ptr %13, align 8, !tbaa !31
  br label %.backedge

69:                                               ; preds = %22
  %70 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not63 = icmp eq ptr %70, null
  br i1 %.not63, label %.backedge, label %71

71:                                               ; preds = %69
  %72 = call i32 @atoi(ptr nocapture noundef %70) #8
  store i32 %72, ptr %15, align 4, !tbaa !16
  br label %.backedge

73:                                               ; preds = %22
  %74 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not62 = icmp eq ptr %74, null
  br i1 %.not62, label %.backedge, label %75

75:                                               ; preds = %73
  %76 = call i32 @atoi(ptr nocapture noundef %74) #8
  store i32 %76, ptr %16, align 4, !tbaa !17
  br label %.backedge

77:                                               ; preds = %22
  %78 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not61 = icmp eq ptr %78, null
  br i1 %.not61, label %.backedge, label %79

79:                                               ; preds = %77
  %80 = call i32 @atoi(ptr nocapture noundef %78) #8
  store i32 %80, ptr %17, align 8, !tbaa !18
  br label %.backedge

81:                                               ; preds = %22
  %82 = load ptr, ptr @gk_optarg, align 8, !tbaa !22
  %.not60 = icmp eq ptr %82, null
  br i1 %.not60, label %.backedge, label %83

.backedge:                                        ; preds = %81, %83, %77, %79, %73, %75, %69, %71, %61, %63, %57, %59, %46, %51, %48, %35, %40, %37, %24, %29, %26, %88, %68, %67, %66, %65
  br label %22, !llvm.loop !32

83:                                               ; preds = %81
  %84 = call i32 @atoi(ptr nocapture noundef %82) #8
  store i32 %84, ptr %18, align 4, !tbaa !34
  br label %.backedge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %85 = phi ptr [ %87, %.lr.ph ], [ @helpstr, %.preheader ]
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %85)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %87 = getelementptr inbounds [77 x [100 x i8]], ptr @helpstr, i64 0, i64 %indvars.iv.next
  %char058 = load i8, ptr %87, align 4
  %.not59 = icmp eq i8 %char058, 0
  br i1 %.not59, label %._crit_edge, label %.lr.ph, !llvm.loop !35

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  call void @exit(i32 noundef 0) #9
  unreachable

88:                                               ; preds = %22
  %89 = load ptr, ptr %1, align 8, !tbaa !22
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.4, ptr noundef %89) #7
  br label %.backedge

90:                                               ; preds = %22
  %91 = load i32, ptr @gk_optind, align 4, !tbaa !14
  %92 = sub nsw i32 %0, %91
  %.not56 = icmp eq i32 %92, 1
  br i1 %.not56, label %98, label %93

93:                                               ; preds = %90
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %char072 = load i8, ptr @shorthelpstr, align 16
  %.not5773 = icmp eq i8 %char072, 0
  br i1 %.not5773, label %._crit_edge77, label %.lr.ph76

.lr.ph76:                                         ; preds = %93, %.lr.ph76
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph76 ], [ 0, %93 ]
  %95 = phi ptr [ %97, %.lr.ph76 ], [ @shorthelpstr, %93 ]
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %95)
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %97 = getelementptr inbounds [4 x [100 x i8]], ptr @shorthelpstr, i64 0, i64 %indvars.iv.next80
  %char0 = load i8, ptr %97, align 4
  %.not57 = icmp eq i8 %char0, 0
  br i1 %.not57, label %._crit_edge77, label %.lr.ph76, !llvm.loop !36

._crit_edge77:                                    ; preds = %.lr.ph76, %93
  call void @exit(i32 noundef 0) #9
  unreachable

98:                                               ; preds = %90
  %99 = add nsw i32 %91, 1
  store i32 %99, ptr @gk_optind, align 4, !tbaa !14
  %100 = sext i32 %91 to i64
  %101 = getelementptr inbounds ptr, ptr %1, i64 %100
  %102 = load ptr, ptr %101, align 8, !tbaa !22
  %103 = call ptr @gk_strdup(ptr noundef %102) #7
  store ptr %103, ptr %19, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret ptr %4
}

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

declare ptr @gk_malloc(i64 noundef, ptr noundef) local_unnamed_addr #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

declare i32 @gk_getopt_long_only(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @gk_GetStringID(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @errexit(ptr noundef, ...) local_unnamed_addr #2

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

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

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

declare ptr @gk_strdup(ptr 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

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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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, !7, i64 72}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !7, i64 128, !7, i64 132, !10, i64 136, !10, i64 144, !11, i64 152, !11, i64 156, !11, i64 160, !12, i64 168}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !7, i64 80}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 128}
!16 = !{!6, !7, i64 68}
!17 = !{!6, !7, i64 44}
!18 = !{!6, !7, i64 56}
!19 = !{!6, !10, i64 88}
!20 = !{!6, !7, i64 64}
!21 = !{!6, !11, i64 156}
!22 = !{!10, !10, i64 0}
!23 = !{!6, !7, i64 8}
!24 = !{!25, !10, i64 0}
!25 = !{!"gk_option", !10, i64 0, !7, i64 8, !10, i64 16, !7, i64 24}
!26 = !{!6, !7, i64 12}
!27 = !{!6, !7, i64 16}
!28 = !{!6, !7, i64 76}
!29 = !{!6, !7, i64 84}
!30 = !{!6, !7, i64 20}
!31 = !{!6, !7, i64 32}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!6, !7, i64 60}
!35 = distinct !{!35, !33}
!36 = distinct !{!36, !33}


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