#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*/ test(char *, char *);
void TEST_array(void) {
  test("17", "main(){int i[20]; printf(\"17\");}");
  test("17 42",
       "main(){int i[20]; i[0]=17; i[19]=42; printf(\"%d %d\", i[0], i[19]);}");
  test("17 42", "main(){int i[20]; int *p=i; p[0]=17; p[1]=42; printf(\"%d "
                "%d\", *p, p[1]);}");
  test("5", "main(){int i[20]; int *p=i; int *q=p+5; printf(\"%d\", q-p);}");
  test("123", "main(){ int a[3][3]; a[0][1]=1; a[2][0]=2; a[2][2]=3; "
              "printf(\"%d%d%d\", a[0][1], a[2][0], a[2][2]);}");
  test("012345678",
       "main(){int a[3][3]; for (int i=0;i<3;i++) for (int j=0;j<3;j++) "
       "a[i][j]=i*3+j; for (int i=0;i<9;i++) printf(\"%d\",*(*a+i));}");
  test("bx", "main(){printf(0 ? \"a\" : \"b\"); printf(1 ? \"x\" : \"y\");}");
}


x86 assembly (clang, -O0):
<TEST_array>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xef6(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1030 <test@plt>
lea    0xee3(%rip),%rdi
lea    0xf26(%rip),%rsi
call   1030 <test@plt>
lea    0xf64(%rip),%rdi
lea    0xf5f(%rip),%rsi
call   1030 <test@plt>
lea    0xf8f(%rip),%rdi
lea    0xf8c(%rip),%rsi
call   1030 <test@plt>
lea    0xfe4(%rip),%rdi
lea    0xfe7(%rip),%rsi
call   1030 <test@plt>
lea    0x1057(%rip),%rdi
lea    0x1053(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_array>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <test@plt>
lea    0xef9(%rip),%rbx
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf2d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf68(%rip),%rdi
lea    0xf63(%rip),%rsi
call   1030 <test@plt>
lea    0xf93(%rip),%rdi
lea    0xf90(%rip),%rsi
call   1030 <test@plt>
lea    0xfe8(%rip),%rdi
lea    0xfeb(%rip),%rsi
call   1030 <test@plt>
lea    0x105b(%rip),%rdi
lea    0x1057(%rip),%rsi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"17\00"
@.str.1 = [33 x i8] c"main(){int i[20]; printf(\2217\22);}\00"
@.str.2 = [6 x i8] c"17 42\00"
@.str.3 = [68 x i8] c"main(){int i[20]; i[0]=17; i[19]=42; printf(\22%d %d\22, i[0], i[19]);}\00"
@.str.4 = [74 x i8] c"main(){int i[20]; int *p=i; p[0]=17; p[1]=42; printf(\22%d %d\22, *p, p[1]);}\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [60 x i8] c"main(){int i[20]; int *p=i; int *q=p+5; printf(\22%d\22, q-p);}\00"
@.str.7 = [4 x i8] c"123\00"
@.str.8 = [100 x i8] c"main(){ int a[3][3]; a[0][1]=1; a[2][0]=2; a[2][2]=3; printf(\22%d%d%d\22, a[0][1], a[2][0], a[2][2]);}\00"
@.str.9 = [10 x i8] c"012345678\00"
@.str.10 = [124 x i8] c"main(){int a[3][3]; for (int i=0;i<3;i++) for (int j=0;j<3;j++) a[i][j]=i*3+j; for (int i=0;i<9;i++) printf(\22%d\22,*(*a+i));}\00"
@.str.11 = [3 x i8] c"bx\00"
@.str.12 = [54 x i8] c"main(){printf(0 ? \22a\22 : \22b\22); printf(1 ? \22x\22 : \22y\22);}\00"
define void @TEST_array() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
%6 = call i32 @test(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.10, i64 0, i64 0))
%7 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"17\00"
@.str.1 = [33 x i8] c"main(){int i[20]; printf(\2217\22);}\00"
@.str.2 = [6 x i8] c"17 42\00"
@.str.3 = [68 x i8] c"main(){int i[20]; i[0]=17; i[19]=42; printf(\22%d %d\22, i[0], i[19]);}\00"
@.str.4 = [74 x i8] c"main(){int i[20]; int *p=i; p[0]=17; p[1]=42; printf(\22%d %d\22, *p, p[1]);}\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [60 x i8] c"main(){int i[20]; int *p=i; int *q=p+5; printf(\22%d\22, q-p);}\00"
@.str.7 = [4 x i8] c"123\00"
@.str.8 = [100 x i8] c"main(){ int a[3][3]; a[0][1]=1; a[2][0]=2; a[2][2]=3; printf(\22%d%d%d\22, a[0][1], a[2][0], a[2][2]);}\00"
@.str.9 = [10 x i8] c"012345678\00"
@.str.10 = [124 x i8] c"main(){int a[3][3]; for (int i=0;i<3;i++) for (int j=0;j<3;j++) a[i][j]=i*3+j; for (int i=0;i<9;i++) printf(\22%d\22,*(*a+i));}\00"
@.str.11 = [3 x i8] c"bx\00"
@.str.12 = [54 x i8] c"main(){printf(0 ? \22a\22 : \22b\22); printf(1 ? \22x\22 : \22y\22);}\00"
define void @TEST_array() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
%6 = tail call i32 @test(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.10, i64 0, i64 0))
%7 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
ret void
}