#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 *, ...);
int main() {
  int numbers[4] = {0};
  char name[4] = {'a'};
  printf("numbers: %d %d %d %d\n", numbers[0], numbers[1], numbers[2],
         numbers[3]);
  printf("name each: %c %c %c %c\n", name[0], name[1], name[2], name[3]);
  printf("name %s\n", name);
  numbers[0] = 1;
  numbers[1] = 2;
  numbers[2] = 3;
  numbers[3] = 4;
  name[0] = 'A';
  name[1] = 'B';
  name[2] = 'C';
  name[3] = '\0';
  printf("numbers: %d %d %d %d\n", numbers[0], numbers[1], numbers[2],
         numbers[3]);
  printf("name each: %c %c %c %c\n", name[0], name[1], name[2], name[3]);
  printf("name: %s\n", name);
  char *another = "ABC";
  printf("another: %s\n", another);
  printf("another each: %c %c %c %c\n", another[0], another[1], another[2],
         another[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0xebb(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x24(%rbp),%esi
movsbl -0x23(%rbp),%edx
movsbl -0x22(%rbp),%ecx
movsbl -0x21(%rbp),%r8d
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x24(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
movb   $0x41,-0x24(%rbp)
movb   $0x42,-0x23(%rbp)
movb   $0x43,-0x22(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x24(%rbp),%esi
movsbl -0x23(%rbp),%edx
movsbl -0x22(%rbp),%ecx
movsbl -0x21(%rbp),%r8d
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x24(%rbp),%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe32(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
movsbl (%rax),%esi
mov    -0x30(%rbp),%rax
movsbl 0x1(%rax),%edx
mov    -0x30(%rbp),%rax
movsbl 0x2(%rax),%ecx
mov    -0x30(%rbp),%rax
movsbl 0x3(%rax),%r8d
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x61,0xc(%rsp)
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%r14
mov    %r14,%rdi
mov    $0x61,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x434241,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xc(%rsp),%esi
movsbl 0xd(%rsp),%edx
movsbl 0xe(%rsp),%ecx
movsbl 0xf(%rsp),%r8d
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
lea    0xe6e(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.name = [4 x i8] c"a\00\00\00"
@.str = [22 x i8] c"numbers: %d %d %d %d\0A\00"
@.str.1 = [24 x i8] c"name each: %c %c %c %c\0A\00"
@.str.2 = [9 x i8] c"name %s\0A\00"
@.str.3 = [10 x i8] c"name: %s\0A\00"
@.str.4 = [4 x i8] c"ABC\00"
@.str.5 = [13 x i8] c"another: %s\0A\00"
@.str.6 = [27 x i8] c"another each: %c %c %c %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast [4 x i8]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %12, i32 %14)
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %21, i32 %24, i32 %27)
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 1, i32* %31
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 2, i32* %32
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
store i32 3, i32* %33
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
store i32 4, i32* %34
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 65, i8* %35
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 66, i8* %36
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 67, i8* %37
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %38
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%40 = load i32, i32* %39
%41 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%42 = load i32, i32* %41
%43 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%44 = load i32, i32* %43
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %42, i32 %44, i32 %46)
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %50, i32 %53, i32 %56, i32 %59)
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %61)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %4
%63 = load i8*, i8** %4
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%65 = load i8*, i8** %4
%66 = getelementptr inbounds i8, i8* %65, i64 0
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = load i8*, i8** %4
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = load i8*, i8** %4
%74 = getelementptr inbounds i8, i8* %73, i64 2
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = load i8*, i8** %4
%78 = getelementptr inbounds i8, i8* %77, i64 3
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %68, i32 %72, i32 %76, i32 %80)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"numbers: %d %d %d %d\0A\00"
@.str.1 = [24 x i8] c"name each: %c %c %c %c\0A\00"
@.str.2 = [9 x i8] c"name %s\0A\00"
@.str.3 = [10 x i8] c"name: %s\0A\00"
@.str.4 = [4 x i8] c"ABC\00"
@.str.5 = [13 x i8] c"another: %s\0A\00"
@.str.6 = [27 x i8] c"another each: %c %c %c %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to [4 x i8]*
%3 = bitcast i32* %1 to i8*
store i32 97, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 97, i32 0, i32 0, i32 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %1)
store i8 65, i8* %3
store i8 66, i8* %5
store i8 67, i8* %6
store i8 0, i8* %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4)
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = load i8, i8* %7
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14, i32 %16, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 65, i32 66, i32 67, i32 0)
ret i32 0
}