#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*/ g_error(char *, char *);
int /*<<< orphan*/ g_message(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ tit2tui_module(char *, char *);
int main(int argc, char *argv[]) {
  char szIn[40];
  char szOut[40];
  if (argc != 3) {
    g_error("Usage: tit2tui", "[tit file name] [tui file name]");
    return 0;
  } else {
    g_message("Converting...");
  }
  strcpy(szIn, argv[1]);
  strcpy(szOut, argv[2]);
  tit2tui_module(szIn, szOut);
  g_message("Convert successed!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     117f <main+0x3f>
lea    0xe99(%rip),%rdi
lea    0xea1(%rip),%rsi
call   1050 <g_error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11cd <main+0x8d>
lea    0xea9(%rip),%rdi
call   1060 <g_message@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <tit2tui_module@plt>
lea    0xe7c(%rip),%rdi
call   1060 <g_message@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
cmp    $0x3,%edi
jne    1194 <main+0x54>
mov    %rsi,%rbx
lea    0xed9(%rip),%rdi
call   1060 <g_message@plt>
mov    0x8(%rbx),%rsi
lea    0x30(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <tit2tui_module@plt>
lea    0xeb0(%rip),%rdi
call   1060 <g_message@plt>
jmp    11a7 <main+0x67>
lea    0xe65(%rip),%rdi
lea    0xe6d(%rip),%rsi
call   1050 <g_error@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Usage: tit2tui\00"
@.str.1 = [32 x i8] c"[tit file name] [tui file name]\00"
@.str.2 = [14 x i8] c"Converting...\00"
@.str.3 = [19 x i8] c"Convert successed!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [40 x i8]
%7 = alloca [40 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @g_error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %29
12: ; preds = %2
%13 = call i32 @g_message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcpy(i8* %15, i8* %18)
%20 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @strcpy(i8* %20, i8* %23)
%25 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%27 = call i32 @tit2tui_module(i8* %25, i8* %26)
%28 = call i32 @g_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %29
29: ; preds = %14, %10
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [15 x i8] c"Usage: tit2tui\00"
@.str.1 = [32 x i8] c"[tit file name] [tui file name]\00"
@.str.2 = [14 x i8] c"Converting...\00"
@.str.3 = [19 x i8] c"Convert successed!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [40 x i8]
%4 = alloca [40 x i8]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @g_error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %20
10: ; preds = %2
%11 = tail call i32 @g_message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcpy(i8* %5, i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %6, i8* %16)
%18 = call i32 @tit2tui_module(i8* %5, i8* %6)
%19 = call i32 @g_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %10, %8
ret i32 0
}