#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(short *, int, int, int /*<<< orphan*/ *);
void inicia_fifo(char arq[]) {
  FILE *arq_ini;
  short a;
  a = 0;
  arq_ini = fopen(arq, "w+b");
  fseek(arq_ini, 0, SEEK_SET);
  fwrite(&a, sizeof(short), 1, arq_ini);
  fwrite(&a, sizeof(short), 1, arq_ini);
  fwrite(&a, sizeof(short), 1, arq_ini);
  fclose(arq_ini);
}


x86 assembly (clang, -O0):
<inicia_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rcx
lea    -0x12(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x10(%rbp),%rcx
lea    -0x12(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x10(%rbp),%rcx
lea    -0x12(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicia_fifo>:
push   %r14
push   %rbx
push   %rax
movw   $0x0,0x6(%rsp)
lea    0xeae(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
lea    0x6(%rsp),%r14
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"w+b\00"
@SEEK_SET = global i32 0
define void @inicia_fifo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %4
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%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 @fwrite(i16* %4, i32 2, i32 1, i32* %10)
%12 = load i32*, i32** %3
%13 = call i32 @fwrite(i16* %4, i32 2, i32 1, i32* %12)
%14 = load i32*, i32** %3
%15 = call i32 @fwrite(i16* %4, i32 2, i32 1, i32* %14)
%16 = load i32*, i32** %3
%17 = call i32 @fclose(i32* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"w+b\00"
@SEEK_SET = global i32 0
define void @inicia_fifo(i8* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32* %4)
%8 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32* %4)
%9 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32* %4)
%10 = tail call i32 @fclose(i32* %4)
ret void
}