#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 /*<<< orphan*/ _err_exit(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ errno;
scalar_t__ mount(char *, char *, int /*<<< orphan*/ *, unsigned long,
                 int /*<<< orphan*/ *);
void set_propagation(unsigned long flags) {
  if (flags == 0)
    return;
  if (mount("none", "/", NULL, flags, NULL) != 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",
              293, errno, "cannot change root filesystem propagation");
}


x86 assembly (clang, -O0):
<set_propagation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <set_propagation+0x1c>
jmp    1186 <set_propagation+0x66>
mov    -0x8(%rbp),%rcx
lea    0xeb9(%rip),%rdi
lea    0xeb7(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
call   1030 <mount@plt>
cmp    $0x0,%rax
je     1186 <set_propagation+0x66>
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
lea    0xe92(%rip),%rdi
mov    $0x125,%esi
lea    0xf19(%rip),%rcx
call   1040 <_err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_propagation>:
push   %rax
test   %rdi,%rdi
je     1168 <set_propagation+0x48>
mov    %rdi,%rcx
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
xor    %edx,%edx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %rax,%rax
je     1168 <set_propagation+0x48>
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
lea    0xf3d(%rip),%rcx
mov    $0x125,%esi
pop    %rax
jmp    1040 <_err_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [2 x i8] c"/\00"
@.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 = [42 x i8] c"cannot change root filesystem propagation\00"
define void @set_propagation(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null, i64 %7, i32* null)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* @errno
%12 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.2, i64 0, i64 0), i32 293, i32 %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %5, %10, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [2 x i8] c"/\00"
@.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 = [42 x i8] c"cannot change root filesystem propagation\00"
define void @set_propagation(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null, i64 %0, i32* null)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%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 293, i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %1, %6, %3
ret void
}