#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*/ kore_module_load(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ kore_split_string(char *, char *, char **, int);
int configure_load(char *options) {
  char *argv[3];
  kore_split_string(options, " ", argv, 3);
  if (argv[0] == NULL)
    return (0);
  kore_module_load(argv[0], argv[1], 0);
  return (1);
}


x86 assembly (clang, -O0):
<configure_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xec5(%rip),%rsi
mov    $0x3,%ecx
call   1040 <kore_split_string@plt>
cmpq   $0x0,-0x30(%rbp)
jne    115c <configure_load+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1172 <configure_load+0x52>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <kore_module_load@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_load>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rsi
mov    %rsp,%rdx
mov    $0x3,%ecx
call   1040 <kore_split_string@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     1157 <configure_load+0x37>
mov    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <kore_module_load@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @configure_load(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [3 x i8*]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%7 = call i32 @kore_split_string(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %6, i32 3)
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %18
12: ; preds = %1
%13 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%14 = load i8*, i8** %13
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @kore_module_load(i8* %14, i8* %16, i32 0)
store i32 1, i32* %2
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @configure_load(i8* %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%5 = call i32 @kore_split_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4, i32 3)
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @kore_module_load(i8* %6, i8* %10, i32 0)
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ 1, %8 ], [ 0, %1 ]
ret i32 %13
}