#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*/ assert(int);
int /*<<< orphan*/ do_first(int *);
int /*<<< orphan*/ init_array(int *, int);
void example1() {
  int a[20];
  int b[20];
  init_array(a, 42);
  assert(a[2] == 42);
  assert(a[10] == 42);
  do_first(a);
  assert(a[0] == 3);
  init_array(b, 12);
  assert(b[2] == 12);
  assert(b[10] == 12);
}


x86 assembly (clang, -O0):
<example1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x2a,%esi
call   1040 <init_array@plt>
cmpl   $0x2a,-0x48(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x2a,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x50(%rbp),%rdi
call   1030 <do_first@plt>
cmpl   $0x3,-0x50(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0xa0(%rbp),%rdi
mov    $0xc,%esi
call   1040 <init_array@plt>
cmpl   $0xc,-0x98(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0xc,-0x78(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example1>:
push   %rbx
sub    $0xa0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1040 <init_array@plt>
xor    %edi,%edi
cmpl   $0x2a,0x8(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0x2a,0x28(%rsp)
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <do_first@plt>
xor    %edi,%edi
cmpl   $0x3,(%rsp)
sete   %dil
call   1050 <assert@plt>
lea    0x50(%rsp),%rdi
mov    $0xc,%esi
call   1040 <init_array@plt>
xor    %edi,%edi
cmpl   $0xc,0x58(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0xc,0x78(%rsp)
sete   %dil
call   1050 <assert@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @example1() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @init_array(i32* %3, i32 42)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 42
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 10
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 42
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%16 = call i32 @do_first(i32* %15)
%17 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 3
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%23 = call i32 @init_array(i32* %22, i32 12)
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 2
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 12
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 10
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 12
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret void
}

LLVM IR (-O2):
define void @example1() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [20 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = call i32 @init_array(i32* %5, i32 42)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 42
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 10
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 42
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @do_first(i32* %5)
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 3
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%23 = call i32 @init_array(i32* %22, i32 12)
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 2
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 12
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 10
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 12
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret void
}