#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 */
scalar_t__ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void _defaults_rc_copy_line(FILE *src, FILE *dst) {
  int tok;
  if (!src || !dst)
    return;
  while (1) {
    tok = fgetc(src);
    if (feof(src)) {
      return;
    } else {
      fputc(tok, dst);
    }
    if (tok == '\n') {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<_defaults_rc_copy_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <_defaults_rc_copy_line+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    115b <_defaults_rc_copy_line+0x2b>
jmp    11a4 <_defaults_rc_copy_line+0x74>
jmp    1160 <_defaults_rc_copy_line+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     1184 <_defaults_rc_copy_line+0x54>
jmp    11a4 <_defaults_rc_copy_line+0x74>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
cmpl   $0xa,-0x14(%rbp)
jne    119f <_defaults_rc_copy_line+0x6f>
jmp    11a4 <_defaults_rc_copy_line+0x74>
jmp    1160 <_defaults_rc_copy_line+0x30>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_defaults_rc_copy_line>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1176 <_defaults_rc_copy_line+0x46>
mov    %rsi,%r14
test   %rsi,%rsi
je     1176 <_defaults_rc_copy_line+0x46>
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %rax,%rax
jne    1176 <_defaults_rc_copy_line+0x46>
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
cmp    $0xa,%ebp
jne    1150 <_defaults_rc_copy_line+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @_defaults_rc_copy_line(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
br label %29
12: ; preds = %8
br label %13
13: ; preds = %12, %28
%14 = load i32*, i32** %3
%15 = call i32 @fgetc(i32* %14)
store i32 %15, i32* %5
%16 = load i32*, i32** %3
%17 = call i64 @feof(i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
br label %29
20: ; preds = %13
%21 = load i32, i32* %5
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i32 %21, i32* %22)
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %28
27: ; preds = %24
br label %29
28: ; preds = %24
br label %13
29: ; preds = %27, %19, %11
ret void
}

LLVM IR (-O2):
define void @_defaults_rc_copy_line(i32* %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2, %10
%7 = tail call i32 @fgetc(i32* %0)
%8 = tail call i64 @feof(i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call i32 @fputc(i32 %7, i32* %1)
%12 = icmp eq i32 %7, 10
br i1 %12, label %13, label %6
13: ; preds = %10, %6, %2
ret void
}