#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 */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, float *);
int main() {
  char *data;
  float temperatura;
  printf("%s%c%c\n", "Content-Type:text/html;charset=utf-8", 13, 10);
  printf("<TITLE>Celsius para Fahrenheit</TITLE>\n");
  printf("<H3>Celsius para Fahrenheit</H3>\n");
  data = getenv("QUERY_STRING");
  if (data == NULL) {
    printf("<P>Error! Error in passing data from form to script.");
  } else if (sscanf(data, "temperatura=%f", &temperatura) != 1) {
    printf("<P>Error! Invalid data. Data must be numeric.");
  } else {
    printf("<P>Temperatura em Celsius %f para Fahrenheit %f</P>", temperatura,
           temperatura * 18000 + 32.00);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0xd,%edx
mov    $0xa,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a8 <main+0x78>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1211 <main+0xe1>
mov    -0x10(%rbp),%rdi
lea    0xf12(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     11d8 <main+0xa8>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120c <main+0xdc>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xe1f(%rip),%xmm1
mulss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe06(%rip),%xmm2
addsd  %xmm2,%xmm1
lea    0xefd(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1211 <main+0xe1>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
mov    $0xd,%edx
mov    $0xa,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf89(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa4(%rip),%rdi
call   1040 <puts@plt>
lea    0xebe(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11d0 <main+0x90>
lea    0xeef(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    11d9 <main+0x99>
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm0
mulss  0xe4c(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xe48(%rip),%xmm1
lea    0xef5(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    11e7 <main+0xa7>
lea    0xe73(%rip),%rdi
jmp    11e0 <main+0xa0>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s%c%c\0A\00"
@.str.1 = [37 x i8] c"Content-Type:text/html;charset=utf-8\00"
@.str.2 = [40 x i8] c"<TITLE>Celsius para Fahrenheit</TITLE>\0A\00"
@.str.3 = [34 x i8] c"<H3>Celsius para Fahrenheit</H3>\0A\00"
@.str.4 = [13 x i8] c"QUERY_STRING\00"
@.str.5 = [53 x i8] c"<P>Error! Error in passing data from form to script.\00"
@.str.6 = [15 x i8] c"temperatura=%f\00"
@.str.7 = [46 x i8] c"<P>Error! Invalid data. Data must be numeric.\00"
@.str.8 = [52 x i8] c"<P>Temperatura em Celsius %f para Fahrenheit %f</P>\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 10)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%7 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
br label %27
12: ; preds = %0
%13 = load i8*, i8** %2
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), float* %3)
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
br label %26
18: ; preds = %12
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = fmul float %21, 1.800000e+04
%23 = fpext float %22 to double
%24 = fadd double %23, 3.200000e+01
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), double %20, double %24)
br label %26
26: ; preds = %18, %16
br label %27
27: ; preds = %26, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%c%c\0A\00"
@.str.1 = [37 x i8] c"Content-Type:text/html;charset=utf-8\00"
@.str.4 = [13 x i8] c"QUERY_STRING\00"
@.str.5 = [53 x i8] c"<P>Error! Error in passing data from form to script.\00"
@.str.6 = [15 x i8] c"temperatura=%f\00"
@.str.7 = [46 x i8] c"<P>Error! Invalid data. Data must be numeric.\00"
@.str.8 = [52 x i8] c"<P>Temperatura em Celsius %f para Fahrenheit %f</P>\00"
@str = [39 x i8] c"<TITLE>Celsius para Fahrenheit</TITLE>\00"
@str.9 = [33 x i8] c"<H3>Celsius para Fahrenheit</H3>\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
br label %22
10: ; preds = %0
%11 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), float* %1)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
br label %22
15: ; preds = %10
%16 = load float, float* %1
%17 = fpext float %16 to double
%18 = fmul float %16, 1.800000e+04
%19 = fpext float %18 to double
%20 = fadd double %19, 3.200000e+01
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0), double %17, double %20)
br label %22
22: ; preds = %13, %15, %8
ret i32 0
}