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

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

@peacemakr_global_malloc = external global ptr, align 8
@__FUNCTION__.ciphertext_blob_new = external hidden unnamed_addr constant [20 x i8], align 1
@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ciphertext_blob_new(i64 %0, i64 %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i64 noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca %struct.crypto_config_t, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  store i64 %0, ptr %17, align 4
  %18 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  store i64 %1, ptr %18, align 4
  store i64 %2, ptr %10, align 8, !tbaa !5
  store i64 %3, ptr %11, align 8, !tbaa !5
  store i64 %4, ptr %12, align 8, !tbaa !5
  store i64 %5, ptr %13, align 8, !tbaa !5
  store i64 %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %19 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !9
  %20 = call ptr %19(i64 noundef 72)
  store ptr %20, ptr %15, align 8, !tbaa !9
  %21 = load ptr, ptr %15, align 8, !tbaa !9
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %7
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 44, ptr noundef @.str)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

24:                                               ; preds = %7
  %25 = load ptr, ptr %15, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.CiphertextBlob, ptr %25, i32 0, i32 5
  store ptr null, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr %15, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.CiphertextBlob, ptr %27, i32 0, i32 6
  store ptr null, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr %15, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.CiphertextBlob, ptr %29, i32 0, i32 7
  store ptr null, ptr %30, align 8, !tbaa !15
  %31 = load ptr, ptr %15, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.CiphertextBlob, ptr %31, i32 0, i32 8
  store ptr null, ptr %32, align 8, !tbaa !16
  %33 = load ptr, ptr %15, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.CiphertextBlob, ptr %33, i32 0, i32 9
  store ptr null, ptr %34, align 8, !tbaa !17
  %35 = load ptr, ptr %15, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.CiphertextBlob, ptr %35, i32 0, i32 10
  store ptr null, ptr %36, align 8, !tbaa !18
  %37 = load ptr, ptr %15, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.CiphertextBlob, ptr %37, i32 0, i32 0
  store i32 1, ptr %38, align 8, !tbaa !19
  %39 = load ptr, ptr %15, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.CiphertextBlob, ptr %39, i32 0, i32 5
  store ptr null, ptr %40, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.crypto_config_t, ptr %9, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !20
  %43 = load ptr, ptr %15, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.CiphertextBlob, ptr %43, i32 0, i32 1
  store i32 %42, ptr %44, align 4, !tbaa !22
  %45 = getelementptr inbounds %struct.crypto_config_t, ptr %9, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !23
  %47 = load ptr, ptr %15, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.CiphertextBlob, ptr %47, i32 0, i32 2
  store i32 %46, ptr %48, align 8, !tbaa !24
  %49 = getelementptr inbounds %struct.crypto_config_t, ptr %9, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !25
  %51 = load ptr, ptr %15, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.CiphertextBlob, ptr %51, i32 0, i32 3
  store i32 %50, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds %struct.crypto_config_t, ptr %9, i32 0, i32 3
  %54 = load i32, ptr %53, align 4, !tbaa !27
  %55 = load ptr, ptr %15, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.CiphertextBlob, ptr %55, i32 0, i32 4
  store i32 %54, ptr %56, align 8, !tbaa !28
  %57 = load ptr, ptr %15, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.CiphertextBlob, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !22
  switch i32 %59, label %87 [
    i32 0, label %87
    i32 1, label %60
  ]

60:                                               ; preds = %24
  %61 = getelementptr inbounds %struct.crypto_config_t, ptr %9, i32 0, i32 2
  %62 = load i32, ptr %61, align 4, !tbaa !25
  switch i32 %62, label %85 [
    i32 0, label %86
    i32 1, label %63
    i32 2, label %74
  ]

63:                                               ; preds = %60
  %64 = call ptr @buffer_new(i64 noundef 256)
  %65 = load ptr, ptr %15, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.CiphertextBlob, ptr %65, i32 0, i32 5
  store ptr %64, ptr %66, align 8, !tbaa !11
  %67 = load ptr, ptr %15, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.CiphertextBlob, ptr %67, i32 0, i32 5
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %73

71:                                               ; preds = %63
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 71, ptr noundef @.str.1)
  %72 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %72)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

