#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 */
struct mntent {
  char *mnt_fsname;
  char *mnt_dir;
  char *mnt_type;
  char *mnt_opts;
  int mnt_freq;
  int mnt_passno;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, char *, char *, char *, char *,
                   int, int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int addmntent(FILE *f, const struct mntent *mnt) {
  fseek(f, 0, SEEK_END);
  return fprintf(f, "%s\t%s\t%s\t%s\t%d\t%d\n", mnt->mnt_fsname, mnt->mnt_dir,
                 mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq,
                 mnt->mnt_passno) < 0;
}


x86 assembly (clang, -O0):
<addmntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r9
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%r10d
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%eax
lea    0xe83(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addmntent>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    (%rbx),%rdx
mov    0x8(%rbx),%rcx
mov    0x10(%rbx),%r8
mov    0x18(%rbx),%r9
mov    0x20(%rbx),%eax
mov    0x24(%rbx),%ebx
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
push   %rbx
push   %rax
call   1030 <fprintf@plt>
add    $0x10,%rsp
shr    $0x3f,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mntent = type { i8*, i8*, i8*, i8*, i32, i32 }
@SEEK_END = global i32 0
@.str = [19 x i8] c"%s\09%s\09%s\09%s\09%d\09%d\0A\00"
define i32 @addmntent(i32* %0, %struct.mntent* %1) {
%3 = alloca i32*
%4 = alloca %struct.mntent*
store i32* %0, i32** %3
store %struct.mntent* %1, %struct.mntent** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @SEEK_END
%7 = call i32 @fseek(i32* %5, i32 0, i32 %6)
%8 = load i32*, i32** %3
%9 = load %struct.mntent*, %struct.mntent** %4
%10 = getelementptr inbounds %struct.mntent, %struct.mntent* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = load %struct.mntent*, %struct.mntent** %4
%13 = getelementptr inbounds %struct.mntent, %struct.mntent* %12, i32 0, i32 1
%14 = load i8*, i8** %13
%15 = load %struct.mntent*, %struct.mntent** %4
%16 = getelementptr inbounds %struct.mntent, %struct.mntent* %15, i32 0, i32 2
%17 = load i8*, i8** %16
%18 = load %struct.mntent*, %struct.mntent** %4
%19 = getelementptr inbounds %struct.mntent, %struct.mntent* %18, i32 0, i32 3
%20 = load i8*, i8** %19
%21 = load %struct.mntent*, %struct.mntent** %4
%22 = getelementptr inbounds %struct.mntent, %struct.mntent* %21, i32 0, i32 4
%23 = load i32, i32* %22
%24 = load %struct.mntent*, %struct.mntent** %4
%25 = getelementptr inbounds %struct.mntent, %struct.mntent* %24, i32 0, i32 5
%26 = load i32, i32* %25
%27 = call i64 @fprintf(i32* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %14, i8* %17, i8* %20, i32 %23, i32 %26)
%28 = icmp slt i64 %27, 0
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
%struct.mntent = type { i8*, i8*, i8*, i8*, i32, i32 }
@SEEK_END = global i32 0
@.str = [19 x i8] c"%s\09%s\09%s\09%s\09%d\09%d\0A\00"
define i32 @addmntent(i32* nocapture %0, %struct.mntent* nocapture %1) {
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 4
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.mntent, %struct.mntent* %1, i64 0, i32 5
%16 = load i32, i32* %15
%17 = tail call i64 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i8* %10, i8* %12, i32 %14, i32 %16)
%18 = lshr i64 %17, 63
%19 = trunc i64 %18 to i32
ret i32 %19
}