#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 WRDE_NOSPACE;
int WRDE_SYNTAX;
char *w_addchar(char *, size_t *, size_t *, char const);
int parse_squote(char **word, size_t *word_length, size_t *max_length,
                 const char *words, size_t *offset) {
  for (; words[*offset]; ++(*offset)) {
    if (words[*offset] != '\'') {
      *word = w_addchar(*word, word_length, max_length, words[*offset]);
      if (*word == NULL)
        return WRDE_NOSPACE;
    } else
      return 0;
  }
  return WRDE_SYNTAX;
}


x86 assembly (clang, -O0):
<parse_squote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     11ce <parse_squote+0xbe>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     11aa <parse_squote+0x9a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rax,%rcx,1),%ecx
call   1030 <w_addchar@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11a5 <parse_squote+0x95>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11da <parse_squote+0xca>
jmp    11b6 <parse_squote+0xa6>
movl   $0x0,-0x4(%rbp)
jmp    11da <parse_squote+0xca>
jmp    11bb <parse_squote+0xab>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    112c <parse_squote+0x1c>
mov    0x2e13(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_squote>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r13
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    (%r8),%rax
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rax,1),%eax
test   %al,%al
je     1164 <parse_squote+0x54>
cmp    $0x27,%al
je     116d <parse_squote+0x5d>
mov    (%rbx),%rdi
movsbl %al,%ecx
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <w_addchar@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1171 <parse_squote+0x61>
mov    0x0(%r13),%rax
add    $0x1,%rax
mov    %rax,0x0(%r13)
jmp    1130 <parse_squote+0x20>
mov    0x2e7d(%rip),%rax
jmp    1178 <parse_squote+0x68>
xor    %eax,%eax
jmp    117a <parse_squote+0x6a>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WRDE_NOSPACE = global i32 0
@WRDE_SYNTAX = global i32 0
define i32 @parse_squote(i8** %0, i64* %1, i64* %2, i8* %3, i64* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i8*
%11 = alloca i64*
store i8** %0, i8*** %7
store i64* %1, i64** %8
store i64* %2, i64** %9
store i8* %3, i8** %10
store i64* %4, i64** %11
br label %12
12: ; preds = %47, %5
%13 = load i8*, i8** %10
%14 = load i64*, i64** %11
%15 = load i64, i64* %14
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %51
19: ; preds = %12
%20 = load i8*, i8** %10
%21 = load i64*, i64** %11
%22 = load i64, i64* %21
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 39
br i1 %26, label %27, label %45
27: ; preds = %19
%28 = load i8**, i8*** %7
%29 = load i8*, i8** %28
%30 = load i64*, i64** %8
%31 = load i64*, i64** %9
%32 = load i8*, i8** %10
%33 = load i64*, i64** %11
%34 = load i64, i64* %33
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = call i8* @w_addchar(i8* %29, i64* %30, i64* %31, i8 signext %36)
%38 = load i8**, i8*** %7
store i8* %37, i8** %38
%39 = load i8**, i8*** %7
%40 = load i8*, i8** %39
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %44
42: ; preds = %27
%43 = load i32, i32* @WRDE_NOSPACE
store i32 %43, i32* %6
br label %53
44: ; preds = %27
br label %46
45: ; preds = %19
store i32 0, i32* %6
br label %53
46: ; preds = %44
br label %47
47: ; preds = %46
%48 = load i64*, i64** %11
%49 = load i64, i64* %48
%50 = add i64 %49, 1
store i64 %50, i64* %48
br label %12
51: ; preds = %12
%52 = load i32, i32* @WRDE_SYNTAX
store i32 %52, i32* %6
br label %53
53: ; preds = %51, %45, %42
%54 = load i32, i32* %6
ret i32 %54
}

LLVM IR (-O2):
@WRDE_NOSPACE = global i32 0
@WRDE_SYNTAX = global i32 0
define i32 @parse_squote(i8** nocapture %0, i64* %1, i64* %2, i8* nocapture %3, i64* nocapture %4) {
%6 = load i64, i64* %4
br label %7
7: ; preds = %17, %5
%8 = phi i64 [ %19, %17 ], [ %6, %5 ]
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = load i8, i8* %9
switch i8 %10, label %11 [
i8 0, label %20
i8 39, label %22
]
11: ; preds = %7
%12 = load i8*, i8** %0
%13 = tail call i8* @w_addchar(i8* %12, i64* %1, i64* %2, i8 signext %10)
store i8* %13, i8** %0
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* @WRDE_NOSPACE
br label %22
17: ; preds = %11
%18 = load i64, i64* %4
%19 = add i64 %18, 1
store i64 %19, i64* %4
br label %7
20: ; preds = %7
%21 = load i32, i32* @WRDE_SYNTAX
br label %22
22: ; preds = %7, %20, %15
%23 = phi i32 [ %16, %15 ], [ %21, %20 ], [ 0, %7 ]
ret i32 %23
}