#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 */
typedef int /*<<< orphan*/ answer0;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
void elev0() {
  int var0 = 5;
  int var1;
  int var2;
  var1 = var0 + 13;
  var0 = var1 * 3;
  var2 = var0 / var1;
  var2 = var0 + var1 + var2;
  char answer0[20];
  fgets(answer0, sizeof(answer0) - 1, stdin);
  if (var2 == atoi(answer0)) {
    int var3 = var2;
    var2 = var1 & var0;
    var0 = var2 ^ var1;
    var3 = var1 | var3;
    var3 = var1 + var2;
    var3 = var0 + var3;
    memset(answer0, 0, sizeof(answer0));
    fgets(answer0, sizeof(answer0) - 1, stdin);
    if (var3 == atoi(answer0)) {
      puts("So you figured out the second elevator.");
    } else {
      exit(0);
    }
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<elev0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
mov    $0x13,%esi
call   1050 <fgets@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jne    124b <elev0+0xfb>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    0x2de2(%rip),%rax
mov    (%rax),%edx
mov    $0x13,%esi
call   1050 <fgets@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jne    123f <elev0+0xef>
lea    0xdcb(%rip),%rdi
call   1030 <puts@plt>
jmp    1246 <elev0+0xf6>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    1252 <elev0+0x102>
xor    %edi,%edi
call   1070 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elev0>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e8a(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
cmp    $0x4b,%eax
jne    11c1 <elev0+0x71>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
cmp    $0x24,%eax
jne    11c1 <elev0+0x71>
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [40 x i8] c"So you figured out the second elevator.\00"
define void @elev0() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = alloca i32
store i32 5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 13
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 3
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = sdiv i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
store i32 %17, i32* %3
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %18, i32 19, i32 %19)
%21 = load i32, i32* %3
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%23 = call i32 @atoi(i8* %22)
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %56
25: ; preds = %0
%26 = load i32, i32* %3
store i32 %26, i32* %5
%27 = load i32, i32* %2
%28 = load i32, i32* %1
%29 = and i32 %27, %28
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = xor i32 %30, %31
store i32 %32, i32* %1
%33 = load i32, i32* %2
%34 = load i32, i32* %5
%35 = or i32 %33, %34
store i32 %35, i32* %5
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = add nsw i32 %36, %37
store i32 %38, i32* %5
%39 = load i32, i32* %1
%40 = load i32, i32* %5
%41 = add nsw i32 %39, %40
store i32 %41, i32* %5
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%43 = call i32 @memset(i8* %42, i32 0, i32 20)
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%45 = load i32, i32* @stdin
%46 = call i32 @fgets(i8* %44, i32 19, i32 %45)
%47 = load i32, i32* %5
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%49 = call i32 @atoi(i8* %48)
%50 = icmp eq i32 %47, %49
br i1 %50, label %51, label %53
51: ; preds = %25
%52 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %55
53: ; preds = %25
%54 = call i32 @exit(i32 0)
unreachable
55: ; preds = %51
br label %58
56: ; preds = %0
%57 = call i32 @exit(i32 0)
unreachable
58: ; preds = %55
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [40 x i8] c"So you figured out the second elevator.\00"
define void @elev0() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 19, i32 %3)
%5 = call i32 @atoi(i8* %2)
%6 = icmp eq i32 %5, 75
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = call i32 @memset(i8* %2, i32 0, i32 20)
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %2, i32 19, i32 %9)
%11 = call i32 @atoi(i8* %2)
%12 = icmp eq i32 %11, 36
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
15: ; preds = %7
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %0
%18 = call i32 @exit(i32 0)
unreachable
}