; LLVM IR from square/subzero :: core/trezor-crypto/tools (bip39bruteforce)

; 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.curve_info = type { ptr, ptr, i32, i32, i32, i32 }
%struct.HDNode = type { i32, i32, [32 x i8], [32 x i8], [32 x i8], [33 x i8], ptr }

@count = external dso_local global i32, align 4
@found = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [30 x i8], align 1
@secp256k1_info = external constant %struct.curve_info, align 8
@addr = external dso_local global [21 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@start = external dso_local global i64, align 8
@iter = external dso_local global [256 x i8], align 16
@stdin = external global ptr, align 8
@seed = external dso_local global [64 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@SECP256K1_NAME = external constant [0 x i8], align 1
@node = external dso_local global %struct.HDNode, align 8
@pubkeyhash = external dso_local global [20 x i8], align 16
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 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 ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  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
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = icmp ne i32 %12, 2
  br i1 %13, label %14, label %20

14:                                               ; preds = %2
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 3
  br i1 %16, label %17, label %20

17:                                               ; preds = %14
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str) #5
  store i32 1, ptr %3, align 4
  br label %119

20:                                               ; preds = %14, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = getelementptr inbounds ptr, ptr %21, i64 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp eq i32 %24, 3
  br i1 %25, label %26, label %30

26:                                               ; preds = %20
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 2
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %29, ptr %7, align 8, !tbaa !9
  store ptr @.str.1, ptr %8, align 8, !tbaa !9
  br label %31

30:                                               ; preds = %20
  store ptr null, ptr %7, align 8, !tbaa !9
  store ptr @.str.2, ptr %8, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %30, %26
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %42

34:                                               ; preds = %31
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = call i32 @mnemonic_check(ptr noundef %35)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %42, label %38

38:                                               ; preds = %34
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.3, ptr noundef %40) #5
  store i32 2, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %118

42:                                               ; preds = %34, %31
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  %44 = load i32, ptr getelementptr inbounds (%struct.curve_info, ptr @secp256k1_info, i32 0, i32 2), align 8, !tbaa !11
  %45 = call i32 @ecdsa_address_decode(ptr noundef %43, i32 noundef 0, i32 noundef %44, ptr noundef @addr)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %51, label %47

47:                                               ; preds = %42
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !9
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.4, ptr noundef %49) #5
  store i32 3, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %118

51:                                               ; preds = %42
  %52 = load ptr, ptr %8, align 8, !tbaa !9
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %52)
  %54 = call i64 @clock() #5
  store i64 %54, ptr @start, align 8, !tbaa !13
  br label %55

55:                                               ; preds = %92, %90, %51
  %56 = load ptr, ptr @stdin, align 8, !tbaa !9
  %57 = call ptr @fgets(ptr noundef @iter, i32 noundef 256, ptr noundef %56)
  %58 = icmp eq ptr %57, null
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  br label %93

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %61 = call i64 @strlen(ptr noundef @iter) #6
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %10, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = icmp sle i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  store i32 3, ptr %9, align 4
  br label %90

66:                                               ; preds = %60
  %67 = load i32, ptr @count, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr @count, align 4, !tbaa !5
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [256 x i8], ptr @iter, i64 0, i64 %71
  store i8 0, ptr %72, align 1, !tbaa !15
  %73 = load ptr, ptr %7, align 8, !tbaa !9
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %77

75:                                               ; preds = %66
  %76 = load ptr, ptr %7, align 8, !tbaa !9
  call void @mnemonic_to_seed(ptr noundef %76, ptr noundef @iter, ptr noundef @seed, ptr noundef null)
  br label %78

77:                                               ; preds = %66
  call void @mnemonic_to_seed(ptr noundef @iter, ptr noundef @.str.6, ptr noundef @seed, ptr noundef null)
  br label %78

78:                                               ; preds = %77, %75
  %79 = call i32 @hdnode_from_seed(ptr noundef @seed, i32 noundef 64, ptr noundef @SECP256K1_NAME, ptr noundef @node)
  %80 = call i32 @hdnode_private_ckd(ptr noundef @node, i32 noundef -2147483604)
  %81 = call i32 @hdnode_private_ckd(ptr noundef @node, i32 noundef -2147483648)
  %82 = call i32 @hdnode_private_ckd(ptr noundef @node, i32 noundef -2147483648)
  %83 = call i32 @hdnode_private_ckd(ptr noundef @node, i32 noundef 0)
  %84 = call i32 @hdnode_private_ckd(ptr noundef @node, i32 noundef 0)
  call void @hdnode_fill_public_key(ptr noundef @node)
  %85 = load i32, ptr getelementptr inbounds (%struct.curve_info, ptr @secp256k1_info, i32 0, i32 4), align 8, !tbaa !16
  call void @ecdsa_get_pubkeyhash(ptr noundef getelementptr inbounds (%struct.HDNode, ptr @node, i32 0, i32 5), i32 noundef %85, ptr noundef @pubkeyhash)
  %86 = call i32 @memcmp(ptr noundef getelementptr inbounds (i8, ptr @addr, i64 1), ptr noundef @pubkeyhash, i64 noundef 20) #6
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %78
  store i32 1, ptr @found, align 4, !tbaa !5
  store i32 2, ptr %9, align 4
  br label %90

