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

/* Variables and functions */
int /*<<< orphan*/ print_uart0(char *);
int /*<<< orphan*/ print_word_hex(int /*<<< orphan*/ *);
void md(uint32_t *start) {
  int i, j;
  uint32_t *addr = start;
  for (i = 0; i < 10; i++) {
    print_uart0("0x");
    print_word_hex((uint32_t *)&addr);
    print_uart0(": ");
    for (j = 0; j < 3; j++) {
      print_word_hex(addr);
      print_uart0("  ");
      addr++;
    }
    print_uart0("\n");
  }
}


x86 assembly (clang, -O0):
<md>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11c0 <md+0xa0>
lea    0xeb4(%rip),%rdi
call   1030 <print_uart0@plt>
lea    -0x18(%rbp),%rdi
call   1040 <print_word_hex@plt>
lea    0xea2(%rip),%rdi
call   1030 <print_uart0@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11a6 <md+0x86>
mov    -0x18(%rbp),%rdi
call   1040 <print_word_hex@plt>
lea    0xe7f(%rip),%rdi
call   1030 <print_uart0@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116d <md+0x4d>
lea    0xe5c(%rip),%rdi
call   1030 <print_uart0@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <md+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    $0xa,%ebp
lea    0xec5(%rip),%r14
mov    %rsp,%r15
lea    0xebe(%rip),%r12
lea    0xeba(%rip),%rbx
lea    0xeb6(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <print_uart0@plt>
mov    %r15,%rdi
call   1040 <print_word_hex@plt>
mov    %r12,%rdi
call   1030 <print_uart0@plt>
mov    (%rsp),%rdi
call   1040 <print_word_hex@plt>
mov    %rbx,%rdi
call   1030 <print_uart0@plt>
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
call   1040 <print_word_hex@plt>
mov    %rbx,%rdi
call   1030 <print_uart0@plt>
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
call   1040 <print_word_hex@plt>
mov    %rbx,%rdi
call   1030 <print_uart0@plt>
addq   $0x4,(%rsp)
mov    %r13,%rdi
call   1030 <print_uart0@plt>
add    $0xffffffff,%ebp
jne    1160 <md+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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