#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*/ fputs(char *, int /*<<< orphan*/ *);
int lpp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
void fill_page(FILE *file_pointer, int *line_counter, int *page_counter) {
  char temp[100];
  int i;
  strcpy(temp, "\n");
  while (*line_counter < (lpp(0, 0) - 5)) {
    fputs(temp, file_pointer);
    *line_counter = *line_counter + 1;
  }
  for (i = 0; i < 5 - 2; i++)
    fputs(temp, file_pointer);
  fputs("\n                    .", file_pointer);
  for (i = 0; i < (5 - (5 - 2) - 1); i++)
    fputs(temp, file_pointer);
  *line_counter = 0;
  *page_counter = *page_counter + 1;
}


x86 assembly (clang, -O0):
<fill_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <lpp@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%eax
sub    $0x5,%ecx
cmp    %ecx,%eax
jge    11a0 <fill_page+0x70>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1157 <fill_page+0x27>
movl   $0x0,-0x84(%rbp)
cmpl   $0x3,-0x84(%rbp)
jge    11d8 <fill_page+0xa8>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11aa <fill_page+0x7a>
mov    -0x8(%rbp),%rsi
lea    0xe1f(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x1,-0x84(%rbp)
jge    1220 <fill_page+0xf0>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11f2 <fill_page+0xc2>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_page>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0xea4(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    (%rbx),%ebp
xor    %edi,%edi
xor    %esi,%esi
call   1060 <lpp@plt>
add    $0xfffffffb,%eax
cmp    %eax,%ebp
jge    11a2 <fill_page+0x62>
mov    %rsp,%r12
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    (%rbx),%ebp
add    $0x1,%ebp
mov    %ebp,(%rbx)
xor    %edi,%edi
xor    %esi,%esi
call   1060 <lpp@plt>
add    $0xfffffffb,%eax
cmp    %eax,%ebp
jl     1180 <fill_page+0x40>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
lea    0xe35(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
movl   $0x0,(%rbx)
addl   $0x1,(%r14)
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [23 x i8] c"\0A .\00"
define void @fill_page(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [100 x i8]
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %17, %3
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = call i32 @lpp(i32 0, i32 0)
%15 = sub nsw i32 %14, 5
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %25
17: ; preds = %11
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%19 = load i32*, i32** %4
%20 = call i32 @fputs(i8* %18, i32* %19)
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
%24 = load i32*, i32** %5
store i32 %23, i32* %24
br label %11
25: ; preds = %11
store i32 0, i32* %8
br label %26
26: ; preds = %33, %25
%27 = load i32, i32* %8
%28 = icmp slt i32 %27, 3
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%31 = load i32*, i32** %4
%32 = call i32 @fputs(i8* %30, i32* %31)
br label %33
33: ; preds = %29
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %26
36: ; preds = %26
%37 = load i32*, i32** %4
%38 = call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32* %37)
store i32 0, i32* %8
br label %39
39: ; preds = %46, %36
%40 = load i32, i32* %8
%41 = icmp slt i32 %40, 1
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%44 = load i32*, i32** %4
%45 = call i32 @fputs(i8* %43, i32* %44)
br label %46
46: ; preds = %42
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %39
49: ; preds = %39
%50 = load i32*, i32** %5
store i32 0, i32* %50
%51 = load i32*, i32** %6
%52 = load i32, i32* %51
%53 = add nsw i32 %52, 1
%54 = load i32*, i32** %6
store i32 %53, i32* %54
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [23 x i8] c"\0A .\00"
define void @fill_page(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = call i32 @lpp(i32 0, i32 0)
%9 = add nsw i32 %8, -5
%10 = icmp slt i32 %7, %9
br i1 %10, label %19, label %11
11: ; preds = %19, %3
%12 = call i32 @fputs(i8* %5, i32* %0)
%13 = call i32 @fputs(i8* %5, i32* %0)
%14 = call i32 @fputs(i8* %5, i32* %0)
%15 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 22, i64 1, i32* %0)
%16 = call i32 @fputs(i8* %5, i32* %0)
store i32 0, i32* %1
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
ret void
19: ; preds = %3, %19
%20 = call i32 @fputs(i8* %5, i32* %0)
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
%23 = call i32 @lpp(i32 0, i32 0)
%24 = add nsw i32 %23, -5
%25 = icmp slt i32 %22, %24
br i1 %25, label %19, label %11
}