#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 */
int /*<<< orphan*/ RPI_AuxMiniUartWrite(char);
int /*<<< orphan*/ dump_binary(unsigned int);
int /*<<< orphan*/ dump_hex(unsigned int);
int /*<<< orphan*/ dump_string(char *);
int /*<<< orphan*/ reboot_now();
scalar_t__ tube_is_rst_active();
void dump_info(unsigned int *context, int offset, char *type) {
  unsigned int *addr;
  unsigned int *reg;
  unsigned int flags;
  int i, j;
  context = (unsigned int *)(((unsigned int)context) & ~3);
  reg = context + 1;
  dump_string(type);
  dump_string(" at ");
  addr = (unsigned int *)((reg[13] & ~3) - offset);
  dump_hex((unsigned int)addr);
  dump_string("\r\n");
  dump_string("Registers:\r\n");
  for (i = 0; i <= 13; i++) {
    j = (i < 13) ? i : 14;
    dump_string("  r[");
    RPI_AuxMiniUartWrite('0' + (j / 10));
    RPI_AuxMiniUartWrite('0' + (j % 10));
    dump_string("]=");
    dump_hex(reg[i]);
    dump_string("\r\n");
  }
  dump_string("Memory:\r\n");
  for (i = -4; i <= 4; i++) {
    dump_string("  ");
    dump_hex((unsigned int)(addr + i));
    RPI_AuxMiniUartWrite('=');
    dump_hex(*(addr + i));
    if (i == 0) {
      dump_string(" <<<<<< \r\n");
    } else {
      dump_string("\r\n");
    }
  }
  flags = *context;
  dump_string("Flags: \r\n  NZCV--------------------IFTMMMMM\r\n  ");
  dump_binary(flags);
  dump_string(" (");
  switch (flags & 0x1f) {
  case 0x10:
    dump_string("User");
    break;
  case 0x11:
    dump_string("FIQ");
    break;
  case 0x12:
    dump_string("IRQ");
    break;
  case 0x13:
    dump_string("Supervisor");
    break;
  case 0x17:
    dump_string("Abort");
    break;
  case 0x1B:
    dump_string("Undefined");
    break;
  case 0x1F:
    dump_string("System");
    break;
  default:
    dump_string("Illegal");
    break;
  };
  dump_string(" Mode)\r\n");
  dump_string("Halted waiting for reset\r\n");
  while (!tube_is_rst_active())
    ;
  while (tube_is_rst_active())
    ;
  reboot_now();
}


