#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*/ mw_dump(char *, char *, char *);
int /*<<< orphan*/ printf(char *, char);
int dump_data(char *fname, char **opts) {
  char *tracks = NULL;
  char *region = NULL;
  while (*opts) {
    if ((*opts)[0] == '-') {
      switch ((*opts)[1]) {
      case 't':
        opts++;
        tracks = *opts;
        break;
      case 'r':
        opts++;
        region = *opts;
        break;
      default:
        printf("Error: unknown option -%c\n", (*opts)[1]);
        return -1;
      }
    }
    opts++;
  }
  mw_dump(fname, region, tracks);
  return 0;
}


x86 assembly (clang, -O0):
<dump_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ff <dump_data+0xdf>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11ee <dump_data+0xce>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x72,%eax
je     11aa <dump_data+0x8a>
jmp    117d <dump_data+0x5d>
mov    -0x2c(%rbp),%eax
sub    $0x74,%eax
jne    11c6 <dump_data+0xa6>
jmp    118e <dump_data+0x6e>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    11e9 <dump_data+0xc9>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11e9 <dump_data+0xc9>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
lea    0xe2c(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1217 <dump_data+0xf7>
jmp    11ee <dump_data+0xce>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <dump_data+0x20>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <mw_dump@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_data>:
push   %rbx
mov    (%rsi),%rcx
xor    %ebx,%ebx
test   %rcx,%rcx
je     116e <dump_data+0x4e>
xor    %eax,%eax
xor    %edx,%edx
jmp    1155 <dump_data+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsi),%rax
add    $0x8,%rsi
mov    0x8(%rsi),%rcx
add    $0x8,%rsi
test   %rcx,%rcx
je     1172 <dump_data+0x52>
cmpb   $0x2d,(%rcx)
jne    1148 <dump_data+0x28>
movsbl 0x1(%rcx),%ecx
cmp    $0x72,%ecx
je     1140 <dump_data+0x20>
cmp    $0x74,%ecx
jne    117e <dump_data+0x5e>
mov    0x8(%rsi),%rdx
jmp    1144 <dump_data+0x24>
xor    %edx,%edx
xor    %eax,%eax
mov    %rax,%rsi
call   1040 <mw_dump@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe7b(%rip),%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
jmp    117a <dump_data+0x5a>

LLVM IR (-O0):
@.str = [27 x i8] c"Error: unknown option -%c\0A\00"
define i32 @dump_data(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
br label %8
8: ; preds = %42, %2
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %45
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %42
19: ; preds = %12
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
switch i32 %24, label %35 [
i32 116, label %25
i32 114, label %30
]
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
store i8* %29, i8** %6
br label %41
30: ; preds = %19
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i32 1
store i8** %32, i8*** %5
%33 = load i8**, i8*** %5
%34 = load i8*, i8** %33
store i8* %34, i8** %7
br label %41
35: ; preds = %19
%36 = load i8**, i8*** %5
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = load i8, i8* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %39)
store i32 -1, i32* %3
br label %50
41: ; preds = %30, %25
br label %42
42: ; preds = %41, %12
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i32 1
store i8** %44, i8*** %5
br label %8
45: ; preds = %8
%46 = load i8*, i8** %4
%47 = load i8*, i8** %7
%48 = load i8*, i8** %6
%49 = call i32 @mw_dump(i8* %46, i8* %47, i8* %48)
store i32 0, i32* %3
br label %50
50: ; preds = %45, %35
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error: unknown option -%c\0A\00"
define i32 @dump_data(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %31, label %5
5: ; preds = %2, %24
%6 = phi i8* [ %29, %24 ], [ %3, %2 ]
%7 = phi i8* [ %27, %24 ], [ null, %2 ]
%8 = phi i8* [ %26, %24 ], [ null, %2 ]
%9 = phi i8** [ %28, %24 ], [ %1, %2 ]
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 45
br i1 %11, label %12, label %24
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
switch i32 %15, label %22 [
i32 116, label %16
i32 114, label %19
]
16: ; preds = %12
%17 = getelementptr inbounds i8*, i8** %9, i64 1
%18 = load i8*, i8** %17
br label %24
19: ; preds = %12
%20 = getelementptr inbounds i8*, i8** %9, i64 1
%21 = load i8*, i8** %20
br label %24
22: ; preds = %12
%23 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %35
24: ; preds = %16, %19, %5
%25 = phi i8** [ %20, %19 ], [ %17, %16 ], [ %9, %5 ]
%26 = phi i8* [ %8, %19 ], [ %18, %16 ], [ %8, %5 ]
%27 = phi i8* [ %21, %19 ], [ %7, %16 ], [ %7, %5 ]
%28 = getelementptr inbounds i8*, i8** %25, i64 1
%29 = load i8*, i8** %28
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %5
31: ; preds = %24, %2
%32 = phi i8* [ null, %2 ], [ %26, %24 ]
%33 = phi i8* [ null, %2 ], [ %27, %24 ]
%34 = tail call i32 @mw_dump(i8* %0, i8* %33, i8* %32)
br label %35
35: ; preds = %31, %22
%36 = phi i32 [ -1, %22 ], [ 0, %31 ]
ret i32 %36
}