; LLVM IR from tleonhardt/practical_cryptography_engineering :: ecdh (main)

; 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.mbedtls_ecdh_context = type { %struct.mbedtls_ecp_group, %struct.mbedtls_mpi, %struct.mbedtls_ecp_point, %struct.mbedtls_ecp_point, %struct.mbedtls_mpi, i32, %struct.mbedtls_ecp_point, %struct.mbedtls_ecp_point, %struct.mbedtls_mpi }
%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 }
%struct.mbedtls_mpi = type { i32, i64, ptr }
%struct.mbedtls_entropy_context = type { %struct.mbedtls_sha512_context, i32, [20 x %struct.mbedtls_entropy_source_state] }
%struct.mbedtls_sha512_context = type { [2 x i64], [8 x i64], [128 x i8], i32 }
%struct.mbedtls_entropy_source_state = type { ptr, ptr, i64, i64, i32 }
%struct.mbedtls_ctr_drbg_context = type { [16 x i8], i32, i32, i64, i32, %struct.mbedtls_aes_context, ptr, ptr }
%struct.mbedtls_aes_context = type { i32, ptr, [68 x i32] }

@__const.main.pers = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@stdout = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 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 %struct.mbedtls_ecdh_context, align 8
  %8 = alloca %struct.mbedtls_ecdh_context, align 8
  %9 = alloca %struct.mbedtls_entropy_context, align 8
  %10 = alloca %struct.mbedtls_ctr_drbg_context, align 8
  %11 = alloca [66 x i8], align 16
  %12 = alloca [66 x i8], align 16
  %13 = alloca [66 x i8], align 16
  %14 = alloca [66 x i8], align 16
  %15 = alloca [5 x i8], align 1
  %16 = alloca [80 x i8], align 16
  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) #4
  call void @llvm.lifetime.start.p0(i64 616, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 616, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 344, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 66, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 66, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 66, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 66, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 5, ptr %15) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %15, ptr align 1 @__const.main.pers, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #4
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  call void @mbedtls_ecdh_init(ptr noundef %7)
  call void @mbedtls_ecdh_init(ptr noundef %8)
  call void @mbedtls_ctr_drbg_init(ptr noundef %10)
  call void @mbedtls_entropy_init(ptr noundef %9)
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !9
  %23 = call i32 @fflush(ptr noundef %22)
  %24 = getelementptr inbounds [5 x i8], ptr %15, i64 0, i64 0
  %25 = call i32 @mbedtls_ctr_drbg_seed(ptr noundef %10, ptr noundef @mbedtls_entropy_func, ptr noundef %9, ptr noundef %24, i64 noundef 5)
  store i32 %25, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %2
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %29)
  br label %219

31:                                               ; preds = %2
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %34 = load ptr, ptr @stdout, align 8, !tbaa !9
  %35 = call i32 @fflush(ptr noundef %34)
  %36 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 0
  %37 = call i32 @mbedtls_ecp_group_load(ptr noundef %36, i32 noundef 5)
  store i32 %37, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %31
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %41)
  br label %219

43:                                               ; preds = %31
  %44 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 0
  %45 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 1
  %46 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 2
  %47 = call i32 @mbedtls_ecdh_gen_public(ptr noundef %44, ptr noundef %45, ptr noundef %46, ptr noundef @mbedtls_ctr_drbg_random, ptr noundef %10)
  store i32 %47, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %43
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %51)
  br label %219

53:                                               ; preds = %43
  %54 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 2
  %55 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds [66 x i8], ptr %11, i64 0, i64 0
  %57 = call i32 @mbedtls_mpi_write_binary(ptr noundef %55, ptr noundef %56, i64 noundef 66)
  store i32 %57, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %53
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %61)
  br label %219

63:                                               ; preds = %53
  %64 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 2
  %65 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds [66 x i8], ptr %12, i64 0, i64 0
  %67 = call i32 @mbedtls_mpi_write_binary(ptr noundef %65, ptr noundef %66, i64 noundef 66)
  store i32 %67, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %63
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %71)
  br label %219

