; LLVM IR from ARMmbed/mbed-crypto :: programs/pkey (key_app)

; 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.options = type { i32, ptr, ptr, ptr }
%struct.mbedtls_pk_context = type { ptr, ptr }
%struct.mbedtls_mpi = type { i32, i64, ptr }
%struct.mbedtls_ecp_keypair = type { %struct.mbedtls_ecp_group, %struct.mbedtls_mpi, %struct.mbedtls_ecp_point }
%struct.mbedtls_ecp_group = type { i32, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_ecp_point, %struct.mbedtls_mpi, i64, i64, i32, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.mbedtls_ecp_point = type { %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi }

@.str = external hidden unnamed_addr constant [214 x i8], align 1
@opt = external dso_local global %struct.options, align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@stdout = external global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [1024 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.mbedtls_pk_context, align 8
  %13 = alloca %struct.mbedtls_mpi, align 8
  %14 = alloca %struct.mbedtls_mpi, align 8
  %15 = alloca %struct.mbedtls_mpi, align 8
  %16 = alloca %struct.mbedtls_mpi, align 8
  %17 = alloca %struct.mbedtls_mpi, align 8
  %18 = alloca %struct.mbedtls_mpi, align 8
  %19 = alloca %struct.mbedtls_mpi, align 8
  %20 = alloca %struct.mbedtls_mpi, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, 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 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @mbedtls_pk_init(ptr noundef %12)
  %27 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %27, i8 0, i64 1024, i1 false)
  call void @mbedtls_mpi_init(ptr noundef %13)
  call void @mbedtls_mpi_init(ptr noundef %14)
  call void @mbedtls_mpi_init(ptr noundef %15)
  call void @mbedtls_mpi_init(ptr noundef %16)
  call void @mbedtls_mpi_init(ptr noundef %17)
  call void @mbedtls_mpi_init(ptr noundef %18)
  call void @mbedtls_mpi_init(ptr noundef %19)
  call void @mbedtls_mpi_init(ptr noundef %20)
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %2
  br label %31

31:                                               ; preds = %405, %104, %85, %64, %47, %30
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %408

33:                                               ; preds = %2
  store i32 0, ptr @opt, align 8, !tbaa !11
  store ptr @.str.1, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 1), align 8, !tbaa !13
  store ptr @.str.2, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 2), align 8, !tbaa !14
  store ptr @.str.2, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 3), align 8, !tbaa !15
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %34

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

38:                                               ; preds = %34
  %39 = load ptr, ptr %5, align 8, !tbaa !9
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %39, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  store ptr %43, ptr %10, align 8, !tbaa !9
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = call ptr @strchr(ptr noundef %44, i32 noundef 61) #7
  store ptr %45, ptr %11, align 8, !tbaa !9
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %38
  br label %31

48:                                               ; preds = %38
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %49, i32 1
  store ptr %50, ptr %11, align 8, !tbaa !9
  store i8 0, ptr %49, align 1, !tbaa !16
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = call i32 @strcmp(ptr noundef %51, ptr noundef @.str.3) #7
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %67

54:                                               ; preds = %48
  %55 = load ptr, ptr %11, align 8, !tbaa !9
  %56 = call i32 @strcmp(ptr noundef %55, ptr noundef @.str.4) #7
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  store i32 1, ptr @opt, align 8, !tbaa !11
  br label %66

59:                                               ; preds = %54
  %60 = load ptr, ptr %11, align 8, !tbaa !9
  %61 = call i32 @strcmp(ptr noundef %60, ptr noundef @.str.5) #7
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  store i32 2, ptr @opt, align 8, !tbaa !11
  br label %65

64:                                               ; preds = %59
  br label %31

65:                                               ; preds = %63
  br label %66

66:                                               ; preds = %65, %58
  br label %89

67:                                               ; preds = %48
  %68 = load ptr, ptr %10, align 8, !tbaa !9
  %69 = call i32 @strcmp(ptr noundef %68, ptr noundef @.str.6) #7
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %67
  %72 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %72, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 1), align 8, !tbaa !13
  br label %88

73:                                               ; preds = %67
  %74 = load ptr, ptr %10, align 8, !tbaa !9
  %75 = call i32 @strcmp(ptr noundef %74, ptr noundef @.str.7) #7
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %78, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 2), align 8, !tbaa !14
  br label %87

79:                                               ; preds = %73
  %80 = load ptr, ptr %10, align 8, !tbaa !9
  %81 = call i32 @strcmp(ptr noundef %80, ptr noundef @.str.8) #7
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %79
  %84 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %84, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 3), align 8, !tbaa !15
  br label %86

85:                                               ; preds = %79
  br label %31

86:                                               ; preds = %83
  br label %87

87:                                               ; preds = %86, %77
  br label %88

88:                                               ; preds = %87, %71
  br label %89

89:                                               ; preds = %88, %66
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %9, align 4, !tbaa !5
  br label %34, !llvm.loop !17

93:                                               ; preds = %34
  %94 = load i32, ptr @opt, align 8, !tbaa !11
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %310

