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

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct mt *);
int /*<<< orphan*/ mt_print_mt(struct mt *);
struct mt *mt_read_nc(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("nc file not specified\n");
    exit(EXIT_SUCCESS);
  }
  struct mt *mt = mt_read_nc(argv[1]);
  mt_print_mt(mt);
  free(mt);
  exit(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)
cmpl   $0x2,-0x8(%rbp)
jge    118a <main+0x3a>
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <mt_read_nc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <mt_print_mt@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1164 <main+0x14>
lea    0xea3(%rip),%rdi
call   1050 <puts@plt>
jmp    1180 <main+0x30>
mov    0x8(%rsi),%rdi
call   1040 <mt_read_nc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <mt_print_mt@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.mt = type { i32 }
@.str = [23 x i8] c"nc file not specified\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.mt*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call %struct.mt* @mt_read_nc(i8* %16)
store %struct.mt* %17, %struct.mt** %6
%18 = load %struct.mt*, %struct.mt** %6
%19 = call i32 @mt_print_mt(%struct.mt* %18)
%20 = load %struct.mt*, %struct.mt** %6
%21 = call i32 @free(%struct.mt* %20)
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
}

LLVM IR (-O2):
%struct.mt = type { i32 }
@EXIT_SUCCESS = global i32 0
@str = [22 x i8] c"nc file not specified\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call %struct.mt* @mt_read_nc(i8* %10)
%12 = tail call i32 @mt_print_mt(%struct.mt* %11)
%13 = tail call i32 @free(%struct.mt* %11)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = tail call i32 @exit(i32 %14)
unreachable
}