#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 */
scalar_t__ EBUSY;
int MS_NOEXEC;
int MS_NOSUID;
int /*<<< orphan*/ dien();
scalar_t__ errno;
scalar_t__ mount(char *, char *, char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ warn2(char *, char *);
void init_dev() {
  if (mount("dev", "/dev", "devtmpfs", MS_NOSUID | MS_NOEXEC, NULL) < 0) {
    warn2("mount", "/dev");
    if (errno != EBUSY) {
      dien();
    }
  }
}


x86 assembly (clang, -O0):
<init_dev>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7c(%rip),%rax
or     (%rax),%ecx
lea    0xeb4(%rip),%rdi
lea    0xeac(%rip),%rsi
lea    0xeaa(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <mount@plt>
cmp    $0x0,%rax
jge    11a8 <init_dev+0x78>
lea    0xe98(%rip),%rdi
lea    0xe83(%rip),%rsi
call   1050 <warn2@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%rax
mov    0x2e3d(%rip),%rcx
cmp    (%rcx),%rax
je     11a3 <init_dev+0x73>
mov    $0x0,%al
call   1040 <dien@plt>
jmp    11a8 <init_dev+0x78>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_dev>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2e81(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
lea    0xeb7(%rip),%rdi
lea    0xeaf(%rip),%rsi
lea    0xead(%rip),%rdx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %rax,%rax
jns    118e <init_dev+0x5e>
lea    0xea2(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1050 <warn2@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%rax
mov    0x2e47(%rip),%rcx
cmp    (%rcx),%rax
jne    1190 <init_dev+0x60>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <dien@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dev\00"
@.str.1 = [5 x i8] c"/dev\00"
@.str.2 = [9 x i8] c"devtmpfs\00"
@MS_NOSUID = global i32 0
@MS_NOEXEC = global i32 0
@.str.3 = [6 x i8] c"mount\00"
@errno = global i64 0
@EBUSY = global i64 0
define void @init_dev() {
%1 = load i32, i32* @MS_NOSUID
%2 = load i32, i32* @MS_NOEXEC
%3 = or i32 %1, %2
%4 = call i64 @mount(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %3, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = call i32 @warn2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = load i64, i64* @errno
%9 = load i64, i64* @EBUSY
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 (...) @dien()
br label %13
13: ; preds = %11, %6
br label %14
14: ; preds = %13, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dev\00"
@.str.1 = [5 x i8] c"/dev\00"
@.str.2 = [9 x i8] c"devtmpfs\00"
@MS_NOSUID = global i32 0
@MS_NOEXEC = global i32 0
@.str.3 = [6 x i8] c"mount\00"
@errno = global i64 0
@EBUSY = global i64 0
define void @init_dev() {
%1 = load i32, i32* @MS_NOSUID
%2 = load i32, i32* @MS_NOEXEC
%3 = or i32 %2, %1
%4 = tail call i64 @mount(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %3, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = tail call i32 @warn2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = load i64, i64* @errno
%9 = load i64, i64* @EBUSY
%10 = icmp eq i64 %8, %9
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 (...) @dien()
br label %13
13: ; preds = %6, %11, %0
ret void
}