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

/* Variables and functions */
unsigned int efuse_read_byte(int);
int /*<<< orphan*/ serial_put_hex(unsigned int, int);
int /*<<< orphan*/ serial_puts(char *);
void efuse_dump(void) {
  int loo = 0;
  for (loo = 0; loo < 512; loo++) {
    if (loo % 16 == 0) {
      serial_puts("\n");
      serial_put_hex(loo, 12);
      serial_puts(": ");
    }
    unsigned int tmp_data = efuse_read_byte(loo);
    serial_put_hex(tmp_data, 8);
    serial_puts(" ");
  }
  serial_puts("\n");
}


x86 assembly (clang, -O0):
<efuse_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x200,-0x4(%rbp)
jge    11be <efuse_dump+0x8e>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <efuse_dump+0x5c>
lea    0xe92(%rip),%rdi
call   1040 <serial_puts@plt>
mov    -0x4(%rbp),%edi
mov    $0xc,%esi
call   1050 <serial_put_hex@plt>
lea    0xe7b(%rip),%rdi
call   1040 <serial_puts@plt>
mov    -0x4(%rbp),%edi
call   1030 <efuse_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
call   1050 <serial_put_hex@plt>
lea    0xe58(%rip),%rdi
call   1040 <serial_puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <efuse_dump+0x16>
lea    0xe3b(%rip),%rdi
call   1040 <serial_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efuse_dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xebf(%rip),%r14
lea    0xeba(%rip),%r15
lea    0xeb4(%rip),%r12
jmp    1186 <efuse_dump+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <efuse_read_byte@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1050 <serial_put_hex@plt>
mov    %r12,%rdi
call   1040 <serial_puts@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
je     11a9 <efuse_dump+0x79>
test   $0xf,%bl
jne    1160 <efuse_dump+0x30>
mov    %r14,%rdi
call   1040 <serial_puts@plt>
mov    %ebx,%edi
mov    $0xc,%esi
call   1050 <serial_put_hex@plt>
mov    %r15,%rdi
call   1040 <serial_puts@plt>
jmp    1160 <efuse_dump+0x30>
lea    0xe50(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <serial_puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [2 x i8] c" \00"
define void @efuse_dump() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %3
3: ; preds = %21, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 512
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %1
%8 = srem i32 %7, 16
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = call i32 @serial_put_hex(i32 %12, i32 12)
%14 = call i32 @serial_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %10, %6
%16 = load i32, i32* %1
%17 = call i32 @efuse_read_byte(i32 %16)
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = call i32 @serial_put_hex(i32 %18, i32 8)
%20 = call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %15
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %3
24: ; preds = %3
%25 = call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [2 x i8] c" \00"
define void @efuse_dump() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ 0, %0 ], [ %13, %9 ]
%3 = and i32 %2, 15
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @serial_put_hex(i32 %2, i32 12)
%8 = tail call i32 @serial_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %5, %1
%10 = tail call i32 @efuse_read_byte(i32 %2)
%11 = tail call i32 @serial_put_hex(i32 %10, i32 8)
%12 = tail call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = add nuw nsw i32 %2, 1
%14 = icmp eq i32 %13, 512
br i1 %14, label %15, label %1
15: ; preds = %9
%16 = tail call i32 @serial_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}