73:                                               ; preds = %63
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %76 = load ptr, ptr @stdout, align 8, !tbaa !9
  %77 = call i32 @fflush(ptr noundef %76)
  %78 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 0
  %79 = call i32 @mbedtls_ecp_group_load(ptr noundef %78, i32 noundef 5)
  store i32 %79, ptr %6, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %85

82:                                               ; preds = %73
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %83)
  br label %219

85:                                               ; preds = %73
  %86 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 0
  %87 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 1
  %88 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 2
  %89 = call i32 @mbedtls_ecdh_gen_public(ptr noundef %86, ptr noundef %87, ptr noundef %88, ptr noundef @mbedtls_ctr_drbg_random, ptr noundef %10)
  store i32 %89, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %85
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %93)
  br label %219

95:                                               ; preds = %85
  %96 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 2
  %97 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds [66 x i8], ptr %13, i64 0, i64 0
  %99 = call i32 @mbedtls_mpi_write_binary(ptr noundef %97, ptr noundef %98, i64 noundef 66)
  store i32 %99, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %105

102:                                              ; preds = %95
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %103)
  br label %219

105:                                              ; preds = %95
  %106 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 2
  %107 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds [66 x i8], ptr %14, i64 0, i64 0
  %109 = call i32 @mbedtls_mpi_write_binary(ptr noundef %107, ptr noundef %108, i64 noundef 66)
  store i32 %109, ptr %6, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %105
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %113)
  br label %219

115:                                              ; preds = %105
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %118 = load ptr, ptr @stdout, align 8, !tbaa !9
  %119 = call i32 @fflush(ptr noundef %118)
  %120 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 3
  %121 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %120, i32 0, i32 2
  %122 = call i32 @mbedtls_mpi_lset(ptr noundef %121, i64 noundef 1)
  store i32 %122, ptr %6, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %115
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %126)
  br label %219

128:                                              ; preds = %115
  %129 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 3
  %130 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds [66 x i8], ptr %11, i64 0, i64 0
  %132 = call i32 @mbedtls_mpi_read_binary(ptr noundef %130, ptr noundef %131, i64 noundef 66)
  store i32 %132, ptr %6, align 4, !tbaa !5
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %138

135:                                              ; preds = %128
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %136)
  br label %219

138:                                              ; preds = %128
  %139 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 3
  %140 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %139, i32 0, i32 1
  %141 = getelementptr inbounds [66 x i8], ptr %12, i64 0, i64 0
  %142 = call i32 @mbedtls_mpi_read_binary(ptr noundef %140, ptr noundef %141, i64 noundef 66)
  store i32 %142, ptr %6, align 4, !tbaa !5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %148

145:                                              ; preds = %138
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %146)
  br label %219

148:                                              ; preds = %138
  %149 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 0
  %150 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 4
  %151 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 3
  %152 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 1
  %153 = call i32 @mbedtls_ecdh_compute_shared(ptr noundef %149, ptr noundef %150, ptr noundef %151, ptr noundef %152, ptr noundef @mbedtls_ctr_drbg_random, ptr noundef %10)
  store i32 %153, ptr %6, align 4, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %160

156:                                              ; preds = %148
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = sub nsw i32 0, %157
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %158)
  br label %219

160:                                              ; preds = %148
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %163 = load ptr, ptr @stdout, align 8, !tbaa !9
  %164 = call i32 @fflush(ptr noundef %163)
  %165 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 3
  %166 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %165, i32 0, i32 2
  %167 = call i32 @mbedtls_mpi_lset(ptr noundef %166, i64 noundef 1)
  store i32 %167, ptr %6, align 4, !tbaa !5
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %173

170:                                              ; preds = %160
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %171)
  br label %219

173:                                              ; preds = %160
  %174 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 3
  %175 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %174, i32 0, i32 0
  %176 = getelementptr inbounds [66 x i8], ptr %13, i64 0, i64 0
  %177 = call i32 @mbedtls_mpi_read_binary(ptr noundef %175, ptr noundef %176, i64 noundef 66)
  store i32 %177, ptr %6, align 4, !tbaa !5
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %183

180:                                              ; preds = %173
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %181)
  br label %219