96:                                               ; preds = %93
  %97 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 2), align 8, !tbaa !14
  %98 = call i64 @strlen(ptr noundef %97) #7
  %99 = icmp ne i64 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %96
  %101 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 3), align 8, !tbaa !15
  %102 = call i64 @strlen(ptr noundef %101) #7
  %103 = icmp ne i64 %102, 0
  br i1 %103, label %104, label %106

104:                                              ; preds = %100
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %31

106:                                              ; preds = %100, %96
  %107 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 3), align 8, !tbaa !15
  %108 = call i64 @strlen(ptr noundef %107) #7
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %110, label %162

110:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %112 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 3), align 8, !tbaa !15
  %113 = call noalias ptr @fopen(ptr noundef %112, ptr noundef @.str.11)
  store ptr %113, ptr %21, align 8, !tbaa !9
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %117

115:                                              ; preds = %110
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  store i32 3, ptr %22, align 4
  br label %159

117:                                              ; preds = %110
  %118 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %119 = load ptr, ptr %21, align 8, !tbaa !9
  %120 = call ptr @fgets(ptr noundef %118, i32 noundef 1024, ptr noundef %119)
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %126

122:                                              ; preds = %117
  %123 = load ptr, ptr %21, align 8, !tbaa !9
  %124 = call i32 @fclose(ptr noundef %123)
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  store i32 3, ptr %22, align 4
  br label %159

126:                                              ; preds = %117
  %127 = load ptr, ptr %21, align 8, !tbaa !9
  %128 = call i32 @fclose(ptr noundef %127)
  %129 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %130 = call i64 @strlen(ptr noundef %129) #7
  %131 = trunc i64 %130 to i32
  store i32 %131, ptr %9, align 4, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !16
  %137 = sext i8 %136 to i32
  %138 = icmp eq i32 %137, 10
  br i1 %138, label %139, label %144

139:                                              ; preds = %126
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 %142
  store i8 0, ptr %143, align 1, !tbaa !16
  br label %144

144:                                              ; preds = %139, %126
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 2
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !16
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %150, 13
  br i1 %151, label %152, label %157

152:                                              ; preds = %144
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 2
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 %155
  store i8 0, ptr %156, align 1, !tbaa !16
  br label %157

157:                                              ; preds = %152, %144
  %158 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  store ptr %158, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 2), align 8, !tbaa !14
  store i32 0, ptr %22, align 4
  br label %159

159:                                              ; preds = %157, %122, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %160 = load i32, ptr %22, align 4
  switch i32 %160, label %418 [
    i32 0, label %161
    i32 3, label %408
  ]

161:                                              ; preds = %159
  br label %162

162:                                              ; preds = %161, %106
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %164 = load ptr, ptr @stdout, align 8, !tbaa !9
  %165 = call i32 @fflush(ptr noundef %164)
  %166 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 1), align 8, !tbaa !13
  %167 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 2), align 8, !tbaa !14
  %168 = call i32 @mbedtls_pk_parse_keyfile(ptr noundef %12, ptr noundef %166, ptr noundef %167)
  store i32 %168, ptr %6, align 4, !tbaa !5
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %175

171:                                              ; preds = %162
  %172 = load i32, ptr %6, align 4, !tbaa !5
  %173 = sub nsw i32 0, %172
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %173)
  br label %408

175:                                              ; preds = %162
  %176 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %178 = call i32 @mbedtls_pk_get_type(ptr noundef %12)
  %179 = icmp eq i32 %178, 1
  br i1 %179, label %180, label %255

180:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %181 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8
  %183 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %184 = load ptr, ptr %183, align 8
  %185 = call ptr @mbedtls_pk_rsa(ptr %182, ptr %184)
  store ptr %185, ptr %23, align 8, !tbaa !9
  %186 = load ptr, ptr %23, align 8, !tbaa !9
  %187 = call i32 @mbedtls_rsa_export(ptr noundef %186, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  store i32 %187, ptr %6, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %193, label %189

189:                                              ; preds = %180
  %190 = load ptr, ptr %23, align 8, !tbaa !9
  %191 = call i32 @mbedtls_rsa_export_crt(ptr noundef %190, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  store i32 %191, ptr %6, align 4, !tbaa !5
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %195

193:                                              ; preds = %189, %180
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 3, ptr %22, align 4
  br label %252

195:                                              ; preds = %189
  br label %196

196:                                              ; preds = %195
  %197 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.19, ptr noundef %13, i32 noundef 16, ptr noundef null)
  store i32 %197, ptr %6, align 4, !tbaa !5
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %199, label %200

199:                                              ; preds = %196
  store i32 3, ptr %22, align 4
  br label %252

200:                                              ; preds = %196
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202
  %204 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.20, ptr noundef %17, i32 noundef 16, ptr noundef null)
  store i32 %204, ptr %6, align 4, !tbaa !5
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %207

206:                                              ; preds = %203
  store i32 3, ptr %22, align 4
  br label %252

207:                                              ; preds = %203
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  %211 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.21, ptr noundef %16, i32 noundef 16, ptr noundef null)
  store i32 %211, ptr %6, align 4, !tbaa !5
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  store i32 3, ptr %22, align 4
  br label %252

