#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 */
typedef int uint32_t;

/* Variables and functions */
bool multiple_lines(const char *s) {
  uint32_t new_lines;
  new_lines = 0;
  while (*s != '\0') {
    if (*s == '\n') {
      new_lines++;
      if (new_lines > 1)
        break;
    }
    s++;
  }
  return new_lines >= 2;
}


x86 assembly (clang, -O0):
<multiple_lines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <multiple_lines+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114c <multiple_lines+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1147 <multiple_lines+0x47>
jmp    115d <multiple_lines+0x5d>
jmp    114c <multiple_lines+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <multiple_lines+0xf>
cmpl   $0x2,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple_lines>:
xor    %ecx,%ecx
jmp    111d <multiple_lines+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %ecx,%ecx
mov    $0x1,%ecx
jg     112a <multiple_lines+0x2a>
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <multiple_lines+0x10>
test   %al,%al
jne    1119 <multiple_lines+0x19>
jmp    112f <multiple_lines+0x2f>
mov    $0x2,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
setge  %al
ret

LLVM IR (-O0):
define i32 @multiple_lines(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %14
br label %24
20: ; preds = %14
br label %21
21: ; preds = %20, %9
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %2
br label %4
24: ; preds = %19, %4
%25 = load i32, i32* %3
%26 = icmp sge i32 %25, 2
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @multiple_lines(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 10, label %6
]
6: ; preds = %2
%7 = icmp sgt i32 %4, 0
br i1 %7, label %11, label %8
8: ; preds = %2, %6
%9 = phi i32 [ 1, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2, %6
%12 = phi i32 [ 2, %6 ], [ %4, %2 ]
%13 = icmp sgt i32 %12, 1
%14 = zext i1 %13 to i32
ret i32 %14
}