#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 Cannonball(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char const *argv[]) {
  assert(Cannonball(4) == 30);
  assert(Cannonball(5) == 55);
  assert(Cannonball(6) == 91);
  assert(Cannonball(7) == 140);
  puts("All assertions correct - success!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <Cannonball@plt>
cmp    $0x1e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x5,%edi
call   1040 <Cannonball@plt>
cmp    $0x37,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x6,%edi
call   1040 <Cannonball@plt>
cmp    $0x5b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x7,%edi
call   1040 <Cannonball@plt>
cmp    $0x8c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <Cannonball@plt>
xor    %edi,%edi
cmp    $0x1e,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x5,%edi
call   1040 <Cannonball@plt>
xor    %edi,%edi
cmp    $0x37,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x6,%edi
call   1040 <Cannonball@plt>
xor    %edi,%edi
cmp    $0x5b,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x7,%edi
call   1040 <Cannonball@plt>
xor    %edi,%edi
cmp    $0x8c,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"All assertions correct - success!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @Cannonball(i32 4)
%7 = icmp eq i32 %6, 30
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @Cannonball(i32 5)
%11 = icmp eq i32 %10, 55
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @Cannonball(i32 6)
%15 = icmp eq i32 %14, 91
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @Cannonball(i32 7)
%19 = icmp eq i32 %18, 140
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"All assertions correct - success!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Cannonball(i32 4)
%4 = icmp eq i32 %3, 30
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @Cannonball(i32 5)
%8 = icmp eq i32 %7, 55
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @Cannonball(i32 6)
%12 = icmp eq i32 %11, 91
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @Cannonball(i32 7)
%16 = icmp eq i32 %15, 140
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}