#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 l_saveCoordsToFile(int /*<<< orphan*/ *, char *, int, int, long, int,
                       char *);
scalar_t__ tt_chktop(int *, long *);
int tt_saveCoordsToFile(FILE *outfile, char *buf, int maxLen, int table,
                        long top, int isOrig, char *sep) {
  if (tt_chktop(&table, &top))
    return -5;
  return l_saveCoordsToFile(outfile, buf, maxLen, table, top, isOrig, sep);
}


x86 assembly (clang, -O0):
<tt_saveCoordsToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <tt_chktop@plt>
cmp    $0x0,%rax
je     1165 <tt_saveCoordsToFile+0x45>
movl   $0xfffffffb,-0x4(%rbp)
jmp    118b <tt_saveCoordsToFile+0x6b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <l_saveCoordsToFile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tt_saveCoordsToFile>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %ecx,0xc(%rsp)
mov    %r8,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <tt_chktop@plt>
mov    %rax,%rcx
mov    $0xfffffffb,%eax
test   %rcx,%rcx
jne    117e <tt_saveCoordsToFile+0x5e>
mov    0x40(%rsp),%rax
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%r8
mov    %rax,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%r9d
call   1040 <l_saveCoordsToFile@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tt_saveCoordsToFile(i32* %0, i8* %1, i32 %2, i32 %3, i64 %4, i32 %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
store i32* %0, i32** %9
store i8* %1, i8** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i64 %4, i64* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
%16 = call i64 @tt_chktop(i32* %12, i64* %13)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %7
store i32 -5, i32* %8
br label %28
19: ; preds = %7
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i64, i64* %13
%25 = load i32, i32* %14
%26 = load i8*, i8** %15
%27 = call i32 @l_saveCoordsToFile(i32* %20, i8* %21, i32 %22, i32 %23, i64 %24, i32 %25, i8* %26)
store i32 %27, i32* %8
br label %28
28: ; preds = %19, %18
%29 = load i32, i32* %8
ret i32 %29
}

LLVM IR (-O2):
define i32 @tt_saveCoordsToFile(i32* %0, i8* %1, i32 %2, i32 %3, i64 %4, i32 %5, i8* %6) {
%8 = alloca i32
%9 = alloca i64
store i32 %3, i32* %8
store i64 %4, i64* %9
%10 = call i64 @tt_chktop(i32* %8, i64* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i32, i32* %8
%14 = load i64, i64* %9
%15 = call i32 @l_saveCoordsToFile(i32* %0, i8* %1, i32 %2, i32 %13, i64 %14, i32 %5, i8* %6)
br label %16
16: ; preds = %7, %12
%17 = phi i32 [ %15, %12 ], [ -5, %7 ]
ret i32 %17
}