#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 */
scalar_t__ dateSplit(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, ...);
void testDateSplit(int dayOfYear, int year) {
  int day, month;
  if (dateSplit(dayOfYear, year, &day, &month))
    printf("%d,%d => %d,%d\n", dayOfYear, year, day, month);
  else
    printf("%d,%d => invalid\n", dayOfYear, year);
}


x86 assembly (clang, -O0):
<testDateSplit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <dateSplit@plt>
cmp    $0x0,%rax
je     116b <testDateSplit+0x4b>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <testDateSplit+0x5f>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDateSplit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <dateSplit@plt>
test   %rax,%rax
je     1155 <testDateSplit+0x35>
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
lea    0xeb8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1167 <testDateSplit+0x47>
lea    0xeb4(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d,%d => %d,%d\0A\00"
@.str.1 = [18 x i8] c"%d,%d => invalid\0A\00"
define void @testDateSplit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i64 @dateSplit(i32 %7, i32 %8, i32* %5, i32* %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
br label %21
17: ; preds = %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d,%d => %d,%d\0A\00"
@.str.1 = [18 x i8] c"%d,%d => invalid\0A\00"
define void @testDateSplit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i64 @dateSplit(i32 %0, i32 %1, i32* %3, i32* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %10, i32 %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %15
15: ; preds = %13, %9
ret void
}