#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 /*<<< orphan*/ printf(char *, char, char, char);
int processchunked(char *resp, int size) {
  char *p = resp + size - 5;
  printf("%d %d %d\n", *(p - 1), *p, *(p + 1));
  if (*p == '0' && *(p - 1) == '\n' && *(p + 1) == '\r') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<processchunked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0xfffffffffffffffb,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x1(%rax),%dl
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
lea    0xeb6(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl 0x1(%rax),%ecx
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1197 <processchunked+0x87>
mov    -0x20(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
jne    1197 <processchunked+0x87>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xd,%eax
jne    1197 <processchunked+0x87>
movl   $0x0,-0x4(%rbp)
jmp    119e <processchunked+0x8e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processchunked>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
movsbl -0x6(%rdi,%rbx,1),%esi
movsbl -0x5(%rdi,%rbx,1),%edx
movsbl -0x4(%rdi,%rbx,1),%ecx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
cmpb   $0x30,-0x5(%r14,%rbx,1)
jne    114f <processchunked+0x3f>
cmpb   $0xa,-0x6(%r14,%rbx,1)
jne    114f <processchunked+0x3f>
xor    %eax,%eax
cmpb   $0xd,-0x4(%r14,%rbx,1)
je     1154 <processchunked+0x44>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @processchunked(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -5
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = load i8, i8* %13
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %14, i8 signext %16, i8 signext %19)
%21 = load i8*, i8** %6
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 48
br i1 %24, label %25, label %38
25: ; preds = %2
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i64 -1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 10
br i1 %30, label %31, label %38
31: ; preds = %25
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 13
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 0, i32* %3
br label %39
38: ; preds = %31, %25, %2
store i32 1, i32* %3
br label %39
39: ; preds = %38, %37
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @processchunked(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -5
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %8, i8 signext %10)
%12 = load i8, i8* %5
%13 = icmp eq i8 %12, 48
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8, i8* %6
%16 = icmp eq i8 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8, i8* %9
%19 = icmp eq i8 %18, 13
br i1 %19, label %21, label %20
20: ; preds = %17, %14, %2
br label %21
21: ; preds = %17, %20
%22 = phi i32 [ 1, %20 ], [ 0, %17 ]
ret i32 %22
}