#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*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ replace_first_char(char *, char *);
int main(void) {
  char str1[] = "Jerry";
  char str2[] = "Terry";
  ft_putstr(str1);
  ft_putchar('\n');
  ft_putstr(str2);
  ft_putchar('\n');
  replace_first_char(str1, str2);
  ft_putstr(str1);
  ft_putchar('\n');
  ft_putstr(str2);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xea7(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0xa(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
lea    -0x10(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
lea    -0xa(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <replace_first_char@plt>
lea    -0xa(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
lea    -0x10(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x79,0x14(%rsp)
movl   $0x7272654a,0x10(%rsp)
72
movw   $0x79,0xc(%rsp)
movl   $0x72726554,0x8(%rsp)
72
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <replace_first_char@plt>
mov    %r14,%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
mov    %rbx,%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str1 = [6 x i8] c"Jerry\00"
@__const.main.str2 = [6 x i8] c"Terry\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @ft_putstr(i8* %6)
%8 = call i32 @ft_putchar(i8 signext 10)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = call i32 @ft_putstr(i8* %9)
%11 = call i32 @ft_putchar(i8 signext 10)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%14 = call i32 @replace_first_char(i8* %12, i8* %13)
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%16 = call i32 @ft_putstr(i8* %15)
%17 = call i32 @ft_putchar(i8 signext 10)
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%19 = call i32 @ft_putstr(i8* %18)
%20 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [6 x i8] c"Jerry\00"
@__const.main.str2 = [6 x i8] c"Terry\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @ft_putstr(i8* %3)
%6 = call i32 @ft_putchar(i8 signext 10)
%7 = call i32 @ft_putstr(i8* %4)
%8 = call i32 @ft_putchar(i8 signext 10)
%9 = call i32 @replace_first_char(i8* %3, i8* %4)
%10 = call i32 @ft_putstr(i8* %3)
%11 = call i32 @ft_putchar(i8 signext 10)
%12 = call i32 @ft_putstr(i8* %4)
%13 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}