#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*/ set_option(char *, char *);
int /*<<< orphan*/ split_apart(char *, char *, char *);
scalar_t__ strlen(char *);
char *strtok_r(char *, char *, char **);
void loadeqn_set_internopt(char *line) {
  char name[20], value[80], *mystring;
  char *toksave;
  strtok_r(line, " ,", &toksave);
  while ((mystring = strtok_r(NULL, " ,\n\r", &toksave)) != NULL) {
    split_apart(mystring, name, value);
    if (strlen(name) > 0 && strlen(value) > 0) {
      set_option(name, value);
    }
  }
}


x86 assembly (clang, -O0):
<loadeqn_set_internopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1050 <strtok_r@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe95(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
je     11ce <loadeqn_set_internopt+0x8e>
mov    -0x78(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1040 <split_apart@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    11c9 <loadeqn_set_internopt+0x89>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    11c9 <loadeqn_set_internopt+0x89>
lea    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <set_option@plt>
jmp    1163 <loadeqn_set_internopt+0x23>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadeqn_set_internopt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xeab(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1050 <strtok_r@plt>
lea    0xe9a(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
call   1050 <strtok_r@plt>
test   %rax,%rax
je     11d7 <loadeqn_set_internopt+0x97>
lea    0x10(%rsp),%rbx
lea    0x30(%rsp),%r14
lea    0xe7a(%rip),%r15
lea    0x8(%rsp),%r12
jmp    11a2 <loadeqn_set_internopt+0x62>
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <strtok_r@plt>
test   %rax,%rax
je     11d7 <loadeqn_set_internopt+0x97>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <split_apart@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1190 <loadeqn_set_internopt+0x50>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1190 <loadeqn_set_internopt+0x50>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <set_option@plt>
jmp    1190 <loadeqn_set_internopt+0x50>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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