#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int dispone(char *seq, int cols, int count, int max, FILE *OUTPUT) {
  int j;
  for (j = 0; j < cols; ++j)
    if ((count + j) < max)
      fprintf(OUTPUT, "%c", seq[count + j]);
  fprintf(OUTPUT, "\n");
  return 0;
}


x86 assembly (clang, -O0):
<dispone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <dispone+0x71>
mov    -0x10(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116e <dispone+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1173 <dispone+0x63>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <dispone+0x20>
mov    -0x20(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispone>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
test   %esi,%esi
jle    114e <dispone+0x3e>
mov    %rdi,%r15
movslq %edx,%rbx
movslq %ecx,%r12
mov    %esi,%r13d
jmp    113a <dispone+0x2a>
xchg   %ax,%ax
add    $0x1,%rbx
add    $0xffffffffffffffff,%r13
je     114e <dispone+0x3e>
cmp    %r12,%rbx
jge    1130 <dispone+0x20>
movsbl (%r15,%rbx,1),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
jmp    1130 <dispone+0x20>
mov    $0xa,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @dispone(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %23
7: ; preds = %5
%8 = sext i32 %2 to i64
%9 = sext i32 %3 to i64
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %7, %20
%12 = phi i64 [ 0, %7 ], [ %21, %20 ]
%13 = add nsw i64 %12, %8
%14 = icmp slt i64 %13, %9
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %0, i64 %13
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = tail call i32 @fputc(i32 %18, i32* %4)
br label %20
20: ; preds = %11, %15
%21 = add nuw nsw i64 %12, 1
%22 = icmp eq i64 %21, %10
br i1 %22, label %23, label %11
23: ; preds = %20, %5
%24 = tail call i32 @fputc(i32 10, i32* %4)
ret i32 0
}