#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 */
float convertTemperature(char, char);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, char, float,
                           float);
int /*<<< orphan*/ stderr;
char testit(char byte1, char byte2, float expected) {
  float result;
  result = convertTemperature(byte1, byte2);
  if (result != expected) {
    fprintf(stderr, "invalid result: 0x%.2x%.2x -> %g (expected: %g)\n", byte1,
            byte2, result, expected);
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<testit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x2(%rbp),%al
movsbl %al,%edi
movsbl -0x3(%rbp),%esi
call   1040 <convertTemperature@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1167 <testit+0x47>
jp     1167 <testit+0x47>
jmp    119b <testit+0x7b>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe79(%rip),%rsi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <fprintf@plt>
movb   $0xff,-0x1(%rbp)
jmp    119f <testit+0x7f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testit>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <convertTemperature@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm1,%xmm0
jne    113f <testit+0x1f>
jnp    115f <testit+0x3f>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
movsbl %bpl,%edx
movsbl %bl,%ecx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%al
jmp    1161 <testit+0x41>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"invalid result: 0x%.2x%.2x -> %g (expected: %g)\0A\00"
define signext i8 @testit(i8 signext %0, i8 signext %1, float %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca float
%8 = alloca float
store i8 %0, i8* %5
store i8 %1, i8* %6
store float %2, float* %7
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = call float @convertTemperature(i8 signext %9, i8 signext %10)
store float %11, float* %8
%12 = load float, float* %8
%13 = load float, float* %7
%14 = fcmp une float %12, %13
br i1 %14, label %15, label %22
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = load i8, i8* %5
%18 = load i8, i8* %6
%19 = load float, float* %8
%20 = load float, float* %7
%21 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8 signext %17, i8 signext %18, float %19, float %20)
store i8 -1, i8* %4
br label %23
22: ; preds = %3
store i8 0, i8* %4
br label %23
23: ; preds = %22, %15
%24 = load i8, i8* %4
ret i8 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"invalid result: 0x%.2x%.2x -> %g (expected: %g)\0A\00"
define signext i8 @testit(i8 signext %0, i8 signext %1, float %2) {
%4 = tail call float @convertTemperature(i8 signext %0, i8 signext %1)
%5 = fcmp une float %4, %2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1, float %4, float %2)
br label %9
9: ; preds = %3, %6
%10 = phi i8 [ -1, %6 ], [ 0, %3 ]
ret i8 %10
}