89:                                               ; preds = %78
  store i32 0, ptr %9, align 4
  br label %90

90:                                               ; preds = %89, %88, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %91 = load i32, ptr %9, align 4
  switch i32 %91, label %121 [
    i32 0, label %92
    i32 3, label %55
    i32 2, label %93
  ]

92:                                               ; preds = %90
  br label %55

93:                                               ; preds = %90, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %94 = call i64 @clock() #5
  %95 = load i64, ptr @start, align 8, !tbaa !13
  %96 = sub nsw i64 %94, %95
  %97 = sitofp i64 %96 to float
  %98 = fdiv float %97, 1.000000e+06
  store float %98, ptr %11, align 4, !tbaa !17
  %99 = load i32, ptr @count, align 4, !tbaa !5
  %100 = load ptr, ptr %8, align 8, !tbaa !9
  %101 = load float, ptr %11, align 4, !tbaa !17
  %102 = fpext float %101 to double
  %103 = load i32, ptr @count, align 4, !tbaa !5
  %104 = sitofp i32 %103 to float
  %105 = load float, ptr %11, align 4, !tbaa !17
  %106 = fdiv float %104, %105
  %107 = fpext float %106 to double
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %99, ptr noundef %100, double noundef %102, double noundef %107)
  %109 = load i32, ptr @found, align 4, !tbaa !5
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %114

111:                                              ; preds = %93
  %112 = load ptr, ptr %8, align 8, !tbaa !9
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %112, ptr noundef @iter)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %117

114:                                              ; preds = %93
  %115 = load ptr, ptr %8, align 8, !tbaa !9
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %115)
  store i32 4, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %117

117:                                              ; preds = %114, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %118

118:                                              ; preds = %117, %47, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %119

119:                                              ; preds = %118, %17
  %120 = load i32, ptr %3, align 4
  ret i32 %120

121:                                              ; preds = %90
  unreachable
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr 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

declare i32 @mnemonic_check(ptr noundef) #3

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

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

; Function Attrs: nounwind
declare i64 @clock() #1

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

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

declare void @mnemonic_to_seed(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

declare void @hdnode_fill_public_key(ptr noundef) #3

declare void @ecdsa_get_pubkeyhash(ptr noundef, i32 noundef, ptr noundef) #3

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!12, !6, i64 24}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !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.curve_info = type { ptr, ptr, i32, i32, i32, i32 }
%struct.HDNode = type { i32, i32, [32 x i8], [32 x i8], [32 x i8], [33 x i8], ptr }

@count = external dso_local local_unnamed_addr global i32, align 4
@found = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [30 x i8], align 1
@secp256k1_info = external local_unnamed_addr constant %struct.curve_info, align 8
@addr = external dso_local global [21 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@start = external dso_local local_unnamed_addr global i64, align 8
@iter = external dso_local global [256 x i8], align 16
@stdin = external local_unnamed_addr global ptr, align 8
@seed = external dso_local global [64 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@SECP256K1_NAME = external constant [0 x i8], align 1
@node = external dso_local global %struct.HDNode, align 8
@pubkeyhash = external dso_local global [20 x i8], align 16
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 5) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = add i32 %0, -4
  %or.cond = icmp ult i32 %3, -2
  br i1 %or.cond, label %4, label %7

4:                                                ; preds = %2
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str) #6
  br label %71

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %0, 3
  br i1 %10, label %11, label %.thread

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %.thread, label %14

14:                                               ; preds = %11
  %15 = tail call i32 @mnemonic_check(ptr noundef nonnull %13) #7
  %.not26 = icmp eq i32 %15, 0
  br i1 %.not26, label %16, label %.thread

16:                                               ; preds = %14
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.3, ptr noundef nonnull %13) #6
  br label %71

.thread:                                          ; preds = %7, %14, %11
  %.not34 = phi i1 [ false, %14 ], [ true, %11 ], [ true, %7 ]
  %.02233 = phi ptr [ %13, %14 ], [ null, %11 ], [ null, %7 ]
  %.02432 = phi ptr [ @.str.1, %14 ], [ @.str.1, %11 ], [ @.str.2, %7 ]
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @secp256k1_info, i64 16), align 8, !tbaa !9
  %20 = tail call i32 @ecdsa_address_decode(ptr noundef %9, i32 noundef 0, i32 noundef %19, ptr noundef nonnull @addr) #7
  %.not27 = icmp eq i32 %20, 0
  br i1 %.not27, label %21, label %24

21:                                               ; preds = %.thread
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.4, ptr noundef %9) #6
  br label %71

