#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 dayofyear(int, int, int);
int /*<<< orphan*/ monthday(int /*<<< orphan*/, int, int *, int *);
int main(int argc, char *argv[]) {
  int m;
  int d;
  monthday(0, 0, &m, &d);
  assert(m == 0 && d == 0);
  monthday(0, 367, &m, &d);
  assert(m == 0 && d == 0);
  monthday(0, 60, &m, &d);
  assert(m == 2 && d == 29);
  assert(dayofyear(0, -1, 0) == 0);
  assert(dayofyear(0, 13, 1) == 0);
  assert(dayofyear(0, 12, 32) == 0);
  assert(dayofyear(2013, 2, 13) == 44);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %esi,%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    %esi,%edi
call   1040 <monthday@plt>
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jne    1170 <main+0x40>
cmpl   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0x16f,%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <monthday@plt>
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x1a(%rbp)
jne    11aa <main+0x7a>
cmpl   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0x3c,%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <monthday@plt>
xor    %eax,%eax
cmpl   $0x2,-0x14(%rbp)
mov    %al,-0x1b(%rbp)
jne    11e4 <main+0xb4>
cmpl   $0x1d,-0x18(%rbp)
sete   %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edx,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
call   1030 <dayofyear@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0xd,%esi
mov    $0x1,%edx
call   1030 <dayofyear@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0xc,%esi
mov    $0x20,%edx
call   1030 <dayofyear@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x7dd,%edi
mov    $0x2,%esi
mov    $0xd,%edx
call   1030 <dayofyear@plt>
cmp    $0x2c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <monthday@plt>
mov    0x4(%rsp),%eax
xor    %edi,%edi
or     (%rsp),%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0x16f,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <monthday@plt>
mov    0x4(%rsp),%eax
xor    %edi,%edi
or     (%rsp),%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0x3c,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <monthday@plt>
mov    0x4(%rsp),%eax
xor    $0x2,%eax
mov    (%rsp),%ecx
xor    $0x1d,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1030 <dayofyear@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0xd,%esi
mov    $0x1,%edx
call   1030 <dayofyear@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    $0xc,%esi
mov    $0x20,%edx
call   1030 <dayofyear@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x7dd,%edi
mov    $0x2,%esi
mov    $0xd,%edx
call   1030 <dayofyear@plt>
xor    %edi,%edi
cmp    $0x2c,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @monthday(i32 0, i32 0, i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %11, %2
%15 = phi i1 [ false, %2 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @monthday(i32 0, i32 367, i32* %6, i32* %7)
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br label %24
24: ; preds = %21, %14
%25 = phi i1 [ false, %14 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i32 @monthday(i32 0, i32 60, i32* %6, i32* %7)
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, 29
br label %34
34: ; preds = %31, %24
%35 = phi i1 [ false, %24 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 @dayofyear(i32 0, i32 -1, i32 0)
%39 = icmp eq i32 %38, 0
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @dayofyear(i32 0, i32 13, i32 1)
%43 = icmp eq i32 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32 @dayofyear(i32 0, i32 12, i32 32)
%47 = icmp eq i32 %46, 0
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = call i32 @dayofyear(i32 2013, i32 2, i32 13)
%51 = icmp eq i32 %50, 44
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @monthday(i32 0, i32 0, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @monthday(i32 0, i32 367, i32* %3, i32* %4)
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 0
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
%20 = select i1 %17, i1 %19, i1 false
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @monthday(i32 0, i32 60, i32* %3, i32* %4)
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 2
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 29
%28 = select i1 %25, i1 %27, i1 false
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @dayofyear(i32 0, i32 -1, i32 0)
%32 = icmp eq i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i32 @dayofyear(i32 0, i32 13, i32 1)
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = call i32 @dayofyear(i32 0, i32 12, i32 32)
%40 = icmp eq i32 %39, 0
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i32 @dayofyear(i32 2013, i32 2, i32 13)
%44 = icmp eq i32 %43, 44
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
ret i32 0
}