214:                                              ; preds = %210
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216
  %218 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.22, ptr noundef %14, i32 noundef 16, ptr noundef null)
  store i32 %218, ptr %6, align 4, !tbaa !5
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %217
  store i32 3, ptr %22, align 4
  br label %252

221:                                              ; preds = %217
  br label %222

222:                                              ; preds = %221
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  %225 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.23, ptr noundef %15, i32 noundef 16, ptr noundef null)
  store i32 %225, ptr %6, align 4, !tbaa !5
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %228

227:                                              ; preds = %224
  store i32 3, ptr %22, align 4
  br label %252

228:                                              ; preds = %224
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229
  br label %231

231:                                              ; preds = %230
  %232 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.24, ptr noundef %18, i32 noundef 16, ptr noundef null)
  store i32 %232, ptr %6, align 4, !tbaa !5
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %235

234:                                              ; preds = %231
  store i32 3, ptr %22, align 4
  br label %252

235:                                              ; preds = %231
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  br label %238

238:                                              ; preds = %237
  %239 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.25, ptr noundef %19, i32 noundef 16, ptr noundef null)
  store i32 %239, ptr %6, align 4, !tbaa !5
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %242

241:                                              ; preds = %238
  store i32 3, ptr %22, align 4
  br label %252

242:                                              ; preds = %238
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  br label %245

245:                                              ; preds = %244
  %246 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.26, ptr noundef %20, i32 noundef 16, ptr noundef null)
  store i32 %246, ptr %6, align 4, !tbaa !5
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %249

248:                                              ; preds = %245
  store i32 3, ptr %22, align 4
  br label %252

249:                                              ; preds = %245
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  store i32 0, ptr %22, align 4
  br label %252

252:                                              ; preds = %251, %248, %241, %234, %227, %220, %213, %206, %199, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  %253 = load i32, ptr %22, align 4
  switch i32 %253, label %418 [
    i32 0, label %254
    i32 3, label %408
  ]

254:                                              ; preds = %252
  br label %309

255:                                              ; preds = %175
  %256 = call i32 @mbedtls_pk_get_type(ptr noundef %12)
  %257 = icmp eq i32 %256, 2
  br i1 %257, label %258, label %306

258:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %259 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %260 = load ptr, ptr %259, align 8
  %261 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %262 = load ptr, ptr %261, align 8
  %263 = call ptr @mbedtls_pk_ec(ptr %260, ptr %262)
  store ptr %263, ptr %24, align 8, !tbaa !9
  br label %264

264:                                              ; preds = %258
  %265 = load ptr, ptr %24, align 8, !tbaa !9
  %266 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %265, i32 0, i32 2
  %267 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %266, i32 0, i32 0
  %268 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.27, ptr noundef %267, i32 noundef 16, ptr noundef null)
  store i32 %268, ptr %6, align 4, !tbaa !5
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %270, label %271

270:                                              ; preds = %264
  store i32 3, ptr %22, align 4
  br label %303

271:                                              ; preds = %264
  br label %272

272:                                              ; preds = %271
  br label %273

273:                                              ; preds = %272
  br label %274

274:                                              ; preds = %273
  %275 = load ptr, ptr %24, align 8, !tbaa !9
  %276 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %275, i32 0, i32 2
  %277 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %276, i32 0, i32 1
  %278 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.28, ptr noundef %277, i32 noundef 16, ptr noundef null)
  store i32 %278, ptr %6, align 4, !tbaa !5
  %279 = icmp ne i32 %278, 0
  br i1 %279, label %280, label %281

280:                                              ; preds = %274
  store i32 3, ptr %22, align 4
  br label %303

281:                                              ; preds = %274
  br label %282

282:                                              ; preds = %281
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283
  %285 = load ptr, ptr %24, align 8, !tbaa !9
  %286 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %285, i32 0, i32 2
  %287 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %286, i32 0, i32 2
  %288 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.29, ptr noundef %287, i32 noundef 16, ptr noundef null)
  store i32 %288, ptr %6, align 4, !tbaa !5
  %289 = icmp ne i32 %288, 0
  br i1 %289, label %290, label %291

290:                                              ; preds = %284
  store i32 3, ptr %22, align 4
  br label %303

291:                                              ; preds = %284
  br label %292

292:                                              ; preds = %291
  br label %293

293:                                              ; preds = %292
  br label %294

294:                                              ; preds = %293
  %295 = load ptr, ptr %24, align 8, !tbaa !9
  %296 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %295, i32 0, i32 1
  %297 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.30, ptr noundef %296, i32 noundef 16, ptr noundef null)
  store i32 %297, ptr %6, align 4, !tbaa !5
  %298 = icmp ne i32 %297, 0
  br i1 %298, label %299, label %300

299:                                              ; preds = %294
  store i32 3, ptr %22, align 4
  br label %303

300:                                              ; preds = %294
  br label %301

301:                                              ; preds = %300
  br label %302

302:                                              ; preds = %301
  store i32 0, ptr %22, align 4
  br label %303

303:                                              ; preds = %302, %299, %290, %280, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  %304 = load i32, ptr %22, align 4
  switch i32 %304, label %418 [
    i32 0, label %305
    i32 3, label %408
  ]

