#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 */
struct fatfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vfs_mount(char *, char *, char *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *);
int mount(struct fatfs *fs) {
  printf("\nC:\\MOUNT /dev/sd0 /mnt\n");
  if (!fs)
    return -1;
  vfs_mount("/dev/sd0", "/mnt", "fatfs", 0, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    114f <mount+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <mount+0x57>
lea    0xec3(%rip),%rdi
lea    0xec5(%rip),%rsi
lea    0xec3(%rip),%rdx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <vfs_mount@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount>:
push   %rbx
mov    %rdi,%rbx
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     1158 <mount+0x38>
lea    0xec4(%rip),%rdi
lea    0xedf(%rip),%rsi
lea    0xebf(%rip),%rdx
xor    %ebx,%ebx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <vfs_mount@plt>
jmp    115d <mount+0x3d>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.fatfs = type { i32 }
@.str = [25 x i8] c"\0AC:\\MOUNT /dev/sd0 /mnt\0A\00"
@.str.1 = [9 x i8] c"/dev/sd0\00"
@.str.2 = [5 x i8] c"/mnt\00"
@.str.3 = [6 x i8] c"fatfs\00"
define i32 @mount(%struct.fatfs* %0) {
%2 = alloca i32
%3 = alloca %struct.fatfs*
store %struct.fatfs* %0, %struct.fatfs** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.fatfs*, %struct.fatfs** %3
%6 = icmp ne %struct.fatfs* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 -1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @vfs_mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0, i32* null)
store i32 0, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.fatfs = type { i32 }
@.str.1 = [9 x i8] c"/dev/sd0\00"
@.str.2 = [5 x i8] c"/mnt\00"
@.str.3 = [6 x i8] c"fatfs\00"
@str = [24 x i8] c"\0AC:\\MOUNT /dev/sd0 /mnt\00"
define i32 @mount(%struct.fatfs* readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = icmp eq %struct.fatfs* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @vfs_mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0, i32* null)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}