#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*/ remove_leading_whitespace(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strpbrk(char *, char *);
scalar_t__ strstr(char *, char *);
void find_match_char(char *buffer, char *match, char *result) {
  char *position;
  remove_leading_whitespace(buffer);
  if (strstr(buffer, match) == strstr(buffer, buffer)) {
    position = strpbrk(buffer, ":=");
    if (position != NULL) {
      position += 1;
      strcpy(result, position);
      position = strstr(result, "\n");
      *(position) = '\0';
      remove_leading_whitespace(result);
    } else
      strcpy(result, "\0");
  }
}


x86 assembly (clang, -O0):
<find_match_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <remove_leading_whitespace@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jne    1201 <find_match_char+0xc1>
mov    -0x8(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11ec <find_match_char+0xac>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1060 <remove_leading_whitespace@plt>
jmp    11fc <find_match_char+0xbc>
mov    -0x18(%rbp),%rdi
lea    0xe0e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1201 <find_match_char+0xc1>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_match_char>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1060 <remove_leading_whitespace@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strstr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1050 <strstr@plt>
cmp    %rax,%r15
jne    11b3 <find_match_char+0x73>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strpbrk@plt>
test   %rax,%rax
je     11b9 <find_match_char+0x79>
add    $0x1,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe68(%rip),%rsi
mov    %r14,%rdi
call   1050 <strstr@plt>
movb   $0x0,(%rax)
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <remove_leading_whitespace@plt>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe45(%rip),%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [3 x i8] c":=\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] zeroinitializer
define void @find_match_char(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @remove_leading_whitespace(i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i64 @strstr(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @strstr(i8* %13, i8* %14)
%16 = icmp eq i64 %12, %15
br i1 %16, label %17, label %38
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = call i8* @strpbrk(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %34
22: ; preds = %17
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %24, i8** %7
%25 = load i8*, i8** %6
%26 = load i8*, i8** %7
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = load i8*, i8** %6
%29 = call i64 @strstr(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %7
%31 = load i8*, i8** %7
store i8 0, i8* %31
%32 = load i8*, i8** %6
%33 = call i32 @remove_leading_whitespace(i8* %32)
br label %37
34: ; preds = %17
%35 = load i8*, i8** %6
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %34, %22
br label %38
38: ; preds = %37, %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c":=\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] zeroinitializer
define void @find_match_char(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @remove_leading_whitespace(i8* %0)
%5 = tail call i64 @strstr(i8* %0, i8* %1)
%6 = tail call i64 @strstr(i8* %0, i8* %0)
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %3
%9 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = tail call i32 @strcpy(i8* %2, i8* %12)
%14 = tail call i64 @strstr(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = inttoptr i64 %14 to i8*
store i8 0, i8* %15
%16 = tail call i32 @remove_leading_whitespace(i8* %2)
br label %19
17: ; preds = %8
%18 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %11, %17, %3
ret void
}