73:                                               ; preds = %63
  br label %86

74:                                               ; preds = %60
  %75 = call ptr @buffer_new(i64 noundef 512)
  %76 = load ptr, ptr %15, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.CiphertextBlob, ptr %76, i32 0, i32 5
  store ptr %75, ptr %77, align 8, !tbaa !11
  %78 = load ptr, ptr %15, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.CiphertextBlob, ptr %78, i32 0, i32 5
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = icmp eq ptr %80, null
  br i1 %81, label %82, label %84

82:                                               ; preds = %74
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 77, ptr noundef @.str.1)
  %83 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %83)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

84:                                               ; preds = %74
  br label %86

85:                                               ; preds = %60
  br label %86

86:                                               ; preds = %85, %84, %73, %60
  br label %87

87:                                               ; preds = %86, %24, %24
  %88 = load i64, ptr %10, align 8, !tbaa !5
  %89 = call ptr @buffer_new(i64 noundef %88)
  %90 = load ptr, ptr %15, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.CiphertextBlob, ptr %90, i32 0, i32 6
  store ptr %89, ptr %91, align 8, !tbaa !14
  %92 = load ptr, ptr %15, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.CiphertextBlob, ptr %92, i32 0, i32 6
  %94 = load ptr, ptr %93, align 8, !tbaa !14
  %95 = icmp ne ptr %94, null
  br i1 %95, label %101, label %96

96:                                               ; preds = %87
  %97 = load i64, ptr %10, align 8, !tbaa !5
  %98 = icmp eq i64 %97, 0
  br i1 %98, label %101, label %99

99:                                               ; preds = %96
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 89, ptr noundef @.str.2)
  %100 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %100)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

101:                                              ; preds = %96, %87
  %102 = load i64, ptr %11, align 8, !tbaa !5
  %103 = call ptr @buffer_new(i64 noundef %102)
  %104 = load ptr, ptr %15, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.CiphertextBlob, ptr %104, i32 0, i32 7
  store ptr %103, ptr %105, align 8, !tbaa !15
  %106 = load ptr, ptr %15, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.CiphertextBlob, ptr %106, i32 0, i32 7
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = icmp ne ptr %108, null
  br i1 %109, label %115, label %110

110:                                              ; preds = %101
  %111 = load i64, ptr %11, align 8, !tbaa !5
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %115, label %113

113:                                              ; preds = %110
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 93, ptr noundef @.str.3)
  %114 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %114)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

115:                                              ; preds = %110, %101
  %116 = load i64, ptr %12, align 8, !tbaa !5
  %117 = call ptr @buffer_new(i64 noundef %116)
  %118 = load ptr, ptr %15, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.CiphertextBlob, ptr %118, i32 0, i32 8
  store ptr %117, ptr %119, align 8, !tbaa !16
  %120 = load ptr, ptr %15, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.CiphertextBlob, ptr %120, i32 0, i32 8
  %122 = load ptr, ptr %121, align 8, !tbaa !16
  %123 = icmp ne ptr %122, null
  br i1 %123, label %129, label %124

124:                                              ; preds = %115
  %125 = load i64, ptr %12, align 8, !tbaa !5
  %126 = icmp eq i64 %125, 0
  br i1 %126, label %129, label %127

127:                                              ; preds = %124
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 97, ptr noundef @.str.4)
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %128)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

129:                                              ; preds = %124, %115
  %130 = load i64, ptr %13, align 8, !tbaa !5
  %131 = call ptr @buffer_new(i64 noundef %130)
  %132 = load ptr, ptr %15, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.CiphertextBlob, ptr %132, i32 0, i32 9
  store ptr %131, ptr %133, align 8, !tbaa !17
  %134 = load ptr, ptr %15, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.CiphertextBlob, ptr %134, i32 0, i32 9
  %136 = load ptr, ptr %135, align 8, !tbaa !17
  %137 = icmp ne ptr %136, null
  br i1 %137, label %143, label %138

138:                                              ; preds = %129
  %139 = load i64, ptr %13, align 8, !tbaa !5
  %140 = icmp eq i64 %139, 0
  br i1 %140, label %143, label %141

