#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*/ die(char *);
char *strdup(char *);
char *strstr(char *, char *);
void parse_option_name(char **option, char **plugin) {
  char *p;
  *plugin = NULL;
  if ((p = strstr(*option, ":"))) {
    *plugin = *option;
    *p = '\0';
    *option = strdup(p + 1);
    if (!*option)
      die("malloc");
  }
}


x86 assembly (clang, -O0):
<parse_option_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xea7(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11b7 <parse_option_name+0x87>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11b2 <parse_option_name+0x82>
lea    0xe55(%rip),%rdi
call   1030 <die@plt>
jmp    11b7 <parse_option_name+0x87>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_option_name>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
movq   $0x0,(%rsi)
mov    (%rdi),%rbx
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1171 <parse_option_name+0x41>
mov    %rbx,(%r15)
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     1177 <parse_option_name+0x47>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe82(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <die@plt>

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

LLVM IR (-O2):
@.str.1 = [7 x i8] c"malloc\00"
define void @parse_option_name(i8** nocapture %0, i8** nocapture writeonly %1) {
store i8* null, i8** %1
%3 = load i8*, i8** %0
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i32 58)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %2
store i8* %3, i8** %1
store i8 0, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call i8* @strdup(i8* %7)
store i8* %8, i8** %0
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %6, %10, %2
ret void
}