; LLVM IR from tleonhardt/practical_cryptography_engineering :: sodium (nacl_verify)

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

@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 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 ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca [32 x i8], align 16
  %15 = alloca [65 x i8], align 16
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, 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 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !9
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp ne i32 %22, 3
  br i1 %23, label %24, label %29

24:                                               ; preds = %2
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 0
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %27)
  br label %138

29:                                               ; preds = %2
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 1
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  store ptr %32, ptr %11, align 8, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds ptr, ptr %33, i64 2
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  store ptr %35, ptr %12, align 8, !tbaa !9
  %36 = call i32 @sodium_init()
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %29
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %166

40:                                               ; preds = %29
  %41 = load ptr, ptr %11, align 8, !tbaa !9
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %41)
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = call noalias ptr @fopen(ptr noundef %43, ptr noundef @.str.3)
  store ptr %44, ptr %7, align 8, !tbaa !9
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = icmp eq ptr null, %45
  br i1 %46, label %47, label %50

47:                                               ; preds = %40
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %48)
  br label %138

50:                                               ; preds = %40
  %51 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  %52 = load ptr, ptr %7, align 8, !tbaa !9
  %53 = call i64 @fread(ptr noundef %51, i64 noundef 1, i64 noundef 32, ptr noundef %52)
  store i64 %53, ptr %16, align 8, !tbaa !11
  %54 = load i64, ptr %16, align 8, !tbaa !11
  %55 = icmp ne i64 32, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %50
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %138

58:                                               ; preds = %50
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %60 = getelementptr inbounds [65 x i8], ptr %15, i64 0, i64 0
  %61 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  %62 = call ptr @sodium_bin2hex(ptr noundef %60, i64 noundef 65, ptr noundef %61, i64 noundef 32)
  %63 = getelementptr inbounds [65 x i8], ptr %15, i64 0, i64 0
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %63)
  %65 = load ptr, ptr %12, align 8, !tbaa !9
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %65)
  %67 = load ptr, ptr %12, align 8, !tbaa !9
  %68 = call noalias ptr @fopen(ptr noundef %67, ptr noundef @.str.3)
  store ptr %68, ptr %8, align 8, !tbaa !9
  %69 = load ptr, ptr %8, align 8, !tbaa !9
  %70 = icmp eq ptr null, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %58
  %72 = load ptr, ptr %12, align 8, !tbaa !9
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %72)
  br label %138

74:                                               ; preds = %58
  %75 = load ptr, ptr %8, align 8, !tbaa !9
  %76 = call i32 @fileno(ptr noundef %75) #6
  %77 = call i64 @lseek(i32 noundef %76, i64 noundef 0, i32 noundef 2) #6
  store i64 %77, ptr %17, align 8, !tbaa !11
  %78 = icmp slt i64 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %74
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %138

81:                                               ; preds = %74
  %82 = load i64, ptr %17, align 8, !tbaa !11
  store i64 %82, ptr %18, align 8, !tbaa !11
  %83 = load i64, ptr %18, align 8, !tbaa !11
  %84 = icmp ult i64 %83, 64
  br i1 %84, label %85, label %87

85:                                               ; preds = %81
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %138

87:                                               ; preds = %81
  %88 = load ptr, ptr %8, align 8, !tbaa !9
  %89 = call i32 @fseek(ptr noundef %88, i64 noundef 0, i32 noundef 0)
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %93

91:                                               ; preds = %87
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %138

93:                                               ; preds = %87
  %94 = load i64, ptr %18, align 8, !tbaa !11
  store i64 %94, ptr %19, align 8, !tbaa !13
  %95 = load i64, ptr %19, align 8, !tbaa !13
  %96 = sub i64 %95, 64
  store i64 %96, ptr %20, align 8, !tbaa !13
  %97 = load i64, ptr %20, align 8, !tbaa !13
  %98 = add i64 %97, 1
  %99 = call noalias ptr @malloc(i64 noundef %98) #7
  store ptr %99, ptr %9, align 8, !tbaa !9
  %100 = load i64, ptr %19, align 8, !tbaa !13
  %101 = add i64 %100, 1
  %102 = call noalias ptr @malloc(i64 noundef %101) #7
  store ptr %102, ptr %10, align 8, !tbaa !9
  %103 = load ptr, ptr %10, align 8, !tbaa !9
  %104 = load i64, ptr %19, align 8, !tbaa !13
  %105 = load ptr, ptr %8, align 8, !tbaa !9
  %106 = call i64 @fread(ptr noundef %103, i64 noundef 1, i64 noundef %104, ptr noundef %105)
  store i64 %106, ptr %16, align 8, !tbaa !11
  %107 = load i64, ptr %19, align 8, !tbaa !13
  %108 = load i64, ptr %16, align 8, !tbaa !11
  %109 = icmp ne i64 %107, %108
  br i1 %109, label %110, label %112

