#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*/ printf(char *);
int /*<<< orphan*/ sum_count(int, ...);
int /*<<< orphan*/ sum_end0(int, ...);
int main(void) {
  sum_end0(1, 2, 3, 0);
  sum_count(3, 1, 2, 3);
  printf("-------------------\n");
  printf("Check some edge cases:");
  sum_end0(0);
  sum_end0(1, 0);
  sum_count(0);
  sum_count(1, 1);
  printf("-------------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <sum_end0@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1040 <sum_count@plt>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sum_end0@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <sum_end0@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <sum_count@plt>
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <sum_count@plt>
lea    0xe44(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <sum_end0@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1050 <sum_count@plt>
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
call   1060 <printf@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <sum_end0@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <sum_end0@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1050 <sum_count@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <sum_count@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"-------------------\0A\00"
@.str.1 = [23 x i8] c"Check some edge cases:\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, ...) @sum_end0(i32 1, i32 2, i32 3, i32 0)
%3 = call i32 (i32, ...) @sum_count(i32 3, i32 1, i32 2, i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) @sum_end0(i32 0)
%7 = call i32 (i32, ...) @sum_end0(i32 1, i32 0)
%8 = call i32 (i32, ...) @sum_count(i32 0)
%9 = call i32 (i32, ...) @sum_count(i32 1, i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Check some edge cases:\00"
@str.2 = [20 x i8] c"-------------------\00"
define i32 @main() {
%1 = tail call i32 (i32, ...) @sum_end0(i32 1, i32 2, i32 3, i32 0)
%2 = tail call i32 (i32, ...) @sum_count(i32 3, i32 1, i32 2, i32 3)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) @sum_end0(i32 0)
%6 = tail call i32 (i32, ...) @sum_end0(i32 1, i32 0)
%7 = tail call i32 (i32, ...) @sum_count(i32 0)
%8 = tail call i32 (i32, ...) @sum_count(i32 1, i32 1)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}