#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 */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
void print_config_file_warning(const char *config_file, const char *log_dir) {
  struct stat st;
  if (0 == stat(log_dir, &st))
    return;
  if (0 == stat(config_file, &st))
    return;
  fprintf(stderr, "using default configuration\n");
  return;
}


x86 assembly (clang, -O0):
<print_config_file_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1150 <print_config_file_warning+0x30>
jmp    1185 <print_config_file_warning+0x65>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1170 <print_config_file_warning+0x50>
jmp    1185 <print_config_file_warning+0x65>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_config_file_warning>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1040 <stat@plt>
test   %rax,%rax
je     1164 <print_config_file_warning+0x44>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
test   %rax,%rax
je     1164 <print_config_file_warning+0x44>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"using default configuration\0A\00"
define void @print_config_file_warning(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.stat
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @stat(i8* %6, %struct.stat* %5)
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %18
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i64 @stat(i8* %11, %struct.stat* %5)
%13 = icmp eq i64 0, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %18
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %14, %9
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"using default configuration\0A\00"
define void @print_config_file_warning(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i64 @stat(i8* %1, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = call i64 @stat(i8* %0, %struct.stat* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %7, %2, %10
ret void
}