; LLVM IR from peacemakr-io/peacemakr-core-crypto :: src/core/src (Key)

; 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.PeacemakrKey = type { %struct.crypto_config_t, %union.anon, ptr }
%struct.crypto_config_t = type { i32, i32, i32, i32 }
%union.anon = type { ptr }

@__FUNCTION__.peacemakr_key_new_asymmetric = external hidden unnamed_addr constant [29 x i8], align 1
@.str = external hidden unnamed_addr constant [56 x i8], align 1
@peacemakr_global_malloc = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @peacemakr_key_new_asymmetric(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  %10 = load ptr, ptr %7, align 8, !tbaa !9
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %3
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 151, ptr noundef @.str)
  store ptr null, ptr %4, align 8
  br label %120

13:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %14 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !9
  %15 = call ptr %14(i64 noundef 32)
  store ptr %15, ptr %8, align 8, !tbaa !9
  %16 = load ptr, ptr %8, align 8, !tbaa !9
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %13
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 154, ptr noundef @.str.1)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

19:                                               ; preds = %13
  %20 = load ptr, ptr %8, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.PeacemakrKey, ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %struct.crypto_config_t, ptr %21, i32 0, i32 0
  store i32 1, ptr %22, align 8, !tbaa !11
  %23 = load ptr, ptr %8, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.PeacemakrKey, ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %struct.crypto_config_t, ptr %24, i32 0, i32 1
  store i32 0, ptr %25, align 4, !tbaa !14
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.PeacemakrKey, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.crypto_config_t, ptr %28, i32 0, i32 2
  store i32 %26, ptr %29, align 8, !tbaa !15
  %30 = load ptr, ptr %8, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.PeacemakrKey, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds %struct.crypto_config_t, ptr %31, i32 0, i32 3
  store i32 0, ptr %32, align 4, !tbaa !16
  %33 = load ptr, ptr %8, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.PeacemakrKey, ptr %33, i32 0, i32 1
  store ptr null, ptr %34, align 8, !tbaa !17
  %35 = load ptr, ptr %8, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.PeacemakrKey, ptr %35, i32 0, i32 2
  store ptr null, ptr %36, align 8, !tbaa !18
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %47

39:                                               ; preds = %19
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = icmp uge i32 %40, 1
  br i1 %41, label %42, label %47

42:                                               ; preds = %39
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = icmp ule i32 %43, 2
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 166, ptr noundef @.str.2)
  %46 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %46)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

47:                                               ; preds = %42, %39, %19
  %48 = load ptr, ptr %8, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.PeacemakrKey, ptr %48, i32 0, i32 1
  store ptr null, ptr %49, align 8, !tbaa !17
  %50 = load i32, ptr %5, align 4, !tbaa !5
  switch i32 %50, label %115 [
    i32 0, label %51
    i32 1, label %53
    i32 2, label %66
    i32 3, label %79
    i32 4, label %88
    i32 5, label %97
    i32 6, label %106
  ]

51:                                               ; preds = %47
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 174, ptr noundef @.str.3)
  %52 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %52)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

53:                                               ; preds = %47
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load ptr, ptr %8, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.PeacemakrKey, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.crypto_config_t, ptr %56, i32 0, i32 1
  store i32 %54, ptr %57, align 4, !tbaa !14
  %58 = load ptr, ptr %8, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.PeacemakrKey, ptr %58, i32 0, i32 1
  %60 = call zeroext i1 @keygen_inner(i32 noundef 6, ptr noundef %59, i32 noundef 2048)
  %61 = zext i1 %60 to i32
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %53
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 181, ptr noundef @.str.4)
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %64)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

65:                                               ; preds = %53
  br label %117

66:                                               ; preds = %47
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.PeacemakrKey, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.crypto_config_t, ptr %69, i32 0, i32 1
  store i32 %67, ptr %70, align 4, !tbaa !14
  %71 = load ptr, ptr %8, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.PeacemakrKey, ptr %71, i32 0, i32 1
  %73 = call zeroext i1 @keygen_inner(i32 noundef 6, ptr noundef %72, i32 noundef 4096)
  %74 = zext i1 %73 to i32
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %78

76:                                               ; preds = %66
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 190, ptr noundef @.str.4)
  %77 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %77)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

78:                                               ; preds = %66
  br label %117

79:                                               ; preds = %47
  %80 = load ptr, ptr %8, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.PeacemakrKey, ptr %80, i32 0, i32 1
  %82 = call zeroext i1 @dh_keygen_inner(ptr noundef %81, i32 noundef 0)
  %83 = zext i1 %82 to i32
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %79
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 198, ptr noundef @.str.4)
  %86 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %86)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

87:                                               ; preds = %79
  br label %117

88:                                               ; preds = %47
  %89 = load ptr, ptr %8, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.PeacemakrKey, ptr %89, i32 0, i32 1
  %91 = call zeroext i1 @dh_keygen_inner(ptr noundef %90, i32 noundef 1)
  %92 = zext i1 %91 to i32
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %88
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 206, ptr noundef @.str.4)
  %95 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %95)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

96:                                               ; preds = %88
  br label %117

97:                                               ; preds = %47
  %98 = load ptr, ptr %8, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.PeacemakrKey, ptr %98, i32 0, i32 1
  %100 = call zeroext i1 @dh_keygen_inner(ptr noundef %99, i32 noundef 2)
  %101 = zext i1 %100 to i32
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %105

