#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 */
char getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int main() {
  int a[5] = {};
  for (int i = 0; i < 5; i++) {
    printf("&a[%d]=%p\n", i, &a[i]);
  }
  printf("&a=%p\n", a);
  printf("%d\n", a[6]);
  printf("\'\\0\' ASCII=%d\n", '\0');
  char b[10] = {};
  for (int j = 0; j < 10; j++) {
    if ((b[j] = getchar()) == '\n') {
      b[j] = '\0';
      break;
    }
  }
  char str[100] = "abcdef";
  for (int k = 0; str[k] != '\0'; k++) {
    printf("%c", str[k]);
  }
  char s[10] = {};
  gets(s);
  puts(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11b1 <main+0x61>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <main+0x29>
lea    -0x20(%rbp),%rsi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe37(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2e(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1241 <main+0xf1>
mov    $0x0,%al
call   1060 <getchar@plt>
movslq -0x34(%rbp),%rcx
mov    %al,-0x2e(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0xa,%eax
jne    122e <main+0xde>
movslq -0x34(%rbp),%rax
movb   $0x0,-0x2e(%rbp,%rax,1)
jmp    1241 <main+0xf1>
jmp    1233 <main+0xe3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11fb <main+0xab>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x61,-0xa0(%rbp)
movb   $0x62,-0x9f(%rbp)
movb   $0x63,-0x9e(%rbp)
movb   $0x64,-0x9d(%rbp)
movb   $0x65,-0x9c(%rbp)
movb   $0x66,-0x9b(%rbp)
movl   $0x0,-0xa4(%rbp)
movslq -0xa4(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     12d1 <main+0x181>
movslq -0xa4(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%esi
ff
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1288 <main+0x138>
lea    -0xae(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    -0xae(%rbp),%rdi
call   1070 <gets@plt>
lea    -0xae(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x10(%rsp),%r14
lea    0xe89(%rip),%rbx
mov    %rsp,%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe2d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe11(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1274 <main+0x124>
xor    %eax,%eax
call   1060 <getchar@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movl   $0x0,0x90(%rsp)
movl   $0x64636261,0x30(%rsp)
64
lea    0x31(%rsp),%rbx
movw   $0x6665,0x34(%rsp)
mov    $0x61,%al
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    12c0 <main+0x170>
movw   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"&a[%d]=%p\0A\00"
@.str.1 = [7 x i8] c"&a=%p\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [15 x i8] c"'\\0' ASCII=%d\0A\00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca [10 x i8]
store i32 0, i32* %1
%9 = bitcast [5 x i32]* %2 to i8*
store i32 0, i32* %3
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14, i32* %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %10
22: ; preds = %10
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 6
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
%29 = bitcast [10 x i8]* %4 to i8*
store i32 0, i32* %5
br label %30
30: ; preds = %45, %22
%31 = load i32, i32* %5
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %48
33: ; preds = %30
%34 = call signext i8 (...) @getchar()
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %36
store i8 %34, i8* %37
%38 = sext i8 %34 to i32
%39 = icmp eq i32 %38, 10
br i1 %39, label %40, label %44
40: ; preds = %33
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %42
store i8 0, i8* %43
br label %48
44: ; preds = %33
br label %45
45: ; preds = %44
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %30
48: ; preds = %40, %30
%49 = bitcast [100 x i8]* %6 to i8*
%50 = bitcast i8* %49 to [100 x i8]*
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 0
store i8 97, i8* %51
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 1
store i8 98, i8* %52
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 2
store i8 99, i8* %53
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 3
store i8 100, i8* %54
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 4
store i8 101, i8* %55
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %50, i32 0, i32 5
store i8 102, i8* %56
store i32 0, i32* %7
br label %57
57: ; preds = %71, %48
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %74
64: ; preds = %57
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %64
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
br label %57
74: ; preds = %57
%75 = bitcast [10 x i8]* %8 to i8*
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%77 = call i32 @gets(i8* %76)
%78 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%79 = call i32 @puts(i8* %78)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"&a[%d]=%p\0A\00"
@.str.1 = [7 x i8] c"&a=%p\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [15 x i8] c"'\\0' ASCII=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [100 x i8]
%3 = alloca [10 x i8]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0, i32* %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32* %7)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32* %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32* %11)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 6
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
%20 = call signext i8 (...) @getchar()
%21 = icmp eq i8 %20, 10
br i1 %21, label %48, label %22
22: ; preds = %0
%23 = call signext i8 (...) @getchar()
%24 = icmp eq i8 %23, 10
br i1 %24, label %48, label %25
25: ; preds = %22
%26 = call signext i8 (...) @getchar()
%27 = icmp eq i8 %26, 10
br i1 %27, label %48, label %28
28: ; preds = %25
%29 = call signext i8 (...) @getchar()
%30 = icmp eq i8 %29, 10
br i1 %30, label %48, label %31
31: ; preds = %28
%32 = call signext i8 (...) @getchar()
%33 = icmp eq i8 %32, 10
br i1 %33, label %48, label %34
34: ; preds = %31
%35 = call signext i8 (...) @getchar()
%36 = icmp eq i8 %35, 10
br i1 %36, label %48, label %37
37: ; preds = %34
%38 = call signext i8 (...) @getchar()
%39 = icmp eq i8 %38, 10
br i1 %39, label %48, label %40
40: ; preds = %37
%41 = call signext i8 (...) @getchar()
%42 = icmp eq i8 %41, 10
br i1 %42, label %48, label %43
43: ; preds = %40
%44 = call signext i8 (...) @getchar()
%45 = icmp eq i8 %44, 10
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = call signext i8 (...) @getchar()
br label %48
48: ; preds = %46, %0, %22, %25, %28, %31, %34, %37, %40, %43
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 97, i8* %49
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 98, i8* %50
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 99, i8* %51
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
store i8 100, i8* %52
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
store i8 101, i8* %53
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 5
store i8 102, i8* %54
br label %59
55: ; preds = %59
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%57 = call i32 @gets(i8* %56)
%58 = call i32 @puts(i8* %56)
ret i32 0
59: ; preds = %48, %59
%60 = phi i64 [ 0, %48 ], [ %64, %59 ]
%61 = phi i8 [ 97, %48 ], [ %66, %59 ]
%62 = sext i8 %61 to i32
%63 = call i32 @putchar(i32 %62)
%64 = add nuw i64 %60, 1
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = icmp eq i8 %66, 0
br i1 %67, label %55, label %59
}