#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*/ gen_acs(char *);
int /*<<< orphan*/ gen_psk(char *, char *);
int /*<<< orphan*/ gen_ssid(char *, int);
int /*<<< orphan*/ gen_wep128(char *);
int /*<<< orphan*/ gen_wep64(char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("\n  ZyXEL key generator v1.0"
       "\n  Copyright (c) 2012 Kevin Devine, Damien O'Reilly");
  gen_wep64("password");
  gen_wep128("password");
  gen_ssid("B0B2DCA742B4", 12);
  gen_psk("B0B2DCA742B4", "S121K27025123");
  gen_acs("S121K27025123");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe83(%rip),%rdi
call   1050 <puts@plt>
lea    0xec6(%rip),%rdi
call   1080 <gen_wep64@plt>
lea    0xeba(%rip),%rdi
call   1040 <gen_wep128@plt>
lea    0xeb7(%rip),%rdi
mov    $0xc,%esi
call   1030 <gen_ssid@plt>
lea    0xea6(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1060 <gen_psk@plt>
lea    0xea0(%rip),%rdi
call   1070 <gen_acs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe95(%rip),%rdi
call   1050 <puts@plt>
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1080 <gen_wep64@plt>
mov    %rbx,%rdi
call   1040 <gen_wep128@plt>
lea    0xeca(%rip),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1030 <gen_ssid@plt>
lea    0xec3(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <gen_psk@plt>
mov    %rbx,%rdi
call   1070 <gen_acs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [79 x i8] c"\0A ZyXEL key generator v1.0\0A Copyright (c) 2012 Kevin Devine, Damien O'Reilly\00"
@.str.1 = [9 x i8] c"password\00"
@.str.2 = [13 x i8] c"B0B2DCA742B4\00"
@.str.3 = [14 x i8] c"S121K27025123\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @gen_wep64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @gen_wep128(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @gen_ssid(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 12)
%10 = call i32 @gen_psk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @gen_acs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [79 x i8] c"\0A ZyXEL key generator v1.0\0A Copyright (c) 2012 Kevin Devine, Damien O'Reilly\00"
@.str.1 = [9 x i8] c"password\00"
@.str.2 = [13 x i8] c"B0B2DCA742B4\00"
@.str.3 = [14 x i8] c"S121K27025123\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @gen_wep64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @gen_wep128(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @gen_ssid(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 12)
%7 = tail call i32 @gen_psk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @gen_acs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}