#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  int a, b, c, d;
  a = 10;
  b = 20;
  c = 30;
  d = 40;
  if (a > b)
    printf("a=%d\n", a);
  else if (b > c)
    printf("b=%d\n", b);
  else if (c > d)
    printf("c=%d\n", c);
  else if (d > a)
    printf("d=%d\n", d);
  else
    printf("default\n");
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x1e,-0x10(%rbp)
movl   $0x28,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    116d <main+0x4d>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    118f <main+0x6f>
mov    -0xc(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11eb <main+0xcb>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11b1 <main+0x91>
mov    -0x10(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d3 <main+0xb3>
mov    -0x14(%rbp),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
jmp    11eb <main+0xcb>
jmp    11f0 <main+0xd0>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x28,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.3 = [6 x i8] c"d=%d\0A\00"
@.str.5 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 40)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}