#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*/ SEEK_SET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int getc(int /*<<< orphan*/ *);
void write_trash_size(FILE *output_file, unsigned int trash_size) {
  unsigned int first_byte;
  unsigned int writing_char;
  fseek(output_file, (0), SEEK_SET);
  first_byte = getc(output_file);
  writing_char = (0);
  writing_char = (first_byte | (trash_size << (8 - 3)));
  fseek(output_file, (0), SEEK_SET);
  fprintf(output_file, "%c", writing_char);
}


x86 assembly (clang, -O0):
<write_trash_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe6a(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_trash_size>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2e9f(%rip),%r15
mov    (%r15),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rdi
call   1050 <getc@plt>
shl    $0x5,%ebx
or     %eax,%ebx
mov    (%r15),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebx,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%c\00"
define void @write_trash_size(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %5
store i32 0, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = shl i32 %13, 5
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i32*, i32** %3
%17 = load i32, i32* @SEEK_SET
%18 = call i32 @fseek(i32* %16, i32 0, i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %6
%21 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @write_trash_size(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @getc(i32* %0)
%6 = shl i32 %1, 5
%7 = or i32 %5, %6
%8 = load i32, i32* @SEEK_SET
%9 = tail call i32 @fseek(i32* %0, i32 0, i32 %8)
%10 = tail call i32 @fputc(i32 %7, i32* %0)
ret void
}