#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 */
size_t getN(int);
int /*<<< orphan*/ printf(char *);
int main() {
  size_t sz[3];
  sz[0] = getN(1);
  sz[1] = getN(256);
  sz[2] = getN(1024);
  if (sz[0] == 1 && sz[1] == 256 && sz[2] == 1024) {
    printf("PASS\n");
  } else {
    printf("ERROR\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <getN@plt>
mov    %rax,-0x20(%rbp)
mov    $0x100,%edi
call   1030 <getN@plt>
mov    %rax,-0x18(%rbp)
mov    $0x400,%edi
call   1030 <getN@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    1191 <main+0x71>
cmpq   $0x100,-0x18(%rbp)
jne    1191 <main+0x71>
cmpq   $0x400,-0x10(%rbp)
jne    1191 <main+0x71>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
jmp    11a9 <main+0x89>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b0 <main+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%edi
call   1040 <getN@plt>
mov    %rax,%r14
mov    $0x100,%edi
call   1040 <getN@plt>
mov    %rax,%rbx
mov    $0x400,%edi
call   1040 <getN@plt>
xor    $0x1,%r14
xor    $0x100,%rbx
or     %r14,%rbx
xor    $0x400,%rax
xor    %ebp,%ebp
or     %rbx,%rax
setne  %bpl
lea    0xe9a(%rip),%rax
lea    0xe8d(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
@.str.1 = [7 x i8] c"ERROR\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i64]
store i32 0, i32* %1
%3 = call i64 @getN(i32 1)
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
store i64 %3, i64* %4
%5 = call i64 @getN(i32 256)
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
store i64 %5, i64* %6
%7 = call i64 @getN(i32 1024)
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
store i64 %7, i64* %8
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 1
br i1 %11, label %12, label %22
12: ; preds = %0
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%14 = load i64, i64* %13
%15 = icmp eq i64 %14, 256
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%18 = load i64, i64* %17
%19 = icmp eq i64 %18, 1024
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %24
22: ; preds = %16, %12, %0
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %25
24: ; preds = %20
store i32 0, i32* %1
br label %25
25: ; preds = %24, %22
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@str = [6 x i8] c"ERROR\00"
@str.2 = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i64 @getN(i32 1)
%2 = tail call i64 @getN(i32 256)
%3 = tail call i64 @getN(i32 1024)
%4 = icmp eq i64 %1, 1
%5 = icmp eq i64 %2, 256
%6 = select i1 %4, i1 %5, i1 false
%7 = icmp eq i64 %3, 1024
%8 = select i1 %6, i1 %7, i1 false
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%10 = xor i1 %8, true
%11 = zext i1 %10 to i32
%12 = tail call i32 @puts(i8* dereferenceable(1) %9)
ret i32 %11
}