#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 */
typedef int /*<<< orphan*/ quote;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _memset(char *, int /*<<< orphan*/, int);
char *clean_quote(char *);
int count_words(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
char *str_unite(char *, char *);
int strlen(char *);
scalar_t__ strstr(char *, char *);
void extract_quotes(char *filename) {
  FILE *fp, *fp_out;
  char *ptr;
  char buf[712], *buf_ptr, *buf_end;
  char quote[712], *quote_ptr;
  int quote_begin, quote_end, quote_index, quote_word_count;
  int i, buf_index, buf_len;
  if (!filename)
    return;
  if (strstr(filename, ".eq")) {
    printf("extract_quotes: Already extracted %s\n", filename);
    return;
  }
  printf("extract_quotes: Extracting quotes from %s\n", filename);
  fp = fopen(filename, "r");
  if (!fp) {
    perror("fopen");
    return;
  }
  ptr = str_unite("%s.eq", filename);
  fp_out = fopen(ptr, "w");
  if (!fp_out) {
    perror("fopen(2) ");
    goto cleanup;
  }
  quote_begin = quote_end = quote_index = 0;
  while (1) {
  begin:
    if (fgets(buf, sizeof(buf) - 1, fp) == NULL)
      break;
    buf_ptr = buf;
    buf_len = strlen(buf_ptr);
    buf_end = buf_ptr + buf_len;
    if (buf_ptr > buf_end) {
      continue;
    }
    while (*buf_ptr && buf_ptr < buf_end) {
      if (quote_begin == 1) {
        if (*buf_ptr == '\n') {
          quote[quote_index] = ' ';
          quote_index++;
          buf_ptr++;
          break;
        }
        if (*buf_ptr != '\n') {
          quote[quote_index] = *buf_ptr;
          quote_index++;
        }
        if (*buf_ptr == '\"' && !isalnum(*(buf_ptr + 1))) {
          quote_ptr = clean_quote(quote);
          quote_word_count = count_words(quote);
          if (quote_word_count)
            fprintf(fp_out, "%i %s %s\n", quote_word_count, filename,
                    quote_ptr);
          _memset(quote, 0, sizeof(quote));
          quote_begin = 0;
          quote_index = 0;
          buf_ptr++;
          continue;
        }
        if (quote_index > sizeof(quote)) {
          _memset(quote, 0, sizeof(quote));
          quote_begin = 0;
          buf_ptr++;
          continue;
        }
      } else if (quote_begin == 0) {
        if (*buf_ptr == '\"' && !isalnum(*(buf_ptr - 1))) {
          puts("FOUND QUOTE");
          quote_begin = 1;
          _memset(quote, 0, sizeof(quote));
          quote_index = 0;
          quote[quote_index] = *buf_ptr;
          quote_index++;
        }
      }
      buf_ptr++;
    }
  }
cleanup:
  if (fp)
    fclose(fp);
  if (fp_out)
    fclose(fp_out);
  if (ptr)
    free(ptr);
  return;
}


x86 assembly (clang, -O0):
<extract_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    120f <extract_quotes+0x1f>
jmp    1639 <extract_quotes+0x449>
mov    -0x8(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
je     123e <extract_quotes+0x4e>
mov    -0x8(%rbp),%rsi
lea    0xdcc(%rip),%rdi
call   1080 <printf@plt>
jmp    1639 <extract_quotes+0x449>
mov    -0x8(%rbp),%rsi
lea    0xddd(%rip),%rdi
call   1080 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    127e <extract_quotes+0x8e>
lea    0xddf(%rip),%rdi
call   10e0 <perror@plt>
jmp    1639 <extract_quotes+0x449>
mov    -0x8(%rbp),%rsi
lea    0xdd0(%rip),%rdi
call   10c0 <str_unite@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12c2 <extract_quotes+0xd2>
lea    0xda9(%rip),%rdi
call   10e0 <perror@plt>
jmp    15f8 <extract_quotes+0x408>
movl   $0x0,-0x5e4(%rbp)
movl   $0x0,-0x5e0(%rbp)
movl   $0x0,-0x5dc(%rbp)
jmp    12e5 <extract_quotes+0xf5>
lea    -0x2f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2c7,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
jne    1309 <extract_quotes+0x119>
jmp    15f3 <extract_quotes+0x403>
lea    -0x2f0(%rbp),%rax
mov    %rax,-0x2f8(%rbp)
mov    -0x2f8(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x5f4(%rbp)
mov    -0x2f8(%rbp),%rax
movslq -0x5f4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x300(%rbp)
mov    -0x2f8(%rbp),%rax
cmp    -0x300(%rbp),%rax
jbe    135a <extract_quotes+0x16a>
jmp    12e0 <extract_quotes+0xf0>
jmp    135f <extract_quotes+0x16f>
mov    -0x2f8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5f5(%rbp)
je     1391 <extract_quotes+0x1a1>
mov    -0x2f8(%rbp),%rax
cmp    -0x300(%rbp),%rax
setb   %al
mov    %al,-0x5f5(%rbp)
mov    -0x5f5(%rbp),%al
test   $0x1,%al
jne    13a4 <extract_quotes+0x1b4>
jmp    15ee <extract_quotes+0x3fe>
cmpl   $0x1,-0x5dc(%rbp)
jne    153b <extract_quotes+0x34b>
mov    -0x2f8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    13f9 <extract_quotes+0x209>
movslq -0x5e4(%rbp),%rax
movb   $0x20,-0x5d0(%rbp,%rax,1)
20
mov    -0x5e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5e4(%rbp)
mov    -0x2f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2f8(%rbp)
jmp    15ee <extract_quotes+0x3fe>
mov    -0x2f8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1432 <extract_quotes+0x242>
mov    -0x2f8(%rbp),%rax
mov    (%rax),%cl
movslq -0x5e4(%rbp),%rax
mov    %cl,-0x5d0(%rbp,%rax,1)
mov    -0x5e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5e4(%rbp)
mov    -0x2f8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    14ef <extract_quotes+0x2ff>
mov    -0x2f8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1090 <isalnum@plt>
cmp    $0x0,%eax
jne    14ef <extract_quotes+0x2ff>
lea    -0x5d0(%rbp),%rdi
call   1100 <clean_quote@plt>
mov    %rax,-0x5d8(%rbp)
lea    -0x5d0(%rbp),%rdi
call   1030 <count_words@plt>
mov    %eax,-0x5e8(%rbp)
cmpl   $0x0,-0x5e8(%rbp)
je     14b1 <extract_quotes+0x2c1>
mov    -0x18(%rbp),%rdi
mov    -0x5e8(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    -0x5d8(%rbp),%r8
lea    0xbbf(%rip),%rsi
call   10b0 <fprintf@plt>
lea    -0x5d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
movl   $0x0,-0x5dc(%rbp)
movl   $0x0,-0x5e4(%rbp)
mov    -0x2f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2f8(%rbp)
jmp    135f <extract_quotes+0x16f>
movslq -0x5e4(%rbp),%rax
cmp    $0x2c8,%rax
jbe    1536 <extract_quotes+0x346>
lea    -0x5d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
movl   $0x0,-0x5dc(%rbp)
mov    -0x2f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2f8(%rbp)
jmp    135f <extract_quotes+0x16f>
jmp    15d7 <extract_quotes+0x3e7>
cmpl   $0x0,-0x5dc(%rbp)
jne    15d2 <extract_quotes+0x3e2>
mov    -0x2f8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    15cd <extract_quotes+0x3dd>
mov    -0x2f8(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1090 <isalnum@plt>
cmp    $0x0,%eax
jne    15cd <extract_quotes+0x3dd>
lea    0xafa(%rip),%rdi
call   1050 <puts@plt>
movl   $0x1,-0x5dc(%rbp)
lea    -0x5d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
movl   $0x0,-0x5e4(%rbp)
mov    -0x2f8(%rbp),%rax
mov    (%rax),%cl
movslq -0x5e4(%rbp),%rax
mov    %cl,-0x5d0(%rbp,%rax,1)
mov    -0x5e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5e4(%rbp)
jmp    15d2 <extract_quotes+0x3e2>
jmp    15d7 <extract_quotes+0x3e7>
mov    -0x2f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2f8(%rbp)
jmp    135f <extract_quotes+0x16f>
jmp    12e0 <extract_quotes+0xf0>
jmp    15f8 <extract_quotes+0x408>
cmpq   $0x0,-0x10(%rbp)
je     160c <extract_quotes+0x41c>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
cmpq   $0x0,-0x18(%rbp)
je     1620 <extract_quotes+0x430>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     1634 <extract_quotes+0x444>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
jmp    1639 <extract_quotes+0x449>
add    $0x600,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_quotes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5b8,%rsp
test   %rdi,%rdi
je     146c <extract_quotes+0x27c>
mov    %rdi,%r15
lea    0xe47(%rip),%rsi
call   1110 <strstr@plt>
test   %rax,%rax
je     123e <extract_quotes+0x4e>
lea    0xddb(%rip),%rdi
mov    %r15,%rsi
add    $0x5b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <printf@plt>
lea    0xde1(%rip),%rdi
mov    %r15,%rsi
call   1080 <printf@plt>
lea    0xdfd(%rip),%rsi
mov    %r15,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     147e <extract_quotes+0x28e>
mov    %rax,%r13
lea    0xdea(%rip),%rdi
mov    %r15,%rsi
call   10c0 <str_unite@plt>
mov    %rax,%rbp
lea    0xdde(%rip),%rsi
mov    %rax,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     149b <extract_quotes+0x2ab>
mov    %rax,0x10(%rsp)
movl   $0x0,(%rsp)
lea    0x2f0(%rsp),%rbx
xor    %r12d,%r12d
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x2c7,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     144d <extract_quotes+0x25d>
mov    %rbx,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
js     12b0 <extract_quotes+0xc0>
mov    0x2f0(%rsp),%cl
test   %cl,%cl
je     12b0 <extract_quotes+0xc0>
test   %eax,%eax
je     12b0 <extract_quotes+0xc0>
mov    %eax,%eax
add    %rsp,%rax
add    $0x2f0,%rax
mov    %rax,0x18(%rsp)
mov    %rbx,%r14
mov    %rbp,0x8(%rsp)
cmp    $0x1,%r12d
jne    1362 <extract_quotes+0x172>
mov    (%rsp),%ebp
movslq %ebp,%rax
cmp    $0xa,%cl
je     1432 <extract_quotes+0x242>
mov    %cl,0x20(%rsp,%rax,1)
cmp    $0x22,%cl
jne    132c <extract_quotes+0x13c>
movsbl 0x1(%r14),%edi
call   1090 <isalnum@plt>
test   %eax,%eax
je     13bb <extract_quotes+0x1cb>
add    $0x1,%ebp
mov    $0x1,%r12d
mov    %ebp,(%rsp)
cmp    $0x2c9,%ebp
jb     13b0 <extract_quotes+0x1c0>
xor    %r12d,%r12d
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
add    $0x1,%r14
mov    0x8(%rsp),%rbp
jmp    1416 <extract_quotes+0x226>
xor    %r12d,%r12d
cmp    $0x22,%cl
jne    13aa <extract_quotes+0x1ba>
movsbl -0x1(%r14),%edi
call   1090 <isalnum@plt>
test   %eax,%eax
jne    13aa <extract_quotes+0x1ba>
lea    0xcf6(%rip),%rdi
call   1050 <puts@plt>
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
movzbl (%r14),%eax
mov    %al,0x20(%rsp)
movl   $0x1,(%rsp)
mov    $0x1,%r12d
add    $0x1,%r14
jmp    1416 <extract_quotes+0x226>
mov    0x8(%rsp),%rbp
add    $0x1,%r14
jmp    1416 <extract_quotes+0x226>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
call   1100 <clean_quote@plt>
mov    %rax,(%rsp)
mov    %r12,%rdi
call   1030 <count_words@plt>
test   %eax,%eax
mov    0x8(%rsp),%rbp
je     13f7 <extract_quotes+0x207>
mov    0x10(%rsp),%rdi
lea    0xc82(%rip),%rsi
mov    %eax,%edx
mov    %r15,%rcx
mov    (%rsp),%r8
call   10b0 <fprintf@plt>
add    $0x1,%r14
movl   $0x0,(%rsp)
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x2c8,%edx
call   10f0 <_memset@plt>
xor    %r12d,%r12d
movzbl (%r14),%ecx
test   %cl,%cl
je     12b0 <extract_quotes+0xc0>
cmp    0x18(%rsp),%r14
jb     12fc <extract_quotes+0x10c>
jmp    12b0 <extract_quotes+0xc0>
movb   $0x20,0x20(%rsp,%rax,1)
add    $0x1,%ebp
mov    %ebp,(%rsp)
mov    $0x1,%r12d
mov    0x8(%rsp),%rbp
jmp    12b0 <extract_quotes+0xc0>
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1060 <fclose@plt>
test   %rbp,%rbp
je     146c <extract_quotes+0x27c>
mov    %rbp,%rdi
call   1040 <free@plt>
add    $0x5b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbce(%rip),%rdi
add    $0x5b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10e0 <perror@plt>
lea    0xbbf(%rip),%rdi
call   10e0 <perror@plt>
mov    %r13,%rdi
jmp    145a <extract_quotes+0x26a>

LLVM IR (-O0):
@.str = [4 x i8] c".eq\00"
@.str.1 = [38 x i8] c"extract_quotes: Already extracted %s\0A\00"
@.str.2 = [43 x i8] c"extract_quotes: Extracting quotes from %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [6 x i8] c"fopen\00"
@.str.5 = [6 x i8] c"%s.eq\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [10 x i8] c"fopen(2) \00"
@.str.8 = [10 x i8] c"%i %s %s\0A\00"
@.str.9 = [12 x i8] c"FOUND QUOTE\00"
define void @extract_quotes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca [712 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [712 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %2
%18 = load i8*, i8** %2
%19 = icmp ne i8* %18, null
br i1 %19, label %21, label %20
20: ; preds = %1
br label %197
21: ; preds = %1
%22 = load i8*, i8** %2
%23 = call i64 @strstr(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i8*, i8** %2
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %26)
br label %197
28: ; preds = %21
%29 = load i8*, i8** %2
%30 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = load i8*, i8** %2
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %32, i32** %3
%33 = load i32*, i32** %3
%34 = icmp ne i32* %33, null
br i1 %34, label %37, label %35
35: ; preds = %28
%36 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %197
37: ; preds = %28
%38 = load i8*, i8** %2
%39 = call i8* @str_unite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %38)
store i8* %39, i8** %5
%40 = load i8*, i8** %5
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %41, i32** %4
%42 = load i32*, i32** %4
%43 = icmp ne i32* %42, null
br i1 %43, label %46, label %44
44: ; preds = %37
%45 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %178
46: ; preds = %37
store i32 0, i32* %13
store i32 0, i32* %12
store i32 0, i32* %11
br label %47
47: ; preds = %46, %65, %176
br label %48
48: ; preds = %47
%49 = getelementptr inbounds [712 x i8], [712 x i8]* %6, i64 0, i64 0
%50 = load i32*, i32** %3
%51 = call i32* @fgets(i8* %49, i32 711, i32* %50)
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %54
53: ; preds = %48
br label %177
54: ; preds = %48
%55 = getelementptr inbounds [712 x i8], [712 x i8]* %6, i64 0, i64 0
store i8* %55, i8** %7
%56 = load i8*, i8** %7
%57 = call i32 @strlen(i8* %56)
store i32 %57, i32* %17
%58 = load i8*, i8** %7
%59 = load i32, i32* %17
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
store i8* %61, i8** %8
%62 = load i8*, i8** %7
%63 = load i8*, i8** %8
%64 = icmp ugt i8* %62, %63
br i1 %64, label %65, label %66
65: ; preds = %54
br label %47
66: ; preds = %54
br label %67
67: ; preds = %173, %140, %131, %66
%68 = load i8*, i8** %7
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %67
%73 = load i8*, i8** %7
%74 = load i8*, i8** %8
%75 = icmp ult i8* %73, %74
br label %76
76: ; preds = %72, %67
%77 = phi i1 [ false, %67 ], [ %75, %72 ]
br i1 %77, label %78, label %176
78: ; preds = %76
%79 = load i32, i32* %11
%80 = icmp eq i32 %79, 1
br i1 %80, label %81, label %146
81: ; preds = %78
%82 = load i8*, i8** %7
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 10
br i1 %85, label %86, label %94
86: ; preds = %81
%87 = load i32, i32* %13
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 %88
store i8 32, i8* %89
%90 = load i32, i32* %13
%91 = add nsw i32 %90, 1
store i32 %91, i32* %13
%92 = load i8*, i8** %7
%93 = getelementptr inbounds i8, i8* %92, i32 1
store i8* %93, i8** %7
br label %176
94: ; preds = %81
%95 = load i8*, i8** %7
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp ne i32 %97, 10
br i1 %98, label %99, label %107
99: ; preds = %94
%100 = load i8*, i8** %7
%101 = load i8, i8* %100
%102 = load i32, i32* %13
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 %103
store i8 %101, i8* %104
%105 = load i32, i32* %13
%106 = add nsw i32 %105, 1
store i32 %106, i32* %13
br label %107
107: ; preds = %99, %94
%108 = load i8*, i8** %7
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 34
br i1 %111, label %112, label %136
112: ; preds = %107
%113 = load i8*, i8** %7
%114 = getelementptr inbounds i8, i8* %113, i64 1
%115 = load i8, i8* %114
%116 = call i32 @isalnum(i8 signext %115)
%117 = icmp ne i32 %116, 0
br i1 %117, label %136, label %118
118: ; preds = %112
%119 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 0
%120 = call i8* @clean_quote(i8* %119)
store i8* %120, i8** %10
%121 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 0
%122 = call i32 @count_words(i8* %121)
store i32 %122, i32* %14
%123 = load i32, i32* %14
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %131
125: ; preds = %118
%126 = load i32*, i32** %4
%127 = load i32, i32* %14
%128 = load i8*, i8** %2
%129 = load i8*, i8** %10
%130 = call i32 @fprintf(i32* %126, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %127, i8* %128, i8* %129)
br label %131
131: ; preds = %125, %118
%132 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 0
%133 = call i32 @_memset(i8* %132, i32 0, i32 712)
store i32 0, i32* %11
store i32 0, i32* %13
%134 = load i8*, i8** %7
%135 = getelementptr inbounds i8, i8* %134, i32 1
store i8* %135, i8** %7
br label %67
136: ; preds = %112, %107
%137 = load i32, i32* %13
%138 = sext i32 %137 to i64
%139 = icmp ugt i64 %138, 712
br i1 %139, label %140, label %145
140: ; preds = %136
%141 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 0
%142 = call i32 @_memset(i8* %141, i32 0, i32 712)
store i32 0, i32* %11
%143 = load i8*, i8** %7
%144 = getelementptr inbounds i8, i8* %143, i32 1
store i8* %144, i8** %7
br label %67
145: ; preds = %136
br label %173
146: ; preds = %78
%147 = load i32, i32* %11
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %172
149: ; preds = %146
%150 = load i8*, i8** %7
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 34
br i1 %153, label %154, label %171
154: ; preds = %149
%155 = load i8*, i8** %7
%156 = getelementptr inbounds i8, i8* %155, i64 -1
%157 = load i8, i8* %156
%158 = call i32 @isalnum(i8 signext %157)
%159 = icmp ne i32 %158, 0
br i1 %159, label %171, label %160
160: ; preds = %154
%161 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %11
%162 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 0
%163 = call i32 @_memset(i8* %162, i32 0, i32 712)
store i32 0, i32* %13
%164 = load i8*, i8** %7
%165 = load i8, i8* %164
%166 = load i32, i32* %13
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [712 x i8], [712 x i8]* %9, i64 0, i64 %167
store i8 %165, i8* %168
%169 = load i32, i32* %13
%170 = add nsw i32 %169, 1
store i32 %170, i32* %13
br label %171
171: ; preds = %160, %154, %149
br label %172
172: ; preds = %171, %146
br label %173
173: ; preds = %172, %145
%174 = load i8*, i8** %7
%175 = getelementptr inbounds i8, i8* %174, i32 1
store i8* %175, i8** %7
br label %67
176: ; preds = %86, %76
br label %47
177: ; preds = %53
br label %178
178: ; preds = %177, %44
%179 = load i32*, i32** %3
%180 = icmp ne i32* %179, null
br i1 %180, label %181, label %184
181: ; preds = %178
%182 = load i32*, i32** %3
%183 = call i32 @fclose(i32* %182)
br label %184
184: ; preds = %181, %178
%185 = load i32*, i32** %4
%186 = icmp ne i32* %185, null
br i1 %186, label %187, label %190
187: ; preds = %184
%188 = load i32*, i32** %4
%189 = call i32 @fclose(i32* %188)
br label %190
190: ; preds = %187, %184
%191 = load i8*, i8** %5
%192 = icmp ne i8* %191, null
br i1 %192, label %193, label %196
193: ; preds = %190
%194 = load i8*, i8** %5
%195 = call i32 @free(i8* %194)
br label %196
196: ; preds = %193, %190
br label %197
197: ; preds = %196, %35, %25, %20
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c".eq\00"
@.str.1 = [38 x i8] c"extract_quotes: Already extracted %s\0A\00"
@.str.2 = [43 x i8] c"extract_quotes: Extracting quotes from %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [6 x i8] c"fopen\00"
@.str.5 = [6 x i8] c"%s.eq\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [10 x i8] c"fopen(2) \00"
@.str.8 = [10 x i8] c"%i %s %s\0A\00"
@.str.9 = [12 x i8] c"FOUND QUOTE\00"
define void @extract_quotes(i8* %0) {
%2 = alloca [712 x i8]
%3 = alloca [712 x i8]
%4 = getelementptr inbounds [712 x i8], [712 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [712 x i8], [712 x i8]* %3, i64 0, i64 0
%6 = icmp eq i8* %0, null
br i1 %6, label %109, label %7
7: ; preds = %1
%8 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %109
12: ; preds = %7
%13 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%14 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %109
18: ; preds = %12
%19 = tail call i8* @str_unite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %98
22: ; preds = %18
%23 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%24 = tail call i32 @fclose(i32* %14)
br label %105
25: ; preds = %101, %28
%26 = call i32* @fgets(i8* %4, i32 711, i32* %14)
%27 = icmp eq i32* %26, null
br i1 %27, label %102, label %28
28: ; preds = %25
%29 = call i32 @strlen(i8* %4)
%30 = icmp slt i32 %29, 0
br i1 %30, label %25, label %31
31: ; preds = %28
%32 = load i8, i8* %4
%33 = icmp ne i8 %32, 0
%34 = icmp ne i32 %29, 0
%35 = select i1 %33, i1 %34, i1 false
br i1 %35, label %36, label %101
36: ; preds = %31
%37 = zext i32 %29 to i64
%38 = getelementptr inbounds [712 x i8], [712 x i8]* %2, i64 0, i64 %37
br label %39
39: ; preds = %36, %70
%40 = phi i8 [ %74, %70 ], [ %32, %36 ]
%41 = phi i8* [ %73, %70 ], [ %4, %36 ]
%42 = phi i32 [ %72, %70 ], [ %100, %36 ]
%43 = phi i32 [ %71, %70 ], [ %99, %36 ]
%44 = icmp eq i32 %42, 1
br i1 %44, label %45, label %83
45: ; preds = %39
%46 = icmp eq i8 %40, 10
%47 = sext i32 %43 to i64
%48 = getelementptr inbounds [712 x i8], [712 x i8]* %3, i64 0, i64 %47
br i1 %46, label %49, label %54
49: ; preds = %45
store i8 32, i8* %48
%50 = add nsw i32 %43, 1
br label %51
51: ; preds = %70, %49
%52 = phi i32 [ %50, %49 ], [ %71, %70 ]
%53 = phi i32 [ 1, %49 ], [ %72, %70 ]
br label %98
54: ; preds = %45
store i8 %40, i8* %48
%55 = add nsw i32 %43, 1
%56 = icmp eq i8 %40, 34
br i1 %56, label %57, label %78
57: ; preds = %54
%58 = getelementptr inbounds i8, i8* %41, i64 1
%59 = load i8, i8* %58
%60 = call i32 @isalnum(i8 signext %59)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %78
62: ; preds = %57
%63 = call i8* @clean_quote(i8* %5)
%64 = call i32 @count_words(i8* %5)
%65 = icmp eq i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %62
%67 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %64, i8* %0, i8* %63)
br label %68
68: ; preds = %66, %62
%69 = call i32 @_memset(i8* %5, i32 0, i32 712)
br label %70
70: ; preds = %68, %80, %94
%71 = phi i32 [ %55, %80 ], [ %95, %94 ], [ 0, %68 ]
%72 = phi i32 [ 0, %80 ], [ %96, %94 ], [ 0, %68 ]
%73 = phi i8* [ %82, %80 ], [ %97, %94 ], [ %58, %68 ]
%74 = load i8, i8* %73
%75 = icmp ne i8 %74, 0
%76 = icmp ult i8* %73, %38
%77 = select i1 %75, i1 %76, i1 false
br i1 %77, label %39, label %51
78: ; preds = %57, %54
%79 = icmp ugt i32 %55, 712
br i1 %79, label %80, label %94
80: ; preds = %78
%81 = call i32 @_memset(i8* %5, i32 0, i32 712)
%82 = getelementptr inbounds i8, i8* %41, i64 1
br label %70
83: ; preds = %39
%84 = icmp eq i8 %40, 34
br i1 %84, label %85, label %94
85: ; preds = %83
%86 = getelementptr inbounds i8, i8* %41, i64 -1
%87 = load i8, i8* %86
%88 = call i32 @isalnum(i8 signext %87)
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%92 = call i32 @_memset(i8* %5, i32 0, i32 712)
%93 = load i8, i8* %41
store i8 %93, i8* %5
br label %94
94: ; preds = %90, %85, %83, %78
%95 = phi i32 [ %55, %78 ], [ %43, %85 ], [ 1, %90 ], [ %43, %83 ]
%96 = phi i32 [ 1, %78 ], [ 0, %85 ], [ 1, %90 ], [ 0, %83 ]
%97 = getelementptr inbounds i8, i8* %41, i64 1
br label %70
98: ; preds = %18, %51
%99 = phi i32 [ %52, %51 ], [ 0, %18 ]
%100 = phi i32 [ %53, %51 ], [ 0, %18 ]
br label %101
101: ; preds = %98, %31
br label %25
102: ; preds = %25
%103 = call i32 @fclose(i32* %14)
%104 = call i32 @fclose(i32* %20)
br label %105
105: ; preds = %22, %102
%106 = icmp eq i8* %19, null
br i1 %106, label %109, label %107
107: ; preds = %105
%108 = call i32 @free(i8* %19)
br label %109
109: ; preds = %105, %107, %1, %16, %10
ret void
}