#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
char *getPrivateKeyPassword();
int getPrivateKeyPassword_Error();
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stderr;
int strlen(char const *);
int main(__attribute__((unused)) int argc,
         __attribute__((unused)) char **argv) {
  const char *password = getPrivateKeyPassword();
  int len = strlen(password);
  if (len)
    printf("%s\n", password);
  else
    fprintf(stderr, "Error %u reading private key password.\n",
            getPrivateKeyPassword_Error());
  exit(len ? EXIT_SUCCESS : EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <getPrivateKeyPassword@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11ac <main+0x4c>
mov    -0x18(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
jmp    11d0 <main+0x70>
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <getPrivateKeyPassword_Error@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%edx
lea    0xe39(%rip),%rsi
call   1060 <fprintf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11eb <main+0x8b>
mov    0x2def(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    11f7 <main+0x97>
mov    0x2de6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <getPrivateKeyPassword@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    11ad <main+0x4d>
mov    0x2e5e(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1050 <getPrivateKeyPassword_Error@plt>
lea    0xe72(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1060 <fprintf@plt>
test   %ebp,%ebp
je     11c0 <main+0x60>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
lea    0xe4c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
test   %ebp,%ebp
jne    119f <main+0x3f>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"Error %u reading private key password.\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* (...) @getPrivateKeyPassword()
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %20
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 (...) @getPrivateKeyPassword_Error()
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* %7
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = load i32, i32* @EXIT_SUCCESS
br label %27
25: ; preds = %20
%26 = load i32, i32* @EXIT_FAILURE
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
%29 = call i32 @exit(i32 %28)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"Error %u reading private key password.\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getPrivateKeyPassword()
%4 = tail call i32 @strlen(i8* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (...) @getPrivateKeyPassword_Error()
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* @EXIT_SUCCESS
%14 = load i32, i32* @EXIT_FAILURE
%15 = select i1 %5, i32 %14, i32 %13
%16 = tail call i32 @exit(i32 %15)
unreachable
}