#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*/ time_t;
struct tm {
  int /*<<< orphan*/ tm_mday;
  scalar_t__ tm_mon;
  scalar_t__ tm_year;
};

/* Variables and functions */
int /*<<< orphan*/ gregorian_to_jalali(int *, int *, int *, scalar_t__,
                                       scalar_t__, int /*<<< orphan*/);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int y, m, d;
  time_t bin_time;
  struct tm *br_time;
  time(&bin_time);
  br_time = localtime(&bin_time);
  gregorian_to_jalali(&y, &m, &d, 1900 + br_time->tm_year, 1 + br_time->tm_mon,
                      br_time->tm_mday);
  printf("%d-%d-%d\n", y, m, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
add    $0x76c,%rcx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%r8
add    $0x1,%r8
mov    -0x20(%rbp),%rax
mov    (%rax),%r9d
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1060 <gregorian_to_jalali@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    $0x76c,%ecx
add    0x10(%rax),%rcx
mov    0x8(%rax),%r8
add    $0x1,%r8
mov    (%rax),%r9d
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <gregorian_to_jalali@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i64 }
@.str = [10 x i8] c"%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 %struct.tm*
store i32 0, i32* %1
%7 = call i32 @time(i32* %5)
%8 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 2
%11 = load i64, i64* %10
%12 = add nsw i64 1900, %11
%13 = load %struct.tm*, %struct.tm** %6
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
%15 = load i64, i64* %14
%16 = add nsw i64 1, %15
%17 = load %struct.tm*, %struct.tm** %6
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = call i32 @gregorian_to_jalali(i32* %2, i32* %3, i32* %4, i64 %12, i64 %16, i32 %19)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i64 }
@.str = [10 x i8] c"%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*
%9 = call i32 @time(i32* %4)
%10 = call %struct.tm* @localtime(i32* %4)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 2
%12 = load i64, i64* %11
%13 = add nsw i64 %12, 1900
%14 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 1
%15 = load i64, i64* %14
%16 = add nsw i64 %15, 1
%17 = getelementptr inbounds %struct.tm, %struct.tm* %10, i64 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @gregorian_to_jalali(i32* %1, i32* %2, i32* %3, i64 %13, i64 %16, i32 %18)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
ret i32 0
}