x86 assembly (clang, -O0):
<dump_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffc,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <dump_string@plt>
lea    0xea4(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x28(%rbp),%rax
mov    0x34(%rax),%eax
and    $0xfffffffc,%eax
sub    -0xc(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%edi
call   1070 <dump_hex@plt>
lea    0xea6(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xe73(%rip),%rdi
call   1040 <dump_string@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0xd,-0x30(%rbp)
jg     1280 <dump_info+0x120>
cmpl   $0xd,-0x30(%rbp)
jge    11fd <dump_info+0x9d>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    120a <dump_info+0xaa>
mov    $0xe,%eax
mov    %eax,-0x38(%rbp)
jmp    120a <dump_info+0xaa>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    0xe3b(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x34(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x34(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
lea    0xe06(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1070 <dump_hex@plt>
lea    0xdff(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11de <dump_info+0x7e>
lea    0xdd3(%rip),%rdi
call   1040 <dump_string@plt>
movl   $0xfffffffc,-0x30(%rbp)
cmpl   $0x4,-0x30(%rbp)
jg     1313 <dump_info+0x1b3>
lea    0xdf8(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %eax,%edi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1070 <dump_hex@plt>
cmpl   $0x0,-0x30(%rbp)
jne    12f4 <dump_info+0x194>
lea    0xd7a(%rip),%rdi
call   1040 <dump_string@plt>
jmp    1300 <dump_info+0x1a0>
lea    0xd71(%rip),%rdi
call   1040 <dump_string@plt>
jmp    1305 <dump_info+0x1a5>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1293 <dump_info+0x133>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    0xd4c(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x2c(%rbp),%edi
call   1060 <dump_binary@plt>
lea    0xd68(%rip),%rdi
call   1040 <dump_string@plt>
mov    -0x2c(%rbp),%eax
and    $0x1f,%eax
add    $0xfffffff0,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0xf,%eax
ja     13df <dump_info+0x27f>
mov    -0x40(%rbp),%rax
lea    0xca1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd33(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xd27(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xd1a(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xd0d(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xd07(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xcfc(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xcf5(%rip),%rdi
call   1040 <dump_string@plt>
jmp    13eb <dump_info+0x28b>
lea    0xceb(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xce7(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xce4(%rip),%rdi
call   1040 <dump_string@plt>
mov    $0x0,%al
call   1080 <tube_is_rst_active@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1420 <dump_info+0x2c0>
jmp    1425 <dump_info+0x2c5>
jmp    1403 <dump_info+0x2a3>
jmp    142a <dump_info+0x2ca>
mov    $0x0,%al
call   1080 <tube_is_rst_active@plt>
cmp    $0x0,%rax
je     1440 <dump_info+0x2e0>
jmp    142a <dump_info+0x2ca>
mov    $0x0,%al
call   1050 <reboot_now@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %rdi,%rbp
and    $0xfffffffc,%ebp
mov    %rdx,%rdi
call   1040 <dump_string@plt>
lea    0xe7b(%rip),%rdi
call   1040 <dump_string@plt>
mov    %rbp,0x8(%rsp)
mov    0x38(%rbp),%edi
and    $0xfffffffc,%edi
sub    %ebx,%edi
mov    %rdi,0x10(%rsp)
call   1070 <dump_hex@plt>
lea    0xe84(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xe51(%rip),%rdi
call   1040 <dump_string@plt>
xor    %ebp,%ebp
lea    0xe50(%rip),%r12
mov    $0xe,%r14d
lea    0xe48(%rip),%rbx
nop
mov    %r12,%rdi
call   1040 <dump_string@plt>
cmp    $0xd,%rbp
mov    %ebp,%eax
cmove  %r14d,%eax
movzbl %al,%r13d
imul   $0xcd,%r13d,%r15d
shr    $0xb,%r15d
lea    0x30(%r15),%eax
movzbl %al,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
add    %r15d,%r15d
lea    (%r15,%r15,4),%eax
sub    %al,%r13b
or     $0x30,%r13b
movzbl %r13b,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    %rbx,%rdi
call   1040 <dump_string@plt>
mov    0x8(%rsp),%rax
mov    0x4(%rax,%rbp,4),%edi
call   1070 <dump_hex@plt>
lea    0xdfb(%rip),%rdi
call   1040 <dump_string@plt>
add    $0x1,%rbp
cmp    $0xe,%rbp
jne    11d0 <dump_info+0x70>
lea    0xdd3(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xe09(%rip),%r15
mov    %r15,%rdi
call   1040 <dump_string@plt>
mov    0x10(%rsp),%rbx
lea    -0x10(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x10(%rbx),%edi
call   1070 <dump_hex@plt>
lea    0xdaa(%rip),%r12
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    -0xc(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0xc(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    -0x8(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x8(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    -0x4(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    -0x4(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
mov    %ebx,%edi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    (%rbx),%edi
call   1070 <dump_hex@plt>
lea    0xcf2(%rip),%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    0x4(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    0x4(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    0x8(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    0x8(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    0xc(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    0xc(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    %r15,%rdi
call   1040 <dump_string@plt>
lea    0x10(%rbx),%rdi
call   1070 <dump_hex@plt>
mov    $0x3d,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
mov    0x10(%rbx),%edi
call   1070 <dump_hex@plt>
mov    %r12,%rdi
call   1040 <dump_string@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%ebx
lea    0xc3e(%rip),%rdi
call   1040 <dump_string@plt>
mov    %ebx,%edi
call   1060 <dump_binary@plt>
lea    0xc5b(%rip),%rdi
call   1040 <dump_string@plt>
and    $0x1f,%ebx
add    $0xfffffffffffffff0,%rbx
cmp    $0xf,%ebx
ja     1425 <dump_info+0x2c5>
lea    0xca4(%rip),%rax
movslq (%rax,%rbx,4),%rdi
add    %rax,%rdi
jmp    142c <dump_info+0x2cc>
lea    0xc65(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xc61(%rip),%rdi
call   1040 <dump_string@plt>
lea    0xc5e(%rip),%rdi
call   1040 <dump_string@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <tube_is_rst_active@plt>
test   %rax,%rax
je     1450 <dump_info+0x2f0>
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <tube_is_rst_active@plt>
test   %rax,%rax
jne    1460 <dump_info+0x300>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <reboot_now@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" at \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [13 x i8] c"Registers:\0D\0A\00"
@.str.3 = [5 x i8] c" r[\00"
@.str.4 = [3 x i8] c"]=\00"
@.str.5 = [10 x i8] c"Memory:\0D\0A\00"
@.str.6 = [3 x i8] c" \00"
@.str.7 = [11 x i8] c" <<<<<< \0D\0A\00"
@.str.8 = [48 x i8] c"Flags: \0D\0A NZCV--------------------IFTMMMMM\0D\0A \00"
@.str.9 = [3 x i8] c" (\00"
@.str.10 = [5 x i8] c"User\00"
@.str.11 = [4 x i8] c"FIQ\00"
@.str.12 = [4 x i8] c"IRQ\00"
@.str.13 = [11 x i8] c"Supervisor\00"
@.str.14 = [6 x i8] c"Abort\00"
@.str.15 = [10 x i8] c"Undefined\00"
@.str.16 = [7 x i8] c"System\00"
@.str.17 = [8 x i8] c"Illegal\00"
@.str.18 = [9 x i8] c" Mode)\0D\0A\00"
@.str.19 = [27 x i8] c"Halted waiting for reset\0D\0A\00"
define void @dump_info(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%12 = load i32*, i32** %4
%13 = ptrtoint i32* %12 to i32
%14 = and i32 %13, -4
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %4
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32* %18, i32** %8
%19 = load i8*, i8** %6
%20 = call i32 @dump_string(i8* %19)
%21 = call i32 @dump_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%22 = load i32*, i32** %8
%23 = getelementptr inbounds i32, i32* %22, i64 13
%24 = load i32, i32* %23
%25 = and i32 %24, -4
%26 = load i32, i32* %5
%27 = sub i32 %25, %26
%28 = zext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store i32* %29, i32** %7
%30 = load i32*, i32** %7
%31 = ptrtoint i32* %30 to i32
%32 = call i32 @dump_hex(i32 %31)
%33 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @dump_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %10
br label %35
35: ; preds = %65, %3
%36 = load i32, i32* %10
%37 = icmp sle i32 %36, 13
br i1 %37, label %38, label %68
38: ; preds = %35
%39 = load i32, i32* %10
%40 = icmp slt i32 %39, 13
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = load i32, i32* %10
br label %44
43: ; preds = %38
br label %44
44: ; preds = %43, %41
%45 = phi i32 [ %42, %41 ], [ 14, %43 ]
store i32 %45, i32* %11
%46 = call i32 @dump_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%47 = load i32, i32* %11
%48 = sdiv i32 %47, 10
%49 = add nsw i32 48, %48
%50 = trunc i32 %49 to i8
%51 = call i32 @RPI_AuxMiniUartWrite(i8 signext %50)
%52 = load i32, i32* %11
%53 = srem i32 %52, 10
%54 = add nsw i32 48, %53
%55 = trunc i32 %54 to i8
%56 = call i32 @RPI_AuxMiniUartWrite(i8 signext %55)
%57 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%58 = load i32*, i32** %8
%59 = load i32, i32* %10
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
%62 = load i32, i32* %61
%63 = call i32 @dump_hex(i32 %62)
%64 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %65
65: ; preds = %44
%66 = load i32, i32* %10
%67 = add nsw i32 %66, 1
store i32 %67, i32* %10
br label %35
68: ; preds = %35
%69 = call i32 @dump_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
store i32 -4, i32* %10
br label %70
70: ; preds = %95, %68
%71 = load i32, i32* %10
%72 = icmp sle i32 %71, 4
br i1 %72, label %73, label %98
73: ; preds = %70
%74 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%75 = load i32*, i32** %7
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i32, i32* %75, i64 %77
%79 = ptrtoint i32* %78 to i32
%80 = call i32 @dump_hex(i32 %79)
%81 = call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%82 = load i32*, i32** %7
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %82, i64 %84
%86 = load i32, i32* %85
%87 = call i32 @dump_hex(i32 %86)
%88 = load i32, i32* %10
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %73
%91 = call i32 @dump_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %94
92: ; preds = %73
%93 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %94
94: ; preds = %92, %90
br label %95
95: ; preds = %94
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %70
98: ; preds = %70
%99 = load i32*, i32** %4
%100 = load i32, i32* %99
store i32 %100, i32* %9
%101 = call i32 @dump_string(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%102 = load i32, i32* %9
%103 = call i32 @dump_binary(i32 %102)
%104 = call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%105 = load i32, i32* %9
%106 = and i32 %105, 31
switch i32 %106, label %121 [
i32 16, label %107
i32 17, label %109
i32 18, label %111
i32 19, label %113
i32 23, label %115
i32 27, label %117
i32 31, label %119
]
107: ; preds = %98
%108 = call i32 @dump_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %123
109: ; preds = %98
%110 = call i32 @dump_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %123
111: ; preds = %98
%112 = call i32 @dump_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %123
113: ; preds = %98
%114 = call i32 @dump_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %123
115: ; preds = %98
%116 = call i32 @dump_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %123
117: ; preds = %98
%118 = call i32 @dump_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %123
119: ; preds = %98
%120 = call i32 @dump_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %123
121: ; preds = %98
%122 = call i32 @dump_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %123
123: ; preds = %121, %119, %117, %115, %113, %111, %109, %107
%124 = call i32 @dump_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%125 = call i32 @dump_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
br label %126
126: ; preds = %130, %123
%127 = call i64 (...) @tube_is_rst_active()
%128 = icmp ne i64 %127, 0
%129 = xor i1 %128, true
br i1 %129, label %130, label %131
130: ; preds = %126
br label %126
131: ; preds = %126
br label %132
132: ; preds = %135, %131
%133 = call i64 (...) @tube_is_rst_active()
%134 = icmp ne i64 %133, 0
br i1 %134, label %135, label %136
135: ; preds = %132
br label %132
136: ; preds = %132
%137 = call i32 (...) @reboot_now()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" at \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [13 x i8] c"Registers:\0D\0A\00"
@.str.3 = [5 x i8] c" r[\00"
@.str.4 = [3 x i8] c"]=\00"
@.str.5 = [10 x i8] c"Memory:\0D\0A\00"
@.str.6 = [3 x i8] c" \00"
@.str.7 = [11 x i8] c" <<<<<< \0D\0A\00"
@.str.8 = [48 x i8] c"Flags: \0D\0A NZCV--------------------IFTMMMMM\0D\0A \00"
@.str.9 = [3 x i8] c" (\00"
@.str.10 = [5 x i8] c"User\00"
@.str.11 = [4 x i8] c"FIQ\00"
@.str.12 = [4 x i8] c"IRQ\00"
@.str.13 = [11 x i8] c"Supervisor\00"
@.str.14 = [6 x i8] c"Abort\00"
@.str.15 = [10 x i8] c"Undefined\00"
@.str.16 = [7 x i8] c"System\00"
@.str.17 = [8 x i8] c"Illegal\00"
@.str.18 = [9 x i8] c" Mode)\0D\0A\00"
@.str.19 = [27 x i8] c"Halted waiting for reset\0D\0A\00"
@reltable.dump_info = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.10 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.12 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.16 to i64), i64 ptrtoint ([16 x i32]* @reltable.dump_info to i64)) to i32)]
define void @dump_info(i32* %0, i32 %1, i8* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = and i64 %4, 4294967292
%6 = inttoptr i64 %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = tail call i32 @dump_string(i8* %2)
%9 = tail call i32 @dump_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds i32, i32* %6, i64 14
%11 = load i32, i32* %10
%12 = and i32 %11, -4
%13 = sub i32 %12, %1
%14 = zext i32 %13 to i64
%15 = tail call i32 @dump_hex(i32 %13)
%16 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @dump_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %3, %18
%19 = phi i64 [ 0, %3 ], [ %35, %18 ]
%20 = icmp eq i64 %19, 13
%21 = tail call i32 @dump_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = trunc i64 %19 to i8
%23 = select i1 %20, i8 14, i8 %22
%24 = udiv i8 %23, 10
%25 = add nuw nsw i8 %24, 48
%26 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext %25)
%27 = urem i8 %23, 10
%28 = or i8 %27, 48
%29 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext %28)
%30 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%31 = getelementptr inbounds i32, i32* %7, i64 %19
%32 = load i32, i32* %31
%33 = tail call i32 @dump_hex(i32 %32)
%34 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%35 = add nuw nsw i64 %19, 1
%36 = icmp eq i64 %35, 14
br i1 %36, label %37, label %18
37: ; preds = %18
%38 = inttoptr i64 %14 to i32*
%39 = tail call i32 @dump_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%40 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = getelementptr inbounds i32, i32* %38, i64 -4
%42 = ptrtoint i32* %41 to i64
%43 = trunc i64 %42 to i32
%44 = tail call i32 @dump_hex(i32 %43)
%45 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%46 = load i32, i32* %41
%47 = tail call i32 @dump_hex(i32 %46)
%48 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%50 = getelementptr inbounds i32, i32* %38, i64 -3
%51 = ptrtoint i32* %50 to i64
%52 = trunc i64 %51 to i32
%53 = tail call i32 @dump_hex(i32 %52)
%54 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%55 = load i32, i32* %50
%56 = tail call i32 @dump_hex(i32 %55)
%57 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%58 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%59 = getelementptr inbounds i32, i32* %38, i64 -2
%60 = ptrtoint i32* %59 to i64
%61 = trunc i64 %60 to i32
%62 = tail call i32 @dump_hex(i32 %61)
%63 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%64 = load i32, i32* %59
%65 = tail call i32 @dump_hex(i32 %64)
%66 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%67 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%68 = getelementptr inbounds i32, i32* %38, i64 -1
%69 = ptrtoint i32* %68 to i64
%70 = trunc i64 %69 to i32
%71 = tail call i32 @dump_hex(i32 %70)
%72 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%73 = load i32, i32* %68
%74 = tail call i32 @dump_hex(i32 %73)
%75 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%76 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%77 = tail call i32 @dump_hex(i32 %13)
%78 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%79 = load i32, i32* %38
%80 = tail call i32 @dump_hex(i32 %79)
%81 = tail call i32 @dump_string(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%82 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%83 = getelementptr inbounds i32, i32* %38, i64 1
%84 = ptrtoint i32* %83 to i64
%85 = trunc i64 %84 to i32
%86 = tail call i32 @dump_hex(i32 %85)
%87 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%88 = load i32, i32* %83
%89 = tail call i32 @dump_hex(i32 %88)
%90 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%91 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%92 = getelementptr inbounds i32, i32* %38, i64 2
%93 = ptrtoint i32* %92 to i64
%94 = trunc i64 %93 to i32
%95 = tail call i32 @dump_hex(i32 %94)
%96 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%97 = load i32, i32* %92
%98 = tail call i32 @dump_hex(i32 %97)
%99 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%100 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%101 = getelementptr inbounds i32, i32* %38, i64 3
%102 = ptrtoint i32* %101 to i64
%103 = trunc i64 %102 to i32
%104 = tail call i32 @dump_hex(i32 %103)
%105 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%106 = load i32, i32* %101
%107 = tail call i32 @dump_hex(i32 %106)
%108 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%109 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%110 = getelementptr inbounds i32, i32* %38, i64 4
%111 = ptrtoint i32* %110 to i64
%112 = trunc i64 %111 to i32
%113 = tail call i32 @dump_hex(i32 %112)
%114 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext 61)
%115 = load i32, i32* %110
%116 = tail call i32 @dump_hex(i32 %115)
%117 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%118 = load i32, i32* %6
%119 = tail call i32 @dump_string(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%120 = tail call i32 @dump_binary(i32 %118)
%121 = tail call i32 @dump_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%122 = and i32 %118, 31
%123 = add nsw i32 %122, -16
%124 = icmp ult i32 %123, 16
br i1 %124, label %125, label %129
125: ; preds = %37
%126 = sext i32 %123 to i64
%127 = shl i64 %126, 2
%128 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.dump_info to i8*), i64 %127)
br label %129
129: ; preds = %37, %125
%130 = phi i8* [ %128, %125 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), %37 ]
%131 = tail call i32 @dump_string(i8* %130)
%132 = tail call i32 @dump_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%133 = tail call i32 @dump_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
br label %134
134: ; preds = %134, %129
%135 = tail call i64 (...) @tube_is_rst_active()
%136 = icmp eq i64 %135, 0
br i1 %136, label %134, label %137
137: ; preds = %134, %137
%138 = tail call i64 (...) @tube_is_rst_active()
%139 = icmp eq i64 %138, 0
br i1 %139, label %140, label %137
140: ; preds = %137
%141 = tail call i32 (...) @reboot_now()
ret void
}