#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 addDigits(int);
int /*<<< orphan*/ assert(int);
int main(int argc, char **argv) {
  assert(addDigits(0) == 0);
  assert(addDigits(1) == 1);
  assert(addDigits(2) == 2);
  assert(addDigits(3) == 3);
  assert(addDigits(4) == 4);
  assert(addDigits(5) == 5);
  assert(addDigits(6) == 6);
  assert(addDigits(7) == 7);
  assert(addDigits(8) == 8);
  assert(addDigits(9) == 9);
  assert(addDigits(10) == 1);
  assert(addDigits(11) == 2);
  assert(addDigits(12) == 3);
  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)
xor    %edi,%edi
call   1030 <addDigits@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <addDigits@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
call   1030 <addDigits@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%edi
call   1030 <addDigits@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x4,%edi
call   1030 <addDigits@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x5,%edi
call   1030 <addDigits@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6,%edi
call   1030 <addDigits@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7,%edi
call   1030 <addDigits@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x8,%edi
call   1030 <addDigits@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x9,%edi
call   1030 <addDigits@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xa,%edi
call   1030 <addDigits@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xb,%edi
call   1030 <addDigits@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xc,%edi
call   1030 <addDigits@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x3,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x4,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x5,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x6,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x7,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x8,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x9,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xa,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xb,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xc,%edi
call   1030 <addDigits@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 @addDigits(i32 0)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @addDigits(i32 1)
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @addDigits(i32 2)
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @addDigits(i32 3)
%19 = icmp eq i32 %18, 3
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @addDigits(i32 4)
%23 = icmp eq i32 %22, 4
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @addDigits(i32 5)
%27 = icmp eq i32 %26, 5
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i32 @addDigits(i32 6)
%31 = icmp eq i32 %30, 6
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = call i32 @addDigits(i32 7)
%35 = icmp eq i32 %34, 7
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 @addDigits(i32 8)
%39 = icmp eq i32 %38, 8
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @addDigits(i32 9)
%43 = icmp eq i32 %42, 9
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32 @addDigits(i32 10)
%47 = icmp eq i32 %46, 1
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = call i32 @addDigits(i32 11)
%51 = icmp eq i32 %50, 2
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = call i32 @addDigits(i32 12)
%55 = icmp eq i32 %54, 3
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @addDigits(i32 0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @addDigits(i32 1)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @addDigits(i32 2)
%12 = icmp eq i32 %11, 2
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @addDigits(i32 3)
%16 = icmp eq i32 %15, 3
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 @addDigits(i32 4)
%20 = icmp eq i32 %19, 4
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = tail call i32 @addDigits(i32 5)
%24 = icmp eq i32 %23, 5
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
%27 = tail call i32 @addDigits(i32 6)
%28 = icmp eq i32 %27, 6
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = tail call i32 @addDigits(i32 7)
%32 = icmp eq i32 %31, 7
%33 = zext i1 %32 to i32
%34 = tail call i32 @assert(i32 %33)
%35 = tail call i32 @addDigits(i32 8)
%36 = icmp eq i32 %35, 8
%37 = zext i1 %36 to i32
%38 = tail call i32 @assert(i32 %37)
%39 = tail call i32 @addDigits(i32 9)
%40 = icmp eq i32 %39, 9
%41 = zext i1 %40 to i32
%42 = tail call i32 @assert(i32 %41)
%43 = tail call i32 @addDigits(i32 10)
%44 = icmp eq i32 %43, 1
%45 = zext i1 %44 to i32
%46 = tail call i32 @assert(i32 %45)
%47 = tail call i32 @addDigits(i32 11)
%48 = icmp eq i32 %47, 2
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
%51 = tail call i32 @addDigits(i32 12)
%52 = icmp eq i32 %51, 3
%53 = zext i1 %52 to i32
%54 = tail call i32 @assert(i32 %53)
ret i32 0
}