#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*/ MS_MGC_VAL;
scalar_t__ mount(char *, char *, char *, int /*<<< orphan*/,
                 int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sync();
scalar_t__ umount(char *);
int main() {
  sync();
  if (umount("/golf/test") != 0) {
    perror("umount");
  }
  if (mount("devshm", "/golf/test", "tmpfs", MS_MGC_VAL, NULL) != 0) {
    perror("mount");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <sync@plt>
lea    0xea3(%rip),%rdi
call   1030 <umount@plt>
cmp    $0x0,%rax
je     1178 <main+0x38>
lea    0xe98(%rip),%rdi
call   1060 <perror@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%ecx
lea    0xe8a(%rip),%rdi
lea    0xe71(%rip),%rsi
lea    0xe83(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <mount@plt>
cmp    $0x0,%rax
je     11c2 <main+0x82>
lea    0xe5b(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c9 <main+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <sync@plt>
lea    0xeaf(%rip),%rdi
call   1030 <umount@plt>
test   %rax,%rax
jne    118a <main+0x4a>
mov    0x2e7e(%rip),%rax
mov    (%rax),%ecx
lea    0xea7(%rip),%rdi
lea    0xe8e(%rip),%rsi
lea    0xea0(%rip),%rdx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %rax,%rax
jne    1198 <main+0x58>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe7a(%rip),%rdi
call   1060 <perror@plt>
jmp    115b <main+0x1b>
lea    0xe6d(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%ebx
jmp    1186 <main+0x46>

LLVM IR (-O0):
@.str = [11 x i8] c"/golf/test\00"
@.str.1 = [7 x i8] c"umount\00"
@.str.2 = [7 x i8] c"devshm\00"
@.str.3 = [6 x i8] c"tmpfs\00"
@MS_MGC_VAL = global i32 0
@.str.4 = [6 x i8] c"mount\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sync()
%3 = call i64 @umount(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* @MS_MGC_VAL
%9 = call i64 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32* null)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %14
13: ; preds = %7
store i32 0, i32* %1
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"/golf/test\00"
@.str.1 = [7 x i8] c"umount\00"
@.str.2 = [7 x i8] c"devshm\00"
@.str.3 = [6 x i8] c"tmpfs\00"
@MS_MGC_VAL = global i32 0
@.str.4 = [6 x i8] c"mount\00"
define i32 @main() {
%1 = tail call i32 (...) @sync()
%2 = tail call i64 @umount(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* @MS_MGC_VAL
%8 = tail call i64 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32* null)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %12
12: ; preds = %6, %10
%13 = phi i32 [ 1, %10 ], [ 0, %6 ]
ret i32 %13
}