#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 EINVAL;
int getopt(int, char **, char *);
int /*<<< orphan*/ getopt_init();
int /*<<< orphan*/ print_usage();
int remove(char const *);
int main(int argc, char **argv) {
  const char *file_path;
  int opt;
  getopt_init();
  while (-1 != (opt = getopt(argc - 1, argv, "frh"))) {
    switch (opt) {
    case 'f':
      break;
    case 'r':
      break;
    case 'h':
      print_usage();
      return 0;
    default:
      return -EINVAL;
    }
  }
  file_path = argv[argc - 1];
  return remove(file_path);
}


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)
mov    $0x0,%al
call   1040 <getopt_init@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
lea    0xe92(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     11f0 <main+0xb0>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x66,%eax
je     11bb <main+0x7b>
jmp    1199 <main+0x59>
mov    -0x20(%rbp),%eax
sub    $0x68,%eax
je     11c5 <main+0x85>
jmp    11aa <main+0x6a>
mov    -0x20(%rbp),%eax
sub    $0x72,%eax
je     11c0 <main+0x80>
jmp    11d8 <main+0x98>
jmp    11eb <main+0xab>
jmp    11eb <main+0xab>
mov    $0x0,%al
call   1060 <print_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1211 <main+0xd1>
xor    %eax,%eax
mov    0x2dff(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1211 <main+0xd1>
jmp    115d <main+0x1d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <getopt_init@plt>
add    $0xffffffff,%ebp
lea    0xea6(%rip),%r14
jmp    1165 <main+0x25>
nopl   0x0(%rax)
cmp    $0x72,%eax
jne    1191 <main+0x51>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x67,%eax
jg     1160 <main+0x20>
cmp    $0x66,%eax
je     1165 <main+0x25>
cmp    $0xffffffff,%eax
jne    11a1 <main+0x61>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <remove@plt>
cmp    $0x68,%eax
jne    11a1 <main+0x61>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <print_usage@plt>
jmp    11ac <main+0x6c>
mov    0x2e38(%rip),%rax
xor    %ebx,%ebx
sub    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"frh\00"
@EINVAL = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @getopt_init()
br label %9
9: ; preds = %24, %2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = load i8**, i8*** %5
%13 = call i32 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %7
%14 = icmp ne i32 -1, %13
br i1 %14, label %15, label %25
15: ; preds = %9
%16 = load i32, i32* %7
switch i32 %16, label %21 [
i32 102, label %17
i32 114, label %18
i32 104, label %19
]
17: ; preds = %15
br label %24
18: ; preds = %15
br label %24
19: ; preds = %15
%20 = call i32 (...) @print_usage()
store i32 0, i32* %3
br label %34
21: ; preds = %15
%22 = load i32, i32* @EINVAL
%23 = sub nsw i32 0, %22
store i32 %23, i32* %3
br label %34
24: ; preds = %18, %17
br label %9
25: ; preds = %9
%26 = load i8**, i8*** %5
%27 = load i32, i32* %4
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %26, i64 %29
%31 = load i8*, i8** %30
store i8* %31, i8** %6
%32 = load i8*, i8** %6
%33 = call i32 @remove(i8* %32)
store i32 %33, i32* %3
br label %34
34: ; preds = %25, %21, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [4 x i8] c"frh\00"
@EINVAL = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @getopt_init()
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %7, %2
%6 = tail call i32 @getopt(i32 %4, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %6, label %10 [
i32 -1, label %13
i32 102, label %7
i32 114, label %7
i32 104, label %8
]
7: ; preds = %5, %5
br label %5
8: ; preds = %5
%9 = tail call i32 (...) @print_usage()
br label %18
10: ; preds = %5
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
br label %18
13: ; preds = %5
%14 = sext i32 %4 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 @remove(i8* %16)
br label %18
18: ; preds = %13, %10, %8
%19 = phi i32 [ %12, %10 ], [ 0, %8 ], [ %17, %13 ]
ret i32 %19
}