305:                                              ; preds = %303
  br label %308

306:                                              ; preds = %255
  %307 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  br label %408

308:                                              ; preds = %305
  br label %309

309:                                              ; preds = %308, %254
  br label %407

310:                                              ; preds = %93
  %311 = load i32, ptr @opt, align 8, !tbaa !11
  %312 = icmp eq i32 %311, 2
  br i1 %312, label %313, label %405

313:                                              ; preds = %310
  %314 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  %315 = load ptr, ptr @stdout, align 8, !tbaa !9
  %316 = call i32 @fflush(ptr noundef %315)
  %317 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opt, i32 0, i32 1), align 8, !tbaa !13
  %318 = call i32 @mbedtls_pk_parse_public_keyfile(ptr noundef %12, ptr noundef %317)
  store i32 %318, ptr %6, align 4, !tbaa !5
  %319 = load i32, ptr %6, align 4, !tbaa !5
  %320 = icmp ne i32 %319, 0
  br i1 %320, label %321, label %325

321:                                              ; preds = %313
  %322 = load i32, ptr %6, align 4, !tbaa !5
  %323 = sub nsw i32 0, %322
  %324 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, i32 noundef %323)
  br label %408

325:                                              ; preds = %313
  %326 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %327 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %328 = call i32 @mbedtls_pk_get_type(ptr noundef %12)
  %329 = icmp eq i32 %328, 1
  br i1 %329, label %330, label %359

330:                                              ; preds = %325
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %331 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %332 = load ptr, ptr %331, align 8
  %333 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %334 = load ptr, ptr %333, align 8
  %335 = call ptr @mbedtls_pk_rsa(ptr %332, ptr %334)
  store ptr %335, ptr %25, align 8, !tbaa !9
  %336 = load ptr, ptr %25, align 8, !tbaa !9
  %337 = call i32 @mbedtls_rsa_export(ptr noundef %336, ptr noundef %13, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef %17)
  store i32 %337, ptr %6, align 4, !tbaa !5
  %338 = icmp ne i32 %337, 0
  br i1 %338, label %339, label %341

339:                                              ; preds = %330
  %340 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 3, ptr %22, align 4
  br label %356

341:                                              ; preds = %330
  br label %342

342:                                              ; preds = %341
  %343 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.19, ptr noundef %13, i32 noundef 16, ptr noundef null)
  store i32 %343, ptr %6, align 4, !tbaa !5
  %344 = icmp ne i32 %343, 0
  br i1 %344, label %345, label %346

345:                                              ; preds = %342
  store i32 3, ptr %22, align 4
  br label %356

346:                                              ; preds = %342
  br label %347

347:                                              ; preds = %346
  br label %348

348:                                              ; preds = %347
  br label %349

349:                                              ; preds = %348
  %350 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.20, ptr noundef %17, i32 noundef 16, ptr noundef null)
  store i32 %350, ptr %6, align 4, !tbaa !5
  %351 = icmp ne i32 %350, 0
  br i1 %351, label %352, label %353

352:                                              ; preds = %349
  store i32 3, ptr %22, align 4
  br label %356

353:                                              ; preds = %349
  br label %354

354:                                              ; preds = %353
  br label %355

355:                                              ; preds = %354
  store i32 0, ptr %22, align 4
  br label %356

356:                                              ; preds = %355, %352, %345, %339
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  %357 = load i32, ptr %22, align 4
  switch i32 %357, label %418 [
    i32 0, label %358
    i32 3, label %408
  ]

358:                                              ; preds = %356
  br label %404

359:                                              ; preds = %325
  %360 = call i32 @mbedtls_pk_get_type(ptr noundef %12)
  %361 = icmp eq i32 %360, 2
  br i1 %361, label %362, label %401

362:                                              ; preds = %359
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %363 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %364 = load ptr, ptr %363, align 8
  %365 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %366 = load ptr, ptr %365, align 8
  %367 = call ptr @mbedtls_pk_ec(ptr %364, ptr %366)
  store ptr %367, ptr %26, align 8, !tbaa !9
  br label %368

368:                                              ; preds = %362
  %369 = load ptr, ptr %26, align 8, !tbaa !9
  %370 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %369, i32 0, i32 2
  %371 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %370, i32 0, i32 0
  %372 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.27, ptr noundef %371, i32 noundef 16, ptr noundef null)
  store i32 %372, ptr %6, align 4, !tbaa !5
  %373 = icmp ne i32 %372, 0
  br i1 %373, label %374, label %375

374:                                              ; preds = %368
  store i32 3, ptr %22, align 4
  br label %398

375:                                              ; preds = %368
  br label %376

376:                                              ; preds = %375
  br label %377

377:                                              ; preds = %376
  br label %378

378:                                              ; preds = %377
  %379 = load ptr, ptr %26, align 8, !tbaa !9
  %380 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %379, i32 0, i32 2
  %381 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %380, i32 0, i32 1
  %382 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.28, ptr noundef %381, i32 noundef 16, ptr noundef null)
  store i32 %382, ptr %6, align 4, !tbaa !5
  %383 = icmp ne i32 %382, 0
  br i1 %383, label %384, label %385

