#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*/ free(int *);
int *get_totients_under(int);
void get_totients_under_test(void) {
  int *totients = get_totients_under(21);
  assert(totients[1] == 1);
  assert(totients[2] == 1);
  assert(totients[3] == 2);
  assert(totients[4] == 2);
  assert(totients[5] == 4);
  assert(totients[10] == 4);
  assert(totients[11] == 10);
  assert(totients[19] == 18);
  assert(totients[20] == 8);
  free(totients);
}


x86 assembly (clang, -O0):
<get_totients_under_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
call   1050 <get_totients_under@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x1,0x8(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x2,0xc(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x2,0x10(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x4,0x14(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x4,0x28(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0xa,0x2c(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x12,0x4c(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x8,0x50(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_totients_under_test>:
push   %rbx
mov    $0x15,%edi
call   1050 <get_totients_under@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmpl   $0x1,0x4(%rax)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x8(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x2,0xc(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x2,0x10(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x4,0x14(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x4,0x28(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0xa,0x2c(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x12,0x4c(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x8,0x50(%rbx)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @get_totients_under_test() {
%1 = alloca i32*
%2 = call i32* @get_totients_under(i32 21)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %1
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 2
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32*, i32** %1
%22 = getelementptr inbounds i32, i32* %21, i64 4
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 2
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32*, i32** %1
%28 = getelementptr inbounds i32, i32* %27, i64 5
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 4
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load i32*, i32** %1
%34 = getelementptr inbounds i32, i32* %33, i64 10
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 4
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = load i32*, i32** %1
%40 = getelementptr inbounds i32, i32* %39, i64 11
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 10
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load i32*, i32** %1
%46 = getelementptr inbounds i32, i32* %45, i64 19
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 18
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = load i32*, i32** %1
%52 = getelementptr inbounds i32, i32* %51, i64 20
%53 = load i32, i32* %52
%54 = icmp eq i32 %53, 8
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = load i32*, i32** %1
%58 = call i32 @free(i32* %57)
ret void
}

LLVM IR (-O2):
define void @get_totients_under_test() {
%1 = tail call i32* @get_totients_under(i32 21)
%2 = getelementptr inbounds i32, i32* %1, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds i32, i32* %1, i64 2
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 3
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 2
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = getelementptr inbounds i32, i32* %1, i64 4
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 2
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = getelementptr inbounds i32, i32* %1, i64 5
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 4
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
%27 = getelementptr inbounds i32, i32* %1, i64 10
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 4
%30 = zext i1 %29 to i32
%31 = tail call i32 @assert(i32 %30)
%32 = getelementptr inbounds i32, i32* %1, i64 11
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 10
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = getelementptr inbounds i32, i32* %1, i64 19
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 18
%40 = zext i1 %39 to i32
%41 = tail call i32 @assert(i32 %40)
%42 = getelementptr inbounds i32, i32* %1, i64 20
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 8
%45 = zext i1 %44 to i32
%46 = tail call i32 @assert(i32 %45)
%47 = tail call i32 @free(i32* %1)
ret void
}