183:                                              ; preds = %173
  %184 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 3
  %185 = getelementptr inbounds %struct.mbedtls_ecp_point, ptr %184, i32 0, i32 1
  %186 = getelementptr inbounds [66 x i8], ptr %14, i64 0, i64 0
  %187 = call i32 @mbedtls_mpi_read_binary(ptr noundef %185, ptr noundef %186, i64 noundef 66)
  store i32 %187, ptr %6, align 4, !tbaa !5
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %193

190:                                              ; preds = %183
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %191)
  br label %219

193:                                              ; preds = %183
  %194 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 0
  %195 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 4
  %196 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 3
  %197 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 1
  %198 = call i32 @mbedtls_ecdh_compute_shared(ptr noundef %194, ptr noundef %195, ptr noundef %196, ptr noundef %197, ptr noundef @mbedtls_ctr_drbg_random, ptr noundef %10)
  store i32 %198, ptr %6, align 4, !tbaa !5
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %204

201:                                              ; preds = %193
  %202 = load i32, ptr %6, align 4, !tbaa !5
  %203 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %202)
  br label %219

204:                                              ; preds = %193
  %205 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %206 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %207 = load ptr, ptr @stdout, align 8, !tbaa !9
  %208 = call i32 @fflush(ptr noundef %207)
  %209 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %7, i32 0, i32 4
  %210 = getelementptr inbounds %struct.mbedtls_ecdh_context, ptr %8, i32 0, i32 4
  %211 = call i32 @mbedtls_mpi_cmp_mpi(ptr noundef %209, ptr noundef %210)
  store i32 %211, ptr %6, align 4, !tbaa !5
  %212 = load i32, ptr %6, align 4, !tbaa !5
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %217

214:                                              ; preds = %204
  %215 = load i32, ptr %6, align 4, !tbaa !5
  %216 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %215)
  br label %219

217:                                              ; preds = %204
  %218 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %219

219:                                              ; preds = %217, %214, %201, %190, %180, %170, %156, %145, %135, %125, %112, %102, %92, %82, %70, %60, %50, %40, %28
  %220 = load i32, ptr %6, align 4, !tbaa !5
  %221 = icmp ne i32 %220, 0
  br i1 %221, label %222, label %227

222:                                              ; preds = %219
  %223 = load i32, ptr %6, align 4, !tbaa !5
  %224 = getelementptr inbounds [80 x i8], ptr %16, i64 0, i64 0
  call void @mbedtls_strerror(i32 noundef %223, ptr noundef %224, i64 noundef 80)
  %225 = getelementptr inbounds [80 x i8], ptr %16, i64 0, i64 0
  %226 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %225)
  br label %227

227:                                              ; preds = %222, %219
  call void @mbedtls_ecdh_free(ptr noundef %8)
  call void @mbedtls_ecdh_free(ptr noundef %7)
  call void @mbedtls_ctr_drbg_free(ptr noundef %10)
  call void @mbedtls_entropy_free(ptr noundef %9)
  %228 = load i32, ptr %6, align 4, !tbaa !5
  %229 = icmp ne i32 %228, 0
  %230 = zext i1 %229 to i32
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 66, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 66, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 66, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 66, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 344, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 616, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 616, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  ret i32 %230
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @mbedtls_ecdh_init(ptr noundef) #3

declare void @mbedtls_ctr_drbg_init(ptr noundef) #3

declare void @mbedtls_entropy_init(ptr noundef) #3

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

declare i32 @fflush(ptr noundef) #3