384:                                              ; preds = %378
  store i32 3, ptr %22, align 4
  br label %398

385:                                              ; preds = %378
  br label %386

386:                                              ; preds = %385
  br label %387

387:                                              ; preds = %386
  br label %388

388:                                              ; preds = %387
  %389 = load ptr, ptr %26, align 8, !tbaa !9
  %390 = getelementptr inbounds %struct.mbedtls_ecp_keypair, ptr %389, i32 0, i32 2
  %391 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %390, i32 0, i32 2
  %392 = call i32 @mbedtls_mpi_write_file(ptr noundef @.str.29, ptr noundef %391, i32 noundef 16, ptr noundef null)
  store i32 %392, ptr %6, align 4, !tbaa !5
  %393 = icmp ne i32 %392, 0
  br i1 %393, label %394, label %395

394:                                              ; preds = %388
  store i32 3, ptr %22, align 4
  br label %398

395:                                              ; preds = %388
  br label %396

396:                                              ; preds = %395
  br label %397

397:                                              ; preds = %396
  store i32 0, ptr %22, align 4
  br label %398

398:                                              ; preds = %397, %394, %384, %374
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  %399 = load i32, ptr %22, align 4
  switch i32 %399, label %418 [
    i32 0, label %400
    i32 3, label %408
  ]

400:                                              ; preds = %398
  br label %403

401:                                              ; preds = %359
  %402 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  br label %408

403:                                              ; preds = %400
  br label %404

404:                                              ; preds = %403, %358
  br label %406

405:                                              ; preds = %310
  br label %31

406:                                              ; preds = %404
  br label %407

407:                                              ; preds = %406, %309
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %408

408:                                              ; preds = %407, %401, %398, %356, %321, %306, %303, %252, %171, %159, %31
  %409 = load i32, ptr %7, align 4, !tbaa !5
  %410 = icmp ne i32 %409, 0
  br i1 %410, label %411, label %416

411:                                              ; preds = %408
  %412 = load i32, ptr %6, align 4, !tbaa !5
  %413 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  call void @mbedtls_strerror(i32 noundef %412, ptr noundef %413, i64 noundef 1024)
  %414 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %415 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, ptr noundef %414)
  br label %416

416:                                              ; preds = %411, %408
  call void @mbedtls_pk_free(ptr noundef %12)
  call void @mbedtls_mpi_free(ptr noundef %13)
  call void @mbedtls_mpi_free(ptr noundef %14)
  call void @mbedtls_mpi_free(ptr noundef %15)
  call void @mbedtls_mpi_free(ptr noundef %16)
  call void @mbedtls_mpi_free(ptr noundef %17)
  call void @mbedtls_mpi_free(ptr noundef %18)
  call void @mbedtls_mpi_free(ptr noundef %19)
  call void @mbedtls_mpi_free(ptr noundef %20)
  %417 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %417, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %418

418:                                              ; preds = %416, %398, %356, %303, %252, %159
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %419 = load i32, ptr %3, align 4
  ret i32 %419
}

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

declare void @mbedtls_pk_init(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 void @mbedtls_mpi_init(ptr noundef) #2

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

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

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

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

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

declare i32 @fflush(ptr noundef) #2

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

declare i32 @mbedtls_pk_get_type(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_rsa(ptr, ptr) #5

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_ec(ptr, ptr) #5

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

declare void @mbedtls_strerror(i32 noundef, ptr noundef, i64 noundef) #2

declare void @mbedtls_pk_free(ptr noundef) #2

declare void @mbedtls_mpi_free(ptr noundef) #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 = { 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 = { 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 = { inlinehint 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 #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, !6, i64 0}
!12 = !{!"options", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !10, i64 24}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

%struct.options = type { i32, ptr, ptr, ptr }
%struct.mbedtls_pk_context = type { ptr, ptr }
%struct.mbedtls_mpi = type { i32, i64, ptr }

@.str = external hidden unnamed_addr constant [214 x i8], align 1
@opt = external dso_local local_unnamed_addr global %struct.options, align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca %struct.mbedtls_pk_context, align 8
  %5 = alloca %struct.mbedtls_mpi, align 8
  %6 = alloca %struct.mbedtls_mpi, align 8
  %7 = alloca %struct.mbedtls_mpi, align 8
  %8 = alloca %struct.mbedtls_mpi, align 8
  %9 = alloca %struct.mbedtls_mpi, align 8
  %10 = alloca %struct.mbedtls_mpi, align 8
  %11 = alloca %struct.mbedtls_mpi, align 8
  %12 = alloca %struct.mbedtls_mpi, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @mbedtls_pk_init(ptr noundef nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %3, i8 0, i64 1024, i1 false)
  call void @mbedtls_mpi_init(ptr noundef nonnull %5) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %6) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %7) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %8) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %9) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %10) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %11) #7
  call void @mbedtls_mpi_init(ptr noundef nonnull %12) #7
  %13 = icmp eq i32 %0, 0
  br i1 %13, label %.loopexit, label %15

.loopexit:                                        ; preds = %41, %29, %.lr.ph, %15, %._crit_edge, %2, %49
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %.thread