110:                                              ; preds = %93
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %138

112:                                              ; preds = %93
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i64 0, ptr %21, align 8, !tbaa !13
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %115 = load ptr, ptr %9, align 8, !tbaa !9
  %116 = load ptr, ptr %10, align 8, !tbaa !9
  %117 = load i64, ptr %19, align 8, !tbaa !13
  %118 = getelementptr inbounds [32 x i8], ptr %14, i64 0, i64 0
  %119 = call i32 @crypto_sign_open(ptr noundef %115, ptr noundef %21, ptr noundef %116, i64 noundef %117, ptr noundef %118)
  store i32 %119, ptr %6, align 4, !tbaa !5
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = icmp ne i32 0, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %112
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %138

124:                                              ; preds = %112
  %125 = load i64, ptr %21, align 8, !tbaa !13
  %126 = load i64, ptr %20, align 8, !tbaa !13
  %127 = icmp ne i64 %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %124
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  br label %130

130:                                              ; preds = %128, %124
  br label %131

131:                                              ; preds = %130
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = load i64, ptr %20, align 8, !tbaa !13
  %135 = getelementptr inbounds i8, ptr %133, i64 %134
  store i8 0, ptr %135, align 1, !tbaa !15
  %136 = load ptr, ptr %9, align 8, !tbaa !9
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %136)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %131, %122, %110, %91, %85, %79, %71, %56, %47, %24
  %139 = load ptr, ptr %7, align 8, !tbaa !9
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = load ptr, ptr %7, align 8, !tbaa !9
  %143 = call i32 @fclose(ptr noundef %142)
  br label %144

144:                                              ; preds = %141, %138
  %145 = load ptr, ptr %8, align 8, !tbaa !9
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %150

147:                                              ; preds = %144
  %148 = load ptr, ptr %8, align 8, !tbaa !9
  %149 = call i32 @fclose(ptr noundef %148)
  br label %150

150:                                              ; preds = %147, %144
  %151 = load ptr, ptr %9, align 8, !tbaa !9
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %157

153:                                              ; preds = %150
  %154 = load ptr, ptr %9, align 8, !tbaa !9
  %155 = load i64, ptr %20, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 1 %154, i8 0, i64 %155, i1 false)
  %156 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %156) #6
  br label %157

157:                                              ; preds = %153, %150
  %158 = load ptr, ptr %10, align 8, !tbaa !9
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %164

160:                                              ; preds = %157
  %161 = load ptr, ptr %10, align 8, !tbaa !9
  %162 = load i64, ptr %19, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 1 %161, i8 0, i64 %162, i1 false)
  %163 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %163) #6
  br label %164

164:                                              ; preds = %160, %157
  %165 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %165, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %166

166:                                              ; preds = %164, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %167 = load i32, ptr %3, align 4
  ret i32 %167
}

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

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

declare i32 @sodium_init() #2

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

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

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

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind
declare i32 @fileno(ptr noundef) #3

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare i32 @crypto_sign_open(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i32 @fclose(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) #5

; Function Attrs: nounwind
declare void @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 = { "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 "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 allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!7, !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"

@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [32 x i8], align 16
  %4 = alloca [65 x i8], align 16
  %5 = alloca i64, align 8
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %9, label %6

6:                                                ; preds = %2
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %7)
  br label %.thread129

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = tail call i32 @sodium_init() #6
  %15 = icmp slt i32 %14, 0
  br i1 %15, label %16, label %18

16:                                               ; preds = %9
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.thread129

18:                                               ; preds = %9
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %11)
  %20 = tail call noalias ptr @fopen(ptr noundef %11, ptr noundef nonnull @.str.3)
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %18
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %11)
  br label %.thread129

24:                                               ; preds = %18
  %25 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 1, i64 noundef 32, ptr noundef nonnull %20)
  %.not60 = icmp eq i64 %25, 32
  br i1 %.not60, label %28, label %26

