#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 uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printk(char *, ...);
int strlen(char *);
void atags_dump(uint32_t *atags) {
  uint32_t size, count;
  int32_t length;
  uint32_t *tags = atags;
  char *cmdline;
  printk("Dumping ATAGs provied by bootloader:\n");
  while (1) {
    size = tags[0];
    switch (tags[1]) {
    case 0x54410001:
      printk("  CORE: flags: %x, pagesize: %x, "
             "rootdev: %x\n",
             tags[2], tags[3], tags[4]);
      tags += size;
      break;
    case 0x54410002:
      printk("  MEMORY: size: %x (%dMB), start: %x\n", tags[2],
             tags[2] / 1024 / 1024, tags[3]);
      tags += size;
      break;
    case 0x54410003:
      printk("  VIDEOTEXT x,y,video: %x, "
             "mode,cols, ega: %x, lines, vga, points: %x\n",
             tags[2], tags[3], tags[4]);
      tags += size;
      break;
    case 0x54410004:
      printk("  RAMDISK flags: %x, size: %x, start: %x\n", tags[2], tags[3],
             tags[4]);
      tags += size;
      break;
    case 0x54420005:
      printk("  INITRD size: %x, start: %x\n", tags[3], tags[2]);
      tags += size;
      break;
    case 0x54410006:
      printk(" SERIAL NUMBER: low: %x, high: %x\n", tags[2], tags[3]);
      tags += size;
      break;
    case 0x54410007:
      printk(" Board revision: %x\n", tags[2]);
      tags += size;
      break;
    case 0x54410008:
      printk("  VESA framebuffer\n");
      tags += size;
      break;
    case 0x54410009:
      cmdline = (char *)(&tags[2]);
      length = strlen(cmdline);
      printk("  Commandline (%d): ", length);
      count = 0;
      while (length > 0) {
        printk("%s", cmdline + (256 * count));
        length -= 256;
        count++;
      }
      printk("\n");
      tags += size;
      break;
    case 0x00000000:
      printk("\n");
      return;
      break;
    default:
      printk("ERROR! Unknown atag\n");
      break;
    }
  }
}


