#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*/ assert(char *);
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
char *strcat(char *, char *);
char *strncat(char *, char *, int);
int /*<<< orphan*/ system(char *);
void sshLogin(char *uname, char *hostname) {
  printf("Executing...\n");
  char *cmd = calloc(220, sizeof(char));
  assert(cmd);
  cmd[0] = '\0';
  char *path = "./.scripts/.sshLogin ";
  char *userSpace = "-u ";
  char *hostSpace = " -h ";
  cmd = strcat(cmd, path);
  cmd = strcat(cmd, userSpace);
  cmd = strncat(cmd, uname, 30);
  cmd = strcat(cmd, hostSpace);
  cmd = strncat(cmd, hostname, 50);
  system(cmd);
  free(cmd);
}


x86 assembly (clang, -O0):
<sshLogin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
mov    $0xdc,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <assert@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
lea    0xe58(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe63(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe5c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x1e,%edx
call   1060 <strncat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1090 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x32,%edx
call   1060 <strncat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <system@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshLogin>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
mov    $0xdc,%edi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <assert@plt>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
call   1050 <strlen@plt>
movabs $0x206e69676f4c68,%rcx
mov    %rcx,0xe(%rbx,%rax,1)
movups 0xe3e(%rip),%xmm0
movups %xmm0,(%rbx,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
movl   $0x20752d,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1e,%edx
call   1070 <strncat@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
movl   $0x20682d20,(%rbx,%rax,1)
movb   $0x0,0x4(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x32,%edx
call   1070 <strncat@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Executing...\0A\00"
@.str.1 = [22 x i8] c"./.scripts/.sshLogin \00"
@.str.2 = [4 x i8] c"-u \00"
@.str.3 = [5 x i8] c" -h \00"
define void @sshLogin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = call i8* @calloc(i32 220, i32 1)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 @assert(i8* %11)
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %8
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i8* @strcat(i8* %15, i8* %16)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = call i8* @strcat(i8* %18, i8* %19)
store i8* %20, i8** %5
%21 = load i8*, i8** %5
%22 = load i8*, i8** %3
%23 = call i8* @strncat(i8* %21, i8* %22, i32 30)
store i8* %23, i8** %5
%24 = load i8*, i8** %5
%25 = load i8*, i8** %8
%26 = call i8* @strcat(i8* %24, i8* %25)
store i8* %26, i8** %5
%27 = load i8*, i8** %5
%28 = load i8*, i8** %4
%29 = call i8* @strncat(i8* %27, i8* %28, i32 50)
store i8* %29, i8** %5
%30 = load i8*, i8** %5
%31 = call i32 @system(i8* %30)
%32 = load i8*, i8** %5
%33 = call i32 @free(i8* %32)
ret void
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"./.scripts/.sshLogin \00"
@.str.3 = [5 x i8] c" -h \00"
@str = [13 x i8] c"Executing...\00"
define void @sshLogin(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call dereferenceable_or_null(220) i8* @calloc(i32 220, i32 1)
%5 = tail call i32 @assert(i8* %4)
store i8 0, i8* %4
%6 = tail call i64 @strlen(i8* %4)
%7 = getelementptr i8, i8* %4, i64 %6
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(22) %7, i8* align 1 dereferenceable(22) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 22, i1 false)
%8 = tail call i64 @strlen(i8* %4)
%9 = getelementptr i8, i8* %4, i64 %8
%10 = bitcast i8* %9 to i32*
store i32 2127149, i32* %10
%11 = tail call i8* @strncat(i8* %4, i8* %0, i32 30)
%12 = tail call i64 @strlen(i8* dereferenceable(1) %11)
%13 = getelementptr i8, i8* %11, i64 %12
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %13, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 5, i1 false)
%14 = tail call i8* @strncat(i8* %11, i8* %1, i32 50)
%15 = tail call i32 @system(i8* %14)
%16 = tail call i32 @free(i8* %14)
ret void
}