#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*/ abort();
int printf(char *, ...);
int main(void) {
  printf("hello");
  if (printf("hello") != 5)
    abort();
  ;
  printf("hello\n");
  if (printf("hello\n") != 6)
    abort();
  ;
  printf("a");
  if (printf("a") != 1)
    abort();
  ;
  printf("");
  if (printf("") != 0)
    abort();
  ;
  printf("%s", "hello");
  if (printf("%s", "hello") != 5)
    abort();
  ;
  printf("%s", "hello\n");
  if (printf("%s", "hello\n") != 6)
    abort();
  ;
  printf("%s", "a");
  if (printf("%s", "a") != 1)
    abort();
  ;
  printf("%s", "");
  if (printf("%s", "") != 0)
    abort();
  ;
  printf("%c", 'x');
  if (printf("%c", 'x') != 1)
    abort();
  ;
  printf("%s\n", "hello\n");
  if (printf("%s\n", "hello\n") != 7)
    abort();
  ;
  printf("%d\n", 0);
  if (printf("%d\n", 0) != 2)
    abort();
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     115b <main+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x6,%eax
je     1187 <main+0x67>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x1,%eax
je     11b3 <main+0x93>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x0,%eax
je     11df <main+0xbf>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe29(%rip),%rdi
lea    0xe13(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe14(%rip),%rdi
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     1219 <main+0xf9>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xdef(%rip),%rdi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdda(%rip),%rdi
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x6,%eax
je     1253 <main+0x133>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xdb5(%rip),%rdi
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xda0(%rip),%rdi
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x1,%eax
je     128d <main+0x16d>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xd7b(%rip),%rdi
lea    0xd81(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd66(%rip),%rdi
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x0,%eax
je     12c7 <main+0x1a7>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xd44(%rip),%rdi
mov    $0x78,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd31(%rip),%rdi
mov    $0x78,%esi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x1,%eax
je     12fd <main+0x1dd>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xd11(%rip),%rdi
lea    0xcfb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcfc(%rip),%rdi
lea    0xce6(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x7,%eax
je     1337 <main+0x217>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xcdb(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xccb(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x2,%eax
je     1367 <main+0x247>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x5,%eax
jne    12bd <main+0x17d>
lea    0xea8(%rip),%rdi
call   1050 <puts@plt>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x6,%eax
jne    12bd <main+0x17d>
mov    $0x61,%edi
call   1030 <putchar@plt>
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%eax
jne    12bd <main+0x17d>
lea    0xe56(%rip),%rbx
lea    0xe5d(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x5,%eax
jne    12bd <main+0x17d>
lea    0xe33(%rip),%rdi
call   1050 <puts@plt>
lea    0xe19(%rip),%rdi
lea    0xe09(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x6,%eax
jne    12bd <main+0x17d>
mov    $0x61,%edi
call   1030 <putchar@plt>
lea    0xdf1(%rip),%rdi
lea    0xde8(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%eax
jne    12bd <main+0x17d>
lea    0xdd3(%rip),%rdi
lea    0xdd9(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
test   %eax,%eax
jne    12bd <main+0x17d>
mov    $0x78,%edi
call   1030 <putchar@plt>
lea    0xdb3(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%eax
jne    12bd <main+0x17d>
lea    0xd8f(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xd8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x7,%eax
jne    12bd <main+0x17d>
lea    0xd7d(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%eax
jne    12bd <main+0x17d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [7 x i8] c"hello\0A\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i32 %9, 6
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %13
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %19
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%28 = icmp ne i32 %27, 5
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %25
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp ne i32 %33, 6
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp ne i32 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 (...) @abort()
unreachable
43: ; preds = %37
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 (...) @abort()
unreachable
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 120)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 120)
%52 = icmp ne i32 %51, 1
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 (...) @abort()
unreachable
55: ; preds = %49
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%58 = icmp ne i32 %57, 7
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 (...) @abort()
unreachable
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 0)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 0)
%64 = icmp ne i32 %63, 2
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 (...) @abort()
unreachable
67: ; preds = %61
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"hello\0A\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@str.8 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%3 = icmp eq i32 %2, 5
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 6
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %6
%13 = tail call i32 @putchar(i32 97)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 1
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %12
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%21 = icmp eq i32 %20, 5
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %18
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32 %26, 6
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 (...) @abort()
unreachable
30: ; preds = %24
%31 = tail call i32 @putchar(i32 97)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i32 %32, 1
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = tail call i32 (...) @abort()
unreachable
36: ; preds = %30
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = tail call i32 (...) @abort()
unreachable
41: ; preds = %36
%42 = tail call i32 @putchar(i32 120)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 120)
%44 = icmp eq i32 %43, 1
br i1 %44, label %47, label %45
45: ; preds = %41
%46 = tail call i32 (...) @abort()
unreachable
47: ; preds = %41
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp eq i32 %49, 7
br i1 %50, label %53, label %51
51: ; preds = %47
%52 = tail call i32 (...) @abort()
unreachable
53: ; preds = %47
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 0)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 0)
%56 = icmp eq i32 %55, 2
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = tail call i32 (...) @abort()
unreachable
59: ; preds = %53
ret i32 0
}