#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void move_to_content(FILE *fd) {
  char line[5000] = {0};
  while (fgets(line, 5000, fd) != NULL) {
    char *sign = "\r\n";
    if (strcmp(sign, line) == 0) {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<move_to_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13a0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1390(%rbp),%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <memset@plt>
lea    -0x1390(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1388,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11a6 <move_to_content+0x76>
lea    0xe88(%rip),%rax
mov    %rax,-0x1398(%rbp)
mov    -0x1398(%rbp),%rdi
lea    -0x1390(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11a1 <move_to_content+0x71>
jmp    11a6 <move_to_content+0x76>
jmp    1152 <move_to_content+0x22>
add    $0x13a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_to_content>:
push   %r15
push   %r14
push   %rbx
sub    $0x1390,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    $0x1388,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1388,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1185 <move_to_content+0x55>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1160 <move_to_content+0x30>
add    $0x1390,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @move_to_content(i32* %0) {
%2 = alloca i32*
%3 = alloca [5000 x i8]
%4 = alloca i8*
store i32* %0, i32** %2
%5 = bitcast [5000 x i8]* %3 to i8*
br label %6
6: ; preds = %17, %1
%7 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%8 = load i32*, i32** %2
%9 = call i32* @fgets(i8* %7, i32 5000, i32* %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %6
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [5000 x i8], [5000 x i8]* %3, i64 0, i64 0
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
br label %18
17: ; preds = %11
br label %6
18: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @move_to_content(i32* nocapture %0) {
%2 = alloca [5000 x i8]
%3 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %7, %1
%5 = call i32* @fgets(i8* %3, i32 5000, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %7, %4
ret void
}