#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 */
struct arguments {
  int dummy;
};
struct argp_state {
  struct arguments *input;
};
typedef int /*<<< orphan*/ error_t;

/* Variables and functions */
int /*<<< orphan*/ ARGP_ERR_UNKNOWN;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ mute();
int /*<<< orphan*/ parse_route_arg(char *, int *, int *);
int /*<<< orphan*/ set_audio(int, int);
int /*<<< orphan*/ set_fnc(int /*<<< orphan*/);
int /*<<< orphan*/ set_video(int, int);
int /*<<< orphan*/ set_volume(int /*<<< orphan*/);
int /*<<< orphan*/ set_ycm(int /*<<< orphan*/);
int /*<<< orphan*/ set_zcd(int /*<<< orphan*/);
int /*<<< orphan*/ show_fblk();
int /*<<< orphan*/ show_fnc();
int /*<<< orphan*/ show_mute();
int /*<<< orphan*/ show_type();
int /*<<< orphan*/ show_volume();
int /*<<< orphan*/ show_ycm();
int /*<<< orphan*/ show_zcd();
int /*<<< orphan*/ unmute();
error_t parse_opt(int key, char *arg, struct argp_state *state) {
  int s, d;
  struct arguments *arguments = state->input;
  switch (key) {
  case 's':
    show_type();
    show_zcd();
    show_fnc();
    show_ycm();
    show_fblk();
    show_volume();
    show_mute();
    break;
  case 'm':
    mute();
    break;
  case 'u':
    unmute();
    break;
  case 'l':
    set_volume(atoi(arg));
    break;
  case 'z':
    set_zcd(atoi(arg));
    break;
  case 'f':
    set_fnc(atoi(arg));
    break;
  case 'y':
    set_ycm(atoi(arg));
    break;
  case 'v':
    if (parse_route_arg(arg, &s, &d) < 0) {
      return ARGP_ERR_UNKNOWN;
    }
    set_video(s, d);
    break;
  case 'a':
    if (parse_route_arg(arg, &s, &d) < 0) {
      return ARGP_ERR_UNKNOWN;
    }
    set_audio(s, d);
    break;
  default:
    return ARGP_ERR_UNKNOWN;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x19,%eax
ja     136f <parse_opt+0x15f>
mov    -0x30(%rbp),%rax
lea    0xdb2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10a0 <show_type@plt>
mov    $0x0,%al
call   10b0 <show_zcd@plt>
mov    $0x0,%al
call   10f0 <show_fnc@plt>
mov    $0x0,%al
call   1070 <show_ycm@plt>
mov    $0x0,%al
call   1030 <show_fblk@plt>
mov    $0x0,%al
call   10c0 <show_volume@plt>
mov    $0x0,%al
call   1130 <show_mute@plt>
jmp    1380 <parse_opt+0x170>
mov    $0x0,%al
call   1110 <mute@plt>
jmp    1380 <parse_opt+0x170>
mov    $0x0,%al
call   1090 <unmute@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1080 <set_volume@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1060 <set_zcd@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1040 <set_fnc@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1050 <set_ycm@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   10e0 <parse_route_arg@plt>
cmp    $0x0,%eax
jge    1324 <parse_opt+0x114>
mov    0x2cc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <parse_opt+0x177>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1120 <set_video@plt>
jmp    1380 <parse_opt+0x170>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   10e0 <parse_route_arg@plt>
cmp    $0x0,%eax
jge    135f <parse_opt+0x14f>
mov    0x2c8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <parse_opt+0x177>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   10d0 <set_audio@plt>
jmp    1380 <parse_opt+0x170>
mov    0x2c6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <parse_opt+0x177>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
push   %rbx
sub    $0x10,%rsp
add    $0xffffff9f,%edi
cmp    $0x19,%edi
ja     12fe <parse_opt+0xee>
lea    0xdd8(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xc(%rsp),%rax
lea    0x8(%rsp),%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
call   10e0 <parse_route_arg@plt>
test   %eax,%eax
js     12fe <parse_opt+0xee>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   10d0 <set_audio@plt>
jmp    1329 <parse_opt+0x119>
mov    %rsi,%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1040 <set_fnc@plt>
jmp    1329 <parse_opt+0x119>
mov    %rsi,%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1080 <set_volume@plt>
jmp    1329 <parse_opt+0x119>
xor    %ebx,%ebx
xor    %eax,%eax
call   1110 <mute@plt>
jmp    132b <parse_opt+0x11b>
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <show_type@plt>
xor    %eax,%eax
call   10b0 <show_zcd@plt>
xor    %eax,%eax
call   10f0 <show_fnc@plt>
xor    %eax,%eax
call   1070 <show_ycm@plt>
xor    %eax,%eax
call   1030 <show_fblk@plt>
xor    %eax,%eax
call   10c0 <show_volume@plt>
xor    %eax,%eax
call   1130 <show_mute@plt>
jmp    132b <parse_opt+0x11b>
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <unmute@plt>
jmp    132b <parse_opt+0x11b>
lea    0xc(%rsp),%rax
lea    0x8(%rsp),%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
call   10e0 <parse_route_arg@plt>
test   %eax,%eax
js     12fe <parse_opt+0xee>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1120 <set_video@plt>
jmp    1329 <parse_opt+0x119>
mov    0x2cdb(%rip),%rax
mov    (%rax),%ebx
jmp    132b <parse_opt+0x11b>
mov    %rsi,%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1050 <set_ycm@plt>
jmp    1329 <parse_opt+0x119>
mov    %rsi,%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1060 <set_zcd@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.argp_state = type { %struct.arguments* }
%struct.arguments = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.argp_state*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.arguments*
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.argp_state* %2, %struct.argp_state** %7
%11 = load %struct.argp_state*, %struct.argp_state** %7
%12 = getelementptr inbounds %struct.argp_state, %struct.argp_state* %11, i32 0, i32 0
%13 = load %struct.arguments*, %struct.arguments** %12
store %struct.arguments* %13, %struct.arguments** %10
%14 = load i32, i32* %5
switch i32 %14, label %63 [
i32 115, label %15
i32 109, label %23
i32 117, label %25
i32 108, label %27
i32 122, label %31
i32 102, label %35
i32 121, label %39
i32 118, label %43
i32 97, label %53
]
15: ; preds = %3
%16 = call i32 (...) @show_type()
%17 = call i32 (...) @show_zcd()
%18 = call i32 (...) @show_fnc()
%19 = call i32 (...) @show_ycm()
%20 = call i32 (...) @show_fblk()
%21 = call i32 (...) @show_volume()
%22 = call i32 (...) @show_mute()
br label %65
23: ; preds = %3
%24 = call i32 (...) @mute()
br label %65
25: ; preds = %3
%26 = call i32 (...) @unmute()
br label %65
27: ; preds = %3
%28 = load i8*, i8** %6
%29 = call i32 @atoi(i8* %28)
%30 = call i32 @set_volume(i32 %29)
br label %65
31: ; preds = %3
%32 = load i8*, i8** %6
%33 = call i32 @atoi(i8* %32)
%34 = call i32 @set_zcd(i32 %33)
br label %65
35: ; preds = %3
%36 = load i8*, i8** %6
%37 = call i32 @atoi(i8* %36)
%38 = call i32 @set_fnc(i32 %37)
br label %65
39: ; preds = %3
%40 = load i8*, i8** %6
%41 = call i32 @atoi(i8* %40)
%42 = call i32 @set_ycm(i32 %41)
br label %65
43: ; preds = %3
%44 = load i8*, i8** %6
%45 = call i32 @parse_route_arg(i8* %44, i32* %8, i32* %9)
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = load i32, i32* @ARGP_ERR_UNKNOWN
store i32 %48, i32* %4
br label %66
49: ; preds = %43
%50 = load i32, i32* %8
%51 = load i32, i32* %9
%52 = call i32 @set_video(i32 %50, i32 %51)
br label %65
53: ; preds = %3
%54 = load i8*, i8** %6
%55 = call i32 @parse_route_arg(i8* %54, i32* %8, i32* %9)
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = load i32, i32* @ARGP_ERR_UNKNOWN
store i32 %58, i32* %4
br label %66
59: ; preds = %53
%60 = load i32, i32* %8
%61 = load i32, i32* %9
%62 = call i32 @set_audio(i32 %60, i32 %61)
br label %65
63: ; preds = %3
%64 = load i32, i32* @ARGP_ERR_UNKNOWN
store i32 %64, i32* %4
br label %66
65: ; preds = %59, %49, %39, %35, %31, %27, %25, %23, %15
store i32 0, i32* %4
br label %66
66: ; preds = %65, %63, %57, %47
%67 = load i32, i32* %4
ret i32 %67
}

LLVM IR (-O2):
%struct.argp_state = type { %struct.arguments* }
%struct.arguments = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* nocapture readnone %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
switch i32 %0, label %50 [
i32 115, label %8
i32 109, label %16
i32 117, label %18
i32 108, label %20
i32 122, label %23
i32 102, label %26
i32 121, label %29
i32 118, label %32
i32 97, label %41
]
8: ; preds = %3
%9 = tail call i32 (...) @show_type()
%10 = tail call i32 (...) @show_zcd()
%11 = tail call i32 (...) @show_fnc()
%12 = tail call i32 (...) @show_ycm()
%13 = tail call i32 (...) @show_fblk()
%14 = tail call i32 (...) @show_volume()
%15 = tail call i32 (...) @show_mute()
br label %52
16: ; preds = %3
%17 = tail call i32 (...) @mute()
br label %52
18: ; preds = %3
%19 = tail call i32 (...) @unmute()
br label %52
20: ; preds = %3
%21 = tail call i32 @atoi(i8* %1)
%22 = tail call i32 @set_volume(i32 %21)
br label %52
23: ; preds = %3
%24 = tail call i32 @atoi(i8* %1)
%25 = tail call i32 @set_zcd(i32 %24)
br label %52
26: ; preds = %3
%27 = tail call i32 @atoi(i8* %1)
%28 = tail call i32 @set_fnc(i32 %27)
br label %52
29: ; preds = %3
%30 = tail call i32 @atoi(i8* %1)
%31 = tail call i32 @set_ycm(i32 %30)
br label %52
32: ; preds = %3
%33 = call i32 @parse_route_arg(i8* %1, i32* %4, i32* %5)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = load i32, i32* @ARGP_ERR_UNKNOWN
br label %52
37: ; preds = %32
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = call i32 @set_video(i32 %38, i32 %39)
br label %52
41: ; preds = %3
%42 = call i32 @parse_route_arg(i8* %1, i32* %4, i32* %5)
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = load i32, i32* @ARGP_ERR_UNKNOWN
br label %52
46: ; preds = %41
%47 = load i32, i32* %4
%48 = load i32, i32* %5
%49 = call i32 @set_audio(i32 %47, i32 %48)
br label %52
50: ; preds = %3
%51 = load i32, i32* @ARGP_ERR_UNKNOWN
br label %52
52: ; preds = %8, %16, %18, %20, %23, %26, %29, %37, %46, %50, %44, %35
%53 = phi i32 [ %51, %50 ], [ %45, %44 ], [ %36, %35 ], [ 0, %46 ], [ 0, %37 ], [ 0, %29 ], [ 0, %26 ], [ 0, %23 ], [ 0, %20 ], [ 0, %18 ], [ 0, %16 ], [ 0, %8 ]
ret i32 %53
}