#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 copy_passwd(char *, int, char **);
int /*<<< orphan*/ create_passwd(char **);
int /*<<< orphan*/ destroy_passwd(char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int test_passwd(char *, int, char **);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argn, char **argv) {
  char *passwds[100], passwd[12];
  srand(time(NULL));
  create_passwd(passwds);
  int i = 1 + copy_passwd(passwd, argn, argv);
  int j = 1 + test_passwd(passwd, i, passwds);
  if (j == 1) {
    printf("\n\a========\n\aYou WON!\n\a========\n\a");
    exit(0);
  }
  destroy_passwd(passwds);
  printf("Y0u 5uck5!\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    -0x330(%rbp),%rdi
call   1070 <create_passwd@plt>
lea    -0x33c(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1050 <copy_passwd@plt>
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
lea    -0x33c(%rbp),%rdi
mov    -0x340(%rbp),%esi
lea    -0x330(%rbp),%rdx
call   1090 <test_passwd@plt>
add    $0x1,%eax
mov    %eax,-0x344(%rbp)
cmpl   $0x1,-0x344(%rbp)
jne    1213 <main+0x93>
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    -0x330(%rbp),%rdi
call   1030 <destroy_passwd@plt>
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x338,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1080 <create_passwd@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1060 <copy_passwd@plt>
lea    0x1(%rax),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   10a0 <test_passwd@plt>
test   %eax,%eax
je     120a <main+0x7a>
lea    0x10(%rsp),%rdi
call   1040 <destroy_passwd@plt>
lea    0xe2f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdef(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0A\07========\0A\07You WON!\0A\07========\0A\07\00"
@.str.1 = [12 x i8] c"Y0u 5uck5!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8*]
%7 = alloca [12 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @time(i32* null)
%11 = call i32 @srand(i32 %10)
%12 = getelementptr inbounds [100 x i8*], [100 x i8*]* %6, i64 0, i64 0
%13 = call i32 @create_passwd(i8** %12)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @copy_passwd(i8* %14, i32 %15, i8** %16)
%18 = add nsw i32 1, %17
store i32 %18, i32* %8
%19 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%20 = load i32, i32* %8
%21 = getelementptr inbounds [100 x i8*], [100 x i8*]* %6, i64 0, i64 0
%22 = call i32 @test_passwd(i8* %19, i32 %20, i8** %21)
%23 = add nsw i32 1, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %2
%30 = getelementptr inbounds [100 x i8*], [100 x i8*]* %6, i64 0, i64 0
%31 = call i32 @destroy_passwd(i8** %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A\07========\0A\07You WON!\0A\07========\0A\07\00"
@str = [11 x i8] c"Y0u 5uck5!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [100 x i8*]
%4 = alloca [12 x i8]
%5 = bitcast [100 x i8*]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @time(i32* null)
%8 = tail call i32 @srand(i32 %7)
%9 = getelementptr inbounds [100 x i8*], [100 x i8*]* %3, i64 0, i64 0
%10 = call i32 @create_passwd(i8** %9)
%11 = call i32 @copy_passwd(i8* %6, i32 %0, i8** %1)
%12 = add nsw i32 %11, 1
%13 = call i32 @test_passwd(i8* %6, i32 %12, i8** %9)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = call i32 @destroy_passwd(i8** %9)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 1
}