#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*/ EXIT_SUCCESS;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mount();
int /*<<< orphan*/ pfile(unsigned int);
unsigned int strtol(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ umount();
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  unsigned inumber;
  if (argc != 2)
    usage(argv[0]);
  errno = 0;
  inumber = strtol(argv[1], NULL, 10);
  if (errno || inumber <= 0)
    usage(argv[0]);
  mount();
  pfile(inumber);
  umount();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     118c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage@plt>
mov    0x2e4d(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e26(%rip),%rax
cmpq   $0x0,(%rax)
jne    11ce <main+0x6e>
cmpl   $0x0,-0x14(%rbp)
ja     11da <main+0x7a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage@plt>
mov    $0x0,%al
call   1040 <mount@plt>
mov    -0x14(%rbp),%edi
call   1050 <pfile@plt>
mov    $0x0,%al
call   1030 <umount@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1174 <main+0x14>
mov    (%rbx),%rdi
call   1070 <usage@plt>
mov    0x2e65(%rip),%r14
movq   $0x0,(%r14)
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,%ebp
cmpq   $0x0,(%r14)
jne    119e <main+0x3e>
test   %ebp,%ebp
jne    11a6 <main+0x46>
mov    (%rbx),%rdi
call   1070 <usage@plt>
xor    %eax,%eax
call   1040 <mount@plt>
mov    %ebp,%edi
call   1050 <pfile@plt>
xor    %eax,%eax
call   1030 <umount@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
br label %14
14: ; preds = %9, %2
store i64 0, i64* @errno
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strtol(i8* %17, i32* null, i32 10)
store i32 %18, i32* %6
%19 = load i64, i64* @errno
%20 = icmp ne i64 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = load i32, i32* %6
%23 = icmp ule i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21, %14
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 @usage(i8* %27)
br label %29
29: ; preds = %24, %21
%30 = call i32 (...) @mount()
%31 = load i32, i32* %6
%32 = call i32 @pfile(i32 %31)
%33 = call i32 (...) @umount()
%34 = load i32, i32* @EXIT_SUCCESS
%35 = call i32 @exit(i32 %34)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
store i64 0, i64* @errno
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strtol(i8* nocapture %9, i32* null, i32 10)
%11 = load i64, i64* @errno
%12 = icmp ne i64 %11, 0
%13 = icmp eq i32 %10, 0
%14 = select i1 %12, i1 true, i1 %13
br i1 %14, label %15, label %18
15: ; preds = %7
%16 = load i8*, i8** %1
%17 = tail call i32 @usage(i8* %16)
br label %18
18: ; preds = %7, %15
%19 = tail call i32 (...) @mount()
%20 = tail call i32 @pfile(i32 %10)
%21 = tail call i32 (...) @umount()
%22 = load i32, i32* @EXIT_SUCCESS
%23 = tail call i32 @exit(i32 %22)
unreachable
}