#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 /*<<< orphan*/ stderr;
scalar_t__ test_Strtod();
scalar_t__ test_grisu3_print_double();
int main() {
  int fail = 0;
  fail += test_Strtod();
  fail += test_grisu3_print_double();
  if (fail) {
    fprintf(stderr, "FAILURE\n");
    return -1;
  }
  fprintf(stderr, "SUCCESS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_Strtod@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_grisu3_print_double@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1199 <main+0x69>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b5 <main+0x85>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <test_Strtod@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <test_grisu3_print_double@plt>
xor    %ebp,%ebp
add    %ebx,%eax
setne  %bpl
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rax
lea    0xe9d(%rip),%rsi
cmove  %rax,%rsi
neg    %ebp
call   1040 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"FAILURE\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 (...) @test_Strtod()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 (...) @test_grisu3_print_double()
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %21
18: ; preds = %0
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"FAILURE\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @test_Strtod()
%2 = tail call i64 (...) @test_grisu3_print_double()
%3 = add i64 %2, %1
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* @stderr
%7 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
%8 = xor i1 %5, true
%9 = sext i1 %8 to i32
%10 = tail call i32 @fprintf(i32 %6, i8* %7)
ret i32 %9
}