#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__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int mount(const char *source, const char *target, const char *filesystemtype,
          unsigned long mountflags, const void *data) {
  int ret =
      (int)_syscall5(73, (void *)source, (void *)target, (void *)filesystemtype,
                     (void *)mountflags, (void *)data);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    $0x49,%edi
call   1030 <_syscall5@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1171 <mount+0x61>
xor    %ecx,%ecx
sub    -0x34(%rbp),%ecx
mov    0x2e7d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <mount+0x67>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount>:
push   %rax
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x49,%edi
call   1030 <_syscall5@plt>
test   %eax,%eax
js     1130 <mount+0x20>
pop    %rcx
ret
neg    %eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @mount(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = inttoptr i64 %16 to i8*
%18 = load i8*, i8** %11
%19 = call i64 @_syscall5(i32 73, i8* %13, i8* %14, i8* %15, i8* %17, i8* %18)
%20 = trunc i64 %19 to i32
store i32 %20, i32* %12
%21 = load i32, i32* %12
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %5
%24 = load i32, i32* %12
%25 = sub nsw i32 0, %24
store i32 %25, i32* @errno
store i32 -1, i32* %6
br label %28
26: ; preds = %5
%27 = load i32, i32* %12
store i32 %27, i32* %6
br label %28
28: ; preds = %26, %23
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @mount(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = inttoptr i64 %3 to i8*
%7 = tail call i64 @_syscall5(i32 73, i8* %0, i8* %1, i8* %2, i8* %6, i8* %4)
%8 = trunc i64 %7 to i32
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = sub nsw i32 0, %8
store i32 %11, i32* @errno
br label %12
12: ; preds = %5, %10
%13 = phi i32 [ -1, %10 ], [ %8, %5 ]
ret i32 %13
}