#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 LEGACY_passwordClear(char *, int);
char *LEGACY_strError(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int err;
  (void)argc;
  (void)argv;
  err = LEGACY_passwordClear("/", 0600);
  if (err != 0) {
    fprintf(stderr, "ERROR: %s\n", LEGACY_strError(err));
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x180,%esi
call   1040 <LEGACY_passwordClear@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1196 <main+0x66>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <LEGACY_strError@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rdx
lea    0xe7d(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119d <main+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x180,%esi
call   1040 <LEGACY_passwordClear@plt>
test   %eax,%eax
je     116e <main+0x3e>
mov    0x2e93(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1050 <LEGACY_strError@plt>
lea    0xea5(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@stderr = global i32 0
@.str.1 = [11 x i8] c"ERROR: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @LEGACY_passwordClear(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 384)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %6
%15 = call i8* @LEGACY_strError(i32 %14)
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@stderr = global i32 0
@.str.1 = [11 x i8] c"ERROR: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @LEGACY_passwordClear(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 384)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @LEGACY_strError(i32 %3)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}