#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 max(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  struct numbers {
    int n1, n2, n3;
  } num;
  printf("Enter three numbers :");
  scanf("%d %d %d", &num.n1, &num.n2, &num.n3);
  printf("Max: %d\n", max(max(num.n1, num.n2), num.n3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    0xeb5(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <max@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xec3(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1040 <max@plt>
mov    0x10(%rsp),%esi
mov    %eax,%edi
call   1040 <max@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.numbers = type { i32, i32, i32 }
@.str = [22 x i8] c"Enter three numbers :\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [9 x i8] c"Max: %d\0A\00"
define i32 @main() {
%1 = alloca %struct.numbers
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 0
%4 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 1
%5 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 2
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%7 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @max(i32 %8, i32 %10)
%12 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i32 0, i32 2
%13 = load i32, i32* %12
%14 = call i32 @max(i32 %11, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
%struct.numbers = type { i32, i32, i32 }
@.str = [22 x i8] c"Enter three numbers :\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [9 x i8] c"Max: %d\0A\00"
define i32 @main() {
%1 = alloca %struct.numbers
%2 = bitcast %struct.numbers* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i64 0, i32 0
%5 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i64 0, i32 1
%6 = getelementptr inbounds %struct.numbers, %struct.numbers* %1, i64 0, i32 2
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @max(i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @max(i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}