#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*/ argvans;

/* Variables and functions */
int /*<<< orphan*/ elev0();
int /*<<< orphan*/ elev1();
int /*<<< orphan*/ elev2();
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;
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 3) {
    puts("This function needs three arguments.");
    exit(0);
  }
  char argvans[10];
  fgets(argvans, sizeof(argvans), stdin);
  if (strncmp(argv[1], argvans, strlen(argv[1])) != 0) {
    exit(0);
  }
  memset(argvans, 0, sizeof(argvans));
  fgets(argvans, sizeof(argvans), stdin);
  if (strncmp(argv[2], argvans, strlen(argv[2])) != 0) {
    exit(0);
  }
  puts("You might have access to the elevators, but can you figure out how to "
       "use them?");
  elev0();
  elev1();
  elev2();
  puts("So you are actually getting out of here using the elevators! Level "
       "cleared!");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     11bc <main+0x2c>
lea    0xe50(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    -0x1a(%rbp),%rdi
mov    0x2e21(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1090 <fgets@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1214 <main+0x84>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    -0x1a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
lea    -0x1a(%rbp),%rdi
mov    0x2db9(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1090 <fgets@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     127c <main+0xec>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    0xda2(%rip),%rdi
call   1050 <puts@plt>
mov    $0x0,%al
call   1060 <elev0@plt>
mov    $0x0,%al
call   10a0 <elev1@plt>
mov    $0x0,%al
call   1040 <elev2@plt>
lea    0xdd1(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x3,%edi
jne    1264 <main+0xd4>
mov    %rsi,%r15
mov    0x2e3a(%rip),%r12
mov    (%r12),%edx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1090 <fgets@plt>
mov    0x8(%r15),%rbx
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1270 <main+0xe0>
lea    0xe(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
mov    (%r12),%edx
mov    %r14,%rdi
mov    $0xa,%esi
call   1090 <fgets@plt>
mov    0x10(%r15),%rbx
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1270 <main+0xe0>
lea    0xdf5(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <elev0@plt>
xor    %eax,%eax
call   10a0 <elev1@plt>
xor    %eax,%eax
call   1040 <elev2@plt>
lea    0xe24(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xd95(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"This function needs three arguments.\00"
@stdin = global i32 0
@.str.1 = [80 x i8] c"You might have access to the elevators, but can you figure out how to use them?\00"
@.str.2 = [76 x i8] c"So you are actually getting out of here using the elevators! Level cleared!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 10, i32 %13)
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strlen(i8* %21)
%23 = call i64 @strncmp(i8* %17, i8* %18, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %11
%26 = call i32 @exit(i32 0)
unreachable
27: ; preds = %11
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%29 = call i32 @memset(i8* %28, i32 0, i32 10)
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%31 = load i32, i32* @stdin
%32 = call i32 @fgets(i8* %30, i32 10, i32 %31)
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%37 = load i8**, i8*** %4
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @strlen(i8* %39)
%41 = call i64 @strncmp(i8* %35, i8* %36, i32 %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %27
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %27
%46 = call i32 @puts(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%47 = call i32 (...) @elev0()
%48 = call i32 (...) @elev1()
%49 = call i32 (...) @elev2()
%50 = call i32 @puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"This function needs three arguments.\00"
@stdin = global i32 0
@.str.1 = [80 x i8] c"You might have access to the elevators, but can you figure out how to use them?\00"
@.str.2 = [76 x i8] c"So you are actually getting out of here using the elevators! Level cleared!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = icmp eq i32 %0, 3
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 10, i32 %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strlen(i8* %13)
%15 = call i64 @strncmp(i8* %13, i8* %9, i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %8
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %8
%20 = call i32 @memset(i8* %9, i32 0, i32 10)
%21 = load i32, i32* @stdin
%22 = call i32 @fgets(i8* %9, i32 10, i32 %21)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = call i64 @strncmp(i8* %24, i8* %9, i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %19
%29 = call i32 @exit(i32 0)
unreachable
30: ; preds = %19
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 (...) @elev0()
%33 = call i32 (...) @elev1()
%34 = call i32 (...) @elev2()
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}