#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 MS_NODEV;
int MS_NOEXEC;
int MS_NOSUID;
int MS_PRIVATE;
int MS_REC;
int /*<<< orphan*/ _err_exit(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ errno;
int mount(char *, char *, char *, int, int /*<<< orphan*/ *);
void mount_proc(void) {
  int rc;
  rc = mount("none", "/proc", NULL, MS_REC | MS_PRIVATE, NULL);
  if (rc != 0)
    _err_exit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/"
              "heads/main/src/pid1.c",
              306, errno, "mount /proc private");
  rc = mount("none", "/proc", "proc", MS_NOSUID | MS_NODEV | MS_NOEXEC, NULL);
  if (rc != 0)
    _err_exit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/"
              "heads/main/src/pid1.c",
              311, errno, "mount none /proc proc");
  return;
}


x86 assembly (clang, -O0):
<mount_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2e90(%rip),%rax
or     (%rax),%ecx
lea    0xebf(%rip),%rdi
lea    0xebd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
call   1030 <mount@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1183 <mount_proc+0x63>
mov    0x2e57(%rip),%rax
mov    (%rax),%edx
lea    0xe99(%rip),%rdi
mov    $0x132,%esi
lea    0xf20(%rip),%rcx
call   1040 <_err_exit@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%ecx
mov    0x2e5d(%rip),%rax
or     (%rax),%ecx
mov    0x2e14(%rip),%rax
or     (%rax),%ecx
lea    0xe5b(%rip),%rdi
lea    0xe59(%rip),%rsi
lea    0xf10(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <mount@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11eb <mount_proc+0xcb>
mov    0x2def(%rip),%rax
mov    (%rax),%edx
lea    0xe31(%rip),%rdi
mov    $0x137,%esi
lea    0xecc(%rip),%rcx
call   1040 <_err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_proc>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
lea    0xec6(%rip),%rdi
lea    0xec4(%rip),%rsi
xor    %edx,%edx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %eax,%eax
je     1170 <mount_proc+0x50>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
lea    0xeac(%rip),%rdi
lea    0xf38(%rip),%rcx
mov    $0x132,%esi
call   1040 <_err_exit@plt>
mov    0x2e69(%rip),%rax
mov    0x2e72(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2e27(%rip),%rax
or     (%rax),%ecx
lea    0xe6e(%rip),%rdi
lea    0xe6c(%rip),%rsi
lea    0xf23(%rip),%rdx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %eax,%eax
je     11ce <mount_proc+0xae>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
lea    0xe4f(%rip),%rdi
lea    0xeef(%rip),%rcx
mov    $0x137,%esi
pop    %rax
jmp    1040 <_err_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [6 x i8] c"/proc\00"
@MS_REC = global i32 0
@MS_PRIVATE = global i32 0
@.str.2 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/heads/main/src/pid1.c\00"
@errno = global i32 0
@.str.3 = [20 x i8] c"mount /proc private\00"
@.str.4 = [5 x i8] c"proc\00"
@MS_NOSUID = global i32 0
@MS_NODEV = global i32 0
@MS_NOEXEC = global i32 0
@.str.5 = [22 x i8] c"mount none /proc proc\00"
define void @mount_proc() {
%1 = alloca i32
%2 = load i32, i32* @MS_REC
%3 = load i32, i32* @MS_PRIVATE
%4 = or i32 %2, %3
%5 = call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* null, i32 %4, i32* null)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* @errno
%10 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.2, i64 0, i64 0), i32 306, i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %8, %0
%12 = load i32, i32* @MS_NOSUID
%13 = load i32, i32* @MS_NODEV
%14 = or i32 %12, %13
%15 = load i32, i32* @MS_NOEXEC
%16 = or i32 %14, %15
%17 = call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %16, i32* null)
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %11
%21 = load i32, i32* @errno
%22 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.2, i64 0, i64 0), i32 311, i32 %21, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %20, %11
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [6 x i8] c"/proc\00"
@MS_REC = global i32 0
@MS_PRIVATE = global i32 0
@.str.2 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/heads/main/src/pid1.c\00"
@errno = global i32 0
@.str.3 = [20 x i8] c"mount /proc private\00"
@.str.4 = [5 x i8] c"proc\00"
@MS_NOSUID = global i32 0
@MS_NODEV = global i32 0
@MS_NOEXEC = global i32 0
@.str.5 = [22 x i8] c"mount none /proc proc\00"
define void @mount_proc() {
%1 = load i32, i32* @MS_REC
%2 = load i32, i32* @MS_PRIVATE
%3 = or i32 %2, %1
%4 = tail call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* null, i32 %3, i32* null)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = tail call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.2, i64 0, i64 0), i32 306, i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* @MS_NOSUID
%11 = load i32, i32* @MS_NODEV
%12 = or i32 %11, %10
%13 = load i32, i32* @MS_NOEXEC
%14 = or i32 %12, %13
%15 = tail call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32* null)
%16 = icmp eq i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %9
%18 = load i32, i32* @errno
%19 = tail call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.2, i64 0, i64 0), i32 311, i32 %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %20
20: ; preds = %17, %9
ret void
}