#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 */

/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoSaveRxnfile(int, int);
char *indigoToString(int);
int indigoWriteBuffer();
__attribute__((visibility("default"))) const char *indigoRxnfile(int molecule) {
  int b = indigoWriteBuffer();
  const char *res;
  if (b == -1)
    return 0;
  if (indigoSaveRxnfile(molecule, b) == -1)
    return 0;
  res = indigoToString(b);
  indigoFree(b);
  return res;
}


x86 assembly (clang, -O0):
<indigoRxnfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1060 <indigoWriteBuffer@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    116c <indigoRxnfile+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    11a9 <indigoRxnfile+0x69>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <indigoSaveRxnfile@plt>
cmp    $0xffffffff,%eax
jne    118d <indigoRxnfile+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    11a9 <indigoRxnfile+0x69>
mov    -0x10(%rbp),%edi
call   1050 <indigoToString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <indigoFree@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoRxnfile>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <indigoWriteBuffer@plt>
cmp    $0xffffffff,%eax
je     1177 <indigoRxnfile+0x37>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <indigoSaveRxnfile@plt>
cmp    $0xffffffff,%eax
je     1177 <indigoRxnfile+0x37>
mov    %ebx,%edi
call   1050 <indigoToString@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1030 <indigoFree@plt>
mov    %rbp,%rax
jmp    1179 <indigoRxnfile+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @indigoRxnfile(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
%6 = call i32 (...) @indigoWriteBuffer()
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %22
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @indigoSaveRxnfile(i32 %11, i32 %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %10
store i8* null, i8** %2
br label %22
16: ; preds = %10
%17 = load i32, i32* %4
%18 = call i8* @indigoToString(i32 %17)
store i8* %18, i8** %5
%19 = load i32, i32* %4
%20 = call i32 @indigoFree(i32 %19)
%21 = load i8*, i8** %5
store i8* %21, i8** %2
br label %22
22: ; preds = %16, %15, %9
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @indigoRxnfile(i32 %0) {
%2 = tail call i32 (...) @indigoWriteBuffer()
%3 = icmp eq i32 %2, -1
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @indigoSaveRxnfile(i32 %0, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i8* @indigoToString(i32 %2)
%9 = tail call i32 @indigoFree(i32 %2)
br label %10
10: ; preds = %4, %1, %7
%11 = phi i8* [ %8, %7 ], [ null, %1 ], [ null, %4 ]
ret i8* %11
}