#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*/ appendGraphicsPath(char *);
char *getBraceParam();
int /*<<< orphan*/ safe_free(char *);
char *strtok(char *, char *);
void CmdGraphicsPath(int code) {
  char *directories = getBraceParam();
  if (directories != NULL) {
    char *candidate = strtok(directories, "{}");
    while (NULL != candidate) {
      appendGraphicsPath(candidate);
      candidate = strtok(NULL, "{}");
    }
  }
  safe_free(directories);
}


x86 assembly (clang, -O0):
<CmdGraphicsPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a8 <CmdGraphicsPath+0x68>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     11a3 <CmdGraphicsPath+0x63>
mov    -0x18(%rbp),%rdi
call   1060 <appendGraphicsPath@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe6b(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
jmp    1175 <CmdGraphicsPath+0x35>
jmp    11a8 <CmdGraphicsPath+0x68>
mov    -0x10(%rbp),%rdi
call   1040 <safe_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdGraphicsPath>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getBraceParam@plt>
mov    %rax,%r14
test   %rax,%rax
je     1187 <CmdGraphicsPath+0x47>
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
call   1050 <strtok@plt>
test   %rax,%rax
je     1187 <CmdGraphicsPath+0x47>
lea    0xe92(%rip),%rbx
xchg   %ax,%ax
mov    %rax,%rdi
call   1060 <appendGraphicsPath@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
jne    1170 <CmdGraphicsPath+0x30>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <safe_free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{}\00"
define void @CmdGraphicsPath(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = call i8* (...) @getBraceParam()
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strtok(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %4
br label %11
11: ; preds = %14, %8
%12 = load i8*, i8** %4
%13 = icmp ne i8* null, %12
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i8*, i8** %4
%16 = call i32 @appendGraphicsPath(i8* %15)
%17 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %4
br label %11
18: ; preds = %11
br label %19
19: ; preds = %18, %1
%20 = load i8*, i8** %3
%21 = call i32 @safe_free(i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{}\00"
define void @CmdGraphicsPath(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i8* @strtok(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %10, %7 ], [ %5, %4 ]
%9 = tail call i32 @appendGraphicsPath(i8* %8)
%10 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %1
%13 = tail call i32 @safe_free(i8* %2)
ret void
}