#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 */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
struct TYPE_5__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
struct TYPE_4__ {
  int member_1;
  int member_2;
  int member_3;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ cstrng_(char *, int *, long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ qref_(int ***, int *, int *, int *, int *);
int /*<<< orphan*/ vecref_(int *, int *);
int main() {
  int a;
  a = 4;
  printf("Integer that you have entered is %d\n", a);
  int m[1][3][4] = {{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}}};
  int sum = 0;
  int X = 1;
  int Y = 3;
  int Z = 4;
  qref_(m, &sum, &X, &Y, &Z);
  printf("The sum is %d\n", sum);
  int vsum;
  int v[9] = {1, 2, 3, 4, 5, 0, 0, 0, 0};
  vecref_(v, &vsum);
  printf("The vec sum is %d\n", vsum);
  char s[7] = "short";
  int b[3] = {1, 2, 3};
  cstrng_(s, &b[1], 7L);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1080 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x48(%rbp)
movl   $0x3,-0x4c(%rbp)
movl   $0x4,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x4c(%rbp),%rcx
lea    -0x50(%rbp),%r8
call   1040 <qref_@plt>
mov    -0x44(%rbp),%esi
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1060 <memset@plt>
movl   $0x1,-0x80(%rbp)
movl   $0x2,-0x7c(%rbp)
movl   $0x3,-0x78(%rbp)
movl   $0x4,-0x74(%rbp)
movl   $0x5,-0x70(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0x54(%rbp),%rsi
call   1070 <vecref_@plt>
mov    -0x54(%rbp),%esi
lea    0xe09(%rip),%rdi
call   1050 <printf@plt>
mov    0xe4a(%rip),%eax
mov    %eax,-0x87(%rbp)
mov    0xe41(%rip),%ax
mov    %ax,-0x83(%rbp)
mov    0xe36(%rip),%al
mov    %al,-0x81(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0x94(%rbp)
mov    0xe26(%rip),%eax
mov    %eax,-0x8c(%rbp)
lea    -0x87(%rbp),%rdi
lea    -0x94(%rbp),%rsi
add    $0x4,%rsi
mov    $0x7,%edx
call   1030 <cstrng_@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x98,%rsp
lea    0xec2(%rip),%rdi
mov    $0x4,%esi
call   1050 <printf@plt>
movaps 0xf21(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x1,0x14(%rsp)
movl   $0x3,0x10(%rsp)
movl   $0x4,0xc(%rsp)
lea    0x60(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1040 <qref_@plt>
mov    0x4(%rsp),%esi
lea    0xe6d(%rip),%rdi
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movl   $0x0,0x50(%rsp)
movaps 0xe1c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x5,0x40(%rsp)
lea    0x30(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1060 <vecref_@plt>
mov    0x8(%rsp),%esi
lea    0xe39(%rip),%rdi
call   1050 <printf@plt>
movl   $0x7472,0x1b(%rsp)
movl   $0x726f6873,0x18(%rsp)
72
mov    0xe7a(%rip),%eax
mov    %eax,0x28(%rsp)
mov    0xe67(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0x24(%rsp),%rsi
lea    0x18(%rsp),%rdi
mov    $0x7,%edx
call   1030 <cstrng_@plt>
xor    %eax,%eax
add    $0x98,%rsp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Integer that you have entered is %d\0A\00"
@__const.main.m = [1 x [3 x [4 x i32]]] [[3 x [4 x i32]] [[4 x i32] [i32 0, i32 1, i32 2, i32 3], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 8, i32 9, i32 10, i32 11]]]
@.str.1 = [15 x i8] c"The sum is %d\0A\00"
@.str.2 = [19 x i8] c"The vec sum is %d\0A\00"
@__const.main.s = [7 x i8] c"short\00\00"
@__const.main.b = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1 x [3 x [4 x i32]]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [9 x i32]
%10 = alloca [7 x i8]
%11 = alloca [3 x i32]
store i32 0, i32* %1
store i32 4, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = bitcast [1 x [3 x [4 x i32]]]* %3 to i8*
store i32 0, i32* %4
store i32 1, i32* %5
store i32 3, i32* %6
store i32 4, i32* %7
%15 = getelementptr inbounds [1 x [3 x [4 x i32]]], [1 x [3 x [4 x i32]]]* %3, i64 0, i64 0
%16 = bitcast [3 x [4 x i32]]* %15 to i32***
%17 = call i32 @qref_(i32*** %16, i32* %4, i32* %5, i32* %6, i32* %7)
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = bitcast [9 x i32]* %9 to i8*
%21 = bitcast i8* %20 to [9 x i32]*
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i32 0, i32 0
store i32 1, i32* %22
%23 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i32 0, i32 1
store i32 2, i32* %23
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i32 0, i32 2
store i32 3, i32* %24
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i32 0, i32 3
store i32 4, i32* %25
%26 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i32 0, i32 4
store i32 5, i32* %26
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
%28 = call i32 @vecref_(i32* %27, i32* %8)
%29 = load i32, i32* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = bitcast [7 x i8]* %10 to i8*
%32 = bitcast [3 x i32]* %11 to i8*
%33 = getelementptr inbounds [7 x i8], [7 x i8]* %10, i64 0, i64 0
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
%35 = call i32 @cstrng_(i8* %33, i32* %34, i64 7)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Integer that you have entered is %d\0A\00"
@__const.main.m = [1 x [3 x [4 x i32]]] [[3 x [4 x i32]] [[4 x i32] [i32 0, i32 1, i32 2, i32 3], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 8, i32 9, i32 10, i32 11]]]
@.str.1 = [15 x i8] c"The sum is %d\0A\00"
@.str.2 = [19 x i8] c"The vec sum is %d\0A\00"
@__const.main.s = [7 x i8] c"short\00\00"
@__const.main.b = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [1 x [3 x [4 x i32]]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [9 x i32]
%8 = alloca [7 x i8]
%9 = alloca [3 x i32]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 4)
%11 = bitcast [1 x [3 x [4 x i32]]]* %1 to i8*
%12 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%13 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%14 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%15 = bitcast i32* %5 to i8*
store i32 4, i32* %5
%16 = bitcast [1 x [3 x [4 x i32]]]* %1 to i32***
%17 = call i32 @qref_(i32*** %16, i32* %2, i32* %3, i32* %4, i32* %5)
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = bitcast i32* %6 to i8*
%21 = bitcast [9 x i32]* %7 to i8*
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 4
%23 = bitcast i32* %22 to i8*
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 0
%25 = bitcast [9 x i32]* %7 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %25
%26 = getelementptr inbounds [9 x i32], [9 x i32]* %7, i64 0, i64 4
store i32 5, i32* %26
%27 = call i32 @vecref_(i32* %24, i32* %6)
%28 = load i32, i32* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%31 = bitcast [3 x i32]* %9 to i8*
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
%33 = call i32 @cstrng_(i8* %30, i32* %32, i64 7)
ret i32 0
}