#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*/ line2string(char **);
scalar_t__ strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strstr(char *, char *);
void parsestring(char *line, char *label, char *string) {
  if (strstr(line, label)) {
    if (strstr(line, label) < strchr(line, '\"')) {
      line2string(&line);
      strcpy(string, line);
    }
  }
}


x86 assembly (clang, -O0):
<parsestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11b5 <parsestring+0x75>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    11b0 <parsestring+0x70>
lea    -0x8(%rbp),%rdi
call   1050 <line2string@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11b5 <parsestring+0x75>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsestring>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
call   1060 <strstr@plt>
test   %rax,%rax
je     1198 <parsestring+0x58>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strstr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
cmp    %rax,%r15
jge    1198 <parsestring+0x58>
lea    0x8(%rsp),%rdi
call   1050 <line2string@plt>
mov    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @parsestring(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strstr(i8* %7, i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i64 @strstr(i8* %12, i8* %13)
%15 = load i8*, i8** %4
%16 = call i64 @strchr(i8* %15, i8 signext 34)
%17 = icmp slt i64 %14, %16
br i1 %17, label %18, label %23
18: ; preds = %11
%19 = call i32 @line2string(i8** %4)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %4
%22 = call i32 @strcpy(i8* %20, i8* %21)
br label %23
23: ; preds = %18, %11
br label %24
24: ; preds = %23, %3
ret void
}

LLVM IR (-O2):
define void @parsestring(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = tail call i64 @strstr(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = tail call i64 @strstr(i8* %0, i8* %1)
%9 = tail call i64 @strchr(i8* %0, i8 signext 34)
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = call i32 @line2string(i8** %4)
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* %2, i8* %13)
br label %15
15: ; preds = %7, %11, %3
ret void
}