#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*/ createpass(char *);
int /*<<< orphan*/ passwd();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char a[20];
  printf("Now Test Passwd.c\n");
  printf("Test createpass():\n"
         "Enter Your Password:\n");
  scanf("%s", a);
  printf("CREATING PASSWORD...\n");
  createpass(a);
  printf("PASSWORD CREATED SUCCESSFULLY!\nFile name:\"passwd\"");
  printf("Now, you enter.\n");
  do {
    printf("\tEnter Password:\n");
  } while (!passwd());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1060 <scanf@plt>
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <createpass@plt>
lea    0xec2(%rip),%rdi
call   1050 <printf@plt>
lea    0xee8(%rip),%rdi
call   1050 <printf@plt>
lea    0xeed(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <passwd@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a4 <main+0x64>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xedf(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8c(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <createpass@plt>
lea    0xe69(%rip),%rdi
call   1060 <printf@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
lea    0xee2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <passwd@plt>
test   %eax,%eax
je     11c0 <main+0x70>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Now Test Passwd.c\0A\00"
@.str.1 = [41 x i8] c"Test createpass():\0AEnter Your Password:\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [22 x i8] c"CREATING PASSWORD...\0A\00"
@.str.4 = [50 x i8] c"PASSWORD CREATED SUCCESSFULLY!\0AFile name:\22passwd\22\00"
@.str.5 = [17 x i8] c"Now, you enter.\0A\00"
@.str.6 = [18 x i8] c"\09Enter Password:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @createpass(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %12
12: ; preds = %14, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = call i32 (...) @passwd()
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %12, label %18
18: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [50 x i8] c"PASSWORD CREATED SUCCESSFULLY!\0AFile name:\22passwd\22\00"
@str = [18 x i8] c"Now Test Passwd.c\00"
@str.7 = [40 x i8] c"Test createpass():\0AEnter Your Password:\00"
@str.8 = [21 x i8] c"CREATING PASSWORD...\00"
@str.9 = [16 x i8] c"Now, you enter.\00"
@str.10 = [17 x i8] c"\09Enter Password:\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%7 = call i32 @createpass(i8* %2)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.9, i64 0, i64 0))
br label %10
10: ; preds = %10, %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0))
%12 = call i32 (...) @passwd()
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret i32 0
}