#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*/ printf(char *, ...);
int main(void) {
  int i;
  printf("#include <stdlib.h>\nextern char testzero[16384];\nextern int");
  for (i = 0; i < 255; ++i)
    printf(" bar%02x (int),", i);
  printf(" barff (int);\nint main (void)\n{\n  int x = 0;\n");
  for (i = 0; i < 256; ++i)
    printf("  x = bar%02x (x);\n", i);
  printf("  if (x != 0x7fff8000) abort ();\n");
  printf("  for (x = 0; x < 16384; ++x)\n");
  printf("    if (testzero[x]) abort ();\n");
  printf("  exit (0);\n}\n\n");
  printf("asm (\".section nonalloced,\\\"aw\\\",%%nobits\\n\\t\"\n");
  printf("     \".globl testzero\\n\\t\"\n");
  printf("     \"testzero: .skip 16384\\n\\t\"\n");
  printf("     \".previous\");\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jge    1160 <main+0x50>
mov    -0x8(%rbp),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    11a1 <main+0x91>
mov    -0x8(%rbp),%esi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1175 <main+0x65>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf04(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0xff,%ebp
jne    1140 <main+0x20>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1170 <main+0x50>
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xf56(%rip),%rdi
call   1030 <puts@plt>
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf82(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [60 x i8] c"#include <stdlib.h>\0Aextern char testzero[16384];\0Aextern int\00"
@.str.1 = [16 x i8] c" bar%02x (int),\00"
@.str.2 = [46 x i8] c" barff (int);\0Aint main (void)\0A{\0A int x = 0;\0A\00"
@.str.3 = [20 x i8] c" x = bar%02x (x);\0A\00"
@.str.4 = [34 x i8] c" if (x != 0x7fff8000) abort ();\0A\00"
@.str.5 = [31 x i8] c" for (x = 0; x < 16384; ++x)\0A\00"
@.str.6 = [32 x i8] c" if (testzero[x]) abort ();\0A\00"
@.str.7 = [16 x i8] c" exit (0);\0A}\0A\0A\00"
@.str.8 = [48 x i8] c"asm (\22.section nonalloced,\\\22aw\\\22,%%nobits\\n\\t\22\0A\00"
@.str.9 = [28 x i8] c" \22.globl testzero\\n\\t\22\0A\00"
@.str.10 = [34 x i8] c" \22testzero: .skip 16384\\n\\t\22\0A\00"
@.str.11 = [20 x i8] c" \22.previous\22);\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %15
15: ; preds = %21, %13
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 256
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %15
24: ; preds = %15
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [60 x i8] c"#include <stdlib.h>\0Aextern char testzero[16384];\0Aextern int\00"
@.str.1 = [16 x i8] c" bar%02x (int),\00"
@.str.3 = [20 x i8] c" x = bar%02x (x);\0A\00"
@.str.8 = [48 x i8] c"asm (\22.section nonalloced,\\\22aw\\\22,%%nobits\\n\\t\22\0A\00"
@str = [45 x i8] c" barff (int);\0Aint main (void)\0A{\0A int x = 0;\00"
@str.12 = [33 x i8] c" if (x != 0x7fff8000) abort ();\00"
@str.13 = [30 x i8] c" for (x = 0; x < 16384; ++x)\00"
@str.14 = [31 x i8] c" if (testzero[x]) abort ();\00"
@str.15 = [15 x i8] c" exit (0);\0A}\0A\00"
@str.16 = [27 x i8] c" \22.globl testzero\\n\\t\22\00"
@str.17 = [33 x i8] c" \22testzero: .skip 16384\\n\\t\22\00"
@str.18 = [19 x i8] c" \22.previous\22);\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %9
%10 = phi i32 [ 0, %7 ], [ %12, %9 ]
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 256
br i1 %13, label %14, label %9
14: ; preds = %9
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.13, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.14, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.15, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.16, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.17, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.18, i64 0, i64 0))
ret i32 0
}