141:                                              ; preds = %138
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 101, ptr noundef @.str.5)
  %142 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %142)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

143:                                              ; preds = %138, %129
  %144 = load i64, ptr %14, align 8, !tbaa !5
  %145 = call ptr @buffer_new(i64 noundef %144)
  %146 = load ptr, ptr %15, align 8, !tbaa !9
  %147 = getelementptr inbounds %struct.CiphertextBlob, ptr %146, i32 0, i32 10
  store ptr %145, ptr %147, align 8, !tbaa !18
  %148 = load ptr, ptr %15, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.CiphertextBlob, ptr %148, i32 0, i32 10
  %150 = load ptr, ptr %149, align 8, !tbaa !18
  %151 = icmp ne ptr %150, null
  br i1 %151, label %157, label %152

152:                                              ; preds = %143
  %153 = load i64, ptr %14, align 8, !tbaa !5
  %154 = icmp eq i64 %153, 0
  br i1 %154, label %157, label %155

155:                                              ; preds = %152
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.ciphertext_blob_new, i32 noundef 105, ptr noundef @.str.6)
  %156 = load ptr, ptr %15, align 8, !tbaa !9
  call void @ciphertext_blob_free(ptr noundef %156)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

157:                                              ; preds = %152, %143
  %158 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %158, ptr %8, align 8
  store i32 1, ptr %16, align 4
  br label %159

159:                                              ; preds = %157, %155, %141, %127, %113, %99, %82, %71, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  %160 = load ptr, ptr %8, align 8
  ret ptr %160
}

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

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

declare ptr @buffer_new(i64 noundef) #2

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"CiphertextBlob", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !10, i64 32}
!15 = !{!12, !10, i64 40}
!16 = !{!12, !10, i64 48}
!17 = !{!12, !10, i64 56}
!18 = !{!12, !10, i64 64}
!19 = !{!12, !13, i64 0}
!20 = !{!21, !13, i64 0}
!21 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!22 = !{!12, !13, i64 4}
!23 = !{!21, !13, i64 4}
!24 = !{!12, !13, i64 8}
!25 = !{!21, !13, i64 8}
!26 = !{!12, !13, i64 12}
!27 = !{!21, !13, i64 12}
!28 = !{!12, !13, i64 16}


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

@peacemakr_global_malloc = external local_unnamed_addr global ptr, align 8
@__FUNCTION__.ciphertext_blob_new = external hidden unnamed_addr constant [20 x i8], align 1
@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ciphertext_blob_new(i64 %0, i64 %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, i64 noundef %6) local_unnamed_addr #0 {
  %.sroa.3.8.extract.trunc = trunc i64 %1 to i32
  %8 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !5
  %9 = tail call ptr %8(i64 noundef 72) #3
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %7
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 44, ptr noundef nonnull @.str) #3
  br label %58

12:                                               ; preds = %7
  %.sroa.6.8.extract.shift = lshr i64 %1, 32
  %.sroa.6.8.extract.trunc = trunc nuw i64 %.sroa.6.8.extract.shift to i32
  %.sroa.2.0.extract.shift = lshr i64 %0, 32
  %.sroa.2.0.extract.trunc = trunc nuw i64 %.sroa.2.0.extract.shift to i32
  %.sroa.0.0.extract.trunc = trunc i64 %0 to i32
  %13 = getelementptr inbounds i8, ptr %9, i64 24
  %14 = getelementptr inbounds i8, ptr %9, i64 32
  %15 = getelementptr inbounds i8, ptr %9, i64 40
  %16 = getelementptr inbounds i8, ptr %9, i64 48
  %17 = getelementptr inbounds i8, ptr %9, i64 56
  %18 = getelementptr inbounds i8, ptr %9, i64 64
  %19 = getelementptr inbounds i8, ptr %9, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %19, i8 0, i64 40, i1 false)
  store i32 1, ptr %9, align 8, !tbaa !9
  store ptr null, ptr %13, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 %.sroa.0.0.extract.trunc, ptr %20, align 4, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %.sroa.2.0.extract.trunc, ptr %21, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 %.sroa.3.8.extract.trunc, ptr %22, align 4, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %9, i64 16
  store i32 %.sroa.6.8.extract.trunc, ptr %23, align 8, !tbaa !16
  %cond = icmp eq i32 %.sroa.0.0.extract.trunc, 1
  br i1 %cond, label %24, label %33

