#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*/ a;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int main() {
  int a[] = {9875, 857, 864, 3654, 643, 353, 763, 64, 47, 46};
  int i;
  a[0] = -10;
  a[6] = 2;
  char s1[] = "Hello";
  s1[3] = '!';
  s1[2] = '!';
  s1[4] = '\0';
  fprintf(stdout, "%d\n", sizeof(a) / sizeof(a[0]));
  fprintf(stdout, "%s\n", s1);
  for (i = 0; i < sizeof(a) / sizeof(a[0]); i++) {
    fprintf(stdout, "a[%d] = %d\n", i, a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xfffffff6,-0x30(%rbp)
movl   $0x2,-0x18(%rbp)
mov    0xed0(%rip),%eax
mov    %eax,-0x3a(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x36(%rbp)
movb   $0x21,-0x37(%rbp)
movb   $0x21,-0x38(%rbp)
movb   $0x0,-0x36(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    -0x3a(%rbp),%rdx
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    $0xa,%rax
jae    11ee <main+0xce>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
lea    0xe59(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x6c6c6548,(%rsp)
movw   $0x6f,0x4(%rsp)
movw   $0x2121,0x2(%rsp)
movb   $0x0,0x4(%rsp)
mov    0x2eab(%rip),%rbx
mov    (%rbx),%edi
lea    0xed4(%rip),%rsi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb3(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea4(%rip),%r14
mov    %r14,%rsi
xor    %edx,%edx
mov    $0xfffffff6,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x359,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x360,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0xe46,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x283,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x161,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x6,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x7,%edx
mov    $0x40,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x8,%edx
mov    $0x2f,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x9,%edx
mov    $0x2e,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 9875, i32 857, i32 864, i32 3654, i32 643, i32 353, i32 763, i32 64, i32 47, i32 46]
@__const.main.s1 = [6 x i8] c"Hello\00"
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [12 x i8] c"a[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca [6 x i8]
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 -10, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 2, i32* %7
%8 = bitcast [6 x i8]* %4 to i8*
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 3
store i8 33, i8* %9
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 2
store i8 33, i8* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 4
store i8 0, i8* %11
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 10)
%14 = load i32, i32* @stdout
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 0, i32* %3
br label %17
17: ; preds = %29, %0
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = icmp ult i64 %19, 10
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = load i32, i32* @stdout
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %27)
br label %29
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [6 x i8] c"Hello\00"
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [12 x i8] c"a[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
store i8 33, i8* %3
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
store i8 33, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
store i8 0, i8* %5
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 10)
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = load i32, i32* @stdout
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 -10)
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 857)
%14 = load i32, i32* @stdout
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 864)
%16 = load i32, i32* @stdout
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 3654)
%18 = load i32, i32* @stdout
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 643)
%20 = load i32, i32* @stdout
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 353)
%22 = load i32, i32* @stdout
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 2)
%24 = load i32, i32* @stdout
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 64)
%26 = load i32, i32* @stdout
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 8, i32 47)
%28 = load i32, i32* @stdout
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 46)
ret i32 0
}