#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*/ atoi(char *);
int /*<<< orphan*/ map_retrace(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ map_show();
int /*<<< orphan*/ map_walk(char *, int, int);
char *skipspace(char *);
void cmd_map(char *arg) {
  arg = skipspace(arg);
  if (!*arg)
    map_show();
  else if (*arg == '-')
    map_retrace(atoi(arg + 1), 0);
  else
    map_walk(arg, 1, 1);
}


x86 assembly (clang, -O0):
<cmd_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <skipspace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1182 <cmd_map+0x32>
mov    $0x0,%al
call   1070 <map_show@plt>
jmp    11c2 <cmd_map+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11ad <cmd_map+0x5d>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <map_retrace@plt>
jmp    11bd <cmd_map+0x6d>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <map_walk@plt>
jmp    11c2 <cmd_map+0x72>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_map>:
push   %rax
call   1050 <skipspace@plt>
mov    (%rax),%cl
cmp    $0x2d,%cl
je     1169 <cmd_map+0x19>
test   %cl,%cl
jne    117f <cmd_map+0x2f>
xor    %eax,%eax
pop    %rcx
jmp    1070 <map_show@plt>
add    $0x1,%rax
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <map_retrace@plt>
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
pop    %rax
jmp    1040 <map_walk@plt>

LLVM IR (-O0):
define void @cmd_map(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skipspace(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @map_show()
br label %24
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @map_retrace(i32 %18, i32 0)
br label %23
20: ; preds = %10
%21 = load i8*, i8** %2
%22 = call i32 @map_walk(i8* %21, i32 1, i32 1)
br label %23
23: ; preds = %20, %15
br label %24
24: ; preds = %23, %8
ret void
}

LLVM IR (-O2):
define void @cmd_map(i8* %0) {
%2 = tail call i8* @skipspace(i8* %0)
%3 = load i8, i8* %2
switch i8 %3, label %10 [
i8 0, label %4
i8 45, label %6
]
4: ; preds = %1
%5 = tail call i32 (...) @map_show()
br label %12
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @map_retrace(i32 %8, i32 0)
br label %12
10: ; preds = %1
%11 = tail call i32 @map_walk(i8* %2, i32 1, i32 1)
br label %12
12: ; preds = %6, %10, %4
ret void
}