#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int printf(char *, int, int);
int puts(char *);
int /*<<< orphan*/ stdout;
int test(int x, int y) {
  fprintf(stdout, "Hello World!");
  fprintf(stdout, "X = %d\n", x);
  puts("The first, second, and third items.");
  return ((x > y) ? puts("x>y") : printf("x is %d but y is %d", x, y));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    119b <test+0x6b>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,-0xc(%rbp)
jmp    11b0 <test+0x80>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ea1(%rip),%r14
mov    (%r14),%edi
lea    0xeb7(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb3(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
cmp    %ebx,%ebp
jle    1183 <test+0x53>
lea    0xebf(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>
lea    0xeb3(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
@.str.2 = [36 x i8] c"The first, second, and third items.\00"
@.str.3 = [4 x i8] c"x>y\00"
@.str.4 = [20 x i8] c"x is %d but y is %d\00"
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = load i32, i32* %3
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %20
16: ; preds = %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %16, %14
%21 = phi i32 [ %15, %14 ], [ %19, %16 ]
ret i32 %21
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
@.str.2 = [36 x i8] c"The first, second, and third items.\00"
@.str.3 = [4 x i8] c"x>y\00"
@.str.4 = [20 x i8] c"x is %d but y is %d\00"
define i32 @test(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp sgt i32 %0, %1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %0, i32 %1)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}