24:                                               ; preds = %.thread
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull %.02432)
  %26 = tail call i64 @clock() #7
  store i64 %26, ptr @start, align 8, !tbaa !12
  %27 = load ptr, ptr @stdin, align 8, !tbaa !5
  %28 = tail call ptr @fgets(ptr noundef nonnull @iter, i32 noundef 256, ptr noundef %27)
  %29 = icmp eq ptr %28, null
  br i1 %29, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @secp256k1_info, i64 24), align 8
  br label %31

31:                                               ; preds = %.lr.ph, %51
  %32 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @iter) #8
  %33 = trunc i64 %32 to i32
  %34 = icmp slt i32 %33, 1
  br i1 %34, label %51, label %35

35:                                               ; preds = %31
  %36 = load i32, ptr @count, align 4, !tbaa !14
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @count, align 4, !tbaa !14
  %38 = add i64 %32, 4294967295
  %39 = and i64 %38, 4294967295
  %40 = getelementptr inbounds [256 x i8], ptr @iter, i64 0, i64 %39
  store i8 0, ptr %40, align 1, !tbaa !15
  br i1 %.not34, label %42, label %41

41:                                               ; preds = %35
  tail call void @mnemonic_to_seed(ptr noundef nonnull %.02233, ptr noundef nonnull @iter, ptr noundef nonnull @seed, ptr noundef null) #7
  br label %43

42:                                               ; preds = %35
  tail call void @mnemonic_to_seed(ptr noundef nonnull @iter, ptr noundef nonnull @.str.6, ptr noundef nonnull @seed, ptr noundef null) #7
  br label %43

43:                                               ; preds = %42, %41
  %44 = tail call i32 @hdnode_from_seed(ptr noundef nonnull @seed, i32 noundef 64, ptr noundef nonnull @SECP256K1_NAME, ptr noundef nonnull @node) #7
  %45 = tail call i32 @hdnode_private_ckd(ptr noundef nonnull @node, i32 noundef -2147483604) #7
  %46 = tail call i32 @hdnode_private_ckd(ptr noundef nonnull @node, i32 noundef -2147483648) #7
  %47 = tail call i32 @hdnode_private_ckd(ptr noundef nonnull @node, i32 noundef -2147483648) #7
  %48 = tail call i32 @hdnode_private_ckd(ptr noundef nonnull @node, i32 noundef 0) #7
  %49 = tail call i32 @hdnode_private_ckd(ptr noundef nonnull @node, i32 noundef 0) #7
  tail call void @hdnode_fill_public_key(ptr noundef nonnull @node) #7
  tail call void @ecdsa_get_pubkeyhash(ptr noundef nonnull getelementptr inbounds (i8, ptr @node, i64 104), i32 noundef %30, ptr noundef nonnull @pubkeyhash) #7
  %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(20) getelementptr inbounds (i8, ptr @addr, i64 1), ptr noundef nonnull dereferenceable(20) @pubkeyhash, i64 20)
  %50 = icmp eq i32 %bcmp, 0
  br i1 %50, label %.thread35, label %51

.thread35:                                        ; preds = %43
  store i32 1, ptr @found, align 4, !tbaa !14
  br label %.loopexit

51:                                               ; preds = %43, %31
  %52 = load ptr, ptr @stdin, align 8, !tbaa !5
  %53 = tail call ptr @fgets(ptr noundef nonnull @iter, i32 noundef 256, ptr noundef %52)
  %54 = icmp eq ptr %53, null
  br i1 %54, label %.loopexit, label %31

.loopexit:                                        ; preds = %51, %24, %.thread35
  %55 = tail call i64 @clock() #7
  %56 = load i64, ptr @start, align 8, !tbaa !12
  %57 = sub nsw i64 %55, %56
  %58 = sitofp i64 %57 to float
  %59 = fdiv float %58, 1.000000e+06
  %60 = load i32, ptr @count, align 4, !tbaa !14
  %61 = fpext float %59 to double
  %62 = sitofp i32 %60 to float
  %63 = fdiv float %62, %59
  %64 = fpext float %63 to double
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %60, ptr noundef nonnull %.02432, double noundef %61, double noundef %64)
  %66 = load i32, ptr @found, align 4, !tbaa !14
  %.not28 = icmp eq i32 %66, 0
  br i1 %.not28, label %69, label %67

67:                                               ; preds = %.loopexit
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef nonnull %.02432, ptr noundef nonnull @iter)
  br label %71

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

71:                                               ; preds = %16, %21, %69, %67, %4
  %.2 = phi i32 [ 1, %4 ], [ 3, %21 ], [ 2, %16 ], [ 0, %67 ], [ 4, %69 ]
  ret i32 %.2
}

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

declare i32 @mnemonic_check(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #3

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

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

declare void @mnemonic_to_seed(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @hdnode_fill_public_key(ptr noundef) local_unnamed_addr #2

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass