#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void WriteFileNidxHeader(FILE *fp, char *file_name,
                         unsigned int node_buffer_size) {
  unsigned int node_idx = 0;
  if (!fwrite(&node_idx, sizeof(int), 1, fp)) {
    perror(file_name);
    exit(EXIT_FAILURE);
  };
  ;
  if (!fwrite(&node_buffer_size, sizeof(int), 1, fp)) {
    perror(file_name);
    exit(EXIT_FAILURE);
  };
  ;
}


x86 assembly (clang, -O0):
<WriteFileNidxHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x0,%eax
jne    1181 <WriteFileNidxHeader+0x51>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x0,%eax
jne    11b8 <WriteFileNidxHeader+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteFileNidxHeader>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
test   %eax,%eax
je     1181 <WriteFileNidxHeader+0x51>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
test   %eax,%eax
je     1181 <WriteFileNidxHeader+0x51>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
call   1030 <perror@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @WriteFileNidxHeader(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i32* %7, i32 4, i32 1, i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = call i32 @perror(i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %3
%17 = load i32*, i32** %4
%18 = call i32 @fwrite(i32* %6, i32 4, i32 1, i32* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %25, label %20
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i32 @perror(i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %16
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @WriteFileNidxHeader(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %2, i32* %4
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = tail call i32 @perror(i8* %1)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %3
%14 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %0)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = tail call i32 @perror(i8* %1)
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %13
ret void
}