#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 S_IRUSR;
int /*<<< orphan*/ create_empty_dir_as_root(char *, int);
int /*<<< orphan*/ create_empty_file_as_root(char *, int);
scalar_t__ stat(char *, struct stat *);
void preproc_build_firejail_dir(void) {
  struct stat s;
  if (stat("/run", &s)) {
    create_empty_dir_as_root("/run", 0755);
  }
  if (stat("/run/firejail", &s)) {
    create_empty_dir_as_root("/run/firejail", 0755);
  }
  if (stat("/run/firejail/network", &s)) {
    create_empty_dir_as_root("/run/firejail/network", 0755);
  }
  if (stat("/run/firejail/bandwidth", &s)) {
    create_empty_dir_as_root("/run/firejail/bandwidth", 0755);
  }
  if (stat("/run/firejail/name", &s)) {
    create_empty_dir_as_root("/run/firejail/name", 0755);
  }
  if (stat("/run/firejail/profile", &s)) {
    create_empty_dir_as_root("/run/firejail/profile", 0755);
  }
  if (stat("/run/firejail/x11", &s)) {
    create_empty_dir_as_root("/run/firejail/x11", 0755);
  }
  if (stat("/run/firejail/appimage", &s)) {
    create_empty_dir_as_root("/run/firejail/appimage", 0755);
  }
  if (stat("/run/firejail/lib", &s)) {
    create_empty_dir_as_root("/run/firejail/lib", 0755);
  }
  if (stat("/run/firejail/mnt", &s)) {
    create_empty_dir_as_root("/run/firejail/mnt", 0755);
  }
  create_empty_file_as_root("/run/firejail/firejail.ro.file", S_IRUSR);
  create_empty_dir_as_root("/run/firejail/firejail.ro.dir", S_IRUSR);
}


