#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*/ Com_Frame();
int /*<<< orphan*/ Com_Init(char *);
int /*<<< orphan*/ strcat(char *, char *);
int main(int argc, char **argv) {
  char buf[1024] = "";
  unsigned i;
  for (i = 0; i < argc; ++i)
    strcat(buf, argv[i]);
  Com_Init(buf);
  while (1) {
    Com_Frame();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movl   $0x0,-0x414(%rbp)
mov    -0x414(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    11b3 <main+0x73>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x414(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
call   1060 <strcat@plt>
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    1176 <main+0x36>
lea    -0x410(%rbp),%rdi
call   1030 <Com_Init@plt>
mov    $0x0,%al
call   1050 <Com_Frame@plt>
jmp    11bf <main+0x7f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1040 <memset@plt>
test   %ebp,%ebp
je     1185 <main+0x45>
mov    %ebp,%ebp
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1170 <main+0x30>
mov    %rsp,%rdi
call   1030 <Com_Init@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <Com_Frame@plt>
jmp    1190 <main+0x50>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [1024 x i8]* %6 to i8*
store i32 0, i32* %7
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = load i8**, i8*** %5
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @strcat(i8* %14, i8* %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %9
24: ; preds = %9
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%26 = call i32 @Com_Init(i8* %25)
br label %27
27: ; preds = %24, %27
%28 = call i32 (...) @Com_Frame()
br label %27
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @strcat(i8* %4, i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
%16 = call i32 @Com_Init(i8* %4)
br label %17
17: ; preds = %17, %15
%18 = call i32 (...) @Com_Frame()
br label %17
}