#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
scalar_t__ BN_cmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int /*<<< orphan*/ test_fail_bignum_message(int /*<<< orphan*/ *, char const *,
                                            int, char *, char const *,
                                            char const *, char *,
                                            int /*<<< orphan*/ const *,
                                            int /*<<< orphan*/ const *);
int test_BN_lt(const char *file, int line, const char *s1, const char *s2,
               const BIGNUM *t1, const BIGNUM *t2) {
  if (BN_cmp(t1, t2) < 0)
    return 1;
  test_fail_bignum_message(NULL, file, line, "BIGNUM", s1, s2, "<", t1, t2);
  return 0;
}


x86 assembly (clang, -O0):
<test_BN_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <BN_cmp@plt>
cmp    $0x0,%rax
jge    1162 <test_BN_lt+0x42>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <test_BN_lt+0x85>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    -0x38(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edi
lea    0xe7c(%rip),%rcx
lea    0xe7c(%rip),%r11
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <test_fail_bignum_message@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_BN_lt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r12
mov    %rdx,%rbp
mov    %esi,%r13d
mov    %rdi,%r15
mov    %r8,%rdi
mov    %r9,%rsi
call   1040 <BN_cmp@plt>
test   %rax,%rax
js     117f <test_BN_lt+0x5f>
sub    $0x8,%rsp
lea    0xeaf(%rip),%rax
lea    0xea1(%rip),%rcx
mov    %r12,%r9
xor    %r12d,%r12d
xor    %edi,%edi
mov    %r15,%rsi
mov    %r13d,%edx
mov    %rbp,%r8
push   %rbx
push   %r14
push   %rax
call   1030 <test_fail_bignum_message@plt>
add    $0x20,%rsp
jmp    1185 <test_BN_lt+0x65>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"BIGNUM\00"
@.str.1 = [2 x i8] c"<\00"
define i32 @test_BN_lt(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32*, i32** %13
%16 = call i64 @BN_cmp(i32* %14, i32* %15)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %27
19: ; preds = %6
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = load i8*, i8** %10
%23 = load i8*, i8** %11
%24 = load i32*, i32** %12
%25 = load i32*, i32** %13
%26 = call i32 @test_fail_bignum_message(i32* null, i8* %20, i32 %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %24, i32* %25)
store i32 0, i32* %7
br label %27
27: ; preds = %19, %18
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
@.str = [7 x i8] c"BIGNUM\00"
@.str.1 = [2 x i8] c"<\00"
define i32 @test_BN_lt(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4, i32* %5) {
%7 = tail call i64 @BN_cmp(i32* %4, i32* %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @test_fail_bignum_message(i32* null, i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %12
}