#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*/ strcpy(char *, char *);
int /*<<< orphan*/ strstr(char *, char *);
char *strtok(int /*<<< orphan*/, char *);
char *getopt(char *config2, char *token) {
  static char config[100];
  char *pch;
  if (strstr(config2, token) == 0)
    return "0";
  strcpy(config, config2);
  pch = strtok(strstr(config, token), "=");
  pch = strtok(0, " \n");
  return pch;
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%eax
jne    1166 <getopt+0x36>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b2 <getopt+0x82>
mov    -0x10(%rbp),%rsi
lea    0x2edf(%rip),%rdi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0x2ecf(%rip),%rdi
call   1050 <strstr@plt>
mov    %eax,%edi
lea    0xe73(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
lea    0xe63(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strstr@plt>
test   %eax,%eax
je     1182 <getopt+0x52>
lea    0x2f05(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strstr@plt>
lea    0xe9a(%rip),%rsi
mov    %eax,%edi
call   1040 <strtok@plt>
lea    0xe8e(%rip),%rsi
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strtok@plt>
lea    0xe77(%rip),%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@getopt.config = internal global [100 x i8] zeroinitializer
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [3 x i8] c" \0A\00"
define i8* @getopt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strstr(i8* %7, i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %20
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @getopt.config, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @strstr(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @getopt.config, i64 0, i64 0), i8* %15)
%17 = call i8* @strtok(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %17, i8** %6
%18 = call i8* @strtok(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %18, i8** %6
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %12, %11
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@getopt.config = internal global [100 x i8] zeroinitializer
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [3 x i8] c" \0A\00"
define i8* @getopt(i8* %0, i8* %1) {
%3 = tail call i32 @strstr(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @getopt.config, i64 0, i64 0), i8* %0)
%7 = tail call i32 @strstr(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @getopt.config, i64 0, i64 0), i8* %1)
%8 = tail call i8* @strtok(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i8* @strtok(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %2, %5
%11 = phi i8* [ %9, %5 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %11
}