#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 *);
char *get_first(char *, char *);
char *get_next(char *);
int /*<<< orphan*/ split_apart(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void extract_action(char *ptr) {
  char name[256], value[256];
  char tmp[2048];
  char *junk, *mystring;
  strcpy(tmp, ptr);
  junk = get_first(tmp, " ");
  if (junk == NULL) {
  }
  while ((mystring = get_next(" ,;\n")) != 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    $0xa20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xa10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1070 <get_first@plt>
mov    %rax,-0xa18(%rbp)
cmpq   $0x0,-0xa18(%rbp)
jne    11ac <extract_action+0x4c>
jmp    11ac <extract_action+0x4c>
jmp    11b1 <extract_action+0x51>
lea    0xe4a(%rip),%rdi
call   1080 <get_next@plt>
mov    %rax,-0xa20(%rbp)
cmp    $0x0,%rax
je     122c <extract_action+0xcc>
mov    -0xa20(%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    1227 <extract_action+0xc7>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1227 <extract_action+0xc7>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <do_intern_set@plt>
jmp    11b1 <extract_action+0x51>
add    $0xa20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_action>:
push   %r15
push   %r14
push   %rbx
sub    $0xa00,%rsp
mov    %rdi,%rsi
lea    0x200(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1070 <get_first@plt>
lea    0xe6d(%rip),%rdi
call   1080 <get_next@plt>
test   %rax,%rax
je     1202 <extract_action+0xa2>
lea    0x100(%rsp),%rbx
mov    %rsp,%r14
lea    0xe51(%rip),%r15
jmp    11cd <extract_action+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
call   1080 <get_next@plt>
test   %rax,%rax
je     1202 <extract_action+0xa2>
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+0x60>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    11c0 <extract_action+0x60>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <do_intern_set@plt>
jmp    11c0 <extract_action+0x60>
add    $0xa00,%rsp
pop    %rbx
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 [2048 x i8]
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %2
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%12 = call i8* @get_first(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %1
br label %17
17: ; preds = %36, %16
%18 = call i8* @get_next(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %18, i8** %7
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i8*, i8** %7
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%24 = call i32 @split_apart(i8* %21, i8* %22, i8* %23)
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%26 = call i64 @strlen(i8* %25)
%27 = icmp sgt i64 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %20
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%30 = call i64 @strlen(i8* %29)
%31 = icmp sgt i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%35 = call i32 @do_intern_set(i8* %33, i8* %34)
br label %36
36: ; preds = %32, %28, %20
br label %17
37: ; preds = %17
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 [2048 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* %0)
%9 = call i8* @get_first(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i8* @get_next(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %25, label %12
12: ; preds = %1, %22
%13 = phi i8* [ %23, %22 ], [ %10, %1 ]
%14 = call i32 @split_apart(i8* %13, i8* %5, i8* %6)
%15 = call i64 @strlen(i8* %5)
%16 = icmp sgt i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = call i64 @strlen(i8* %6)
%19 = icmp sgt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @do_intern_set(i8* %5, i8* %6)
br label %22
22: ; preds = %20, %17, %12
%23 = call i8* @get_next(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %12
25: ; preds = %22, %1
ret void
}