#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 /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int a, b, c, d, e, f, g;
  printf("Enter a b c d:\n");
  scanf("%d %d %d %d", &a, &b, &c, &d);
  e = (a > b) ? a : b;
  f = (c > d) ? c : d;
  g = (e > f) ? e : f;
  printf("%d is maximum", g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1170 <main+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1176 <main+0x56>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1193 <main+0x73>
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1199 <main+0x79>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11b6 <main+0x96>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11bc <main+0x9c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
cmp    %esi,%ecx
cmovg  %ecx,%esi
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a b c d:\0A\00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [14 x i8] c"%d is maximum\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = load i32, i32* %2
br label %18
16: ; preds = %0
%17 = load i32, i32* %3
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %4
br label %27
25: ; preds = %18
%26 = load i32, i32* %5
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
store i32 %28, i32* %7
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = load i32, i32* %6
br label %36
34: ; preds = %27
%35 = load i32, i32* %7
br label %36
36: ; preds = %34, %32
%37 = phi i32 [ %33, %32 ], [ %35, %34 ]
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [14 x i8] c"%d is maximum\00"
@str = [15 x i8] c"Enter a b c d:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = icmp sgt i32 %11, %12
%14 = select i1 %13, i32 %11, i32 %12
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp sgt i32 %15, %16
%18 = select i1 %17, i32 %15, i32 %16
%19 = icmp sgt i32 %14, %18
%20 = select i1 %19, i32 %14, i32 %18
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %20)
ret i32 0
}