#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 *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *compose_get_games_of(char *name) {
  char *execStr = malloc(200);
  strcpy(execStr, "SELECT * FROM game_data WHERE u1=\"");
  strcat(execStr, name);
  strcat(execStr, "\" or u2=\"");
  strcat(execStr, name);
  strcat(execStr, "\";");
  return execStr;
}


x86 assembly (clang, -O0):
<compose_get_games_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_get_games_of>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xc8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"SELECT * FROM game_data WHERE u1=\22\00"
@.str.1 = [10 x i8] c"\22 or u2=\22\00"
@.str.2 = [3 x i8] c"\22;\00"
define i8* @compose_get_games_of(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 200)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcat(i8* %12, i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [35 x i8] c"SELECT * FROM game_data WHERE u1=\22\00"
@.str.1 = [10 x i8] c"\22 or u2=\22\00"
@.str.2 = [3 x i8] c"\22;\00"
define i8* @compose_get_games_of(i8* %0) {
%2 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %2, i8* %0)
%7 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i8* %2
}