#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*/ pull(char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strtok(char *, char *);
int /*<<< orphan*/ zwm_util_spawn(char *);
void run_once(const char *arg) {
  char data[1024];
  char *cmd;
  char *cls;
  strcpy(data, arg);
  cls = strtok(data, ";");
  cmd = cls + strlen(cls) + 1;
  if (!pull(arg))
    zwm_util_spawn(cmd);
}


x86 assembly (clang, -O0):
<run_once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x420(%rbp)
mov    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
mov    -0x420(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x428(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x418(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pull@plt>
cmp    $0x0,%eax
jne    11db <run_once+0x8b>
mov    -0x418(%rbp),%rdi
call   1050 <zwm_util_spawn@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_once>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strtok@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <strlen@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1040 <pull@plt>
test   %eax,%eax
jne    11a5 <run_once+0x55>
movslq %r14d,%rax
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <zwm_util_spawn@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
define void @run_once(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i8* @strtok(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @pull(i8* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = call i32 @zwm_util_spawn(i8* %12)
br label %14
14: ; preds = %9, %1
ret void
}