#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 */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ change_arr_str(char *, char, int);
int /*<<< orphan*/ change_arr_str_other(char *, char, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_arr_str(char *, int);
int main(int argv, char **argc) {
  char arr[10];
  int arr_len = sizeof(arr);
  int i;
  for (i = 0; i < arr_len; i++) {
    arr[i] = 'b';
  }
  print_arr_str(arr, arr_len);
  char char_c = 'c';
  change_arr_str(arr, char_c, arr_len);
  print_arr_str(arr, arr_len);
  char char_d = 'd';
  change_arr_str_other(arr, char_d, arr_len);
  print_arr_str(arr, arr_len);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1187 <main+0x47>
movslq -0x24(%rbp),%rax
movb   $0x62,-0x1a(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1164 <main+0x24>
lea    -0x1a(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1060 <print_arr_str@plt>
movb   $0x63,-0x25(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x25(%rbp),%al
mov    -0x20(%rbp),%edx
movsbl %al,%esi
call   1040 <change_arr_str@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1060 <print_arr_str@plt>
movb   $0x64,-0x26(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x26(%rbp),%al
mov    -0x20(%rbp),%edx
movsbl %al,%esi
call   1030 <change_arr_str_other@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1060 <print_arr_str@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6262626262626262,%rax
62 62 62
mov    %rax,(%rsp)
movw   $0x6262,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <print_arr_str@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    $0xa,%edx
call   1040 <change_arr_str@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <print_arr_str@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0xa,%edx
call   1030 <change_arr_str_other@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <print_arr_str@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %7
store i32 0, i32* %8
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %17
store i8 98, i8* %18
br label %19
19: ; preds = %15
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %11
22: ; preds = %11
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%24 = load i32, i32* %7
%25 = call i32 @print_arr_str(i8* %23, i32 %24)
store i8 99, i8* %9
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%27 = load i8, i8* %9
%28 = load i32, i32* %7
%29 = call i32 @change_arr_str(i8* %26, i8 signext %27, i32 %28)
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%31 = load i32, i32* %7
%32 = call i32 @print_arr_str(i8* %30, i32 %31)
store i8 100, i8* %10
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%34 = load i8, i8* %10
%35 = load i32, i32* %7
%36 = call i32 @change_arr_str_other(i8* %33, i8 signext %34, i32 %35)
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%38 = load i32, i32* %7
%39 = call i32 @print_arr_str(i8* %37, i32 %38)
%40 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @print_arr_str(i8* %5, i32 10)
%7 = call i32 @change_arr_str(i8* %5, i8 signext 99, i32 10)
%8 = call i32 @print_arr_str(i8* %5, i32 10)
%9 = call i32 @change_arr_str_other(i8* %5, i8 signext 100, i32 10)
%10 = call i32 @print_arr_str(i8* %5, i32 10)
%11 = call i32 @exit(i32 0)
unreachable
}