#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 */

/* Variables and functions */
int /*<<< orphan*/ rewind_tape(int);
int /*<<< orphan*/ write_block(int, int);
int /*<<< orphan*/ write_filemarks(int, int);
void write_tape_pattern_1(int fd) {
  rewind_tape(fd);
  write_block(fd, 8 * 1024);
  write_block(fd, 64 * 1024);
  write_filemarks(fd, 1);
  write_block(fd, 64 * 1024);
  write_block(fd, 64 * 1024);
  write_block(fd, 64 * 1024);
  write_block(fd, 64 * 1024);
  write_block(fd, 64 * 1024);
  write_filemarks(fd, 0);
  write_filemarks(fd, 1);
}


x86 assembly (clang, -O0):
<write_tape_pattern_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <rewind_tape@plt>
mov    -0x4(%rbp),%edi
mov    $0x2000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <write_filemarks@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <write_filemarks@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <write_filemarks@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tape_pattern_1>:
push   %rbx
mov    %edi,%ebx
call   1050 <rewind_tape@plt>
mov    %ebx,%edi
mov    $0x2000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <write_filemarks@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
mov    $0x10000,%esi
call   1030 <write_block@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <write_filemarks@plt>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <write_filemarks@plt>

LLVM IR (-O0):
define void @write_tape_pattern_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rewind_tape(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @write_block(i32 %5, i32 8192)
%7 = load i32, i32* %2
%8 = call i32 @write_block(i32 %7, i32 65536)
%9 = load i32, i32* %2
%10 = call i32 @write_filemarks(i32 %9, i32 1)
%11 = load i32, i32* %2
%12 = call i32 @write_block(i32 %11, i32 65536)
%13 = load i32, i32* %2
%14 = call i32 @write_block(i32 %13, i32 65536)
%15 = load i32, i32* %2
%16 = call i32 @write_block(i32 %15, i32 65536)
%17 = load i32, i32* %2
%18 = call i32 @write_block(i32 %17, i32 65536)
%19 = load i32, i32* %2
%20 = call i32 @write_block(i32 %19, i32 65536)
%21 = load i32, i32* %2
%22 = call i32 @write_filemarks(i32 %21, i32 0)
%23 = load i32, i32* %2
%24 = call i32 @write_filemarks(i32 %23, i32 1)
ret void
}

LLVM IR (-O2):
define void @write_tape_pattern_1(i32 %0) {
%2 = tail call i32 @rewind_tape(i32 %0)
%3 = tail call i32 @write_block(i32 %0, i32 8192)
%4 = tail call i32 @write_block(i32 %0, i32 65536)
%5 = tail call i32 @write_filemarks(i32 %0, i32 1)
%6 = tail call i32 @write_block(i32 %0, i32 65536)
%7 = tail call i32 @write_block(i32 %0, i32 65536)
%8 = tail call i32 @write_block(i32 %0, i32 65536)
%9 = tail call i32 @write_block(i32 %0, i32 65536)
%10 = tail call i32 @write_block(i32 %0, i32 65536)
%11 = tail call i32 @write_filemarks(i32 %0, i32 0)
%12 = tail call i32 @write_filemarks(i32 %0, i32 1)
ret void
}