26:                                               ; preds = %24
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %75

28:                                               ; preds = %24
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %30 = call ptr @sodium_bin2hex(ptr noundef nonnull %4, i64 noundef 65, ptr noundef nonnull %3, i64 noundef 32) #6
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull %4)
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %13)
  %33 = call noalias ptr @fopen(ptr noundef %13, ptr noundef nonnull @.str.3)
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %37

35:                                               ; preds = %28
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %13)
  br label %75

37:                                               ; preds = %28
  %38 = call i32 @fileno(ptr noundef nonnull %33) #6
  %39 = call i64 @lseek(i32 noundef %38, i64 noundef 0, i32 noundef 2) #6
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %37
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %77

43:                                               ; preds = %37
  %44 = icmp ult i64 %39, 64
  br i1 %44, label %45, label %47

45:                                               ; preds = %43
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %77

47:                                               ; preds = %43
  %48 = call i32 @fseek(ptr noundef nonnull %33, i64 noundef 0, i32 noundef 0)
  %49 = icmp slt i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %77

52:                                               ; preds = %47
  %53 = add nsw i64 %39, -64
  %54 = add nsw i64 %39, -63
  %55 = call noalias ptr @malloc(i64 noundef %54) #7
  %56 = add nuw i64 %39, 1
  %57 = call noalias ptr @malloc(i64 noundef %56) #7
  %58 = call i64 @fread(ptr noundef %57, i64 noundef 1, i64 noundef %39, ptr noundef nonnull %33)
  %.not61 = icmp eq i64 %39, %58
  br i1 %.not61, label %61, label %59

59:                                               ; preds = %52
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %77

61:                                               ; preds = %52
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  store i64 0, ptr %5, align 8, !tbaa !9
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %64 = call i32 @crypto_sign_open(ptr noundef %55, ptr noundef nonnull %5, ptr noundef %57, i64 noundef %39, ptr noundef nonnull %3) #6
  %.not62 = icmp eq i32 %64, 0
  br i1 %.not62, label %67, label %65

65:                                               ; preds = %61
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %77

67:                                               ; preds = %61
  %68 = load i64, ptr %5, align 8, !tbaa !9
  %.not63 = icmp eq i64 %68, %53
  br i1 %.not63, label %71, label %69

69:                                               ; preds = %67
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  br label %71

71:                                               ; preds = %67, %69
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %73 = getelementptr inbounds i8, ptr %55, i64 %53
  store i8 0, ptr %73, align 1, !tbaa !11
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %55)
  br label %77

75:                                               ; preds = %35, %26
  %76 = call i32 @fclose(ptr noundef nonnull %20)
  br label %.thread129

77:                                               ; preds = %41, %45, %50, %59, %65, %71
  %.054.ph.ph = phi ptr [ null, %41 ], [ null, %45 ], [ null, %50 ], [ %55, %59 ], [ %55, %65 ], [ %55, %71 ]
  %.053.ph.ph = phi ptr [ null, %41 ], [ null, %45 ], [ null, %50 ], [ %57, %59 ], [ %57, %65 ], [ %57, %71 ]
  %.050.ph.ph = phi i32 [ 1, %41 ], [ 1, %45 ], [ 1, %50 ], [ 1, %59 ], [ %64, %65 ], [ 0, %71 ]
  %78 = call i32 @fclose(ptr noundef nonnull %20)
  %79 = call i32 @fclose(ptr noundef nonnull %33)
  %.not66 = icmp eq ptr %.054.ph.ph, null
  br i1 %.not66, label %81, label %80

80:                                               ; preds = %77
  call void @free(ptr noundef nonnull %.054.ph.ph) #6
  br label %81

81:                                               ; preds = %80, %77
  %.not67 = icmp eq ptr %.053.ph.ph, null
  br i1 %.not67, label %.thread129, label %82

82:                                               ; preds = %81
  call void @free(ptr noundef nonnull %.053.ph.ph) #6
  br label %.thread129

.thread129:                                       ; preds = %75, %6, %22, %81, %82, %16
  %.049 = phi i32 [ 1, %16 ], [ %.050.ph.ph, %82 ], [ %.050.ph.ph, %81 ], [ 1, %75 ], [ 1, %6 ], [ 1, %22 ]
  ret i32 %.049
}

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

declare i32 @sodium_init() local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

declare ptr @sodium_bin2hex(ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

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 = { 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 #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 "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }

!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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass