#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*/ multiply_all(int *, int);
int /*<<< orphan*/ print_array(int *);
int /*<<< orphan*/ set_ones(int *);
int /*<<< orphan*/ set_sequence(int *);
int main() {
  int arr[10];
  print_array(arr);
  set_ones(arr);
  print_array(arr);
  multiply_all(arr, 2);
  print_array(arr);
  set_sequence(arr);
  print_array(arr);
  multiply_all(arr, 10);
  print_array(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <print_array@plt>
lea    -0x30(%rbp),%rdi
call   1030 <set_ones@plt>
lea    -0x30(%rbp),%rdi
call   1040 <print_array@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1060 <multiply_all@plt>
lea    -0x30(%rbp),%rdi
call   1040 <print_array@plt>
lea    -0x30(%rbp),%rdi
call   1050 <set_sequence@plt>
lea    -0x30(%rbp),%rdi
call   1040 <print_array@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <multiply_all@plt>
lea    -0x30(%rbp),%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <set_ones@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <multiply_all@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1050 <set_sequence@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <multiply_all@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = call i32 @print_array(i32* %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @set_ones(i32* %5)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @print_array(i32* %7)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @multiply_all(i32* %9, i32 2)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @print_array(i32* %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = call i32 @set_sequence(i32* %13)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%16 = call i32 @print_array(i32* %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%18 = call i32 @multiply_all(i32* %17, i32 10)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%20 = call i32 @print_array(i32* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3)
%5 = call i32 @set_ones(i32* %3)
%6 = call i32 @print_array(i32* %3)
%7 = call i32 @multiply_all(i32* %3, i32 2)
%8 = call i32 @print_array(i32* %3)
%9 = call i32 @set_sequence(i32* %3)
%10 = call i32 @print_array(i32* %3)
%11 = call i32 @multiply_all(i32* %3, i32 10)
%12 = call i32 @print_array(i32* %3)
ret i32 0
}