24:                                               ; preds = %12
  switch i32 %.sroa.3.8.extract.trunc, label %33 [
    i32 2, label %29
    i32 1, label %25
  ]

25:                                               ; preds = %24
  %26 = tail call ptr @buffer_new(i64 noundef 256) #3
  store ptr %26, ptr %13, align 8, !tbaa !12
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %33

28:                                               ; preds = %25
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 71, ptr noundef nonnull @.str.1) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

29:                                               ; preds = %24
  %30 = tail call ptr @buffer_new(i64 noundef 512) #3
  store ptr %30, ptr %13, align 8, !tbaa !12
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 77, ptr noundef nonnull @.str.1) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

33:                                               ; preds = %25, %29, %24, %12
  %34 = tail call ptr @buffer_new(i64 noundef %2) #3
  store ptr %34, ptr %14, align 8, !tbaa !17
  %35 = icmp ne ptr %34, null
  %36 = icmp eq i64 %2, 0
  %or.cond = or i1 %36, %35
  br i1 %or.cond, label %38, label %37

37:                                               ; preds = %33
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 89, ptr noundef nonnull @.str.2) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

38:                                               ; preds = %33
  %39 = tail call ptr @buffer_new(i64 noundef %3) #3
  store ptr %39, ptr %15, align 8, !tbaa !18
  %40 = icmp ne ptr %39, null
  %41 = icmp eq i64 %3, 0
  %or.cond3 = or i1 %41, %40
  br i1 %or.cond3, label %43, label %42

42:                                               ; preds = %38
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 93, ptr noundef nonnull @.str.3) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

43:                                               ; preds = %38
  %44 = tail call ptr @buffer_new(i64 noundef %4) #3
  store ptr %44, ptr %16, align 8, !tbaa !19
  %45 = icmp ne ptr %44, null
  %46 = icmp eq i64 %4, 0
  %or.cond5 = or i1 %46, %45
  br i1 %or.cond5, label %48, label %47

47:                                               ; preds = %43
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 97, ptr noundef nonnull @.str.4) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

48:                                               ; preds = %43
  %49 = tail call ptr @buffer_new(i64 noundef %5) #3
  store ptr %49, ptr %17, align 8, !tbaa !20
  %50 = icmp ne ptr %49, null
  %51 = icmp eq i64 %5, 0
  %or.cond7 = or i1 %51, %50
  br i1 %or.cond7, label %53, label %52

52:                                               ; preds = %48
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 101, ptr noundef nonnull @.str.5) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

53:                                               ; preds = %48
  %54 = tail call ptr @buffer_new(i64 noundef %6) #3
  store ptr %54, ptr %18, align 8, !tbaa !21
  %55 = icmp ne ptr %54, null
  %56 = icmp eq i64 %6, 0
  %or.cond9 = or i1 %56, %55
  br i1 %or.cond9, label %58, label %57

57:                                               ; preds = %53
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.ciphertext_blob_new, i32 noundef 105, ptr noundef nonnull @.str.6) #3
  tail call void @ciphertext_blob_free(ptr noundef nonnull %9)
  br label %58

58:                                               ; preds = %53, %57, %52, %47, %42, %37, %32, %28, %11
  %.0 = phi ptr [ null, %11 ], [ null, %57 ], [ null, %52 ], [ null, %47 ], [ null, %42 ], [ null, %37 ], [ null, %28 ], [ null, %32 ], [ %9, %53 ]
  ret ptr %.0
}

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

declare ptr @buffer_new(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @ciphertext_blob_free(ptr 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, !11, i64 0}
!10 = !{!"CiphertextBlob", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 24}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !11, i64 12}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !6, i64 32}
!18 = !{!10, !6, i64 40}
!19 = !{!10, !6, i64 48}
!20 = !{!10, !6, i64 56}
!21 = !{!10, !6, i64 64}


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