#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*/ printf(char *);
int /*<<< orphan*/ usage();
scalar_t__ vncEncryptAndStorePasswd(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 3)
    usage();
  if (vncEncryptAndStorePasswd(argv[1], argv[2]) != 0) {
    printf("storing password failed.\n");
    return 1;
  } else {
    printf("storing password succeeded.\n");
    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)
cmpl   $0x3,-0x8(%rbp)
je     1157 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <vncEncryptAndStorePasswd@plt>
cmp    $0x0,%rax
je     118e <main+0x5e>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a1 <main+0x71>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1140 <main+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1050 <vncEncryptAndStorePasswd@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xea4(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"storing password failed.\0A\00"
@.str.1 = [29 x i8] c"storing password succeeded.\0A\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @vncEncryptAndStorePasswd(i8* %13, i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %23
21: ; preds = %10
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %23
23: ; preds = %21, %19
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@str = [28 x i8] c"storing password succeeded.\00"
@str.2 = [25 x i8] c"storing password failed.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @vncEncryptAndStorePasswd(i8* %8, i8* %10)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0)
%14 = xor i1 %12, true
%15 = zext i1 %14 to i32
%16 = tail call i32 @puts(i8* dereferenceable(1) %13)
ret i32 %15
}