#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 */
char *calloc(int, int);
int /*<<< orphan*/ strcat(char *, char *);
char *compose_add_user(char *name, char *password) {
  char *execStr = calloc(400, 1);
  strcat(execStr, "INSERT INTO users VALUES ( \"");
  strcat(execStr, name);
  strcat(execStr, "\", \"");
  strcat(execStr, password);
  strcat(execStr, "\");");
  return execStr;
}


x86 assembly (clang, -O0):
<compose_add_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x190,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_add_user>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x190,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"INSERT INTO users VALUES ( \22\00"
@.str.1 = [5 x i8] c"\22, \22\00"
@.str.2 = [4 x i8] c"\22);\00"
define i8* @compose_add_user(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @calloc(i32 400, i32 1)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @strcat(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"INSERT INTO users VALUES ( \22\00"
@.str.1 = [5 x i8] c"\22, \22\00"
@.str.2 = [4 x i8] c"\22);\00"
define i8* @compose_add_user(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(400) i8* @calloc(i32 400, i32 1)
%4 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %3, i8* %0)
%6 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %3, i8* %1)
%8 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i8* %3
}