#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 indigoLoadMoleculeFromString(char *);
int /*<<< orphan*/ indigoRender(int, int);
int /*<<< orphan*/ indigoRenderToFile(int, char *);
int /*<<< orphan*/ indigoSetOption(char *, char *);
int /*<<< orphan*/ indigoToBuffer(int, char **, int *);
int indigoWriteBuffer();
void testHDC() {
  int buffer_object;
  char *raw_ptr;
  int size;
  int hdc_buffer_object;
  int molecule;
  molecule = indigoLoadMoleculeFromString("C1=CC=CC=C1");
  indigoSetOption("render-output-format", "png");
  indigoSetOption("render-background-color", "255, 255, 255");
  indigoRenderToFile(molecule, "indigo-renderer-test.png");
  buffer_object = indigoWriteBuffer();
  indigoRender(molecule, buffer_object);
  indigoToBuffer(buffer_object, &raw_ptr, &size);
  indigoFree(buffer_object);
  indigoFree(molecule);
}


x86 assembly (clang, -O0):
<testHDC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe81(%rip),%rdi
call   1030 <indigoLoadMoleculeFromString@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe7e(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1080 <indigoSetOption@plt>
lea    0xe80(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1080 <indigoSetOption@plt>
mov    -0x1c(%rbp),%edi
lea    0xe90(%rip),%rsi
call   1090 <indigoRenderToFile@plt>
mov    $0x0,%al
call   1070 <indigoWriteBuffer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <indigoRender@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <indigoToBuffer@plt>
mov    -0x4(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x1c(%rbp),%edi
call   1040 <indigoFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHDC>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xe83(%rip),%rdi
call   1030 <indigoLoadMoleculeFromString@plt>
mov    %eax,%ebx
lea    0xe81(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1080 <indigoSetOption@plt>
lea    0xe83(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1080 <indigoSetOption@plt>
lea    0xe96(%rip),%rsi
mov    %ebx,%edi
call   1090 <indigoRenderToFile@plt>
xor    %eax,%eax
call   1070 <indigoWriteBuffer@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <indigoRender@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %ebp,%edi
call   1060 <indigoToBuffer@plt>
mov    %ebp,%edi
call   1040 <indigoFree@plt>
mov    %ebx,%edi
call   1040 <indigoFree@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"C1=CC=CC=C1\00"
@.str.1 = [21 x i8] c"render-output-format\00"
@.str.2 = [4 x i8] c"png\00"
@.str.3 = [24 x i8] c"render-background-color\00"
@.str.4 = [14 x i8] c"255, 255, 255\00"
@.str.5 = [25 x i8] c"indigo-renderer-test.png\00"
define void @testHDC() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @indigoLoadMoleculeFromString(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %5
%7 = call i32 @indigoSetOption(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @indigoSetOption(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%9 = load i32, i32* %5
%10 = call i32 @indigoRenderToFile(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (...) @indigoWriteBuffer()
store i32 %11, i32* %1
%12 = load i32, i32* %5
%13 = load i32, i32* %1
%14 = call i32 @indigoRender(i32 %12, i32 %13)
%15 = load i32, i32* %1
%16 = call i32 @indigoToBuffer(i32 %15, i8** %2, i32* %3)
%17 = load i32, i32* %1
%18 = call i32 @indigoFree(i32 %17)
%19 = load i32, i32* %5
%20 = call i32 @indigoFree(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"C1=CC=CC=C1\00"
@.str.1 = [21 x i8] c"render-output-format\00"
@.str.2 = [4 x i8] c"png\00"
@.str.3 = [24 x i8] c"render-background-color\00"
@.str.4 = [14 x i8] c"255, 255, 255\00"
@.str.5 = [25 x i8] c"indigo-renderer-test.png\00"
define void @testHDC() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @indigoLoadMoleculeFromString(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @indigoSetOption(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @indigoSetOption(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @indigoRenderToFile(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 (...) @indigoWriteBuffer()
%10 = tail call i32 @indigoRender(i32 %5, i32 %9)
%11 = call i32 @indigoToBuffer(i32 %9, i8** %1, i32* %2)
%12 = call i32 @indigoFree(i32 %9)
%13 = call i32 @indigoFree(i32 %5)
ret void
}