#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*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_CTX_new();
int /*<<< orphan*/ *BN_new();
int /*<<< orphan*/ CRYPTO_set_mem_debug_functions(int /*<<< orphan*/,
                                                  int /*<<< orphan*/,
                                                  int /*<<< orphan*/,
                                                  int /*<<< orphan*/,
                                                  int /*<<< orphan*/);
int /*<<< orphan*/ RAND_seed(char *, int);
int /*<<< orphan*/ RAND_status();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ do_mul_exp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  BN_CTX *ctx;
  BIGNUM *a, *b, *c, *r;
  if (!CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0))
    abort();
  ctx = BN_CTX_new();
  a = BN_new();
  b = BN_new();
  c = BN_new();
  r = BN_new();
  while (!RAND_status()) {
    const char str[] = "I demand a manual recount!";
    RAND_seed("I demand a manual recount!", sizeof str);
  };
  do_mul_exp(r, a, b, c, ctx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1080 <CRYPTO_set_mem_debug_functions@plt>
cmp    $0x0,%eax
jne    11aa <main+0x3a>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1070 <BN_CTX_new@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <RAND_status@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11fd <main+0x8d>
jmp    1248 <main+0xd8>
mov    0xdfc(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xdf9(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xdf6(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xdf3(%rip),%ax
mov    %ax,-0x48(%rbp)
mov    0xdeb(%rip),%al
mov    %al,-0x46(%rbp)
lea    0xde2(%rip),%rdi
mov    $0x1b,%esi
call   1040 <RAND_seed@plt>
jmp    11e1 <main+0x71>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1090 <do_mul_exp@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1080 <CRYPTO_set_mem_debug_functions@plt>
test   %eax,%eax
je     121d <main+0xad>
xor    %eax,%eax
call   1070 <BN_CTX_new@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <RAND_status@plt>
test   %eax,%eax
jne    11f8 <main+0x88>
lea    0xe29(%rip),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x1b,%esi
call   1040 <RAND_seed@plt>
xor    %eax,%eax
call   1030 <RAND_status@plt>
test   %eax,%eax
je     11e0 <main+0x70>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %r14,%r8
call   1090 <do_mul_exp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <abort@plt>

LLVM IR (-O0):
@__const.main.str = [27 x i8] c"I demand a manual recount!\00"
@.str = [27 x i8] c"I demand a manual recount!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [27 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 @CRYPTO_set_mem_debug_functions(i32 0, i32 0, i32 0, i32 0, i32 0)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %2
%17 = call i32* (...) @BN_CTX_new()
store i32* %17, i32** %6
%18 = call i32* (...) @BN_new()
store i32* %18, i32** %7
%19 = call i32* (...) @BN_new()
store i32* %19, i32** %8
%20 = call i32* (...) @BN_new()
store i32* %20, i32** %9
%21 = call i32* (...) @BN_new()
store i32* %21, i32** %10
br label %22
22: ; preds = %26, %16
%23 = call i32 (...) @RAND_status()
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = bitcast [27 x i8]* %11 to i8*
%28 = call i32 @RAND_seed(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 27)
br label %22
29: ; preds = %22
%30 = load i32*, i32** %10
%31 = load i32*, i32** %7
%32 = load i32*, i32** %8
%33 = load i32*, i32** %9
%34 = load i32*, i32** %6
%35 = call i32 @do_mul_exp(i32* %30, i32* %31, i32* %32, i32* %33, i32* %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"I demand a manual recount!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @CRYPTO_set_mem_debug_functions(i32 0, i32 0, i32 0, i32 0, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32* (...) @BN_CTX_new()
%9 = tail call i32* (...) @BN_new()
%10 = tail call i32* (...) @BN_new()
%11 = tail call i32* (...) @BN_new()
%12 = tail call i32* (...) @BN_new()
%13 = tail call i32 (...) @RAND_status()
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %7, %15
%16 = tail call i32 @RAND_seed(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 27)
%17 = tail call i32 (...) @RAND_status()
%18 = icmp eq i32 %17, 0
br i1 %18, label %15, label %19
19: ; preds = %15, %7
%20 = tail call i32 @do_mul_exp(i32* %12, i32* %9, i32* %10, i32* %11, i32* %8)
ret i32 0
}