#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__ isspace(char);
int find_continuation(char *line, int pos) {
  pos--;
  while (pos >= 0 && isspace(line[pos]))
    pos--;
  if (pos >= 0 && line[pos] == '\\')
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<find_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jl     1152 <find_continuation+0x42>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1162 <find_continuation+0x52>
jmp    1170 <find_continuation+0x60>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <find_continuation+0x18>
cmpl   $0x0,-0x14(%rbp)
jl     119a <find_continuation+0x8a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    119a <find_continuation+0x8a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <find_continuation+0x91>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_continuation>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%ebx
mov    $0xffffffff,%ebp
xchg   %ax,%ax
test   %ebx,%ebx
jle    1143 <find_continuation+0x33>
movsbl -0x1(%r14,%rbx,1),%edi
call   1030 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1120 <find_continuation+0x10>
mov    %ebx,%eax
cmpb   $0x5c,(%r14,%rax,1)
jne    1143 <find_continuation+0x33>
mov    %ebx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @find_continuation(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, -1
store i32 %7, i32* %5
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i64 @isspace(i8 signext %16)
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %11, %8
%20 = phi i1 [ false, %8 ], [ %18, %11 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %8
24: ; preds = %19
%25 = load i32, i32* %5
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = load i8*, i8** %4
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 92
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = load i32, i32* %5
store i32 %36, i32* %3
br label %38
37: ; preds = %27, %24
store i32 -1, i32* %3
br label %38
38: ; preds = %37, %35
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
define i32 @find_continuation(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 %6
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %9
%15 = trunc i64 %6 to i32
%16 = and i64 %6, 4294967295
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 92
br i1 %19, label %21, label %20
20: ; preds = %4, %14
br label %21
21: ; preds = %14, %20
%22 = phi i32 [ -1, %20 ], [ %15, %14 ]
ret i32 %22
}