#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, size_t const,
                          int /*<<< orphan*/ *const);
size_t strcspn(char const *, char *);
void out_(char const *data, FILE *const io) {
  while (*data) {
    size_t const len = strcspn(data, "\r");
    data += fwrite(data, 1, len, io);
    if (*data == '\r')
      ++data;
  }
}


x86 assembly (clang, -O0):
<out_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1198 <out_+0x78>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1193 <out_+0x73>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <out_+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1177 <out_+0x57>
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcspn@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r15,%rcx
call   1040 <fwrite@plt>
cltq
lea    (%rbx,%rax,1),%rcx
xor    %edx,%edx
cmpb   $0xd,(%rbx,%rax,1)
sete   %dl
lea    (%rcx,%rdx,1),%rbx
cmpb   $0x0,(%rdx,%rcx,1)
jne    1140 <out_+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0D\00"
define void @out_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
store i8* %0, i8** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %27, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i64 @strcspn(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 %12, i64* %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %5
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i8* %13, i32 1, i64 %14, i32* %15)
%17 = load i8*, i8** %3
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %3
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 13
br i1 %23, label %24, label %27
24: ; preds = %10
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %27
27: ; preds = %24, %10
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0D\00"
define void @out_(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %14, %5 ], [ %0, %2 ]
%7 = tail call i64 @strcspn(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @fwrite(i8* %6, i32 1, i64 %7, i32* %1)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 13
%13 = zext i1 %12 to i64
%14 = getelementptr i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
ret void
}