#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int vlc_demux_process_path(char const *, char const *);
int main(int argc, char *argv[]) {
  const char *demux = NULL, *filename;
  switch (argc) {
  case 3:
    demux = argv[argc - 2];
  case 2:
    filename = argv[argc - 1];
    break;
  default:
    fprintf(stderr, "Usage: %s [demux] <filename>\n", argv[0]);
    return 1;
  }
  return -vlc_demux_process_path(demux, filename);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2,%eax
je     1178 <main+0x58>
jmp    1152 <main+0x32>
mov    -0x24(%rbp),%eax
sub    $0x3,%eax
jne    1192 <main+0x72>
jmp    1163 <main+0x43>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    11ba <main+0x9a>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe57(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <main+0xb0>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <vlc_demux_process_path@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
je     1131 <main+0x11>
cmp    $0x3,%edi
jne    1146 <main+0x26>
mov    0x8(%rsi),%rax
jmp    1133 <main+0x13>
xor    %eax,%eax
add    $0xffffffff,%edi
mov    (%rsi,%rdi,8),%rsi
mov    %rax,%rdi
call   1040 <vlc_demux_process_path@plt>
neg    %eax
pop    %rcx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s [demux] <filename>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = load i32, i32* %4
switch i32 %8, label %23 [
i32 3, label %9
i32 2, label %16
]
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %6
br label %16
16: ; preds = %2, %9
%17 = load i8**, i8*** %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %17, i64 %20
%22 = load i8*, i8** %21
store i8* %22, i8** %7
br label %29
23: ; preds = %2
%24 = load i32, i32* @stderr
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %27)
store i32 1, i32* %3
br label %34
29: ; preds = %16
%30 = load i8*, i8** %6
%31 = load i8*, i8** %7
%32 = call i32 @vlc_demux_process_path(i8* %30, i8* %31)
%33 = sub nsw i32 0, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %29, %23
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s [demux] <filename>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %14 [
i32 3, label %3
i32 2, label %6
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
br label %6
6: ; preds = %2, %3
%7 = phi i8* [ null, %2 ], [ %5, %3 ]
%8 = add nsw i32 %0, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @vlc_demux_process_path(i8* %7, i8* %11)
%13 = sub nsw i32 0, %12
br label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %1
%17 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %6, %14
%19 = phi i32 [ 1, %14 ], [ %13, %6 ]
ret i32 %19
}