#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*/ sprintf(char *, char *, char *);
char *strchr(char *, char);
void createLoginString(char *user, char *pass, char *sck, char *dest) {
  char *aux = dest;
  sprintf(aux, "%s", user);
  aux = (strchr(dest, '\0') + 1);
  sprintf(aux, "%s", pass);
  aux = (strchr(aux, '\0') + 1);
  sprintf(aux, "%s", sck);
}


x86 assembly (clang, -O0):
<createLoginString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe63(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createLoginString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%r12
add    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    (%rax,%r12,1),%rdi
add    $0x2,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @createLoginString(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
store i8* %10, i8** %9
%11 = load i8*, i8** %9
%12 = load i8*, i8** %5
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %8
%15 = call i8* @strchr(i8* %14, i8 signext 0)
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %9
%17 = load i8*, i8** %9
%18 = load i8*, i8** %6
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %9
%21 = call i8* @strchr(i8* %20, i8 signext 0)
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8* %22, i8** %9
%23 = load i8*, i8** %9
%24 = load i8*, i8** %7
%25 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
ret void
}

LLVM IR (-O2):
define void @createLoginString(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* %3) {
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%7 = getelementptr i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i8* @strcpy(i8* %8, i8* dereferenceable(1) %1)
%10 = tail call i64 @strlen(i8* %8)
%11 = getelementptr i8, i8* %8, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = tail call i8* @strcpy(i8* %12, i8* dereferenceable(1) %2)
ret void
}