103:                                              ; preds = %97
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 214, ptr noundef @.str.4)
  %104 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %104)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

105:                                              ; preds = %97
  br label %117

106:                                              ; preds = %47
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.PeacemakrKey, ptr %107, i32 0, i32 1
  %109 = call zeroext i1 @dh_keygen_inner(ptr noundef %108, i32 noundef 3)
  %110 = zext i1 %109 to i32
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %114

112:                                              ; preds = %106
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 222, ptr noundef @.str.4)
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %113)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

114:                                              ; preds = %106
  br label %117

115:                                              ; preds = %47
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 229, ptr noundef @.str.5)
  %116 = load ptr, ptr %8, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %116)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

117:                                              ; preds = %114, %105, %96, %87, %78, %65
  %118 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %118, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

119:                                              ; preds = %117, %115, %112, %103, %94, %85, %76, %63, %51, %45, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %120

120:                                              ; preds = %119, %12
  %121 = load ptr, ptr %4, align 8
  ret ptr %121
}

declare void @log_printf(ptr noundef, i32 noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @peacemakr_key_free(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @keygen_inner(i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @dh_keygen_inner(ptr noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }

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

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


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

@__FUNCTION__.peacemakr_key_new_asymmetric = external hidden unnamed_addr constant [29 x i8], align 1
@.str = external hidden unnamed_addr constant [56 x i8], align 1
@peacemakr_global_malloc = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @peacemakr_key_new_asymmetric(i32 noundef %0, i32 noundef %1, ptr noundef readnone %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %2, null
  br i1 %4, label %5, label %6

5:                                                ; preds = %3
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 151, ptr noundef nonnull @.str) #3
  br label %41

6:                                                ; preds = %3
  %7 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !5
  %8 = tail call ptr %7(i64 noundef 32) #3
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %6
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 154, ptr noundef nonnull @.str.1) #3
  br label %41

11:                                               ; preds = %6
  store i32 1, ptr %8, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 0, ptr %12, align 4, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %0, ptr %13, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %8, i64 12
  %15 = getelementptr inbounds i8, ptr %8, i64 16
  %16 = icmp eq i32 %1, 0
  %17 = add i32 %0, -1
  %18 = icmp ult i32 %17, 2
  %or.cond3 = and i1 %16, %18
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %14, i8 0, i64 20, i1 false)
  br i1 %or.cond3, label %19, label %20

19:                                               ; preds = %11
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 166, ptr noundef nonnull @.str.2) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

20:                                               ; preds = %11
  switch i32 %0, label %40 [
    i32 0, label %21
    i32 1, label %22
    i32 2, label %25
    i32 3, label %28
    i32 4, label %31
    i32 5, label %34
    i32 6, label %37
  ]

21:                                               ; preds = %20
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 174, ptr noundef nonnull @.str.3) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

22:                                               ; preds = %20
  store i32 %1, ptr %12, align 4, !tbaa !13
  %23 = tail call zeroext i1 @keygen_inner(i32 noundef 6, ptr noundef nonnull %15, i32 noundef 2048)
  br i1 %23, label %41, label %24

24:                                               ; preds = %22
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 181, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

25:                                               ; preds = %20
  store i32 %1, ptr %12, align 4, !tbaa !13
  %26 = tail call zeroext i1 @keygen_inner(i32 noundef 6, ptr noundef nonnull %15, i32 noundef 4096)
  br i1 %26, label %41, label %27

27:                                               ; preds = %25
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 190, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

28:                                               ; preds = %20
  %29 = tail call zeroext i1 @dh_keygen_inner(ptr noundef nonnull %15, i32 noundef 0)
  br i1 %29, label %41, label %30

30:                                               ; preds = %28
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 198, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

31:                                               ; preds = %20
  %32 = tail call zeroext i1 @dh_keygen_inner(ptr noundef nonnull %15, i32 noundef 1)
  br i1 %32, label %41, label %33

33:                                               ; preds = %31
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 206, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

34:                                               ; preds = %20
  %35 = tail call zeroext i1 @dh_keygen_inner(ptr noundef nonnull %15, i32 noundef 2)
  br i1 %35, label %41, label %36

36:                                               ; preds = %34
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 214, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

37:                                               ; preds = %20
  %38 = tail call zeroext i1 @dh_keygen_inner(ptr noundef nonnull %15, i32 noundef 3)
  br i1 %38, label %41, label %39

39:                                               ; preds = %37
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 222, ptr noundef nonnull @.str.4) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

40:                                               ; preds = %20
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_asymmetric, i32 noundef 229, ptr noundef nonnull @.str.5) #3
  tail call void @peacemakr_key_free(ptr noundef nonnull %8)
  br label %41

41:                                               ; preds = %10, %19, %21, %24, %27, %30, %33, %36, %39, %40, %37, %34, %31, %28, %25, %22, %5
  %.1 = phi ptr [ null, %5 ], [ null, %10 ], [ null, %19 ], [ null, %40 ], [ null, %39 ], [ null, %36 ], [ null, %33 ], [ null, %30 ], [ null, %27 ], [ null, %24 ], [ null, %21 ], [ %8, %37 ], [ %8, %34 ], [ %8, %31 ], [ %8, %28 ], [ %8, %25 ], [ %8, %22 ]
  ret ptr %.1
}

declare void @log_printf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @keygen_inner(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @dh_keygen_inner(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind }

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass