#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_year_day_number(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ to_century_day_number(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ to_time(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t to_sec_since_2000(uint16_t y, uint8_t mo, uint8_t d, uint8_t h,
                           uint8_t mi, uint8_t s) {
  uint16_t ydn = get_year_day_number(y, mo, d);
  uint16_t cdn = to_century_day_number(y, ydn);
  return to_time(cdn, h, mi, s);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <get_year_day_number@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <to_century_day_number@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <to_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edi,%ebp
call   1050 <get_year_day_number@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <to_century_day_number@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <to_time@plt>

LLVM IR (-O0):
define i32 @to_sec_since_2000(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @get_year_day_number(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %13
%19 = load i32, i32* %7
%20 = load i32, i32* %13
%21 = call i32 @to_century_day_number(i32 %19, i32 %20)
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = call i32 @to_time(i32 %22, i32 %23, i32 %24, i32 %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @to_sec_since_2000(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @get_year_day_number(i32 %0, i32 %1, i32 %2)
%8 = tail call i32 @to_century_day_number(i32 %0, i32 %7)
%9 = tail call i32 @to_time(i32 %8, i32 %3, i32 %4, i32 %5)
ret i32 %9
}