declare i32 @mbedtls_ctr_drbg_seed(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_entropy_func(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_ecp_group_load(ptr noundef, i32 noundef) #3

declare i32 @mbedtls_ecdh_gen_public(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @mbedtls_ctr_drbg_random(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_mpi_write_binary(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_mpi_lset(ptr noundef, i64 noundef) #3

declare i32 @mbedtls_mpi_read_binary(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_ecdh_compute_shared(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @mbedtls_mpi_cmp_mpi(ptr noundef, ptr noundef) #3

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

declare void @mbedtls_ecdh_free(ptr noundef) #3

declare void @mbedtls_ctr_drbg_free(ptr noundef) #3

declare void @mbedtls_entropy_free(ptr noundef) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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}


; 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.mbedtls_ecdh_context = type { %struct.mbedtls_ecp_group, %struct.mbedtls_mpi, %struct.mbedtls_ecp_point, %struct.mbedtls_ecp_point, %struct.mbedtls_mpi, i32, %struct.mbedtls_ecp_point, %struct.mbedtls_ecp_point, %struct.mbedtls_mpi }
%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 }
%struct.mbedtls_mpi = type { i32, i64, ptr }
%struct.mbedtls_entropy_context = type { %struct.mbedtls_sha512_context, i32, [20 x %struct.mbedtls_entropy_source_state] }
%struct.mbedtls_sha512_context = type { [2 x i64], [8 x i64], [128 x i8], i32 }
%struct.mbedtls_entropy_source_state = type { ptr, ptr, i64, i64, i32 }
%struct.mbedtls_ctr_drbg_context = type { [16 x i8], i32, i32, i64, i32, %struct.mbedtls_aes_context, ptr, ptr }
%struct.mbedtls_aes_context = type { i32, ptr, [68 x i32] }

@__const.main.pers = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.mbedtls_ecdh_context, align 8
  %4 = alloca %struct.mbedtls_ecdh_context, align 8
  %5 = alloca %struct.mbedtls_entropy_context, align 8
  %6 = alloca %struct.mbedtls_ctr_drbg_context, align 8
  %7 = alloca [66 x i8], align 16
  %8 = alloca [66 x i8], align 16
  %9 = alloca [66 x i8], align 16
  %10 = alloca [66 x i8], align 16
  %11 = alloca [5 x i8], align 1
  %12 = alloca [80 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 616, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 616, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 344, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 66, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 66, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 66, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 66, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %11, ptr noundef nonnull align 1 dereferenceable(5) @__const.main.pers, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %12) #5
  call void @mbedtls_ecdh_init(ptr noundef nonnull %3) #5
  call void @mbedtls_ecdh_init(ptr noundef nonnull %4) #5
  call void @mbedtls_ctr_drbg_init(ptr noundef nonnull %6) #5
  call void @mbedtls_entropy_init(ptr noundef nonnull %5) #5
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  %17 = call i32 @fflush(ptr noundef %16)
  %18 = call i32 @mbedtls_ctr_drbg_seed(ptr noundef nonnull %6, ptr noundef nonnull @mbedtls_entropy_func, ptr noundef nonnull %5, ptr noundef nonnull %11, i64 noundef 5) #5
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %21, label %19

19:                                               ; preds = %2
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %18)
  br label %126

21:                                               ; preds = %2
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %24 = load ptr, ptr @stdout, align 8, !tbaa !5
  %25 = call i32 @fflush(ptr noundef %24)
  %26 = call i32 @mbedtls_ecp_group_load(ptr noundef nonnull %3, i32 noundef 5) #5
  %.not58 = icmp eq i32 %26, 0
  br i1 %.not58, label %29, label %27

27:                                               ; preds = %21
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %26)
  br label %126

29:                                               ; preds = %21
  %30 = getelementptr inbounds i8, ptr %3, i64 248
  %31 = getelementptr inbounds i8, ptr %3, i64 272
  %32 = call i32 @mbedtls_ecdh_gen_public(ptr noundef nonnull %3, ptr noundef nonnull %30, ptr noundef nonnull %31, ptr noundef nonnull @mbedtls_ctr_drbg_random, ptr noundef nonnull %6) #5
  %.not59 = icmp eq i32 %32, 0
  br i1 %.not59, label %35, label %33

33:                                               ; preds = %29
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %32)
  br label %126

35:                                               ; preds = %29
  %36 = call i32 @mbedtls_mpi_write_binary(ptr noundef nonnull %31, ptr noundef nonnull %7, i64 noundef 66) #5
  %.not60 = icmp eq i32 %36, 0
  br i1 %.not60, label %39, label %37

37:                                               ; preds = %35
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %36)
  br label %126

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %3, i64 296
  %41 = call i32 @mbedtls_mpi_write_binary(ptr noundef nonnull %40, ptr noundef nonnull %8, i64 noundef 66) #5
  %.not61 = icmp eq i32 %41, 0
  br i1 %.not61, label %44, label %42

42:                                               ; preds = %39
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %41)
  br label %126