x86 assembly (clang, -O0):
<atags_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x2c(%rbp)
test   %eax,%eax
je     146e <atags_dump+0x34e>
jmp    1162 <atags_dump+0x42>
mov    -0x2c(%rbp),%eax
sub    $0x54410001,%eax
je     120d <atags_dump+0xed>
jmp    1175 <atags_dump+0x55>
mov    -0x2c(%rbp),%eax
sub    $0x54410002,%eax
je     124a <atags_dump+0x12a>
jmp    1188 <atags_dump+0x68>
mov    -0x2c(%rbp),%eax
sub    $0x54410003,%eax
je     1299 <atags_dump+0x179>
jmp    119b <atags_dump+0x7b>
mov    -0x2c(%rbp),%eax
sub    $0x54410004,%eax
je     12d6 <atags_dump+0x1b6>
jmp    11ae <atags_dump+0x8e>
mov    -0x2c(%rbp),%eax
sub    $0x54410006,%eax
je     1349 <atags_dump+0x229>
jmp    11c1 <atags_dump+0xa1>
mov    -0x2c(%rbp),%eax
sub    $0x54410007,%eax
je     137f <atags_dump+0x25f>
jmp    11d4 <atags_dump+0xb4>
mov    -0x2c(%rbp),%eax
sub    $0x54410008,%eax
je     13ae <atags_dump+0x28e>
jmp    11e7 <atags_dump+0xc7>
mov    -0x2c(%rbp),%eax
sub    $0x54410009,%eax
je     13d6 <atags_dump+0x2b6>
jmp    11fa <atags_dump+0xda>
mov    -0x2c(%rbp),%eax
sub    $0x54420005,%eax
je     1313 <atags_dump+0x1f3>
jmp    1482 <atags_dump+0x362>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%ecx
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%ecx
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%edx
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1446 <atags_dump+0x326>
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
cltq
add    %rax,%rsi
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x14(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1406 <atags_dump+0x2e6>
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1490 <atags_dump+0x370>
lea    0xbaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
add    $0x30,%rsp
pop    %rbp
ret
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
jmp    1142 <atags_dump+0x22>

x86 assembly (clang, -O2):
<atags_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeef(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xebd(%rip),%r13
lea    0x1044(%rip),%r12
jmp    1167 <atags_dump+0x47>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edx
mov    0x10(%rbx),%ecx
lea    0xeee(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    (%rbx,%r15,4),%rbx
movslq (%rbx),%r15
mov    0x4(%rbx),%eax
lea    -0x54410001(%rax),%ecx
cmp    $0x8,%ecx
ja     119f <atags_dump+0x7f>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%ecx
lea    0xfffff(%rsi),%edx
test   %esi,%esi
cmovns %esi,%edx
sar    $0x14,%edx
lea    0xedb(%rip),%rdi
jmp    115c <atags_dump+0x3c>
cmp    $0x54420005,%eax
je     128b <atags_dump+0x16b>
test   %eax,%eax
je     12a8 <atags_dump+0x188>
lea    0xfd8(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
jmp    1167 <atags_dump+0x47>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edx
mov    0x10(%rbx),%ecx
lea    0xecc(%rip),%rdi
jmp    115c <atags_dump+0x3c>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edx
mov    0x10(%rbx),%ecx
lea    0xf01(%rip),%rdi
jmp    115c <atags_dump+0x3c>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edx
lea    0xf37(%rip),%rdi
jmp    1298 <atags_dump+0x178>
mov    0x8(%rbx),%esi
lea    0xf4b(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    (%rbx,%r15,4),%rbx
jmp    1167 <atags_dump+0x47>
lea    0xf49(%rip),%rdi
jmp    127b <atags_dump+0x15b>
lea    0x8(%rbx),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %eax,%r14d
lea    0xf45(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printk@plt>
test   %r14d,%r14d
jle    1274 <atags_dump+0x154>
add    $0x100,%r14d
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printk@plt>
add    $0x100,%rbp
add    $0xffffff00,%r14d
cmp    $0x100,%r14d
ja     1250 <atags_dump+0x130>
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    (%rbx,%r15,4),%rbx
jmp    1167 <atags_dump+0x47>
mov    0x8(%rbx),%edx
mov    0xc(%rbx),%esi
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    (%rbx,%r15,4),%rbx
jmp    1167 <atags_dump+0x47>
lea    0xd99(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Dumping ATAGs provied by bootloader:\0A\00"
@.str.1 = [46 x i8] c" CORE: flags: %x, pagesize: %x, rootdev: %x\0A\00"
@.str.2 = [38 x i8] c" MEMORY: size: %x (%dMB), start: %x\0A\00"
@.str.3 = [71 x i8] c" VIDEOTEXT x,y,video: %x, mode,cols, ega: %x, lines, vga, points: %x\0A\00"
@.str.4 = [42 x i8] c" RAMDISK flags: %x, size: %x, start: %x\0A\00"
@.str.5 = [30 x i8] c" INITRD size: %x, start: %x\0A\00"
@.str.6 = [35 x i8] c" SERIAL NUMBER: low: %x, high: %x\0A\00"
@.str.7 = [21 x i8] c" Board revision: %x\0A\00"
@.str.8 = [20 x i8] c" VESA framebuffer\0A\00"
@.str.9 = [21 x i8] c" Commandline (%d): \00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [21 x i8] c"ERROR! Unknown atag\0A\00"
define void @atags_dump(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
store i32* %0, i32** %2
%8 = load i32*, i32** %2
store i32* %8, i32** %6
%9 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %1, %150
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
store i32 %13, i32* %3
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
switch i32 %16, label %148 [
i32 1413545985, label %17
i32 1413545986, label %32
i32 1413545987, label %49
i32 1413545988, label %64
i32 1413611525, label %79
i32 1413545990, label %91
i32 1413545991, label %103
i32 1413545992, label %112
i32 1413545993, label %118
i32 0, label %146
]
17: ; preds = %10
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 3
%23 = load i32, i32* %22
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 4
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23, i32 %26)
%28 = load i32, i32* %3
%29 = load i32*, i32** %6
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i32, i32* %29, i64 %30
store i32* %31, i32** %6
br label %150
32: ; preds = %10
%33 = load i32*, i32** %6
%34 = getelementptr inbounds i32, i32* %33, i64 2
%35 = load i32, i32* %34
%36 = load i32*, i32** %6
%37 = getelementptr inbounds i32, i32* %36, i64 2
%38 = load i32, i32* %37
%39 = sdiv i32 %38, 1024
%40 = sdiv i32 %39, 1024
%41 = load i32*, i32** %6
%42 = getelementptr inbounds i32, i32* %41, i64 3
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %35, i32 %40, i32 %43)
%45 = load i32, i32* %3
%46 = load i32*, i32** %6
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds i32, i32* %46, i64 %47
store i32* %48, i32** %6
br label %150
49: ; preds = %10
%50 = load i32*, i32** %6
%51 = getelementptr inbounds i32, i32* %50, i64 2
%52 = load i32, i32* %51
%53 = load i32*, i32** %6
%54 = getelementptr inbounds i32, i32* %53, i64 3
%55 = load i32, i32* %54
%56 = load i32*, i32** %6
%57 = getelementptr inbounds i32, i32* %56, i64 4
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %55, i32 %58)
%60 = load i32, i32* %3
%61 = load i32*, i32** %6
%62 = sext i32 %60 to i64
%63 = getelementptr inbounds i32, i32* %61, i64 %62
store i32* %63, i32** %6
br label %150
64: ; preds = %10
%65 = load i32*, i32** %6
%66 = getelementptr inbounds i32, i32* %65, i64 2
%67 = load i32, i32* %66
%68 = load i32*, i32** %6
%69 = getelementptr inbounds i32, i32* %68, i64 3
%70 = load i32, i32* %69
%71 = load i32*, i32** %6
%72 = getelementptr inbounds i32, i32* %71, i64 4
%73 = load i32, i32* %72
%74 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %67, i32 %70, i32 %73)
%75 = load i32, i32* %3
%76 = load i32*, i32** %6
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds i32, i32* %76, i64 %77
store i32* %78, i32** %6
br label %150
79: ; preds = %10
%80 = load i32*, i32** %6
%81 = getelementptr inbounds i32, i32* %80, i64 3
%82 = load i32, i32* %81
%83 = load i32*, i32** %6
%84 = getelementptr inbounds i32, i32* %83, i64 2
%85 = load i32, i32* %84
%86 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %82, i32 %85)
%87 = load i32, i32* %3
%88 = load i32*, i32** %6
%89 = sext i32 %87 to i64
%90 = getelementptr inbounds i32, i32* %88, i64 %89
store i32* %90, i32** %6
br label %150
91: ; preds = %10
%92 = load i32*, i32** %6
%93 = getelementptr inbounds i32, i32* %92, i64 2
%94 = load i32, i32* %93
%95 = load i32*, i32** %6
%96 = getelementptr inbounds i32, i32* %95, i64 3
%97 = load i32, i32* %96
%98 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %94, i32 %97)
%99 = load i32, i32* %3
%100 = load i32*, i32** %6
%101 = sext i32 %99 to i64
%102 = getelementptr inbounds i32, i32* %100, i64 %101
store i32* %102, i32** %6
br label %150
103: ; preds = %10
%104 = load i32*, i32** %6
%105 = getelementptr inbounds i32, i32* %104, i64 2
%106 = load i32, i32* %105
%107 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %106)
%108 = load i32, i32* %3
%109 = load i32*, i32** %6
%110 = sext i32 %108 to i64
%111 = getelementptr inbounds i32, i32* %109, i64 %110
store i32* %111, i32** %6
br label %150
112: ; preds = %10
%113 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%114 = load i32, i32* %3
%115 = load i32*, i32** %6
%116 = sext i32 %114 to i64
%117 = getelementptr inbounds i32, i32* %115, i64 %116
store i32* %117, i32** %6
br label %150
118: ; preds = %10
%119 = load i32*, i32** %6
%120 = getelementptr inbounds i32, i32* %119, i64 2
%121 = bitcast i32* %120 to i8*
store i8* %121, i8** %7
%122 = load i8*, i8** %7
%123 = call i32 @strlen(i8* %122)
store i32 %123, i32* %5
%124 = load i32, i32* %5
%125 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %124)
store i32 0, i32* %4
br label %126
126: ; preds = %129, %118
%127 = load i32, i32* %5
%128 = icmp sgt i32 %127, 0
br i1 %128, label %129, label %140
129: ; preds = %126
%130 = load i8*, i8** %7
%131 = load i32, i32* %4
%132 = mul nsw i32 256, %131
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8, i8* %130, i64 %133
%135 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %134)
%136 = load i32, i32* %5
%137 = sub nsw i32 %136, 256
store i32 %137, i32* %5
%138 = load i32, i32* %4
%139 = add nsw i32 %138, 1
store i32 %139, i32* %4
br label %126
140: ; preds = %126
%141 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%142 = load i32, i32* %3
%143 = load i32*, i32** %6
%144 = sext i32 %142 to i64
%145 = getelementptr inbounds i32, i32* %143, i64 %144
store i32* %145, i32** %6
br label %150
146: ; preds = %10
%147 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
ret void
148: ; preds = %10
%149 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %150
150: ; preds = %148, %140, %112, %103, %91, %79, %64, %49, %32, %17
br label %10
}

