#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*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ generate_output(char const *, char const *);
int /*<<< orphan*/ init_fp_formats();
int /*<<< orphan*/ read_input(char const *);
int main(int argc, char **argv) {
  if (argc != 4)
    error(EXIT_FAILURE, 0,
          "usage: gen-auto-libm-tests <input> <func> <output>");
  const char *input_filename = argv[1];
  const char *function = argv[2];
  const char *output_filename = argv[3];
  init_fp_formats();
  read_input(input_filename);
  generate_output(function, output_filename);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1187 <main+0x37>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xe7e(%rip),%rdx
call   1050 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <init_fp_formats@plt>
mov    -0x18(%rbp),%rdi
call   1070 <read_input@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <generate_output@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
je     1174 <main+0x24>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rdx
xor    %esi,%esi
call   1050 <error@plt>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%rbx
xor    %eax,%eax
call   1040 <init_fp_formats@plt>
mov    %r14,%rdi
call   1070 <read_input@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <generate_output@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [51 x i8] c"usage: gen-auto-libm-tests <input> <func> <output>\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @error(i32 %12, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
store i8* %20, i8** %7
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
store i8* %23, i8** %8
%24 = call i32 (...) @init_fp_formats()
%25 = load i8*, i8** %6
%26 = call i32 @read_input(i8* %25)
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = call i32 @generate_output(i8* %27, i8* %28)
%30 = load i32, i32* @EXIT_SUCCESS
%31 = call i32 @exit(i32 %30)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [51 x i8] c"usage: gen-auto-libm-tests <input> <func> <output>\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @error(i32 %5, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 (...) @init_fp_formats()
%15 = tail call i32 @read_input(i8* %9)
%16 = tail call i32 @generate_output(i8* %11, i8* %13)
%17 = load i32, i32* @EXIT_SUCCESS
%18 = tail call i32 @exit(i32 %17)
unreachable
}