#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 IOcontext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ IO_readInput(struct IOcontext *);
struct IOcontext *IOcontext_create(int, char **);
int /*<<< orphan*/ IOcontext_free(struct IOcontext **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct IOcontext *ioc = IOcontext_create(argc, argv);
  if (ioc == NULL) {
    exit(EXIT_FAILURE);
  }
  IO_readInput(ioc);
  IOcontext_free(&ioc);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <IOcontext_create@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <main+0x3f>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IO_readInput@plt>
lea    -0x18(%rbp),%rdi
call   1060 <IOcontext_free@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <IOcontext_create@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     116a <main+0x2a>
mov    %rax,%rdi
call   1030 <IO_readInput@plt>
mov    %rsp,%rdi
call   1060 <IOcontext_free@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.IOcontext = type { i32 }
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.IOcontext*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call %struct.IOcontext* @IOcontext_create(i32 %7, i8** %8)
store %struct.IOcontext* %9, %struct.IOcontext** %6
%10 = load %struct.IOcontext*, %struct.IOcontext** %6
%11 = icmp eq %struct.IOcontext* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load %struct.IOcontext*, %struct.IOcontext** %6
%17 = call i32 @IO_readInput(%struct.IOcontext* %16)
%18 = call i32 @IOcontext_free(%struct.IOcontext** %6)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
%struct.IOcontext = type { i32 }
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.IOcontext*
%4 = bitcast %struct.IOcontext** %3 to i8*
%5 = tail call %struct.IOcontext* @IOcontext_create(i32 %0, i8** %1)
store %struct.IOcontext* %5, %struct.IOcontext** %3
%6 = icmp eq %struct.IOcontext* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = tail call i32 @IO_readInput(%struct.IOcontext* %5)
%12 = call i32 @IOcontext_free(%struct.IOcontext** %3)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}