x86 assembly (clang, -O0):
<preproc_build_firejail_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1163 <preproc_build_firejail_dir+0x33>
lea    0xea7(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe9b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     118e <preproc_build_firejail_dir+0x5e>
lea    0xe81(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     11b9 <preproc_build_firejail_dir+0x89>
lea    0xe64(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe69(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     11e4 <preproc_build_firejail_dir+0xb4>
lea    0xe4f(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe56(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     120f <preproc_build_firejail_dir+0xdf>
lea    0xe3c(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe3e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     123a <preproc_build_firejail_dir+0x10a>
lea    0xe24(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe29(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1265 <preproc_build_firejail_dir+0x135>
lea    0xe0f(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe10(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1290 <preproc_build_firejail_dir+0x160>
lea    0xdf6(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xdfc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     12bb <preproc_build_firejail_dir+0x18b>
lea    0xde2(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xde3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     12e6 <preproc_build_firejail_dir+0x1b6>
lea    0xdc9(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%esi
lea    0xdc1(%rip),%rdi
call   1040 <create_empty_file_as_root@plt>
mov    0x2cde(%rip),%rax
mov    (%rax),%esi
lea    0xdcb(%rip),%rdi
call   1050 <create_empty_dir_as_root@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preproc_build_firejail_dir>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     115c <preproc_build_firejail_dir+0x2c>
lea    0xeae(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xea2(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     1183 <preproc_build_firejail_dir+0x53>
lea    0xe8c(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe89(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     11aa <preproc_build_firejail_dir+0x7a>
lea    0xe73(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe78(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     11d1 <preproc_build_firejail_dir+0xa1>
lea    0xe62(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe69(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     11f8 <preproc_build_firejail_dir+0xc8>
lea    0xe53(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe55(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     121f <preproc_build_firejail_dir+0xef>
lea    0xe3f(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe44(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     1246 <preproc_build_firejail_dir+0x116>
lea    0xe2e(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe2f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     126d <preproc_build_firejail_dir+0x13d>
lea    0xe19(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe1f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     1294 <preproc_build_firejail_dir+0x164>
lea    0xe09(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
lea    0xe0a(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     12bb <preproc_build_firejail_dir+0x18b>
lea    0xdf4(%rip),%rdi
mov    $0x1ed,%esi
call   1050 <create_empty_dir_as_root@plt>
mov    0x2d1e(%rip),%rbx
mov    (%rbx),%esi
lea    0xdec(%rip),%rdi
call   1040 <create_empty_file_as_root@plt>
mov    (%rbx),%esi
lea    0xdfd(%rip),%rdi
call   1050 <create_empty_dir_as_root@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"/run\00"
@.str.1 = [14 x i8] c"/run/firejail\00"
@.str.2 = [22 x i8] c"/run/firejail/network\00"
@.str.3 = [24 x i8] c"/run/firejail/bandwidth\00"
@.str.4 = [19 x i8] c"/run/firejail/name\00"
@.str.5 = [22 x i8] c"/run/firejail/profile\00"
@.str.6 = [18 x i8] c"/run/firejail/x11\00"
@.str.7 = [23 x i8] c"/run/firejail/appimage\00"
@.str.8 = [18 x i8] c"/run/firejail/lib\00"
@.str.9 = [18 x i8] c"/run/firejail/mnt\00"
@.str.10 = [31 x i8] c"/run/firejail/firejail.ro.file\00"
@S_IRUSR = global i32 0
@.str.11 = [30 x i8] c"/run/firejail/firejail.ro.dir\00"
define void @preproc_build_firejail_dir() {
%1 = alloca %struct.stat
%2 = call i64 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 493)
br label %6
6: ; preds = %4, %0
%7 = call i64 @stat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 493)
br label %11
11: ; preds = %9, %6
%12 = call i64 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 493)
br label %16
16: ; preds = %14, %11
%17 = call i64 @stat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), %struct.stat* %1)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %21
21: ; preds = %19, %16
%22 = call i64 @stat(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), %struct.stat* %1)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 493)
br label %26
26: ; preds = %24, %21
%27 = call i64 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %1)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 493)
br label %31
31: ; preds = %29, %26
%32 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), %struct.stat* %1)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 493)
br label %36
36: ; preds = %34, %31
%37 = call i64 @stat(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), %struct.stat* %1)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 493)
br label %41
41: ; preds = %39, %36
%42 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), %struct.stat* %1)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 493)
br label %46
46: ; preds = %44, %41
%47 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %1)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 493)
br label %51
51: ; preds = %49, %46
%52 = load i32, i32* @S_IRUSR
%53 = call i32 @create_empty_file_as_root(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %52)
%54 = load i32, i32* @S_IRUSR
%55 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 %54)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"/run\00"
@.str.1 = [14 x i8] c"/run/firejail\00"
@.str.2 = [22 x i8] c"/run/firejail/network\00"
@.str.3 = [24 x i8] c"/run/firejail/bandwidth\00"
@.str.4 = [19 x i8] c"/run/firejail/name\00"
@.str.5 = [22 x i8] c"/run/firejail/profile\00"
@.str.6 = [18 x i8] c"/run/firejail/x11\00"
@.str.7 = [23 x i8] c"/run/firejail/appimage\00"
@.str.8 = [18 x i8] c"/run/firejail/lib\00"
@.str.9 = [18 x i8] c"/run/firejail/mnt\00"
@.str.10 = [31 x i8] c"/run/firejail/firejail.ro.file\00"
@S_IRUSR = global i32 0
@.str.11 = [30 x i8] c"/run/firejail/firejail.ro.dir\00"
define void @preproc_build_firejail_dir() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 493)
br label %7
7: ; preds = %5, %0
%8 = call i64 @stat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 493)
br label %12
12: ; preds = %10, %7
%13 = call i64 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 493)
br label %17
17: ; preds = %15, %12
%18 = call i64 @stat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), %struct.stat* %1)
%19 = icmp eq i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %22
22: ; preds = %20, %17
%23 = call i64 @stat(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), %struct.stat* %1)
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 493)
br label %27
27: ; preds = %25, %22
%28 = call i64 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %1)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 493)
br label %32
32: ; preds = %30, %27
%33 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), %struct.stat* %1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 493)
br label %37
37: ; preds = %35, %32
%38 = call i64 @stat(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), %struct.stat* %1)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 493)
br label %42
42: ; preds = %40, %37
%43 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), %struct.stat* %1)
%44 = icmp eq i64 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 493)
br label %47
47: ; preds = %45, %42
%48 = call i64 @stat(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %1)
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 493)
br label %52
52: ; preds = %50, %47
%53 = load i32, i32* @S_IRUSR
%54 = call i32 @create_empty_file_as_root(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @S_IRUSR
%56 = call i32 @create_empty_dir_as_root(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 %55)
ret void
}