#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 {
  scalar_t__ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(scalar_t__);
int /*<<< orphan*/ lstat(char *, struct stat *);
int /*<<< orphan*/ mkdir(char *, int);
void dir_init(void) {
  if (!({
        struct stat _ant_statbuf_;
        _ant_statbuf_.st_mode = 0;
        lstat("dump", &_ant_statbuf_);
        S_ISDIR(_ant_statbuf_.st_mode);
      }))
    mkdir("dump", 0755);
  if (!({
        struct stat _ant_statbuf_;
        _ant_statbuf_.st_mode = 0;
        lstat("log", &_ant_statbuf_);
        S_ISDIR(_ant_statbuf_.st_mode);
      }))
    mkdir("log", 0755);
}


x86 assembly (clang, -O0):
<dir_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <lstat@plt>
mov    -0x8(%rbp),%rdi
call   1040 <S_ISDIR@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1177 <dir_init+0x47>
lea    0xe93(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
movq   $0x0,-0x18(%rbp)
lea    0xe7f(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <lstat@plt>
mov    -0x18(%rbp),%rdi
call   1040 <S_ISDIR@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11b6 <dir_init+0x86>
lea    0xe59(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_init>:
push   %rax
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <lstat@plt>
mov    (%rsp),%rdi
call   1040 <S_ISDIR@plt>
test   %eax,%eax
jne    1166 <dir_init+0x36>
lea    0xea4(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
movq   $0x0,(%rsp)
lea    0xe90(%rip),%rdi
mov    %rsp,%rsi
call   1050 <lstat@plt>
mov    (%rsp),%rdi
call   1040 <S_ISDIR@plt>
test   %eax,%eax
je     118c <dir_init+0x5c>
pop    %rax
ret
lea    0xe72(%rip),%rdi
mov    $0x1ed,%esi
pop    %rax
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [5 x i8] c"dump\00"
@.str.1 = [4 x i8] c"log\00"
define void @dir_init() {
%1 = alloca %struct.stat
%2 = alloca i32
%3 = alloca %struct.stat
%4 = alloca i32
%5 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
store i64 0, i64* %5
%6 = call i32 @lstat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = call i32 @S_ISDIR(i64 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 @mkdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 493)
br label %14
14: ; preds = %12, %0
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
store i64 0, i64* %15
%16 = call i32 @lstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %3)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%18 = load i64, i64* %17
%19 = call i32 @S_ISDIR(i64 %18)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %14
%23 = call i32 @mkdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 493)
br label %24
24: ; preds = %22, %14
ret void
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [5 x i8] c"dump\00"
@.str.1 = [4 x i8] c"log\00"
define void @dir_init() {
%1 = alloca %struct.stat
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %1 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i64 0, i64* %4
%5 = call i32 @lstat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%6 = load i64, i64* %4
%7 = tail call i32 @S_ISDIR(i64 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i32 @mkdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 493)
br label %11
11: ; preds = %9, %0
%12 = bitcast %struct.stat* %2 to i8*
%13 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i64 0, i64* %13
%14 = call i32 @lstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %2)
%15 = load i64, i64* %13
%16 = tail call i32 @S_ISDIR(i64 %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = tail call i32 @mkdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 493)
br label %20
20: ; preds = %18, %11
ret void
}