15:                                               ; preds = %2
  store i32 0, ptr @opt, align 8, !tbaa !5
  store ptr @.str.1, ptr getelementptr inbounds (i8, ptr @opt, i64 8), align 8, !tbaa !11
  store ptr @.str.2, ptr getelementptr inbounds (i8, ptr @opt, i64 16), align 8, !tbaa !12
  store ptr @.str.2, ptr getelementptr inbounds (i8, ptr @opt, i64 24), align 8, !tbaa !13
  %16 = icmp sgt i32 %0, 1
  br i1 %16, label %.lr.ph.preheader, label %.loopexit

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %45
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %45 ]
  %17 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %19 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %18, i32 noundef 61) #8
  %20 = icmp eq ptr %19, null
  br i1 %20, label %.loopexit, label %21

21:                                               ; preds = %.lr.ph
  %22 = getelementptr inbounds i8, ptr %19, i64 1
  store i8 0, ptr %19, align 1, !tbaa !15
  %23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) @.str.3) #8
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %33

25:                                               ; preds = %21
  %26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.4) #8
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store i32 1, ptr @opt, align 8, !tbaa !5
  br label %45

29:                                               ; preds = %25
  %30 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.5) #8
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %.loopexit

32:                                               ; preds = %29
  store i32 2, ptr @opt, align 8, !tbaa !5
  br label %45

33:                                               ; preds = %21
  %34 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) @.str.6) #8
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store ptr %22, ptr getelementptr inbounds (i8, ptr @opt, i64 8), align 8, !tbaa !11
  br label %45

37:                                               ; preds = %33
  %38 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  store ptr %22, ptr getelementptr inbounds (i8, ptr @opt, i64 16), align 8, !tbaa !12
  br label %45

41:                                               ; preds = %37
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) @.str.8) #8
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %.loopexit

44:                                               ; preds = %41
  store ptr %22, ptr getelementptr inbounds (i8, ptr @opt, i64 24), align 8, !tbaa !13
  br label %45

45:                                               ; preds = %32, %28, %40, %44, %36
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %45
  %.pre = load i32, ptr @opt, align 8, !tbaa !5
  switch i32 %.pre, label %.loopexit [
    i32 1, label %46
    i32 2, label %141
  ]

46:                                               ; preds = %._crit_edge
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 16), align 8, !tbaa !12
  %char0 = load i8, ptr %47, align 1
  %.not92 = icmp eq i8 %char0, 0
  %.pre151 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 24), align 8, !tbaa !13
  %char095.pre = load i8, ptr %.pre151, align 1
  %.not96 = icmp eq i8 %char095.pre, 0
  br i1 %.not92, label %51, label %48

48:                                               ; preds = %46
  br i1 %.not96, label %.thread152, label %49

49:                                               ; preds = %48
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %.loopexit

51:                                               ; preds = %46
  br i1 %.not96, label %.thread152, label %52

52:                                               ; preds = %51
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 24), align 8, !tbaa !13
  %55 = call noalias ptr @fopen(ptr noundef %54, ptr noundef nonnull @.str.11)
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %59

57:                                               ; preds = %52
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  br label %.thread

59:                                               ; preds = %52
  %60 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %55)
  %61 = icmp eq ptr %60, null
  %62 = call i32 @fclose(ptr noundef nonnull %55)
  br i1 %61, label %63, label %65

63:                                               ; preds = %59
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %.thread

65:                                               ; preds = %59
  %66 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  %67 = shl i64 %66, 32
  %sext = add i64 %67, -4294967296
  %68 = ashr exact i64 %sext, 32
  %69 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !15
  %71 = icmp eq i8 %70, 10
  br i1 %71, label %72, label %73

72:                                               ; preds = %65
  store i8 0, ptr %69, align 1, !tbaa !15
  br label %73

73:                                               ; preds = %72, %65
  %sext97 = add i64 %67, -8589934592
  %74 = ashr exact i64 %sext97, 32
  %75 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !15
  %77 = icmp eq i8 %76, 13
  br i1 %77, label %78, label %79

78:                                               ; preds = %73
  store i8 0, ptr %75, align 1, !tbaa !15
  br label %79

79:                                               ; preds = %73, %78
  store ptr %3, ptr getelementptr inbounds (i8, ptr @opt, i64 16), align 8, !tbaa !12
  br label %.thread152

.thread152:                                       ; preds = %48, %79, %51
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %81 = load ptr, ptr @stdout, align 8, !tbaa !14
  %82 = call i32 @fflush(ptr noundef %81)
  %83 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 8), align 8, !tbaa !11
  %84 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 16), align 8, !tbaa !12
  %85 = call i32 @mbedtls_pk_parse_keyfile(ptr noundef nonnull %4, ptr noundef %83, ptr noundef %84) #7
  %.not98 = icmp eq i32 %85, 0
  br i1 %.not98, label %89, label %86

86:                                               ; preds = %.thread152
  %87 = sub nsw i32 0, %85
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %87)
  br label %.thread

89:                                               ; preds = %.thread152
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %92 = call i32 @mbedtls_pk_get_type(ptr noundef nonnull %4) #7
  %93 = icmp eq i32 %92, 1
  br i1 %93, label %94, label %120

