#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 */
char *jump_next_line(char *ptr) {
  char *temp;
  if (!ptr)
    return NULL;
  for (temp = ptr; temp[0] != '\0'; temp++)
    if (temp[0] == '\n')
      return (temp + 1);
  return NULL;
}


x86 assembly (clang, -O0):
<jump_next_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <jump_next_line+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1177 <jump_next_line+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <jump_next_line+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1159 <jump_next_line+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <jump_next_line+0x77>
jmp    115e <jump_next_line+0x5e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <jump_next_line+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_next_line>:
test   %rdi,%rdi
je     1122 <jump_next_line+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1122 <jump_next_line+0x22>
cmp    $0xa,%cl
jne    1110 <jump_next_line+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @jump_next_line(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %8
%4 = phi i8* [ %9, %8 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %10
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
10: ; preds = %3, %1, %6
%11 = phi i8* [ %7, %6 ], [ null, %1 ], [ null, %3 ]
ret i8* %11
}