#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*/ AddAction(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ Print(int /*<<< orphan*/, char *, char *const);
int /*<<< orphan*/ Split(char *const, char **, char **);
int /*<<< orphan*/ atol(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void ParseActionLine(char *const command) {
  char *axes;
  char *buttons;
  char *temp;
  char *cmd;
  Split(command, &axes, &temp);
  Split(temp, &buttons, &cmd);
  free(temp);
  if (cmd == NULL) {
    Print(stderr, "exit: wrong format in action line: ", command);
    exit(1);
  }
  AddAction(atol(axes), atol(buttons), cmd);
  free(axes);
  free(buttons);
  free(cmd);
}


x86 assembly (clang, -O0):
<ParseActionLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1060 <Split@plt>
mov    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <Split@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x28(%rbp)
jne    11c5 <ParseActionLine+0x65>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe4a(%rip),%rsi
call   1070 <Print@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <atol@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atol@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
call   1040 <AddAction@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseActionLine>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%r14
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <Split@plt>
mov    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <Split@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rbx
test   %rbx,%rbx
je     11e7 <ParseActionLine+0x87>
mov    0x18(%rsp),%rdi
call   1050 <atol@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%rdi
call   1050 <atol@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <AddAction@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    %r14,%rdx
call   1070 <Print@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"exit: wrong format in action line: \00"
define void @ParseActionLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @Split(i8* %7, i8** %3, i8** %5)
%9 = load i8*, i8** %5
%10 = call i32 @Split(i8* %9, i8** %4, i8** %6)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
%13 = load i8*, i8** %6
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %2
%18 = call i32 @Print(i32 %16, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %1
%21 = load i8*, i8** %3
%22 = call i32 @atol(i8* %21)
%23 = load i8*, i8** %4
%24 = call i32 @atol(i8* %23)
%25 = load i8*, i8** %6
%26 = call i32 @AddAction(i32 %22, i32 %24, i8* %25)
%27 = load i8*, i8** %3
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %4
%30 = call i32 @free(i8* %29)
%31 = load i8*, i8** %6
%32 = call i32 @free(i8* %31)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"exit: wrong format in action line: \00"
define void @ParseActionLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast i8** %2 to i8*
%7 = bitcast i8** %3 to i8*
%8 = bitcast i8** %4 to i8*
%9 = bitcast i8** %5 to i8*
%10 = call i32 @Split(i8* %0, i8** %2, i8** %4)
%11 = load i8*, i8** %4
%12 = call i32 @Split(i8* %11, i8** %3, i8** %5)
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %1
%18 = load i32, i32* @stderr
%19 = call i32 @Print(i32 %18, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %1
%22 = load i8*, i8** %2
%23 = call i32 @atol(i8* %22)
%24 = load i8*, i8** %3
%25 = call i32 @atol(i8* %24)
%26 = call i32 @AddAction(i32 %23, i32 %25, i8* %15)
%27 = load i8*, i8** %2
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %3
%30 = call i32 @free(i8* %29)
%31 = load i8*, i8** %5
%32 = call i32 @free(i8* %31)
ret void
}