#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*/ fail(char *);
int /*<<< orphan*/ read_derived(char *);
int /*<<< orphan*/ read_table(char *);
int /*<<< orphan*/ read_ucnid(char *);
int /*<<< orphan*/ write_context_switch();
int /*<<< orphan*/ write_copyright();
int /*<<< orphan*/ write_table();
int main(int argc, char **argv) {
  if (argc != 4)
    fail("too few arguments to makeucn");
  read_ucnid(argv[1]);
  read_table(argv[2]);
  read_derived(argv[3]);
  write_copyright();
  write_table();
  write_context_switch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     119c <main+0x2c>
lea    0xe69(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <read_ucnid@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <read_table@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <read_derived@plt>
mov    $0x0,%al
call   1040 <write_copyright@plt>
mov    $0x0,%al
call   1090 <write_table@plt>
mov    $0x0,%al
call   1060 <write_context_switch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
je     1185 <main+0x15>
lea    0xe80(%rip),%rdi
call   1030 <fail@plt>
mov    0x8(%rbx),%rdi
call   1070 <read_ucnid@plt>
mov    0x10(%rbx),%rdi
call   1050 <read_table@plt>
mov    0x18(%rbx),%rdi
call   1080 <read_derived@plt>
xor    %eax,%eax
call   1040 <write_copyright@plt>
xor    %eax,%eax
call   1090 <write_table@plt>
xor    %eax,%eax
call   1060 <write_context_switch@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"too few arguments to makeucn\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @fail(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @read_ucnid(i8* %13)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @read_table(i8* %17)
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 3
%21 = load i8*, i8** %20
%22 = call i32 @read_derived(i8* %21)
%23 = call i32 (...) @write_copyright()
%24 = call i32 (...) @write_table()
%25 = call i32 (...) @write_context_switch()
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"too few arguments to makeucn\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fail(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @read_ucnid(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @read_table(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @read_derived(i8* %14)
%16 = tail call i32 (...) @write_copyright()
%17 = tail call i32 (...) @write_table()
%18 = tail call i32 (...) @write_context_switch()
ret i32 0
}