#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*/ config_handle_option(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ main_pause(int);
int /*<<< orphan*/ main_reset();
scalar_t__ strcmp(char *, char *);
char *strsep(char **, char *);
void parse_command(char *in) {
  char *cmd;
  char *val;
  cmd = strsep(&in, "=");
  val = in;
  if (strcmp(cmd, "pause") == 0) {
    main_pause(1);
  } else if (strcmp(cmd, "resume") == 0) {
    main_pause(0);
  } else if (strcmp(cmd, "reset") == 0) {
    main_reset();
  } else {
    config_handle_option(0, cmd, val);
  }
}


x86 assembly (clang, -O0):
<parse_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1070 <strsep@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11a1 <parse_command+0x51>
mov    $0x1,%edi
call   1050 <main_pause@plt>
jmp    1206 <parse_command+0xb6>
mov    -0x10(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11c7 <parse_command+0x77>
xor    %edi,%edi
call   1050 <main_pause@plt>
jmp    1201 <parse_command+0xb1>
mov    -0x10(%rbp),%rdi
lea    0xe3d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ed <parse_command+0x9d>
mov    $0x0,%al
call   1040 <main_reset@plt>
jmp    11fc <parse_command+0xac>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <config_handle_option@plt>
jmp    1201 <parse_command+0xb1>
jmp    1206 <parse_command+0xb6>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_command>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
lea    0xea1(%rip),%rsi
mov    %rsp,%rdi
call   1070 <strsep@plt>
mov    %rax,%rbx
mov    (%rsp),%r14
lea    0xe8d(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11b9 <parse_command+0x69>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c5 <parse_command+0x75>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11ce <parse_command+0x7e>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <config_handle_option@plt>
jmp    11d5 <parse_command+0x85>
mov    $0x1,%edi
call   1050 <main_pause@plt>
jmp    11d5 <parse_command+0x85>
xor    %edi,%edi
call   1050 <main_pause@plt>
jmp    11d5 <parse_command+0x85>
xor    %eax,%eax
call   1040 <main_reset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [7 x i8] c"resume\00"
@.str.3 = [6 x i8] c"reset\00"
define void @parse_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %2
store i8* %6, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @main_pause(i32 1)
br label %30
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @main_pause(i32 0)
br label %29
18: ; preds = %12
%19 = load i8*, i8** %3
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (...) @main_reset()
br label %28
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = load i8*, i8** %4
%27 = call i32 @config_handle_option(i32 0, i8* %25, i8* %26)
br label %28
28: ; preds = %24, %22
br label %29
29: ; preds = %28, %16
br label %30
30: ; preds = %29, %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [7 x i8] c"resume\00"
@.str.3 = [6 x i8] c"reset\00"
define void @parse_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @main_pause(i32 1)
br label %21
9: ; preds = %1
%10 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @main_pause(i32 0)
br label %21
14: ; preds = %9
%15 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @main_reset()
br label %21
19: ; preds = %14
%20 = call i32 @config_handle_option(i32 0, i8* %3, i8* %4)
br label %21
21: ; preds = %12, %19, %17, %7
ret void
}