#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ parse_long(char *, long *);
int /*<<< orphan*/ printf(char *, long, int);
int /*<<< orphan*/ stderr;
int sun_delta_tai_utc(long);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <daynum>\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  long daynum;
  if (!parse_long(argv[1], &daynum)) {
    fprintf(stderr, "Not an integer: %s\n", argv[1]);
    exit(EXIT_FAILURE);
  }
  int delta = sun_delta_tai_utc(daynum);
  printf("On Modified Julian Day %ld the difference TAI-UTC = %d s\n", daynum,
         delta);
  exit(EXIT_SUCCESS);
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    119a <main+0x4a>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <parse_long@plt>
cmp    $0x0,%eax
jne    11df <main+0x8f>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe48(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1060 <sun_delta_tai_utc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1172 <main+0x22>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe90(%rip),%rsi
jmp    1198 <main+0x48>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1050 <parse_long@plt>
test   %eax,%eax
jne    11ab <main+0x5b>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xe7c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x8(%rsp),%rdi
call   1060 <sun_delta_tai_utc@plt>
mov    0x8(%rsp),%rsi
lea    0xe67(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <daynum>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [20 x i8] c"Not an integer: %s\0A\00"
@.str.2 = [58 x i8] c"On Modified Julian Day %ld the difference TAI-UTC = %d s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @parse_long(i8* %21, i64* %6)
%23 = icmp ne i32 %22, 0
br i1 %23, label %32, label %24
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %18
%33 = load i64, i64* %6
%34 = call i32 @sun_delta_tai_utc(i64 %33)
store i32 %34, i32* %7
%35 = load i64, i64* %6
%36 = load i32, i32* %7
%37 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i64 %35, i32 %36)
%38 = load i32, i32* @EXIT_SUCCESS
%39 = call i32 @exit(i32 %38)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <daynum>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [20 x i8] c"Not an integer: %s\0A\00"
@.str.2 = [58 x i8] c"On Modified Julian Day %ld the difference TAI-UTC = %d s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = bitcast i64* %3 to i8*
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @parse_long(i8* %14, i64* %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %13
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %11
%24 = load i64, i64* %3
%25 = call i32 @sun_delta_tai_utc(i64 %24)
%26 = load i64, i64* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i64 %26, i32 %25)
%28 = load i32, i32* @EXIT_SUCCESS
%29 = call i32 @exit(i32 %28)
unreachable
}