#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 *);
extract_action(char *ptr) {
  char name[256], value[256];
  char tmp[512];
  char *junk, *mystring;
  strcpy(tmp, ptr);
  junk = get_first(tmp, " ");
  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    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1070 <get_first@plt>
mov    %rax,-0x418(%rbp)
lea    0xe62(%rip),%rdi
call   1080 <get_next@plt>
mov    %rax,-0x420(%rbp)
cmp    $0x0,%rax
je     1214 <extract_action+0xb4>
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    120f <extract_action+0xaf>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    120f <extract_action+0xaf>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <do_intern_set@plt>
jmp    1199 <extract_action+0x39>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_action>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%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    $0x400,%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 i32 @extract_action(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [512 x i8]
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%13 = call i8* @get_first(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %13, i8** %7
br label %14
14: ; preds = %33, %1
%15 = call i8* @get_next(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %15, i8** %8
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = load i8*, i8** %8
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%21 = call i32 @split_apart(i8* %18, i8* %19, i8* %20)
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%23 = call i64 @strlen(i8* %22)
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %17
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%27 = call i64 @strlen(i8* %26)
%28 = icmp sgt i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%32 = call i32 @do_intern_set(i8* %30, i8* %31)
br label %33
33: ; preds = %29, %25, %17
br label %14
34: ; preds = %14
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c" ,;\0A\00"
define i32 @extract_action(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [512 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 [512 x i8], [512 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 i32 undef
}