#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 */
const char *extract_string(char **string) {
  char *str;
  if (**string != '"')
    return NULL;
  else
    (*string)++;
  str = *string;
  for (; *str; str++) {
    switch (*str) {
    case '"':
      return str;
      break;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<extract_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1128 <extract_string+0x28>
movq   $0x0,-0x8(%rbp)
jmp    118c <extract_string+0x8c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1184 <extract_string+0x84>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
sub    $0x22,%al
jne    116e <extract_string+0x6e>
jmp    1161 <extract_string+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <extract_string+0x8c>
jmp    1173 <extract_string+0x73>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <extract_string+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_string>:
mov    (%rdi),%rax
cmpb   $0x22,(%rax)
jne    1122 <extract_string+0x22>
add    $0x1,%rax
mov    %rax,(%rdi)
nop
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <extract_string+0x22>
cmp    $0x22,%cl
je     1124 <extract_string+0x24>
add    $0x1,%rax
jmp    1110 <extract_string+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @extract_string(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 34
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %33
11: ; preds = %1
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %15
15: ; preds = %11
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
store i8* %17, i8** %4
br label %18
18: ; preds = %29, %15
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %18
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
switch i32 %25, label %28 [
i32 34, label %26
]
26: ; preds = %22
%27 = load i8*, i8** %4
store i8* %27, i8** %2
br label %33
28: ; preds = %22
br label %29
29: ; preds = %28
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %18
32: ; preds = %18
store i8* null, i8** %2
br label %33
33: ; preds = %32, %26, %10
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
define i8* @extract_string(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 34
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %6, i8** %0
br label %7
7: ; preds = %10, %5
%8 = phi i8* [ %6, %5 ], [ %11, %10 ]
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 0, label %13
i8 34, label %12
]
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
br label %7
12: ; preds = %7
br label %13
13: ; preds = %7, %12, %1
%14 = phi i8* [ null, %1 ], [ %8, %12 ], [ null, %7 ]
ret i8* %14
}