#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void main(int argc, char *argv[]) {
  char *cmd;
  cmd = (char *)malloc(100 * sizeof(char));
  if (argc >= 3) {
    strcpy(cmd, "Server --username ");
    strcat(cmd, argv[1]);
    strcat(cmd, " --password ");
    strcat(cmd, argv[2]);
    strcat(cmd, " -p ");
    strcat(cmd, argv[3]);
  }
  while (1) {
    system(cmd);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x3,-0x4(%rbp)
jl     11ca <main+0x8a>
mov    -0x18(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1060 <strcat@plt>
jmp    11cf <main+0x8f>
mov    -0x18(%rbp),%rdi
call   1040 <system@plt>
jmp    11cf <main+0x8f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
cmp    $0x3,%ebp
jl     11b0 <main+0x70>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x8(%r14),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    0x10(%r14),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    0x18(%r14),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <system@plt>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@.str = [19 x i8] c"Server --username \00"
@.str.1 = [13 x i8] c" --password \00"
@.str.2 = [5 x i8] c" -p \00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i64 @malloc(i32 100)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 3
br i1 %9, label %10, label %32
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcat(i8* %13, i8* %16)
%18 = load i8*, i8** %5
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%20 = load i8*, i8** %5
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @strcat(i8* %20, i8* %23)
%25 = load i8*, i8** %5
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%27 = load i8*, i8** %5
%28 = load i8**, i8*** %4
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
%31 = call i32 @strcat(i8* %27, i8* %30)
br label %32
32: ; preds = %10, %2
br label %33
33: ; preds = %32, %33
%34 = load i8*, i8** %5
%35 = call i32 @system(i8* %34)
br label %33
}

LLVM IR (-O2):
@.str = [19 x i8] c"Server --username \00"
@.str.1 = [13 x i8] c" --password \00"
@.str.2 = [5 x i8] c" -p \00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strcat(i8* %4, i8* %9)
%11 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @strcat(i8* %4, i8* %13)
%15 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = tail call i32 @strcat(i8* %4, i8* %17)
br label %19
19: ; preds = %6, %2
br label %20
20: ; preds = %19, %20
%21 = tail call i32 @system(i8* %4)
br label %20
}