#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*/ delay();
int /*<<< orphan*/ fdc_init();
int /*<<< orphan*/ fdc_printf(char *, ...);
int /*<<< orphan*/ fdc_sprintf(char *, char *, ...);
int main() {
  volatile int *IO_LEDR = (int *)0xbf800000;
  volatile int *IO_PUSHBUTTONS = (int *)0xbf80000c;
  volatile unsigned int pushbutton;
  volatile unsigned short count = 0;
  fdc_init();
  while (1) {
    pushbutton = *IO_PUSHBUTTONS;
    switch (pushbutton) {
    case 0x1: {
      if (count == 0)
        count = 0xf000;
      else
        count = count >> 1;
      fdc_printf("1");
      fdc_printf("1\n");
      fdc_printf("12\n");
      fdc_printf("123\n");
      break;
    }
    case 0x2: {
      if (count == 0)
        count = ~count;
      else
        count = 0;
      char *ptr = "Hello world!";
      char *np = 0;
      int i = 5;
      unsigned int bs = sizeof(int) * 8;
      int mi;
      char buf[80];
      mi = (1 << (bs - 1)) + 1;
      fdc_printf("%s\n", ptr);
      fdc_printf("printf test\n");
      fdc_printf("%s is null pointer\n", np);
      fdc_printf("%d = 5\n", i);
      fdc_printf("%d = - max int\n", mi);
      fdc_printf("char %c = 'a'\n", 'a');
      fdc_printf("hex %x = ff\n", 0xff);
      fdc_printf("hex %02x = 00\n", 0);
      fdc_printf("signed %d = unsigned %u = hex %x\n", -3, -3, -3);
      fdc_printf("%d %s(s)%", 0, "message");
      fdc_printf("\n");
      fdc_printf("%d %s(s) with %%\n", 0, "message");
      fdc_printf("justif: \"%-10s\"\n", "left");
      fdc_sprintf(buf, "justif: \"%-10s\"\n", "left");
      fdc_printf("%s", buf);
      fdc_sprintf(buf, "justif: \"%10s\"\n", "right");
      fdc_printf("%s", buf);
      fdc_sprintf(buf, " 3: %04d zero padded\n", 3);
      fdc_printf("%s", buf);
      fdc_sprintf(buf, " 3: %-4d left justif.\n", 3);
      fdc_printf("%s", buf);
      fdc_sprintf(buf, " 3: %4d right justif.\n", 3);
      fdc_printf("%s", buf);
      fdc_sprintf(buf, "-3: %04d zero padded\n", -3);
      fdc_printf("%s", buf);
      fdc_sprintf(buf, "-3: %-4d left justif.\n", -3);
      fdc_printf("%s", buf);
      fdc_sprintf(buf, "-3: %4d right justif.\n", -3);
      fdc_printf("%s", buf);
      break;
    }
    case 0x4: {
      count--;
      fdc_printf(
          "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789\n");
      break;
    }
    case 0x8: {
      for (count = 64000; count < 65000; count++) {
        fdc_printf("%d\n", count);
      }
      break;
    }
    case 0x10: {
      fdc_printf("count = %d\n", count++);
      break;
    }
    default:
      if (count == 0)
        count = 0xf;
      else
        count = count << 1;
    }
    *IO_LEDR = count;
    delay();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xbf800000,%eax
mov    %rax,-0x10(%rbp)
mov    $0xbf80000c,%eax
mov    %rax,-0x18(%rbp)
movw   $0x0,-0x1e(%rbp)
mov    $0x0,%al
call   1030 <fdc_init@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0xf,%eax
ja     1566 <main+0x426>
mov    -0x98(%rbp),%rax
lea    0xe60(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
cmp    $0x0,%eax
jne    11c4 <main+0x84>
movw   $0xf000,-0x1e(%rbp)
jmp    11d2 <main+0x92>
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
sar    $0x1,%eax
mov    %ax,-0x1e(%rbp)
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
jmp    1594 <main+0x454>
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
cmp    $0x0,%eax
jne    1232 <main+0xf2>
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
xor    $0xffffffff,%eax
mov    %ax,-0x1e(%rbp)
jmp    1238 <main+0xf8>
movw   $0x0,-0x1e(%rbp)
lea    0xe0f(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x5,-0x34(%rbp)
movl   $0x20,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
mov    -0x34(%rbp),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdd1(%rip),%rdi
mov    $0x61,%esi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdcd(%rip),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdc7(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdc6(%rip),%rdi
mov    $0xfffffffd,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdd1(%rip),%rdi
xor    %esi,%esi
lea    0xdd2(%rip),%rdx
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdbe(%rip),%rdi
xor    %esi,%esi
lea    0xdad(%rip),%rdx
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    0xdb9(%rip),%rdi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd9d(%rip),%rsi
lea    0xda7(%rip),%rdx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd85(%rip),%rsi
lea    0xd8e(%rip),%rdx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd51(%rip),%rsi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xd08(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd39(%rip),%rsi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd21(%rip),%rsi
mov    $0xfffffffd,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xd08(%rip),%rsi
mov    $0xfffffffd,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xcf0(%rip),%rsi
mov    $0xfffffffd,%edx
mov    $0x0,%al
call   1040 <fdc_sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xc4c(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
jmp    1594 <main+0x454>
mov    -0x1e(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x1e(%rbp)
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
jmp    1594 <main+0x454>
movw   $0xfa00,-0x1e(%rbp)
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
cmp    $0xfde8,%eax
jge    153c <main+0x3fc>
mov    -0x1e(%rbp),%ax
movzwl %ax,%esi
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
mov    -0x1e(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1e(%rbp)
jmp    1504 <main+0x3c4>
jmp    1594 <main+0x454>
mov    -0x1e(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1e(%rbp)
movzwl %ax,%esi
lea    0xca8(%rip),%rdi
mov    $0x0,%al
call   1050 <fdc_printf@plt>
jmp    1594 <main+0x454>
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
cmp    $0x0,%eax
jne    1581 <main+0x441>
movw   $0xf,-0x1e(%rbp)
jmp    158f <main+0x44f>
mov    -0x1e(%rbp),%ax
movzwl %ax,%eax
shl    $0x1,%eax
mov    %ax,-0x1e(%rbp)
jmp    1594 <main+0x454>
mov    -0x1e(%rbp),%ax
movzwl %ax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1060 <delay@plt>
jmp    1171 <main+0x31>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    $0xbf800000,%r13d
movw   $0x0,0xa(%rsp)
xor    %eax,%eax
call   1030 <fdc_init@plt>
lea    0xe97(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0x1095(%rip),%r14
jmp    11b0 <main+0x70>
movzwl 0xa(%rsp),%esi
lea    0x1(%rsi),%eax
mov    %ax,0xa(%rsp)
lea    0x1077(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzwl 0xa(%rsp),%eax
mov    %eax,0x0(%r13)
xor    %eax,%eax
call   1060 <delay@plt>
mov    0xc(%r13),%eax
mov    %eax,0xc(%rsp)
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xf,%eax
ja     11fb <main+0xbb>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
cmpw   $0x0,0xa(%rsp)
je     1272 <main+0x132>
shrw   0xa(%rsp)
jmp    1279 <main+0x139>
cmpw   $0x0,0xa(%rsp)
je     12b6 <main+0x176>
movw   $0x0,0xa(%rsp)
jmp    12bb <main+0x17b>
cmpw   $0x0,0xa(%rsp)
je     1266 <main+0x126>
shlw   0xa(%rsp)
jmp    11a0 <main+0x60>
addw   $0xffff,0xa(%rsp)
lea    0xfa9(%rip),%rdi
jmp    12aa <main+0x16a>
movw   $0xfa00,0xa(%rsp)
movzwl 0xa(%rsp),%eax
cmp    $0xfde7,%eax
ja     11a0 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzwl 0xa(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
addw   $0x1,0xa(%rsp)
movzwl 0xa(%rsp),%eax
cmp    $0xfde8,%eax
jb     1240 <main+0x100>
jmp    11a0 <main+0x60>
movw   $0xf,0xa(%rsp)
jmp    11a0 <main+0x60>
movw   $0xf000,0xa(%rsp)
lea    0xdc0(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xdb4(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xda9(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd9f(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
jmp    11a0 <main+0x60>
notw   0xa(%rsp)
lea    0xd99(%rip),%rdi
lea    0xd85(%rip),%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd88(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd87(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd8b(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd80(%rip),%rdi
mov    $0x80000001,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd7d(%rip),%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd79(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd73(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd72(%rip),%rdi
mov    $0xfffffffd,%esi
mov    $0xfffffffd,%edx
mov    $0xfffffffd,%ecx
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd77(%rip),%rdi
xor    %esi,%esi
lea    0xd78(%rip),%r15
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd61(%rip),%rdi
xor    %esi,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xd60(%rip),%rbx
mov    %rbx,%rdi
lea    0xd67(%rip),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
lea    0xd4b(%rip),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xd37(%rip),%rsi
lea    0xd40(%rip),%rdx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xd28(%rip),%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xd1b(%rip),%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xd0f(%rip),%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xd03(%rip),%rsi
mov    $0xfffffffd,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xcf6(%rip),%rsi
mov    $0xfffffffd,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
mov    %r12,%rdi
lea    0xcea(%rip),%rsi
mov    $0xfffffffd,%edx
xor    %eax,%eax
call   1040 <fdc_sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fdc_printf@plt>
lea    0xb21(%rip),%rbx
jmp    11a0 <main+0x60>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [4 x i8] c"12\0A\00"
@.str.3 = [5 x i8] c"123\0A\00"
@.str.4 = [13 x i8] c"Hello world!\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [13 x i8] c"printf test\0A\00"
@.str.7 = [20 x i8] c"%s is null pointer\0A\00"
@.str.8 = [8 x i8] c"%d = 5\0A\00"
@.str.9 = [16 x i8] c"%d = - max int\0A\00"
@.str.10 = [15 x i8] c"char %c = 'a'\0A\00"
@.str.11 = [13 x i8] c"hex %x = ff\0A\00"
@.str.12 = [15 x i8] c"hex %02x = 00\0A\00"
@.str.13 = [34 x i8] c"signed %d = unsigned %u = hex %x\0A\00"
@.str.14 = [10 x i8] c"%d %s(s)%\00"
@.str.15 = [8 x i8] c"message\00"
@.str.16 = [2 x i8] c"\0A\00"
@.str.17 = [18 x i8] c"%d %s(s) with %%\0A\00"
@.str.18 = [17 x i8] c"justif: \22%-10s\22\0A\00"
@.str.19 = [5 x i8] c"left\00"
@.str.20 = [3 x i8] c"%s\00"
@.str.21 = [16 x i8] c"justif: \22%10s\22\0A\00"
@.str.22 = [6 x i8] c"right\00"
@.str.23 = [22 x i8] c" 3: %04d zero padded\0A\00"
@.str.24 = [23 x i8] c" 3: %-4d left justif.\0A\00"
@.str.25 = [23 x i8] c" 3: %4d right justif.\0A\00"
@.str.26 = [22 x i8] c"-3: %04d zero padded\0A\00"
@.str.27 = [23 x i8] c"-3: %-4d left justif.\0A\00"
@.str.28 = [23 x i8] c"-3: %4d right justif.\0A\00"
@.str.29 = [66 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789\0A\00"
@.str.30 = [4 x i8] c"%d\0A\00"
@.str.31 = [12 x i8] c"count = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [80 x i8]
store i32 0, i32* %1
store i32* inttoptr (i64 3212836864 to i32*), i32** %2
store i32* inttoptr (i64 3212836876 to i32*), i32** %3
store volatile i16 0, i16* %5
%12 = call i32 (...) @fdc_init()
br label %13
13: ; preds = %0, %129
%14 = load i32*, i32** %3
%15 = load volatile i32, i32* %14
store volatile i32 %15, i32* %4
%16 = load volatile i32, i32* %4
switch i32 %16, label %118 [
i32 1, label %17
i32 2, label %32
i32 4, label %96
i32 8, label %100
i32 16, label %113
]
17: ; preds = %13
%18 = load volatile i16, i16* %5
%19 = zext i16 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store volatile i16 -4096, i16* %5
br label %27
22: ; preds = %17
%23 = load volatile i16, i16* %5
%24 = zext i16 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i16
store volatile i16 %26, i16* %5
br label %27
27: ; preds = %22, %21
%28 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%29 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %129
32: ; preds = %13
%33 = load volatile i16, i16* %5
%34 = zext i16 %33 to i32
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load volatile i16, i16* %5
%38 = zext i16 %37 to i32
%39 = xor i32 %38, -1
%40 = trunc i32 %39 to i16
store volatile i16 %40, i16* %5
br label %42
41: ; preds = %32
store volatile i16 0, i16* %5
br label %42
42: ; preds = %41, %36
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** %6
store i8* null, i8** %7
store i32 5, i32* %8
store i32 32, i32* %9
%43 = load i32, i32* %9
%44 = sub i32 %43, 1
%45 = shl i32 1, %44
%46 = add nsw i32 %45, 1
store i32 %46, i32* %10
%47 = load i8*, i8** %6
%48 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %47)
%49 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%50 = load i8*, i8** %7
%51 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* %50)
%52 = load i32, i32* %8
%53 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %10
%55 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %54)
%56 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 97)
%57 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 255)
%58 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 0)
%59 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 -3, i32 -3, i32 -3)
%60 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%61 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%62 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%63 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%64 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%65 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %64, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%66 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%67 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %66)
%68 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%69 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %68, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%70 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%71 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %70)
%72 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%73 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %72, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i64 0, i64 0), i32 3)
%74 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%75 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %74)
%76 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%77 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %76, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i32 3)
%78 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%79 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %78)
%80 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%81 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %80, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i32 3)
%82 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%83 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%85 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %84, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0), i32 -3)
%86 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%87 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %86)
%88 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%89 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %88, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.27, i64 0, i64 0), i32 -3)
%90 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%91 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %90)
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%93 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %92, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.28, i64 0, i64 0), i32 -3)
%94 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%95 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %94)
br label %129
96: ; preds = %13
%97 = load volatile i16, i16* %5
%98 = add i16 %97, -1
store volatile i16 %98, i16* %5
%99 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.29, i64 0, i64 0))
br label %129
100: ; preds = %13
store volatile i16 -1536, i16* %5
br label %101
101: ; preds = %109, %100
%102 = load volatile i16, i16* %5
%103 = zext i16 %102 to i32
%104 = icmp slt i32 %103, 65000
br i1 %104, label %105, label %112
105: ; preds = %101
%106 = load volatile i16, i16* %5
%107 = zext i16 %106 to i32
%108 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i32 %107)
br label %109
109: ; preds = %105
%110 = load volatile i16, i16* %5
%111 = add i16 %110, 1
store volatile i16 %111, i16* %5
br label %101
112: ; preds = %101
br label %129
113: ; preds = %13
%114 = load volatile i16, i16* %5
%115 = add i16 %114, 1
store volatile i16 %115, i16* %5
%116 = zext i16 %114 to i32
%117 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.31, i64 0, i64 0), i32 %116)
br label %129
118: ; preds = %13
%119 = load volatile i16, i16* %5
%120 = zext i16 %119 to i32
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %118
store volatile i16 15, i16* %5
br label %128
123: ; preds = %118
%124 = load volatile i16, i16* %5
%125 = zext i16 %124 to i32
%126 = shl i32 %125, 1
%127 = trunc i32 %126 to i16
store volatile i16 %127, i16* %5
br label %128
128: ; preds = %123, %122
br label %129
129: ; preds = %128, %113, %112, %96, %42, %27
%130 = load volatile i16, i16* %5
%131 = zext i16 %130 to i32
%132 = load i32*, i32** %2
store volatile i32 %131, i32* %132
%133 = call i32 (...) @delay()
br label %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [4 x i8] c"12\0A\00"
@.str.3 = [5 x i8] c"123\0A\00"
@.str.4 = [13 x i8] c"Hello world!\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [13 x i8] c"printf test\0A\00"
@.str.7 = [20 x i8] c"%s is null pointer\0A\00"
@.str.8 = [8 x i8] c"%d = 5\0A\00"
@.str.9 = [16 x i8] c"%d = - max int\0A\00"
@.str.10 = [15 x i8] c"char %c = 'a'\0A\00"
@.str.11 = [13 x i8] c"hex %x = ff\0A\00"
@.str.12 = [15 x i8] c"hex %02x = 00\0A\00"
@.str.13 = [34 x i8] c"signed %d = unsigned %u = hex %x\0A\00"
@.str.14 = [10 x i8] c"%d %s(s)%\00"
@.str.15 = [8 x i8] c"message\00"
@.str.16 = [2 x i8] c"\0A\00"
@.str.17 = [18 x i8] c"%d %s(s) with %%\0A\00"
@.str.18 = [17 x i8] c"justif: \22%-10s\22\0A\00"
@.str.19 = [5 x i8] c"left\00"
@.str.20 = [3 x i8] c"%s\00"
@.str.21 = [16 x i8] c"justif: \22%10s\22\0A\00"
@.str.22 = [6 x i8] c"right\00"
@.str.23 = [22 x i8] c" 3: %04d zero padded\0A\00"
@.str.24 = [23 x i8] c" 3: %-4d left justif.\0A\00"
@.str.25 = [23 x i8] c" 3: %4d right justif.\0A\00"
@.str.26 = [22 x i8] c"-3: %04d zero padded\0A\00"
@.str.27 = [23 x i8] c"-3: %-4d left justif.\0A\00"
@.str.28 = [23 x i8] c"-3: %4d right justif.\0A\00"
@.str.29 = [66 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789\0A\00"
@.str.30 = [4 x i8] c"%d\0A\00"
@.str.31 = [12 x i8] c"count = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca [80 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i16* %2 to i8*
store volatile i16 0, i16* %2
%6 = tail call i32 (...) @fdc_init()
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
br label %8
8: ; preds = %87, %0
%9 = load volatile i32, i32* inttoptr (i64 3212836876 to i32*)
store volatile i32 %9, i32* %1
%10 = load volatile i32, i32* %1
switch i32 %10, label %80 [
i32 1, label %11
i32 2, label %23
i32 4, label %60
i32 8, label %64
i32 16, label %75
]
11: ; preds = %8
%12 = load volatile i16, i16* %2
%13 = icmp eq i16 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store volatile i16 -4096, i16* %2
br label %18
15: ; preds = %11
%16 = load volatile i16, i16* %2
%17 = lshr i16 %16, 1
store volatile i16 %17, i16* %2
br label %18
18: ; preds = %15, %14
%19 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %87
23: ; preds = %8
%24 = load volatile i16, i16* %2
%25 = icmp eq i16 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load volatile i16, i16* %2
%28 = xor i16 %27, -1
store volatile i16 %28, i16* %2
br label %30
29: ; preds = %23
store volatile i16 0, i16* %2
br label %30
30: ; preds = %29, %26
%31 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* null)
%34 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 5)
%35 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 -2147483647)
%36 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 97)
%37 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 255)
%38 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 0)
%39 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 -3, i32 -3, i32 -3)
%40 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%41 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%42 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%43 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%44 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%45 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%46 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%47 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%48 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i64 0, i64 0), i32 3)
%49 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%50 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i32 3)
%51 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%52 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i32 3)
%53 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%54 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0), i32 -3)
%55 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%56 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.27, i64 0, i64 0), i32 -3)
%57 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
%58 = call i32 (i8*, i8*, ...) @fdc_sprintf(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.28, i64 0, i64 0), i32 -3)
%59 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %7)
br label %87
60: ; preds = %8
%61 = load volatile i16, i16* %2
%62 = add i16 %61, -1
store volatile i16 %62, i16* %2
%63 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.29, i64 0, i64 0))
br label %87
64: ; preds = %8
store volatile i16 -1536, i16* %2
%65 = load volatile i16, i16* %2
%66 = icmp ult i16 %65, -536
br i1 %66, label %67, label %87
67: ; preds = %64, %67
%68 = load volatile i16, i16* %2
%69 = zext i16 %68 to i32
%70 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i32 %69)
%71 = load volatile i16, i16* %2
%72 = add i16 %71, 1
store volatile i16 %72, i16* %2
%73 = load volatile i16, i16* %2
%74 = icmp ult i16 %73, -536
br i1 %74, label %67, label %87
75: ; preds = %8
%76 = load volatile i16, i16* %2
%77 = add i16 %76, 1
store volatile i16 %77, i16* %2
%78 = zext i16 %76 to i32
%79 = call i32 (i8*, ...) @fdc_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.31, i64 0, i64 0), i32 %78)
br label %87
80: ; preds = %8
%81 = load volatile i16, i16* %2
%82 = icmp eq i16 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %80
store volatile i16 15, i16* %2
br label %87
84: ; preds = %80
%85 = load volatile i16, i16* %2
%86 = shl i16 %85, 1
store volatile i16 %86, i16* %2
br label %87
87: ; preds = %67, %64, %83, %84, %75, %60, %30, %18
%88 = load volatile i16, i16* %2
%89 = zext i16 %88 to i32
store volatile i32 %89, i32* inttoptr (i64 3212836864 to i32*)
%90 = call i32 (...) @delay()
br label %8
}