#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*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGTSTP;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getnstr(char *, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ noraw();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char password[80 + 1];
  int pigs_can_fly = 1;
  if (0 != 1) {
    signal(SIGHUP, SIG_IGN);
    signal(SIGINT, SIG_IGN);
    signal(SIGQUIT, SIG_IGN);
    signal(SIGKILL, SIG_IGN);
    signal(SIGTERM, SIG_IGN);
    signal(SIGTSTP, SIG_IGN);
  }
  initscr();
  raw();
  if (0 != 1) {
    noecho();
  }
  while (pigs_can_fly) {
    printw("Password:");
    getnstr(password, 80);
    if (strncmp("frobnitz", password, strlen("frobnitz")) == 0) {
      pigs_can_fly = 0;
    } else {
      printw("Without the password, you're going nowhere :-)\n");
    }
  }
  if (0 != 1) {
    echo();
  }
  noraw();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x74(%rbp)
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
mov    0x2dc9(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    0x2db2(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
mov    0x2d6d(%rip),%rax
mov    (%rax),%esi
call   10a0 <signal@plt>
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1080 <raw@plt>
mov    $0x0,%al
call   10d0 <noecho@plt>
cmpl   $0x0,-0x74(%rbp)
je     12e0 <main+0x130>
lea    0xd80(%rip),%rdi
call   10b0 <printw@plt>
lea    -0x70(%rbp),%rdi
mov    $0x50,%esi
call   1050 <getnstr@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    0xd68(%rip),%rdi
call   1060 <strlen@plt>
mov    -0x80(%rbp),%rsi
mov    %eax,%edx
lea    0xd56(%rip),%rdi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12cf <main+0x11f>
movl   $0x0,-0x74(%rbp)
jmp    12db <main+0x12b>
lea    0xd3d(%rip),%rdi
call   10b0 <printw@plt>
jmp    126f <main+0xbf>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1090 <noraw@plt>
mov    $0x0,%al
call   10c0 <endwin@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    0x2df5(%rip),%rbx
mov    (%rbx),%esi
call   10a0 <signal@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <signal@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <signal@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <signal@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <signal@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   10a0 <signal@plt>
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1080 <raw@plt>
xor    %eax,%eax
call   10d0 <noecho@plt>
lea    0xdc2(%rip),%rdi
call   10b0 <printw@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x50,%esi
call   1050 <getnstr@plt>
lea    0xdb0(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12c7 <main+0x117>
lea    0xd98(%rip),%r14
lea    0xd7e(%rip),%r15
mov    %rsp,%r12
lea    0xd7e(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   10b0 <printw@plt>
mov    %r15,%rdi
call   10b0 <printw@plt>
mov    %r12,%rdi
mov    $0x50,%esi
call   1050 <getnstr@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1290 <main+0xe0>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1090 <noraw@plt>
xor    %eax,%eax
call   10c0 <endwin@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGHUP = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGKILL = global i32 0
@SIGTERM = global i32 0
@SIGTSTP = global i32 0
@.str = [10 x i8] c"Password:\00"
@.str.1 = [9 x i8] c"frobnitz\00"
@.str.2 = [48 x i8] c"Without the password, you're going nowhere :-)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [81 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = load i32, i32* @SIGHUP
%9 = load i32, i32* @SIG_IGN
%10 = call i32 @signal(i32 %8, i32 %9)
%11 = load i32, i32* @SIGINT
%12 = load i32, i32* @SIG_IGN
%13 = call i32 @signal(i32 %11, i32 %12)
%14 = load i32, i32* @SIGQUIT
%15 = load i32, i32* @SIG_IGN
%16 = call i32 @signal(i32 %14, i32 %15)
%17 = load i32, i32* @SIGKILL
%18 = load i32, i32* @SIG_IGN
%19 = call i32 @signal(i32 %17, i32 %18)
%20 = load i32, i32* @SIGTERM
%21 = load i32, i32* @SIG_IGN
%22 = call i32 @signal(i32 %20, i32 %21)
%23 = load i32, i32* @SIGTSTP
%24 = load i32, i32* @SIG_IGN
%25 = call i32 @signal(i32 %23, i32 %24)
%26 = call i32 (...) @initscr()
%27 = call i32 (...) @raw()
%28 = call i32 (...) @noecho()
br label %29
29: ; preds = %43, %2
%30 = load i32, i32* %7
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = call i32 @printw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%34 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%35 = call i32 @getnstr(i8* %34, i32 80)
%36 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%37 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%38 = call i64 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %36, i32 %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %32
store i32 0, i32* %7
br label %43
41: ; preds = %32
%42 = call i32 @printw(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %41, %40
br label %29
44: ; preds = %29
%45 = call i32 (...) @echo()
%46 = call i32 (...) @noraw()
%47 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@SIGHUP = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGKILL = global i32 0
@SIGTERM = global i32 0
@SIGTSTP = global i32 0
@.str = [10 x i8] c"Password:\00"
@.str.1 = [9 x i8] c"frobnitz\00"
@.str.2 = [48 x i8] c"Without the password, you're going nowhere :-)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @SIGHUP
%6 = load i32, i32* @SIG_IGN
%7 = tail call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* @SIGINT
%9 = load i32, i32* @SIG_IGN
%10 = tail call i32 @signal(i32 %8, i32 %9)
%11 = load i32, i32* @SIGQUIT
%12 = load i32, i32* @SIG_IGN
%13 = tail call i32 @signal(i32 %11, i32 %12)
%14 = load i32, i32* @SIGKILL
%15 = load i32, i32* @SIG_IGN
%16 = tail call i32 @signal(i32 %14, i32 %15)
%17 = load i32, i32* @SIGTERM
%18 = load i32, i32* @SIG_IGN
%19 = tail call i32 @signal(i32 %17, i32 %18)
%20 = load i32, i32* @SIGTSTP
%21 = load i32, i32* @SIG_IGN
%22 = tail call i32 @signal(i32 %20, i32 %21)
%23 = tail call i32 (...) @initscr()
%24 = tail call i32 (...) @raw()
%25 = tail call i32 (...) @noecho()
%26 = call i32 @printw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @getnstr(i8* %4, i32 80)
%28 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%29 = call i64 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %38, label %31
31: ; preds = %2, %31
%32 = call i32 @printw(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @printw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%34 = call i32 @getnstr(i8* %4, i32 80)
%35 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%36 = call i64 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %31
38: ; preds = %31, %2
%39 = call i32 (...) @echo()
%40 = call i32 (...) @noraw()
%41 = call i32 (...) @endwin()
ret i32 0
}