#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*/ print_array(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ set_zero(int *, int);
int main(void) {
  int ary1[] = {1, 2, 3, 4, 5};
  int ary2[] = {3, 2, 1};
  printf("ary1 = ");
  print_array(ary1, 5);
  putchar('\n');
  printf("ary2 = ");
  print_array(ary2, 3);
  putchar('\n');
  set_zero(ary1, 5);
  set_zero(ary2, 3);
  printf("把0赋给了两个数组的所有元素。\n");
  printf("ary1 = ");
  print_array(ary1, 5);
  putchar('\n');
  printf("ary2 = ");
  print_array(ary2, 3);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xe9d(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1060 <set_zero@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
call   1060 <set_zero@plt>
lea    0xe43(%rip),%rdi
call   1050 <printf@plt>
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
lea    -0x2c(%rbp),%rdi
mov    $0x3,%esi
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0xeaf(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xea5(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xe92(%rip),%rax
mov    %rax,(%rsp)
lea    0xe93(%rip),%r14
mov    %r14,%rdi
call   1060 <printf@plt>
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe70(%rip),%r15
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1070 <set_zero@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <set_zero@plt>
lea    0xe35(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <print_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.ary1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.ary2 = [3 x i32] [i32 3, i32 2, i32 1]
@.str = [8 x i8] c"ary1 = \00"
@.str.1 = [8 x i8] c"ary2 = \00"
@.str.2 = [45 x i8] c"\E6\8A\8A0\E8\B5\8B\E7\BB\99\E4\BA\86\E4\B8\A4\E4\B8\AA\E6\95\B0\E7\BB\84\E7\9A\84\E6\89\80\E6\9C\89\E5\85\83\E7\B4\A0\E3\80\82\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = bitcast [3 x i32]* %3 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @print_array(i32* %7, i32 5)
%9 = call i32 @putchar(i8 signext 10)
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%12 = call i32 @print_array(i32* %11, i32 3)
%13 = call i32 @putchar(i8 signext 10)
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%15 = call i32 @set_zero(i32* %14, i32 5)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%17 = call i32 @set_zero(i32* %16, i32 3)
%18 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%21 = call i32 @print_array(i32* %20, i32 5)
%22 = call i32 @putchar(i8 signext 10)
%23 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%25 = call i32 @print_array(i32* %24, i32 3)
%26 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ary1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.ary2 = [3 x i32] [i32 3, i32 2, i32 1]
@.str = [8 x i8] c"ary1 = \00"
@.str.1 = [8 x i8] c"ary2 = \00"
@str = [44 x i8] c"\E6\8A\8A0\E8\B5\8B\E7\BB\99\E4\BA\86\E4\B8\A4\E4\B8\AA\E6\95\B0\E7\BB\84\E7\9A\84\E6\89\80\E6\9C\89\E5\85\83\E7\B4\A0\E3\80\82\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = call i32 @print_array(i32* %6, i32 5)
%8 = call i32 @putchar(i8 signext 10)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%11 = call i32 @print_array(i32* %10, i32 3)
%12 = call i32 @putchar(i8 signext 10)
%13 = call i32 @set_zero(i32* %6, i32 5)
%14 = call i32 @set_zero(i32* %10, i32 3)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @print_array(i32* %6, i32 5)
%18 = call i32 @putchar(i8 signext 10)
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @print_array(i32* %10, i32 3)
%21 = call i32 @putchar(i8 signext 10)
ret i32 0
}