#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*/ from_julian_day(int, int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int /*<<< orphan*/ to_julian_day(int, int, int, int *);
int main() {
  int julian_day, year, month, day, roundtrip_julian_day;
  for (julian_day = 0; julian_day < 10000000; julian_day++) {
    from_julian_day(julian_day, &year, &month, &day);
    to_julian_day(year, month, day, &roundtrip_julian_day);
    printf("%d - %d-%d-%d - %d\n", julian_day, year, month, day,
           roundtrip_julian_day);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    11a4 <main+0x74>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1050 <from_julian_day@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1040 <to_julian_day@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x14(%rsp),%r13
lea    0xea5(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1050 <from_julian_day@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r13,%rcx
call   1040 <to_julian_day@plt>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    %rbp,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x989680,%ebx
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d - %d-%d-%d - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 @from_julian_day(i32 %11, i32* %3, i32* %4, i32* %5)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @to_julian_day(i32 %13, i32 %14, i32 %15, i32* %6)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
br label %23
23: ; preds = %10
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %7
26: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d - %d-%d-%d - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ 0, %0 ], [ %21, %9 ]
%11 = call i32 @from_julian_day(i32 %10, i32* %1, i32* %2, i32* %3)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @to_julian_day(i32 %12, i32 %13, i32 %14, i32* %4)
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %16, i32 %17, i32 %18, i32 %19)
%21 = add nuw nsw i32 %10, 1
%22 = icmp eq i32 %21, 10000000
br i1 %22, label %23, label %9
23: ; preds = %9
ret i32 0
}