#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void bn_dump1(FILE *o, const char *a, const unsigned long *b, int n) {
  int i;
  fprintf(o, "%s=", a);
  for (i = n - 1; i >= 0; i--)
    fprintf(o, "%08lX", b[i]);
  fprintf(o, "\n");
}


x86 assembly (clang, -O0):
<bn_dump1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     117c <bn_dump1+0x6c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1146 <bn_dump1+0x36>
mov    -0x8(%rbp),%rdi
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_dump1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %ebp,%ebp
jle    117e <bn_dump1+0x5e>
mov    %ebp,%ebp
add    $0x1,%rbp
lea    0xeb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbp),%eax
mov    (%r14,%rax,8),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1160 <bn_dump1+0x40>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s=\00"
@.str.1 = [6 x i8] c"%08lX\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @bn_dump1(i32* %0, i8* %1, i64* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i8*, i8** %6
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %8
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %9
br label %15
15: ; preds = %26, %4
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32*, i32** %5
%20 = load i64*, i64** %7
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i64, i64* %20, i64 %22
%24 = load i64, i64* %23
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %9
%28 = add nsw i32 %27, -1
store i32 %28, i32* %9
br label %15
29: ; preds = %15
%30 = load i32*, i32** %5
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s=\00"
@.str.1 = [6 x i8] c"%08lX\00"
define void @bn_dump1(i32* nocapture %0, i8* %1, i64* nocapture %2, i32 %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %11, %9 ]
%11 = add nsw i64 %10, -1
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i64, i64* %2, i64 %12
%14 = load i64, i64* %13
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %14)
%16 = icmp ugt i64 %10, 1
br i1 %16, label %9, label %17
17: ; preds = %9, %4
%18 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}