44:                                               ; preds = %39
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %47 = load ptr, ptr @stdout, align 8, !tbaa !5
  %48 = call i32 @fflush(ptr noundef %47)
  %49 = call i32 @mbedtls_ecp_group_load(ptr noundef nonnull %4, i32 noundef 5) #5
  %.not62 = icmp eq i32 %49, 0
  br i1 %.not62, label %52, label %50

50:                                               ; preds = %44
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %49)
  br label %126

52:                                               ; preds = %44
  %53 = getelementptr inbounds i8, ptr %4, i64 248
  %54 = getelementptr inbounds i8, ptr %4, i64 272
  %55 = call i32 @mbedtls_ecdh_gen_public(ptr noundef nonnull %4, ptr noundef nonnull %53, ptr noundef nonnull %54, ptr noundef nonnull @mbedtls_ctr_drbg_random, ptr noundef nonnull %6) #5
  %.not63 = icmp eq i32 %55, 0
  br i1 %.not63, label %58, label %56

56:                                               ; preds = %52
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %55)
  br label %126

58:                                               ; preds = %52
  %59 = call i32 @mbedtls_mpi_write_binary(ptr noundef nonnull %54, ptr noundef nonnull %9, i64 noundef 66) #5
  %.not64 = icmp eq i32 %59, 0
  br i1 %.not64, label %62, label %60

60:                                               ; preds = %58
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %59)
  br label %126

62:                                               ; preds = %58
  %63 = getelementptr inbounds i8, ptr %4, i64 296
  %64 = call i32 @mbedtls_mpi_write_binary(ptr noundef nonnull %63, ptr noundef nonnull %10, i64 noundef 66) #5
  %.not65 = icmp eq i32 %64, 0
  br i1 %.not65, label %67, label %65

65:                                               ; preds = %62
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %64)
  br label %126

67:                                               ; preds = %62
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %70 = load ptr, ptr @stdout, align 8, !tbaa !5
  %71 = call i32 @fflush(ptr noundef %70)
  %72 = getelementptr inbounds i8, ptr %4, i64 344
  %73 = getelementptr inbounds i8, ptr %4, i64 392
  %74 = call i32 @mbedtls_mpi_lset(ptr noundef nonnull %73, i64 noundef 1) #5
  %.not66 = icmp eq i32 %74, 0
  br i1 %.not66, label %77, label %75

75:                                               ; preds = %67
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %74)
  br label %126

77:                                               ; preds = %67
  %78 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %72, ptr noundef nonnull %7, i64 noundef 66) #5
  %.not67 = icmp eq i32 %78, 0
  br i1 %.not67, label %81, label %79

79:                                               ; preds = %77
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %78)
  br label %126

81:                                               ; preds = %77
  %82 = getelementptr inbounds i8, ptr %4, i64 368
  %83 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %82, ptr noundef nonnull %8, i64 noundef 66) #5
  %.not68 = icmp eq i32 %83, 0
  br i1 %.not68, label %86, label %84

84:                                               ; preds = %81
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %83)
  br label %126

86:                                               ; preds = %81
  %87 = getelementptr inbounds i8, ptr %4, i64 416
  %88 = call i32 @mbedtls_ecdh_compute_shared(ptr noundef nonnull %4, ptr noundef nonnull %87, ptr noundef nonnull %72, ptr noundef nonnull %53, ptr noundef nonnull @mbedtls_ctr_drbg_random, ptr noundef nonnull %6) #5
  %.not69 = icmp eq i32 %88, 0
  br i1 %.not69, label %92, label %89

89:                                               ; preds = %86
  %90 = sub nsw i32 0, %88
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %90)
  br label %126

92:                                               ; preds = %86
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %95 = load ptr, ptr @stdout, align 8, !tbaa !5
  %96 = call i32 @fflush(ptr noundef %95)
  %97 = getelementptr inbounds i8, ptr %3, i64 344
  %98 = getelementptr inbounds i8, ptr %3, i64 392
  %99 = call i32 @mbedtls_mpi_lset(ptr noundef nonnull %98, i64 noundef 1) #5
  %.not70 = icmp eq i32 %99, 0
  br i1 %.not70, label %102, label %100

