#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*/ do_intern_set(char *, char *);
int /*<<< orphan*/ split_apart(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strtok_r(char *, char *, char **);
void extract_action(char *ptr) {
  char name[256], value[256];
  char tmp[512];
  char *junk, *mystring, *toksave;
  strcpy(tmp, ptr);
  junk = strtok_r(tmp, " ", &toksave);
  if (junk == NULL) {
  }
  while ((mystring = strtok_r(NULL, " ,;\n", &toksave)) != NULL) {
    split_apart(mystring, name, value);
    if (strlen(name) > 0 && strlen(value) > 0)
      do_intern_set(name, value);
  }
}


x86 assembly (clang, -O0):
<extract_action>:
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
lea    -0x428(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x418(%rbp)
jne    11a3 <extract_action+0x53>
jmp    11a3 <extract_action+0x53>
jmp    11a8 <extract_action+0x58>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe4f(%rip),%rsi
lea    -0x428(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x420(%rbp)
cmp    $0x0,%rax
je     122e <extract_action+0xde>
mov    -0x420(%rbp),%rdi
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
call   1060 <split_apart@plt>
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1229 <extract_action+0xd9>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1229 <extract_action+0xd9>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <do_intern_set@plt>
jmp    11a8 <extract_action+0x58>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_action>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rdi,%rsi
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe88(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1070 <strtok_r@plt>
lea    0xe73(%rip),%rsi
xor    %edi,%edi
mov    %r14,%rdx
call   1070 <strtok_r@plt>
test   %rax,%rax
je     1207 <extract_action+0xb7>
lea    0x110(%rsp),%rbx
lea    0x10(%rsp),%r14
lea    0xe50(%rip),%r15
lea    0x8(%rsp),%r12
jmp    11d2 <extract_action+0x82>
nopl   0x0(%rax)
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1070 <strtok_r@plt>
test   %rax,%rax
je     1207 <extract_action+0xb7>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <split_apart@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    11c0 <extract_action+0x70>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    11c0 <extract_action+0x70>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <do_intern_set@plt>
jmp    11c0 <extract_action+0x70>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c" ,;\0A\00"
define void @extract_action(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [512 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %2
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%13 = call i8* @strtok_r(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %1
br label %18
18: ; preds = %37, %17
%19 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %8)
store i8* %19, i8** %7
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %38
21: ; preds = %18
%22 = load i8*, i8** %7
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%25 = call i32 @split_apart(i8* %22, i8* %23, i8* %24)
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%27 = call i64 @strlen(i8* %26)
%28 = icmp sgt i64 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %21
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%31 = call i64 @strlen(i8* %30)
%32 = icmp sgt i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%36 = call i32 @do_intern_set(i8* %34, i8* %35)
br label %37
37: ; preds = %33, %29, %21
br label %18
38: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c" ,;\0A\00"
define void @extract_action(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [512 x i8]
%5 = alloca i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%9 = bitcast i8** %5 to i8*
%10 = call i32 @strcpy(i8* %8, i8* %0)
%11 = call i8* @strtok_r(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5)
%12 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %5)
%13 = icmp eq i8* %12, null
br i1 %13, label %27, label %14
14: ; preds = %1, %24
%15 = phi i8* [ %25, %24 ], [ %12, %1 ]
%16 = call i32 @split_apart(i8* %15, i8* %6, i8* %7)
%17 = call i64 @strlen(i8* %6)
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = call i64 @strlen(i8* %7)
%21 = icmp sgt i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @do_intern_set(i8* %6, i8* %7)
br label %24
24: ; preds = %22, %19, %14
%25 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %5)
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %14
27: ; preds = %24, %1
ret void
}