#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_backslash(char **word, size_t *word_length, size_t *max_length,
                    const char *words, size_t *offset) {
  switch (words[1 + *offset]) {
  case 0:
    return WRDE_SYNTAX;
  case '\n':
    ++(*offset);
    break;
  default:
    *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_backslash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax,%rcx,1),%eax
mov    %eax,-0x34(%rbp)
test   %eax,%eax
je     115d <parse_backslash+0x4d>
jmp    114c <parse_backslash+0x3c>
mov    -0x34(%rbp),%eax
sub    $0xa,%eax
je     116e <parse_backslash+0x5e>
jmp    1181 <parse_backslash+0x71>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e6 <parse_backslash+0xd6>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    11df <parse_backslash+0xcf>
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
add    $0x1,%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    11d1 <parse_backslash+0xc1>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e6 <parse_backslash+0xd6>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_backslash>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%rbx
mov    (%r8),%rax
movsbl 0x1(%rcx,%rax,1),%ecx
cmp    $0xa,%ecx
je     1149 <parse_backslash+0x39>
test   %ecx,%ecx
jne    1133 <parse_backslash+0x23>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
jmp    1152 <parse_backslash+0x42>
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1030 <w_addchar@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     115a <parse_backslash+0x4a>
mov    (%rbx),%rax
add    $0x1,%rax
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
jmp    1152 <parse_backslash+0x42>

LLVM IR (-O0):
@WRDE_SYNTAX = global i32 0
@WRDE_NOSPACE = global i32 0
define i32 @parse_backslash(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
%12 = load i8*, i8** %10
%13 = load i64*, i64** %11
%14 = load i64, i64* %13
%15 = add i64 1, %14
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %25 [
i32 0, label %19
i32 10, label %21
]
19: ; preds = %5
%20 = load i32, i32* @WRDE_SYNTAX
store i32 %20, i32* %6
br label %48
21: ; preds = %5
%22 = load i64*, i64** %11
%23 = load i64, i64* %22
%24 = add i64 %23, 1
store i64 %24, i64* %22
br label %47
25: ; preds = %5
%26 = load i8**, i8*** %7
%27 = load i8*, i8** %26
%28 = load i64*, i64** %8
%29 = load i64*, i64** %9
%30 = load i8*, i8** %10
%31 = load i64*, i64** %11
%32 = load i64, i64* %31
%33 = add i64 1, %32
%34 = getelementptr inbounds i8, i8* %30, i64 %33
%35 = load i8, i8* %34
%36 = call i8* @w_addchar(i8* %27, i64* %28, i64* %29, i8 signext %35)
%37 = load i8**, i8*** %7
store i8* %36, i8** %37
%38 = load i8**, i8*** %7
%39 = load i8*, i8** %38
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %43
41: ; preds = %25
%42 = load i32, i32* @WRDE_NOSPACE
store i32 %42, i32* %6
br label %48
43: ; preds = %25
%44 = load i64*, i64** %11
%45 = load i64, i64* %44
%46 = add i64 %45, 1
store i64 %46, i64* %44
br label %47
47: ; preds = %43, %21
store i32 0, i32* %6
br label %48
48: ; preds = %47, %41, %19
%49 = load i32, i32* %6
ret i32 %49
}

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