#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 */
scalar_t__ espacos(char *);
char *strchr(char *, char);
int remove_linecontin(char *s) {
  char *p = NULL;
  char *q = NULL;
  p = strchr(s, '\\');
  while (p != NULL) {
    if (espacos(p + 1)) {
      *p = 'y';
      return 1;
    }
    q = p + 1;
    if (*q == '\0')
      return 1;
    p = strchr(q, '\\');
  }
  return 0;
}


x86 assembly (clang, -O0):
<remove_linecontin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11c2 <remove_linecontin+0xa2>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <espacos@plt>
cmp    $0x0,%rax
je     1183 <remove_linecontin+0x63>
mov    -0x18(%rbp),%rax
movb   $0x79,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11c9 <remove_linecontin+0xa9>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11ab <remove_linecontin+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    11c9 <remove_linecontin+0xa9>
mov    -0x20(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    114e <remove_linecontin+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_linecontin>:
push   %rbp
push   %r14
push   %rbx
mov    $0x5c,%esi
call   1030 <strchr@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1177 <remove_linecontin+0x57>
mov    %rax,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%rbp
mov    %rbp,%rdi
call   1040 <espacos@plt>
test   %rax,%rax
jne    116e <remove_linecontin+0x4e>
cmpb   $0x0,0x0(%rbp)
je     1171 <remove_linecontin+0x51>
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <remove_linecontin+0x20>
jmp    1177 <remove_linecontin+0x57>
movb   $0x79,(%rbx)
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @remove_linecontin(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%3 = icmp eq i8* %2, null
br i1 %3, label %16, label %4
4: ; preds = %1, %13
%5 = phi i8* [ %14, %13 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i64 @espacos(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4
store i8 121, i8* %5
br label %16
10: ; preds = %4
%11 = load i8, i8* %6
%12 = icmp eq i8 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i8* @strchr(i8* %6, i8 signext 92)
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %4
16: ; preds = %10, %13, %1, %9
%17 = phi i32 [ 1, %9 ], [ 0, %1 ], [ 1, %10 ], [ 0, %13 ]
ret i32 %17
}