#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_array(int *, int);
int /*<<< orphan*/ test_scalar(int *);
int main(int argc, char **argv) {
  bool my_bool = true;
  bool my_bool_array[10];
  int i;
  test_scalar(&my_bool);
  for (i = 0; i < 10; i += 2)
    my_bool_array[i] = true;
  for (i = 1; i < 10; i += 2)
    my_bool_array[i] = false;
  test_array(my_bool_array, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <test_scalar@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    1171 <main+0x51>
movslq -0x44(%rbp),%rax
movl   $0x1,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x44(%rbp)
jmp    114d <main+0x2d>
movl   $0x1,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    119c <main+0x7c>
movslq -0x44(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x44(%rbp)
jmp    1178 <main+0x58>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1040 <test_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <test_scalar@plt>
movq   $0x1,0x30(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
lea    0x10(%rsp),%rdi
mov    $0xa,%esi
call   1040 <test_array@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%9 = call i32 @test_scalar(i32* %6)
store i32 0, i32* %8
br label %10
10: ; preds = %17, %2
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %15
store i32 1, i32* %16
br label %17
17: ; preds = %13
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 2
store i32 %19, i32* %8
br label %10
20: ; preds = %10
store i32 1, i32* %8
br label %21
21: ; preds = %28, %20
%22 = load i32, i32* %8
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %26
store i32 0, i32* %27
br label %28
28: ; preds = %24
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 2
store i32 %30, i32* %8
br label %21
31: ; preds = %21
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%33 = call i32 @test_array(i32* %32, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = bitcast [10 x i32]* %4 to i8*
%7 = call i32 @test_scalar(i32* %3)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 4
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 8
store i32 1, i32* %10
%11 = bitcast [10 x i32]* %4 to <4 x i32>*
store <4 x i32> <i32 1, i32 0, i32 1, i32 0>, <4 x i32>* %11
%12 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 1, i32 0, i32 1, i32 0>, <4 x i32>* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 9
store i32 0, i32* %13
%14 = call i32 @test_array(i32* %8, i32 10)
ret i32 0
}