void Disassemble(unsigned int address) {
  int a;
  int numBytes = 0;
  const char *retVal = decodeDisasm(address, &numBytes);
  DUMP_REGISTERS();
  printf("%04X :", address);
  for (a = 0; a < numBytes + 1; a++) {
    printf("%02X ", AddressLookup(address + a));
  }
  for (a = 0; a < 4 - (numBytes + 1); a++) {
    printf("   ");
  }
  printf("%s\n", retVal);
}


x86 assembly (clang, -O0):
<Disassemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <decodeDisasm@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <DUMP_REGISTERS@plt>
mov    -0x4(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11c1 <Disassemble+0x81>
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <AddressLookup@plt>
mov    %eax,%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1185 <Disassemble+0x45>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    $0x4,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11fc <Disassemble+0xbc>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c8 <Disassemble+0x88>
mov    -0x18(%rbp),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Disassemble>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <decodeDisasm@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1070 <DUMP_REGISTERS@plt>
lea    0xe82(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     11c4 <Disassemble+0x74>
mov    $0xffffffff,%ebp
lea    0xe6c(%rip),%r15
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%edi
add    $0x1,%edi
xor    %eax,%eax
call   1060 <AddressLookup@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     11a0 <Disassemble+0x50>
add    $0xfffffffc,%eax
cmp    $0xfffffffe,%eax
jg     11fa <Disassemble+0xaa>
lea    0xe3a(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
mov    $0x3,%eax
sub    0x4(%rsp),%eax
cmp    %eax,%ebp
jl     11e0 <Disassemble+0x90>
movslq %r14d,%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%04X :\00"
@.str.1 = [6 x i8] c"%02X \00"
@.str.2 = [4 x i8] c" \00"
@.str.3 = [4 x i8] c"%s\0A\00"
define void @Disassemble(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %2
store i32 0, i32* %4
%6 = load i32, i32* %2
%7 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @decodeDisasm to i32 (i32, i32*, ...)*)(i32 %6, i32* %4)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = call i32 (...) @DUMP_REGISTERS()
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %3
br label %13
13: ; preds = %24, %1
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %27
18: ; preds = %13
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add i32 %19, %20
%22 = call i32 (i32, ...) bitcast (i32 (...)* @AddressLookup to i32 (i32, ...)*)(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %13
27: ; preds = %13
store i32 0, i32* %3
br label %28
28: ; preds = %36, %27
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
%32 = sub nsw i32 4, %31
%33 = icmp slt i32 %29, %32
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %28
39: ; preds = %28
%40 = load i8*, i8** %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %40)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%04X :\00"
@.str.1 = [6 x i8] c"%02X \00"
@.str.2 = [4 x i8] c" \00"
define void @Disassemble(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @decodeDisasm to i32 (i32, i32*, ...)*)(i32 %0, i32* %2)
%5 = call i32 (...) @DUMP_REGISTERS()
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %13, %1
%10 = phi i32 [ %7, %1 ], [ %19, %13 ]
%11 = add i32 %10, -4
%12 = icmp slt i32 %11, -1
br i1 %12, label %21, label %28
13: ; preds = %1, %13
%14 = phi i32 [ %18, %13 ], [ 0, %1 ]
%15 = add i32 %14, %0
%16 = call i32 (i32, ...) bitcast (i32 (...)* @AddressLookup to i32 (i32, ...)*)(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i32 %14, 1
%19 = load i32, i32* %2
%20 = icmp slt i32 %14, %19
br i1 %20, label %13, label %9
21: ; preds = %9, %21
%22 = phi i32 [ %24, %21 ], [ 0, %9 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%24 = add nuw nsw i32 %22, 1
%25 = load i32, i32* %2
%26 = sub i32 3, %25
%27 = icmp slt i32 %24, %26
br i1 %27, label %21, label %28
28: ; preds = %21, %9
%29 = sext i32 %4 to i64
%30 = inttoptr i64 %29 to i8*
%31 = call i32 @puts(i8* dereferenceable(1) %30)
ret void
}