#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 */
scalar_t__ EOF;
double fabs(double);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, char *);
double strtod(char *, char **);
char TestData(double *weights, double global_maximum) {
  char *input = (char *)malloc(sizeof(char) * 20);
  while (scanf("%s", input) != EOF) {
    char *delimiter;
    double output =
        weights[0] * strtod(input, &delimiter) / fabs(global_maximum);
    output -= weights[1];
    printf("%f\n", output);
  }
  free(input);
  return (0);
}


x86 assembly (clang, -O0):
<TestData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1070 <scanf@plt>
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
je     11fb <TestData+0xab>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <strtod@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xe3f(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
jmp    116f <TestData+0x1f>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
movsbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movapd %xmm0,(%rsp)
mov    %rdi,%r14
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rdi
mov    %rax,%rsi
call   1070 <scanf@plt>
mov    0x2e5f(%rip),%rbp
cmp    0x0(%rbp),%rax
je     1200 <TestData+0xb0>
movapd (%rsp),%xmm0
andpd  0xe64(%rip),%xmm0
movapd %xmm0,(%rsp)
lea    0x20(%rsp),%r15
lea    0xe66(%rip),%r12
lea    0xe5c(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strtod@plt>
mulsd  0x18(%rsp),%xmm0
divsd  (%rsp),%xmm0
subsd  0x8(%r14),%xmm0
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    0x0(%rbp),%rax
jne    11c0 <TestData+0x70>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%f\0A\00"
define signext i8 @TestData(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca double
store double* %0, double** %3
store double %1, double* %4
%8 = call i64 @malloc(i32 20)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
br label %10
10: ; preds = %15, %2
%11 = load i8*, i8** %5
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i64, i64* @EOF
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %32
15: ; preds = %10
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load i8*, i8** %5
%20 = call double @strtod(i8* %19, i8** %6)
%21 = fmul double %18, %20
%22 = load double, double* %4
%23 = call double @llvm.fabs.f64(double %22)
%24 = fdiv double %21, %23
store double %24, double* %7
%25 = load double*, double** %3
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = load double, double* %7
%29 = fsub double %28, %27
store double %29, double* %7
%30 = load double, double* %7
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %30)
br label %10
32: ; preds = %10
%33 = load i8*, i8** %5
%34 = call i32 @free(i8* %33)
ret i8 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%f\0A\00"
define signext i8 @TestData(double* nocapture %0, double %1) {
%3 = alloca i8*
%4 = tail call i64 @malloc(i32 20)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %24, label %9
9: ; preds = %2
%10 = bitcast i8** %3 to i8*
%11 = tail call double @llvm.fabs.f64(double %1)
%12 = getelementptr inbounds double, double* %0, i64 1
br label %13
13: ; preds = %9, %13
%14 = load double, double* %0
%15 = call double @strtod(i8* %5, i8** %3)
%16 = fmul double %14, %15
%17 = fdiv double %16, %11
%18 = load double, double* %12
%19 = fsub double %17, %18
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = tail call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %13
24: ; preds = %13, %2
%25 = tail call i32 @free(i8* %5)
ret i8 0
}