#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__ EOF;
scalar_t__ compare(char *, char *, char *);
int /*<<< orphan*/ err(int, char *);
scalar_t__ putchar(char);
void print_from(char *string, char *front, char *back) {
  for (; front < back && compare(string, front, back) == 0; ++front) {
    for (; front < back && *front != '\n'; ++front)
      if (putchar(*front) == EOF)
        err(2, "stdout");
    if (putchar('\n') == EOF)
      err(2, "stdout");
  }
}


x86 assembly (clang, -O0):
<print_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1172 <print_from+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <compare@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1182 <print_from+0x52>
jmp    123e <print_from+0x10e>
jmp    1187 <print_from+0x57>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x1a(%rbp)
jae    11aa <print_from+0x7a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    11ba <print_from+0x8a>
jmp    11fd <print_from+0xcd>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    0x2e1b(%rip),%rcx
cmp    (%rcx),%rax
jne    11e7 <print_from+0xb7>
mov    $0x2,%edi
lea    0xe1e(%rip),%rsi
call   1040 <err@plt>
jmp    11ec <print_from+0xbc>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1187 <print_from+0x57>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dda(%rip),%rcx
cmp    (%rcx),%rax
jne    1228 <print_from+0xf8>
mov    $0x2,%edi
lea    0xddd(%rip),%rsi
call   1040 <err@plt>
jmp    122d <print_from+0xfd>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <print_from+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_from>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jae    11e5 <print_from+0xb5>
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e94(%rip),%r13
lea    0xea5(%rip),%r12
jmp    1169 <print_from+0x39>
nopl   (%rax)
add    $0x1,%rbx
cmp    %r15,%rbx
jae    11e5 <print_from+0xb5>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <compare@plt>
test   %rax,%rax
jne    11e5 <print_from+0xb5>
cmp    %r15,%rbx
jae    11c3 <print_from+0x93>
mov    %r15,%rbp
sub    %rbx,%rbp
jmp    119a <print_from+0x6a>
nopl   0x0(%rax)
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
je     11c0 <print_from+0x90>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     11c3 <print_from+0x93>
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    0x0(%r13),%rax
jne    1190 <print_from+0x60>
mov    $0x2,%edi
mov    %r12,%rsi
call   1040 <err@plt>
jmp    1190 <print_from+0x60>
xchg   %ax,%ax
mov    %r15,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x0(%r13),%rax
jne    1160 <print_from+0x30>
mov    $0x2,%edi
mov    %r12,%rsi
call   1040 <err@plt>
jmp    1160 <print_from+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [7 x i8] c"stdout\00"
define void @print_from(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %50, %3
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i64 @compare(i8* %12, i8* %13, i8* %14)
%16 = icmp eq i64 %15, 0
br label %17
17: ; preds = %11, %7
%18 = phi i1 [ false, %7 ], [ %16, %11 ]
br i1 %18, label %19, label %53
19: ; preds = %17
br label %20
20: ; preds = %40, %19
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = icmp ult i8* %21, %22
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8*, i8** %5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 10
br label %29
29: ; preds = %24, %20
%30 = phi i1 [ false, %20 ], [ %28, %24 ]
br i1 %30, label %31, label %43
31: ; preds = %29
%32 = load i8*, i8** %5
%33 = load i8, i8* %32
%34 = call i64 @putchar(i8 signext %33)
%35 = load i64, i64* @EOF
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = call i32 @err(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %37, %31
br label %40
40: ; preds = %39
%41 = load i8*, i8** %5
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %5
br label %20
43: ; preds = %29
%44 = call i64 @putchar(i8 signext 10)
%45 = load i64, i64* @EOF
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @err(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %49
49: ; preds = %47, %43
br label %50
50: ; preds = %49
%51 = load i8*, i8** %5
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %5
br label %7
53: ; preds = %17
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [7 x i8] c"stdout\00"
define void @print_from(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = icmp ult i8* %1, %2
br i1 %5, label %6, label %40
6: ; preds = %3, %37
%7 = phi i8* [ %38, %37 ], [ %1, %3 ]
%8 = ptrtoint i8* %7 to i64
%9 = tail call i64 @compare(i8* %0, i8* %7, i8* %2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %40
11: ; preds = %6
%12 = icmp ult i8* %7, %2
br i1 %12, label %13, label %30
13: ; preds = %11
%14 = getelementptr i8, i8* %7, i64 %4
%15 = sub i64 0, %8
%16 = getelementptr i8, i8* %14, i64 %15
br label %17
17: ; preds = %13, %27
%18 = phi i8* [ %28, %27 ], [ %7, %13 ]
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 10
br i1 %20, label %30, label %21
21: ; preds = %17
%22 = tail call i64 @putchar(i8 signext %19)
%23 = load i64, i64* @EOF
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = tail call i32 @err(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %21, %25
%28 = getelementptr inbounds i8, i8* %18, i64 1
%29 = icmp eq i8* %28, %16
br i1 %29, label %30, label %17
30: ; preds = %17, %27, %11
%31 = phi i8* [ %7, %11 ], [ %16, %27 ], [ %18, %17 ]
%32 = tail call i64 @putchar(i8 signext 10)
%33 = load i64, i64* @EOF
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = tail call i32 @err(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %37
37: ; preds = %30, %35
%38 = getelementptr inbounds i8, i8* %31, i64 1
%39 = icmp ult i8* %38, %2
br i1 %39, label %6, label %40
40: ; preds = %6, %37, %3
ret void
}