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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ icarus(struct ic_opts *);
struct ic_opts *main_args(int, char **);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  struct ic_opts *opts = 0;
  opts = main_args(argc, argv);
  if (!opts) {
    puts("main: option parsing failed");
    exit(1);
  }
  if (!icarus(opts)) {
    puts("main: call to icarus failed");
    exit(1);
  }
  return 0;
}


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)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <main_args@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118f <main+0x4f>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1060 <icarus@plt>
cmp    $0x0,%eax
jne    11b7 <main+0x77>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <main_args@plt>
test   %rax,%rax
je     115b <main+0x1b>
mov    %rax,%rdi
call   1060 <icarus@plt>
test   %eax,%eax
je     1164 <main+0x24>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9e(%rip),%rdi
jmp    116b <main+0x2b>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.ic_opts = type { i32 }
@.str = [28 x i8] c"main: option parsing failed\00"
@.str.1 = [28 x i8] c"main: call to icarus failed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ic_opts*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.ic_opts* null, %struct.ic_opts** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call %struct.ic_opts* @main_args(i32 %7, i8** %8)
store %struct.ic_opts* %9, %struct.ic_opts** %6
%10 = load %struct.ic_opts*, %struct.ic_opts** %6
%11 = icmp ne %struct.ic_opts* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load %struct.ic_opts*, %struct.ic_opts** %6
%17 = call i32 @icarus(%struct.ic_opts* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
%struct.ic_opts = type { i32 }
@.str = [28 x i8] c"main: option parsing failed\00"
@.str.1 = [28 x i8] c"main: call to icarus failed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call %struct.ic_opts* @main_args(i32 %0, i8** %1)
%4 = icmp eq %struct.ic_opts* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @icarus(%struct.ic_opts* %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %8
ret i32 0
}