#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*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
main() {
  int k;
  char str1[] = "Slobomir";
  char *str2 = "FIT";
  char str3[101];
  char str4[] = {'O', 's', 'n', 'o', 'v', 'i', '\0'};
  strcpy(str3, str2);
  printf("str3 = %s\n", str3);
  strcat(str3, ", ");
  strcat(str3, str1);
  printf("str3 = %s\n", str3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xebe(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x5(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x87(%rbp)
mov    0xea4(%rip),%ax
mov    %ax,-0x83(%rbp)
mov    0xe99(%rip),%al
mov    %al,-0x81(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x80(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x80(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movabs $0x72696d6f626f6c53,%rax
6d 69 72
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xeb8(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xea8(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str1 = [9 x i8] c"Slobomir\00"
@.str = [4 x i8] c"FIT\00"
@__const.main.str4 = [7 x i8] c"Osnovi\00"
@.str.1 = [11 x i8] c"str3 = %s\0A\00"
@.str.2 = [3 x i8] c", \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca i8*
%4 = alloca [101 x i8]
%5 = alloca [7 x i8]
%6 = bitcast [9 x i8]* %2 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%7 = bitcast [7 x i8]* %5 to i8*
%8 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [9 x i8] c"Slobomir\00"
@.str = [4 x i8] c"FIT\00"
@.str.1 = [11 x i8] c"str3 = %s\0A\00"
@.str.2 = [3 x i8] c", \00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @strcat(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}