#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 get_line(char *, char *, int);
scalar_t__ isupper(int);
int /*<<< orphan*/ strcat(char *, char *);
int get_multi_line(char *pin, char *w) {
  int len = 0, l = 0, lines = 0;
  char tmp[250];
  int c1, c2;
  w[0] = '\0';
  tmp[0] = '\0';
  while (*pin != '\0') {
    c1 = *pin;
    c2 = *++pin;
    --pin;
    if (c1 == '.' && isupper(c2))
      break;
    lines++;
    if (lines > 1)
      strcat(w, " \\\\\n");
    l = get_line(pin, tmp, 1);
    strcat(w, tmp);
    len += l + 1;
    pin += l + 1;
  }
  len--;
  pin--;
  return (len);
}


x86 assembly (clang, -O0):
<get_multi_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movb   $0x0,-0x120(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     123f <get_multi_line+0x10f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x124(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
mov    %eax,-0x128(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x2e,-0x124(%rbp)
jne    11cf <get_multi_line+0x9f>
mov    -0x128(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     11cf <get_multi_line+0x9f>
jmp    123f <get_multi_line+0x10f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    11f2 <get_multi_line+0xc2>
mov    -0x10(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    $0x1,%edx
call   1030 <get_line@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <get_multi_line+0x36>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_multi_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movb   $0x0,(%rsi)
movb   $0x0,(%rsp)
xor    %r13d,%r13d
mov    %rsp,%r15
xor    %r12d,%r12d
jmp    118e <get_multi_line+0x5e>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <get_line@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
add    %ebp,%r12d
add    $0x1,%r12d
movslq %ebp,%rax
add    %rax,%rbx
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x2e,%al
je     11a0 <get_multi_line+0x70>
test   %al,%al
jne    11ae <get_multi_line+0x7e>
jmp    11c5 <get_multi_line+0x95>
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
call   1040 <isupper@plt>
test   %rax,%rax
jne    11c5 <get_multi_line+0x95>
sub    $0x1,%r13d
jb     1160 <get_multi_line+0x30>
mov    %r14,%rdi
lea    0xe42(%rip),%rsi
call   1050 <strcat@plt>
jmp    1160 <get_multi_line+0x30>
add    $0xffffffff,%r12d
mov    %r12d,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \\\\\0A\00"
define i32 @get_multi_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [250 x i8]
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 0, i8* %12
%13 = getelementptr inbounds [250 x i8], [250 x i8]* %8, i64 0, i64 0
store i8 0, i8* %13
br label %14
14: ; preds = %44, %2
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %60
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
store i32 %22, i32* %9
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
store i32 %26, i32* %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %3
%29 = load i32, i32* %9
%30 = icmp eq i32 %29, 46
br i1 %30, label %31, label %36
31: ; preds = %19
%32 = load i32, i32* %10
%33 = call i64 @isupper(i32 %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
br label %60
36: ; preds = %31, %19
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
%39 = load i32, i32* %7
%40 = icmp sgt i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i8*, i8** %4
%43 = call i32 @strcat(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %44
44: ; preds = %41, %36
%45 = load i8*, i8** %3
%46 = getelementptr inbounds [250 x i8], [250 x i8]* %8, i64 0, i64 0
%47 = call i32 @get_line(i8* %45, i8* %46, i32 1)
store i32 %47, i32* %6
%48 = load i8*, i8** %4
%49 = getelementptr inbounds [250 x i8], [250 x i8]* %8, i64 0, i64 0
%50 = call i32 @strcat(i8* %48, i8* %49)
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
%53 = load i32, i32* %5
%54 = add nsw i32 %53, %52
store i32 %54, i32* %5
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
%57 = load i8*, i8** %3
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds i8, i8* %57, i64 %58
store i8* %59, i8** %3
br label %14
60: ; preds = %35, %14
%61 = load i32, i32* %5
%62 = add nsw i32 %61, -1
store i32 %62, i32* %5
%63 = load i8*, i8** %3
%64 = getelementptr inbounds i8, i8* %63, i32 -1
store i8* %64, i8** %3
%65 = load i32, i32* %5
ret i32 %65
}

LLVM IR (-O2):
@.str = [5 x i8] c" \\\\\0A\00"
define i32 @get_multi_line(i8* %0, i8* %1) {
%3 = alloca [250 x i8]
%4 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
store i8 0, i8* %1
store i8 0, i8* %4
br label %5
5: ; preds = %21, %2
%6 = phi i32 [ 0, %2 ], [ %17, %21 ]
%7 = phi i32 [ 0, %2 ], [ %25, %21 ]
%8 = phi i8* [ %0, %2 ], [ %27, %21 ]
%9 = load i8, i8* %8
switch i8 %9, label %16 [
i8 0, label %28
i8 46, label %10
]
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i64 @isupper(i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %5, %10
%17 = add nuw nsw i32 %6, 1
%18 = icmp eq i32 %6, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 @strcat(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = call i32 @get_line(i8* %8, i8* %4, i32 1)
%23 = call i32 @strcat(i8* %1, i8* %4)
%24 = add nsw i32 %22, 1
%25 = add nsw i32 %24, %7
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i8, i8* %8, i64 %26
br label %5
28: ; preds = %5, %10
%29 = add nsw i32 %7, -1
ret i32 %29
}