94:                                               ; preds = %89
  %95 = load ptr, ptr %4, align 8
  %96 = getelementptr inbounds i8, ptr %4, i64 8
  %97 = load ptr, ptr %96, align 8
  %98 = call ptr @mbedtls_pk_rsa(ptr %95, ptr %97)
  %99 = call i32 @mbedtls_rsa_export(ptr noundef %98, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #7
  %.not103 = icmp eq i32 %99, 0
  br i1 %.not103, label %100, label %102

100:                                              ; preds = %94
  %101 = call i32 @mbedtls_rsa_export_crt(ptr noundef %98, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12) #7
  %.not104 = icmp eq i32 %101, 0
  br i1 %.not104, label %104, label %102

102:                                              ; preds = %100, %94
  %.046 = phi i32 [ %99, %94 ], [ %101, %100 ]
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %.thread

104:                                              ; preds = %100
  %105 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.19, ptr noundef nonnull %5, i32 noundef 16, ptr noundef null) #7
  %.not105 = icmp eq i32 %105, 0
  br i1 %.not105, label %106, label %.thread

106:                                              ; preds = %104
  %107 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.20, ptr noundef nonnull %9, i32 noundef 16, ptr noundef null) #7
  %.not106 = icmp eq i32 %107, 0
  br i1 %.not106, label %108, label %.thread

108:                                              ; preds = %106
  %109 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.21, ptr noundef nonnull %8, i32 noundef 16, ptr noundef null) #7
  %.not107 = icmp eq i32 %109, 0
  br i1 %.not107, label %110, label %.thread

110:                                              ; preds = %108
  %111 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.22, ptr noundef nonnull %6, i32 noundef 16, ptr noundef null) #7
  %.not108 = icmp eq i32 %111, 0
  br i1 %.not108, label %112, label %.thread

112:                                              ; preds = %110
  %113 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.23, ptr noundef nonnull %7, i32 noundef 16, ptr noundef null) #7
  %.not109 = icmp eq i32 %113, 0
  br i1 %.not109, label %114, label %.thread

114:                                              ; preds = %112
  %115 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.24, ptr noundef nonnull %10, i32 noundef 16, ptr noundef null) #7
  %.not110 = icmp eq i32 %115, 0
  br i1 %.not110, label %116, label %.thread

116:                                              ; preds = %114
  %117 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.25, ptr noundef nonnull %11, i32 noundef 16, ptr noundef null) #7
  %.not111 = icmp eq i32 %117, 0
  br i1 %.not111, label %118, label %.thread

118:                                              ; preds = %116
  %119 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.26, ptr noundef nonnull %12, i32 noundef 16, ptr noundef null) #7
  %.not112 = icmp eq i32 %119, 0
  br i1 %.not112, label %186, label %.thread

120:                                              ; preds = %89
  %121 = call i32 @mbedtls_pk_get_type(ptr noundef nonnull %4) #7
  %122 = icmp eq i32 %121, 2
  br i1 %122, label %123, label %139

123:                                              ; preds = %120
  %124 = load ptr, ptr %4, align 8
  %125 = getelementptr inbounds i8, ptr %4, i64 8
  %126 = load ptr, ptr %125, align 8
  %127 = call ptr @mbedtls_pk_ec(ptr %124, ptr %126)
  %128 = getelementptr inbounds i8, ptr %127, i64 272
  %129 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.27, ptr noundef nonnull %128, i32 noundef 16, ptr noundef null) #7
  %.not99 = icmp eq i32 %129, 0
  br i1 %.not99, label %130, label %.thread

130:                                              ; preds = %123
  %131 = getelementptr inbounds i8, ptr %127, i64 296
  %132 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.28, ptr noundef nonnull %131, i32 noundef 16, ptr noundef null) #7
  %.not100 = icmp eq i32 %132, 0
  br i1 %.not100, label %133, label %.thread

133:                                              ; preds = %130
  %134 = getelementptr inbounds i8, ptr %127, i64 320
  %135 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.29, ptr noundef nonnull %134, i32 noundef 16, ptr noundef null) #7
  %.not101 = icmp eq i32 %135, 0
  br i1 %.not101, label %136, label %.thread

136:                                              ; preds = %133
  %137 = getelementptr inbounds i8, ptr %127, i64 248
  %138 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.30, ptr noundef nonnull %137, i32 noundef 16, ptr noundef null) #7
  %.not102 = icmp eq i32 %138, 0
  br i1 %.not102, label %186, label %.thread

139:                                              ; preds = %120
  %140 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  br label %.thread

141:                                              ; preds = %._crit_edge
  %142 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  %143 = load ptr, ptr @stdout, align 8, !tbaa !14
  %144 = call i32 @fflush(ptr noundef %143)
  %145 = load ptr, ptr getelementptr inbounds (i8, ptr @opt, i64 8), align 8, !tbaa !11
  %146 = call i32 @mbedtls_pk_parse_public_keyfile(ptr noundef nonnull %4, ptr noundef %145) #7
  %.not = icmp eq i32 %146, 0
  br i1 %.not, label %150, label %147

