#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*/ fwrite(char const *, int, int, int /*<<< orphan*/ *);
void output_line(FILE *ofile, const char *buff, const int use_cr) {
  char tbuff[2];
  int i;
  for (i = 0; buff[i] >= ' '; i++)
    ;
  fwrite(buff, i, 1, ofile);
  tbuff[0] = 13;
  tbuff[1] = 10;
  if (use_cr)
    fwrite(tbuff, 2, 1, ofile);
  else
    fwrite(tbuff + 1, 1, 1, ofile);
}


x86 assembly (clang, -O0):
<output_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     1152 <output_line+0x42>
jmp    1144 <output_line+0x34>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <output_line+0x1a>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
movb   $0xd,-0x16(%rbp)
movb   $0xa,-0x15(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1195 <output_line+0x85>
lea    -0x16(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    11ad <output_line+0x9d>
lea    -0x16(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_line>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rax
mov    %rdi,%rbx
xor    %esi,%esi
nopl   (%rax)
cmpb   $0x1f,(%rax,%rsi,1)
lea    0x1(%rsi),%rsi
jg     1130 <output_line+0x10>
add    $0xffffffff,%esi
mov    %rax,%rdi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
movw   $0xa0d,0x6(%rsp)
test   %ebp,%ebp
je     1176 <output_line+0x56>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @output_line(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp sgt i8 %9, 31
%11 = add nuw i64 %7, 1
br i1 %10, label %6, label %12
12: ; preds = %6
%13 = trunc i64 %7 to i32
%14 = tail call i32 @fwrite(i8* %1, i32 %13, i32 1, i32* %0)
store i8 13, i8* %5
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 10, i8* %15
%16 = icmp eq i32 %2, 0
br i1 %16, label %19, label %17
17: ; preds = %12
%18 = call i32 @fwrite(i8* %5, i32 2, i32 1, i32* %0)
br label %21
19: ; preds = %12
%20 = tail call i32 @fputc(i32 10, i32* %0)
br label %21
21: ; preds = %19, %17
ret void
}