#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*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ generate_leap_second_tbl(int /*<<< orphan*/ *);
int posix_tai_unit_test();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int main(void) {
  generate_leap_second_tbl(NULL);
  int res = posix_tai_unit_test();
  if (res < 0) {
    fprintf(stderr, "Unit test failure: %d\n", res);
    return 1;
  }
  puts("Unit test succeeded");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <generate_leap_second_tbl@plt>
mov    $0x0,%al
call   1040 <posix_tai_unit_test@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1190 <main+0x50>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <main+0x63>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <generate_leap_second_tbl@plt>
xor    %eax,%eax
call   1040 <posix_tai_unit_test@plt>
test   %eax,%eax
js     1163 <main+0x23>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
jmp    117f <main+0x3f>
mov    0x2e76(%rip),%rcx
mov    (%rcx),%edi
lea    0xe8d(%rip),%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Unit test failure: %d\0A\00"
@.str.1 = [20 x i8] c"Unit test succeeded\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @generate_leap_second_tbl(i32* null)
%4 = call i32 (...) @posix_tai_unit_test()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 1, i32* %1
br label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Unit test failure: %d\0A\00"
@.str.1 = [20 x i8] c"Unit test succeeded\00"
define i32 @main() {
%1 = tail call i32 @generate_leap_second_tbl(i32* null)
%2 = tail call i32 (...) @posix_tai_unit_test()
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %9
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %10
}