100:                                              ; preds = %92
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %99)
  br label %126

102:                                              ; preds = %92
  %103 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %97, ptr noundef nonnull %9, i64 noundef 66) #5
  %.not71 = icmp eq i32 %103, 0
  br i1 %.not71, label %106, label %104

104:                                              ; preds = %102
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %103)
  br label %126

106:                                              ; preds = %102
  %107 = getelementptr inbounds i8, ptr %3, i64 368
  %108 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %107, ptr noundef nonnull %10, i64 noundef 66) #5
  %.not72 = icmp eq i32 %108, 0
  br i1 %.not72, label %111, label %109

109:                                              ; preds = %106
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %108)
  br label %126

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %3, i64 416
  %113 = call i32 @mbedtls_ecdh_compute_shared(ptr noundef nonnull %3, ptr noundef nonnull %112, ptr noundef nonnull %97, ptr noundef nonnull %30, ptr noundef nonnull @mbedtls_ctr_drbg_random, ptr noundef nonnull %6) #5
  %.not73 = icmp eq i32 %113, 0
  br i1 %.not73, label %116, label %114

114:                                              ; preds = %111
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %113)
  br label %126

116:                                              ; preds = %111
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %119 = load ptr, ptr @stdout, align 8, !tbaa !5
  %120 = call i32 @fflush(ptr noundef %119)
  %121 = call i32 @mbedtls_mpi_cmp_mpi(ptr noundef nonnull %112, ptr noundef nonnull %87) #5
  %.not74 = icmp eq i32 %121, 0
  br i1 %.not74, label %124, label %122

122:                                              ; preds = %116
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %121)
  br label %126

124:                                              ; preds = %116
  %125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %128

126:                                              ; preds = %19, %27, %33, %37, %42, %50, %56, %60, %65, %75, %79, %84, %89, %100, %104, %109, %114, %122
  %.0.ph = phi i32 [ %121, %122 ], [ %113, %114 ], [ %108, %109 ], [ %103, %104 ], [ %99, %100 ], [ %88, %89 ], [ %83, %84 ], [ %78, %79 ], [ %74, %75 ], [ %64, %65 ], [ %59, %60 ], [ %55, %56 ], [ %49, %50 ], [ %41, %42 ], [ %36, %37 ], [ %32, %33 ], [ %26, %27 ], [ %18, %19 ]
  call void @mbedtls_strerror(i32 noundef %.0.ph, ptr noundef nonnull %12, i64 noundef 80) #5
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull %12)
  br label %128

128:                                              ; preds = %124, %126
  %129 = phi i32 [ 1, %126 ], [ 0, %124 ]
  call void @mbedtls_ecdh_free(ptr noundef nonnull %4) #5
  call void @mbedtls_ecdh_free(ptr noundef nonnull %3) #5
  call void @mbedtls_ctr_drbg_free(ptr noundef nonnull %6) #5
  call void @mbedtls_entropy_free(ptr noundef nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 66, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 66, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 66, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 66, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 344, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 616, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 616, ptr nonnull %3) #5
  ret i32 %129
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @mbedtls_ecdh_init(ptr noundef) local_unnamed_addr #3

declare void @mbedtls_ctr_drbg_init(ptr noundef) local_unnamed_addr #3

declare void @mbedtls_entropy_init(ptr noundef) local_unnamed_addr #3

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

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

declare i32 @mbedtls_ctr_drbg_seed(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @mbedtls_entropy_func(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_ecp_group_load(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @mbedtls_ecdh_gen_public(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @mbedtls_ctr_drbg_random(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @mbedtls_mpi_write_binary(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @mbedtls_mpi_lset(ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @mbedtls_mpi_read_binary(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @mbedtls_ecdh_compute_shared(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @mbedtls_mpi_cmp_mpi(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare void @mbedtls_ecdh_free(ptr noundef) local_unnamed_addr #3

declare void @mbedtls_ctr_drbg_free(ptr noundef) local_unnamed_addr #3

declare void @mbedtls_entropy_free(ptr noundef) local_unnamed_addr #3

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass