#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, ...);
void main() {
  int x = 0;
  int y = 0;
  int z = 0;
  int g = 0;
  int h = 0;
  x = 1;
  y = 4;
  z = 5;
  g = 3;
  h = 2;
  printf("max ( x + y, z + g ) = %d;\n",
         ((x + y) > (z + g) ? (x + y) : (z + g)));
  printf("g = %d; square ( g+2 ) = %d;\n", g, (g + 2 * g + 2));
  printf("y * h"
         " = %3d\n",
         y * h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    1180 <main+0x70>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1189 <main+0x79>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    %eax,%edx
add    $0x2,%edx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x3,%esi
mov    $0xb,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"max ( x + y, z + g ) = %d;\0A\00"
@.str.1 = [30 x i8] c"g = %d; square ( g+2 ) = %d;\0A\00"
@.str.2 = [13 x i8] c"y * h = %3d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %1
store i32 4, i32* %2
store i32 5, i32* %3
store i32 3, i32* %4
store i32 2, i32* %5
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = add nsw i32 %14, %15
br label %21
17: ; preds = %0
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
br label %21
21: ; preds = %17, %13
%22 = phi i32 [ %16, %13 ], [ %20, %17 ]
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %4
%26 = load i32, i32* %4
%27 = mul nsw i32 2, %26
%28 = add nsw i32 %25, %27
%29 = add nsw i32 %28, 2
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %29)
%31 = load i32, i32* %2
%32 = load i32, i32* %5
%33 = mul nsw i32 %31, %32
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %33)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"max ( x + y, z + g ) = %d;\0A\00"
@.str.1 = [30 x i8] c"g = %d; square ( g+2 ) = %d;\0A\00"
@.str.2 = [13 x i8] c"y * h = %3d\0A\00"
define void @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 11)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret void
}