#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 scanf(char *, int *, ...);
int main() {
  int n, max1, max2, temp;
  if (scanf("%d%d", &max1, &max2) == 2) {
    if (max2 > max1) {
      temp = max1;
      max1 = max2;
      max2 = temp;
    }
    while (scanf("%d", &n)) {
      if (n > max1) {
        max2 = max1;
        max1 = n;
      } else if (n > max2) {
        max2 = n;
      }
    }
    printf("%d\n", max1);
    printf("%d\n", max2);
  } else {
    printf("Enter at least 2 numbers");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11ec <main+0xcc>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    116c <main+0x4c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1171 <main+0x51>
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x0,%eax
je     11c5 <main+0xa5>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11a9 <main+0x89>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11c0 <main+0xa0>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11bb <main+0x9b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c0 <main+0xa0>
jmp    1171 <main+0x51>
mov    -0xc(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xda>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11b1 <main+0x91>
mov    0xc(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
jle    1158 <main+0x38>
mov    %eax,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0xea3(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
test   %eax,%eax
je     11c1 <main+0xa1>
lea    0xe8c(%rip),%r14
lea    0x14(%rsp),%rbx
jmp    1199 <main+0x79>
nopl   (%rax)
mov    %ecx,0xc(%rsp)
mov    %eax,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
test   %eax,%eax
je     11c1 <main+0xa1>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
jg     1180 <main+0x60>
cmp    0xc(%rsp),%eax
jle    1188 <main+0x68>
mov    %eax,0xc(%rsp)
jmp    1188 <main+0x68>
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11e4 <main+0xc4>
mov    0x10(%rsp),%esi
lea    0xe39(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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