int main(int argc, char *argv[]) {
  char c;
  char noprompt;
  char last_c;
  unsigned char *address;
  for (;;) {
    last_c = c;
    if (!noprompt)
      printf("-> ");
    noprompt = 0;
    switch (c = getchr()) {
    case '\r':
    case '\n':
      if (last_c == 'd') {
        address += 0x100;
        printf("\b\b\b\b");
        display_memory(address);
        c = 'd';
      }
      noprompt = 1;
      break;
    case 'a': {
      char t[] = {1, '=', 2};
      break;
    }
    case 'D':
    case 'd':
      last_c = 'd';
      printf("Display ");
      address = (unsigned char *)gethex(1);
      printf("\r\n");
      getchr();
      display_memory(address);
      break;
    case 'E':
    case 'e':
      printf("LEDs ");
      gethex(1);
      ASM(" OUT R, (OUT_LEDS)");
      printf("\r\n");
      getchr();
      break;
    case 'K':
    case 'k':
      printf("Stack is at 0x%X\r\n", ASM(" LEA 0(SP), RR"));
      break;
    case 'M':
    case 'm':
      printf("Memory ");
      address = (unsigned char *)gethex(1);
      printf(" Value ");
      getchr();
      *address = gethex(1);
      getchr();
      printf("\r\n");
      break;
    case 'S':
    case 's':
      printf("DIP switch is 0x%X\r\n", ASM(" IN (IN_DIP_SWITCH), RU"));
      break;
    case 'T':
    case 't': {
      int temp = ASM(" IN (IN_TEMPERAT), RU");
      printf("Temperature is %d degrees Celsius\r\n", temp);
      break;
    }
    case 'Q':
    case 'q':
    case 'X':
    case 'x':
      printf("Halted.\r\n");
      ASM(" HALT");
      break;
    default:
      printf("\r\n"
             "C - show time\r\n"
             "D - display memory\r\n"
             "E - set LEDs\r\n"
             "K - show stack\r\n"
             "M - modify memory\r\n"
             "S - read DIP switch\r\n"
             "T - read temperature\r\n"
             "Q - quit\r\n"
             "X - exit\r\n"
             "\r\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x13(%rbp)
cmpb   $0x0,-0x12(%rbp)
jne    1184 <main+0x34>
lea    0x1042(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x0,-0x12(%rbp)
xor    %eax,%eax
call   1030 <getchr@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x6e,%eax
ja     1391 <main+0x241>
mov    -0x30(%rbp),%rax
lea    0xe4e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x13(%rbp),%eax
cmp    $0x64,%eax
jne    11f3 <main+0xa3>
mov    -0x20(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x20(%rbp)
lea    0xfe6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <display_memory@plt>
movb   $0x64,-0x11(%rbp)
movb   $0x1,-0x12(%rbp)
jmp    139f <main+0x24f>
mov    0xfb9(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xfb1(%rip),%al
mov    %al,-0x21(%rbp)
jmp    139f <main+0x24f>
movb   $0x64,-0x13(%rbp)
lea    0xfa8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <gethex@plt>
cltq
mov    %rax,-0x20(%rbp)
lea    0x10e8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getchr@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <display_memory@plt>
jmp    139f <main+0x24f>
lea    0xf6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <gethex@plt>
lea    0xf58(%rip),%rdi
mov    $0x0,%al
call   1070 <ASM@plt>
lea    0x109b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getchr@plt>
jmp    139f <main+0x24f>
lea    0xf56(%rip),%rdi
mov    $0x0,%al
call   1070 <ASM@plt>
mov    %eax,%esi
lea    0xf33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    139f <main+0x24f>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <gethex@plt>
cltq
mov    %rax,-0x20(%rbp)
lea    0xf2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getchr@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <gethex@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <getchr@plt>
lea    0x100e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    139f <main+0x24f>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1070 <ASM@plt>
mov    %eax,%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    139f <main+0x24f>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1070 <ASM@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    139f <main+0x24f>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1070 <ASM@plt>
jmp    139f <main+0x24f>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1166 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x104a(%rip),%rbx
lea    0xe87(%rip),%r15
xor    %r13d,%r13d
jmp    119c <main+0x3c>
lea    0x1075(%rip),%rdi
xor    %eax,%eax
call   1080 <ASM@plt>
lea    0x1054(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13d,%r14d
test   $0x1,%r12b
je     11af <main+0x4f>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <getchr@plt>
mov    %eax,%r13d
movsbl %r13b,%eax
mov    $0x1,%r12b
add    $0xfffffff6,%eax
cmp    $0x6e,%eax
ja     1333 <main+0x1d3>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
lea    0x10aa(%rip),%rdi
call   1040 <puts@plt>
lea    0x1098(%rip),%rdi
xor    %eax,%eax
call   1080 <ASM@plt>
jmp    119c <main+0x3c>
xor    %r12d,%r12d
cmp    $0x64,%r14b
jne    119c <main+0x3c>
add    $0x100,%rbp
xor    %r12d,%r12d
lea    0xfb5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <display_memory@plt>
mov    $0x64,%r13d
jmp    119c <main+0x3c>
lea    0xf97(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <gethex@plt>
movslq %eax,%rbp
lea    0x10d9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <getchr@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <display_memory@plt>
jmp    119c <main+0x3c>
lea    0xf61(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <gethex@plt>
lea    0xf4d(%rip),%rdi
xor    %eax,%eax
call   1080 <ASM@plt>
lea    0x108f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <getchr@plt>
jmp    119c <main+0x3c>
lea    0xf5c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <gethex@plt>
movslq %eax,%rbp
lea    0xf47(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <getchr@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <gethex@plt>
mov    %al,0x0(%rbp)
xor    %eax,%eax
call   1030 <getchr@plt>
lea    0x102f(%rip),%rdi
call   1040 <puts@plt>
jmp    119c <main+0x3c>
lea    0xf28(%rip),%rdi
xor    %eax,%eax
call   1080 <ASM@plt>
lea    0xf05(%rip),%rdi
jmp    1193 <main+0x33>
lea    0xf26(%rip),%rdi
xor    %eax,%eax
call   1080 <ASM@plt>
lea    0xf2e(%rip),%rdi
jmp    1193 <main+0x33>
lea    0xf55(%rip),%rdi
call   1040 <puts@plt>
jmp    119c <main+0x3c>

LLVM IR (-O0):
@.str = [4 x i8] c"-> \00"
@.str.1 = [5 x i8] c"\08\08\08\08\00"
@__const.main.t = [3 x i8] c"\01=\02"
@.str.2 = [9 x i8] c"Display \00"
@.str.3 = [3 x i8] c"\0D\0A\00"
@.str.4 = [6 x i8] c"LEDs \00"
@.str.5 = [19 x i8] c" OUT R, (OUT_LEDS)\00"
@.str.6 = [19 x i8] c"Stack is at 0x%X\0D\0A\00"
@.str.7 = [15 x i8] c" LEA 0(SP), RR\00"
@.str.8 = [8 x i8] c"Memory \00"
@.str.9 = [8 x i8] c" Value \00"
@.str.10 = [21 x i8] c"DIP switch is 0x%X\0D\0A\00"
@.str.11 = [24 x i8] c" IN (IN_DIP_SWITCH), RU\00"
@.str.12 = [22 x i8] c" IN (IN_TEMPERAT), RU\00"
@.str.13 = [36 x i8] c"Temperature is %d degrees Celsius\0D\0A\00"
@.str.14 = [10 x i8] c"Halted.\0D\0A\00"
@.str.15 = [6 x i8] c" HALT\00"
@.str.16 = [152 x i8] c"\0D\0AC - show time\0D\0AD - display memory\0D\0AE - set LEDs\0D\0AK - show stack\0D\0AM - modify memory\0D\0AS - read DIP switch\0D\0AT - read temperature\0D\0AQ - quit\0D\0AX - exit\0D\0A\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca [3 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %12
12: ; preds = %77, %2
%13 = load i8, i8* %6
store i8 %13, i8* %8
%14 = load i8, i8* %7
%15 = icmp ne i8 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
store i8 0, i8* %7
%19 = call i32 (...) @getchr()
%20 = trunc i32 %19 to i8
store i8 %20, i8* %6
%21 = sext i8 %20 to i32
switch i32 %21, label %75 [
i32 13, label %22
i32 10, label %22
i32 97, label %33
i32 68, label %35
i32 100, label %35
i32 69, label %44
i32 101, label %44
i32 75, label %50
i32 107, label %50
i32 77, label %53
i32 109, label %53
i32 83, label %65
i32 115, label %65
i32 84, label %68
i32 116, label %68
i32 81, label %72
i32 113, label %72
i32 88, label %72
i32 120, label %72
]
22: ; preds = %18, %18
%23 = load i8, i8* %8
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 100
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i8*, i8** %9
%28 = getelementptr inbounds i8, i8* %27, i64 256
store i8* %28, i8** %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%30 = load i8*, i8** %9
%31 = call i32 (i8*, ...) bitcast (i32 (...)* @display_memory to i32 (i8*, ...)*)(i8* %30)
store i8 100, i8* %6
br label %32
32: ; preds = %26, %22
store i8 1, i8* %7
br label %77
33: ; preds = %18
%34 = bitcast [3 x i8]* %10 to i8*
br label %77
35: ; preds = %18, %18
store i8 100, i8* %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i8*
store i8* %39, i8** %9
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%41 = call i32 (...) @getchr()
%42 = load i8*, i8** %9
%43 = call i32 (i8*, ...) bitcast (i32 (...)* @display_memory to i32 (i8*, ...)*)(i8* %42)
br label %77
44: ; preds = %18, %18
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%47 = call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32 (...) @getchr()
br label %77
50: ; preds = %18, %18
%51 = call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %51)
br label %77
53: ; preds = %18, %18
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%55 = call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%56 = sext i32 %55 to i64
%57 = inttoptr i64 %56 to i8*
store i8* %57, i8** %9
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%59 = call i32 (...) @getchr()
%60 = call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%61 = trunc i32 %60 to i8
%62 = load i8*, i8** %9
store i8 %61, i8* %62
%63 = call i32 (...) @getchr()
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %77
65: ; preds = %18, %18
%66 = call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %66)
br label %77
68: ; preds = %18, %18
%69 = call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
store i32 %69, i32* %11
%70 = load i32, i32* %11
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i32 %70)
br label %77
72: ; preds = %18, %18, %18, %18
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%74 = call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
br label %77
75: ; preds = %18
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.16, i64 0, i64 0))
br label %77
77: ; preds = %75, %72, %68, %65, %53, %50, %44, %35, %33, %32
br label %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"-> \00"
@.str.1 = [5 x i8] c"\08\08\08\08\00"
@.str.2 = [9 x i8] c"Display \00"
@.str.4 = [6 x i8] c"LEDs \00"
@.str.5 = [19 x i8] c" OUT R, (OUT_LEDS)\00"
@.str.6 = [19 x i8] c"Stack is at 0x%X\0D\0A\00"
@.str.7 = [15 x i8] c" LEA 0(SP), RR\00"
@.str.8 = [8 x i8] c"Memory \00"
@.str.9 = [8 x i8] c" Value \00"
@.str.10 = [21 x i8] c"DIP switch is 0x%X\0D\0A\00"
@.str.11 = [24 x i8] c" IN (IN_DIP_SWITCH), RU\00"
@.str.12 = [22 x i8] c" IN (IN_TEMPERAT), RU\00"
@.str.13 = [36 x i8] c"Temperature is %d degrees Celsius\0D\0A\00"
@.str.15 = [6 x i8] c" HALT\00"
@str = [9 x i8] c"Halted.\0D\00"
@str.19 = [2 x i8] c"\0D\00"
@str.20 = [151 x i8] c"\0D\0AC - show time\0D\0AD - display memory\0D\0AE - set LEDs\0D\0AK - show stack\0D\0AM - modify memory\0D\0AS - read DIP switch\0D\0AT - read temperature\0D\0AQ - quit\0D\0AX - exit\0D\0A\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i1 [ undef, %2 ], [ %14, %13 ]
%5 = phi i8* [ undef, %2 ], [ %15, %13 ]
%6 = phi i32 [ 0, %2 ], [ %16, %13 ]
br i1 %4, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = tail call i32 (...) @getchr()
%11 = shl i32 %10, 24
%12 = ashr exact i32 %11, 24
switch i32 %12, label %61 [
i32 13, label %17
i32 10, label %17
i32 97, label %13
i32 68, label %24
i32 100, label %24
i32 69, label %32
i32 101, label %32
i32 75, label %38
i32 107, label %38
i32 77, label %41
i32 109, label %41
i32 83, label %52
i32 115, label %52
i32 84, label %55
i32 116, label %55
i32 81, label %58
i32 113, label %58
i32 88, label %58
i32 120, label %58
]
13: ; preds = %9, %17, %20, %61, %58, %55, %52, %41, %38, %32, %24
%14 = phi i1 [ true, %24 ], [ true, %32 ], [ true, %38 ], [ true, %41 ], [ true, %52 ], [ true, %55 ], [ true, %58 ], [ true, %61 ], [ false, %20 ], [ false, %17 ], [ true, %9 ]
%15 = phi i8* [ %28, %24 ], [ %5, %32 ], [ %5, %38 ], [ %45, %41 ], [ %5, %52 ], [ %5, %55 ], [ %5, %58 ], [ %5, %61 ], [ %21, %20 ], [ %5, %17 ], [ %5, %9 ]
%16 = phi i32 [ %10, %24 ], [ %10, %32 ], [ %10, %38 ], [ %10, %41 ], [ %10, %52 ], [ %10, %55 ], [ %10, %58 ], [ %10, %61 ], [ 100, %20 ], [ %10, %17 ], [ %10, %9 ]
br label %3
17: ; preds = %9, %9
%18 = and i32 %6, 255
%19 = icmp eq i32 %18, 100
br i1 %19, label %20, label %13
20: ; preds = %17
%21 = getelementptr inbounds i8, i8* %5, i64 256
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) bitcast (i32 (...)* @display_memory to i32 (i8*, ...)*)(i8* %21)
br label %13
24: ; preds = %9, %9
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%30 = tail call i32 (...) @getchr()
%31 = tail call i32 (i8*, ...) bitcast (i32 (...)* @display_memory to i32 (i8*, ...)*)(i8* %28)
br label %13
32: ; preds = %9, %9
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%34 = tail call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%35 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%37 = tail call i32 (...) @getchr()
br label %13
38: ; preds = %9, %9
%39 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %39)
br label %13
41: ; preds = %9, %9
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%43 = tail call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%44 = sext i32 %43 to i64
%45 = inttoptr i64 %44 to i8*
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%47 = tail call i32 (...) @getchr()
%48 = tail call i32 (i32, ...) bitcast (i32 (...)* @gethex to i32 (i32, ...)*)(i32 1)
%49 = trunc i32 %48 to i8
store i8 %49, i8* %45
%50 = tail call i32 (...) @getchr()
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
br label %13
52: ; preds = %9, %9
%53 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %53)
br label %13
55: ; preds = %9, %9
%56 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i32 %56)
br label %13
58: ; preds = %9, %9, %9, %9
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%60 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ASM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
br label %13
61: ; preds = %9
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([151 x i8], [151 x i8]* @str.20, i64 0, i64 0))
br label %13
}