LLVM IR (-O2):
@.str = [38 x i8] c"Dumping ATAGs provied by bootloader:\0A\00"
@.str.1 = [46 x i8] c" CORE: flags: %x, pagesize: %x, rootdev: %x\0A\00"
@.str.2 = [38 x i8] c" MEMORY: size: %x (%dMB), start: %x\0A\00"
@.str.3 = [71 x i8] c" VIDEOTEXT x,y,video: %x, mode,cols, ega: %x, lines, vga, points: %x\0A\00"
@.str.4 = [42 x i8] c" RAMDISK flags: %x, size: %x, start: %x\0A\00"
@.str.5 = [30 x i8] c" INITRD size: %x, start: %x\0A\00"
@.str.6 = [35 x i8] c" SERIAL NUMBER: low: %x, high: %x\0A\00"
@.str.7 = [21 x i8] c" Board revision: %x\0A\00"
@.str.8 = [20 x i8] c" VESA framebuffer\0A\00"
@.str.9 = [21 x i8] c" Commandline (%d): \00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [21 x i8] c"ERROR! Unknown atag\0A\00"
define void @atags_dump(i32* %0) {
%2 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %96, %1
%4 = phi i32* [ %0, %1 ], [ %97, %96 ]
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
switch i32 %7, label %94 [
i32 1413545985, label %8
i32 1413545986, label %18
i32 1413545987, label %27
i32 1413545988, label %37
i32 1413611525, label %47
i32 1413545990, label %55
i32 1413545991, label %63
i32 1413545992, label %69
i32 1413545993, label %73
i32 0, label %92
]
8: ; preds = %3
%9 = getelementptr inbounds i32, i32* %4, i64 2
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %4, i64 3
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %4, i64 4
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12, i32 %14)
%16 = sext i32 %5 to i64
%17 = getelementptr inbounds i32, i32* %4, i64 %16
br label %96
18: ; preds = %3
%19 = getelementptr inbounds i32, i32* %4, i64 2
%20 = load i32, i32* %19
%21 = sdiv i32 %20, 1048576
%22 = getelementptr inbounds i32, i32* %4, i64 3
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %21, i32 %23)
%25 = sext i32 %5 to i64
%26 = getelementptr inbounds i32, i32* %4, i64 %25
br label %96
27: ; preds = %3
%28 = getelementptr inbounds i32, i32* %4, i64 2
%29 = load i32, i32* %28
%30 = getelementptr inbounds i32, i32* %4, i64 3
%31 = load i32, i32* %30
%32 = getelementptr inbounds i32, i32* %4, i64 4
%33 = load i32, i32* %32
%34 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %31, i32 %33)
%35 = sext i32 %5 to i64
%36 = getelementptr inbounds i32, i32* %4, i64 %35
br label %96
37: ; preds = %3
%38 = getelementptr inbounds i32, i32* %4, i64 2
%39 = load i32, i32* %38
%40 = getelementptr inbounds i32, i32* %4, i64 3
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %4, i64 4
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %39, i32 %41, i32 %43)
%45 = sext i32 %5 to i64
%46 = getelementptr inbounds i32, i32* %4, i64 %45
br label %96
47: ; preds = %3
%48 = getelementptr inbounds i32, i32* %4, i64 3
%49 = load i32, i32* %48
%50 = getelementptr inbounds i32, i32* %4, i64 2
%51 = load i32, i32* %50
%52 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %49, i32 %51)
%53 = sext i32 %5 to i64
%54 = getelementptr inbounds i32, i32* %4, i64 %53
br label %96
55: ; preds = %3
%56 = getelementptr inbounds i32, i32* %4, i64 2
%57 = load i32, i32* %56
%58 = getelementptr inbounds i32, i32* %4, i64 3
%59 = load i32, i32* %58
%60 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %57, i32 %59)
%61 = sext i32 %5 to i64
%62 = getelementptr inbounds i32, i32* %4, i64 %61
br label %96
63: ; preds = %3
%64 = getelementptr inbounds i32, i32* %4, i64 2
%65 = load i32, i32* %64
%66 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %65)
%67 = sext i32 %5 to i64
%68 = getelementptr inbounds i32, i32* %4, i64 %67
br label %96
69: ; preds = %3
%70 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%71 = sext i32 %5 to i64
%72 = getelementptr inbounds i32, i32* %4, i64 %71
br label %96
73: ; preds = %3
%74 = getelementptr inbounds i32, i32* %4, i64 2
%75 = bitcast i32* %74 to i8*
%76 = tail call i32 @strlen(i8* %75)
%77 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %76)
%78 = icmp sgt i32 %76, 0
br i1 %78, label %79, label %88
79: ; preds = %73, %79
%80 = phi i64 [ %86, %79 ], [ 0, %73 ]
%81 = phi i32 [ %85, %79 ], [ %76, %73 ]
%82 = shl nsw i64 %80, 6
%83 = getelementptr inbounds i32, i32* %74, i64 %82
%84 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %83)
%85 = add nsw i32 %81, -256
%86 = add nuw nsw i64 %80, 1
%87 = icmp ugt i32 %81, 256
br i1 %87, label %79, label %88
88: ; preds = %79, %73
%89 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%90 = sext i32 %5 to i64
%91 = getelementptr inbounds i32, i32* %4, i64 %90
br label %96
92: ; preds = %3
%93 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
ret void
94: ; preds = %3
%95 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %96
96: ; preds = %94, %88, %69, %63, %55, %47, %37, %27, %18, %8
%97 = phi i32* [ %4, %94 ], [ %91, %88 ], [ %72, %69 ], [ %68, %63 ], [ %62, %55 ], [ %54, %47 ], [ %46, %37 ], [ %36, %27 ], [ %26, %18 ], [ %17, %8 ]
br label %3
}