#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 *, char const *, char const *, char const *);
void cmdshell_print_status_write_file(const char *filename,
                                      const char *filedesc,
                                      const char *filereloff) {
  printf("\n"
         "Write file filename:\n"
         "%s\n"
         "Write file description:\n"
         "%s"
         "\n"
         "Write file relative offset:\n"
         "%s\n",
         (*filename != '\0' ? filename : "empty\n"),
         (*filedesc != '\0' ? filedesc : "empty\n"),
         (*filereloff != '\0' ? filereloff : "empty\n"));
}


x86 assembly (clang, -O0):
<cmdshell_print_status_write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <cmdshell_print_status_write_file+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <cmdshell_print_status_write_file+0x41>
lea    0xf0c(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <cmdshell_print_status_write_file+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <cmdshell_print_status_write_file+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1186 <cmdshell_print_status_write_file+0x76>
lea    0xed7(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1186 <cmdshell_print_status_write_file+0x76>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11ab <cmdshell_print_status_write_file+0x9b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    11bb <cmdshell_print_status_write_file+0xab>
lea    0xea2(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    11bb <cmdshell_print_status_write_file+0xab>
mov    -0x38(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rcx
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdshell_print_status_write_file>:
mov    %rsi,%rax
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
lea    0xf34(%rip),%rcx
cmove  %rcx,%rsi
cmpb   $0x0,(%rax)
cmove  %rcx,%rax
cmpb   $0x0,(%rdx)
cmovne %rdx,%rcx
lea    0xec7(%rip),%rdi
mov    %rax,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"\0AWrite file filename:\0A%s\0AWrite file description:\0A%s\0AWrite file relative offset:\0A%s\0A\00"
@.str.1 = [7 x i8] c"empty\0A\00"
define void @cmdshell_print_status_write_file(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8*, i8** %4
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %13 ]
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i8*, i8** %5
br label %23
22: ; preds = %14
br label %23
23: ; preds = %22, %20
%24 = phi i8* [ %21, %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %22 ]
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = load i8*, i8** %6
br label %32
31: ; preds = %23
br label %32
32: ; preds = %31, %29
%33 = phi i8* [ %30, %29 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %31 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %24, i8* %33)
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c"\0AWrite file filename:\0A%s\0AWrite file description:\0A%s\0AWrite file relative offset:\0A%s\0A\00"
@.str.1 = [7 x i8] c"empty\0A\00"
define void @cmdshell_print_status_write_file(i8* %0, i8* %1, i8* %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1
%10 = load i8, i8* %2
%11 = icmp eq i8 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2
%13 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %9, i8* %12)
ret void
}