#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 adpcm2wav(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int wav2adpcm(char *, char *);
int main(int argc, char **argv) {
  if (argc == 4) {
    if (!strcmp(argv[1], "-t")) {
      return wav2adpcm(argv[2], argv[3]);
    } else if (!strcmp(argv[1], "-f")) {
      return adpcm2wav(argv[2], argv[3]);
    } else {
      usage();
      return -1;
    }
  } else {
    usage();
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    11e7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    119a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1050 <wav2adpcm@plt>
mov    %eax,-0x4(%rbp)
jmp    11f5 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11d4 <main+0x94>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <adpcm2wav@plt>
mov    %eax,-0x4(%rbp)
jmp    11f5 <main+0xb5>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f5 <main+0xb5>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    1176 <main+0x36>
mov    %rsi,%rbx
mov    0x8(%rsi),%r14
lea    0xea9(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     118a <main+0x4a>
lea    0xe99(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119e <main+0x5e>
xor    %eax,%eax
call   1060 <usage@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <wav2adpcm@plt>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <adpcm2wav@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-t\00"
@.str.1 = [3 x i8] c"-f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %38
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
%21 = call i32 @wav2adpcm(i8* %17, i8* %20)
store i32 %21, i32* %3
br label %40
22: ; preds = %8
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %22
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i32 @adpcm2wav(i8* %31, i8* %34)
store i32 %35, i32* %3
br label %40
36: ; preds = %22
%37 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %40
38: ; preds = %2
%39 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %40
40: ; preds = %38, %36, %28, %14
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str = [3 x i8] c"-t\00"
@.str.1 = [3 x i8] c"-f\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %26
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @wav2adpcm(i8* %11, i8* %13)
br label %28
15: ; preds = %4
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = tail call i32 @adpcm2wav(i8* %20, i8* %22)
br label %28
24: ; preds = %15
%25 = tail call i32 (...) @usage()
br label %28
26: ; preds = %2
%27 = tail call i32 (...) @usage()
br label %28
28: ; preds = %26, %24, %18, %9
%29 = phi i32 [ -1, %24 ], [ %23, %18 ], [ %14, %9 ], [ -1, %26 ]
ret i32 %29
}