147:                                              ; preds = %141
  %148 = sub nsw i32 0, %146
  %149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, i32 noundef %148)
  br label %.thread

150:                                              ; preds = %141
  %151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %152 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %153 = call i32 @mbedtls_pk_get_type(ptr noundef nonnull %4) #7
  %154 = icmp eq i32 %153, 1
  br i1 %154, label %155, label %167

155:                                              ; preds = %150
  %156 = load ptr, ptr %4, align 8
  %157 = getelementptr inbounds i8, ptr %4, i64 8
  %158 = load ptr, ptr %157, align 8
  %159 = call ptr @mbedtls_pk_rsa(ptr %156, ptr %158)
  %160 = call i32 @mbedtls_rsa_export(ptr noundef %159, ptr noundef nonnull %5, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef nonnull %9) #7
  %.not89 = icmp eq i32 %160, 0
  br i1 %.not89, label %163, label %161

161:                                              ; preds = %155
  %162 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %.thread

163:                                              ; preds = %155
  %164 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.19, ptr noundef nonnull %5, i32 noundef 16, ptr noundef null) #7
  %.not90 = icmp eq i32 %164, 0
  br i1 %.not90, label %165, label %.thread

165:                                              ; preds = %163
  %166 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.20, ptr noundef nonnull %9, i32 noundef 16, ptr noundef null) #7
  %.not91 = icmp eq i32 %166, 0
  br i1 %.not91, label %186, label %.thread

167:                                              ; preds = %150
  %168 = call i32 @mbedtls_pk_get_type(ptr noundef nonnull %4) #7
  %169 = icmp eq i32 %168, 2
  br i1 %169, label %170, label %183

170:                                              ; preds = %167
  %171 = load ptr, ptr %4, align 8
  %172 = getelementptr inbounds i8, ptr %4, i64 8
  %173 = load ptr, ptr %172, align 8
  %174 = call ptr @mbedtls_pk_ec(ptr %171, ptr %173)
  %175 = getelementptr inbounds i8, ptr %174, i64 272
  %176 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.27, ptr noundef nonnull %175, i32 noundef 16, ptr noundef null) #7
  %.not86 = icmp eq i32 %176, 0
  br i1 %.not86, label %177, label %.thread

177:                                              ; preds = %170
  %178 = getelementptr inbounds i8, ptr %174, i64 296
  %179 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.28, ptr noundef nonnull %178, i32 noundef 16, ptr noundef null) #7
  %.not87 = icmp eq i32 %179, 0
  br i1 %.not87, label %180, label %.thread

180:                                              ; preds = %177
  %181 = getelementptr inbounds i8, ptr %174, i64 320
  %182 = call i32 @mbedtls_mpi_write_file(ptr noundef nonnull @.str.29, ptr noundef nonnull %181, i32 noundef 16, ptr noundef null) #7
  %.not88 = icmp eq i32 %182, 0
  br i1 %.not88, label %186, label %.thread

183:                                              ; preds = %167
  %184 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  br label %.thread

.thread:                                          ; preds = %180, %177, %170, %165, %163, %161, %136, %133, %130, %123, %118, %116, %114, %112, %110, %108, %106, %104, %102, %63, %57, %.loopexit, %86, %139, %147, %183
  %.6.ph = phi i32 [ 0, %183 ], [ %146, %147 ], [ 0, %139 ], [ %85, %86 ], [ 1, %.loopexit ], [ 1, %57 ], [ 1, %63 ], [ %119, %118 ], [ %117, %116 ], [ %115, %114 ], [ %113, %112 ], [ %111, %110 ], [ %109, %108 ], [ %107, %106 ], [ %105, %104 ], [ %.046, %102 ], [ %138, %136 ], [ %135, %133 ], [ %132, %130 ], [ %129, %123 ], [ %166, %165 ], [ %164, %163 ], [ %160, %161 ], [ %182, %180 ], [ %179, %177 ], [ %176, %170 ]
  call void @mbedtls_strerror(i32 noundef %.6.ph, ptr noundef nonnull %3, i64 noundef 1024) #7
  %185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, ptr noundef nonnull %3)
  br label %186

186:                                              ; preds = %.thread, %118, %136, %165, %180
  %.047147 = phi i32 [ 1, %.thread ], [ 0, %180 ], [ 0, %165 ], [ 0, %136 ], [ 0, %118 ]
  call void @mbedtls_pk_free(ptr noundef nonnull %4) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %5) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %6) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %7) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %8) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %9) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %10) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %11) #7
  call void @mbedtls_mpi_free(ptr noundef nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  ret i32 %.047147
}

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

declare void @mbedtls_pk_init(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 void @mbedtls_mpi_init(ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

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

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

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

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

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

declare i32 @mbedtls_pk_get_type(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_rsa(ptr, ptr) local_unnamed_addr #6

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_ec(ptr, ptr) local_unnamed_addr #6

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

declare void @mbedtls_strerror(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @mbedtls_pk_free(ptr noundef) local_unnamed_addr #2

declare void @mbedtls_mpi_free(ptr 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 = { "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 = { 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 #5 = { 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 #6 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"options", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !10, i64 24}
!14 = !{!10, !10, i64 0}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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