#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*/ printf(char *, float, float);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  while (1) {
    float temp;
    puts("Graus Celsius:");
    scanf("%f", &temp);
    printf("\nCelsius: %.1f\nFahrenheit: %.1f\n", temp, temp * 1.8 + 32);
    puts("Digite 1 para sair ou 2 para uma nova conversao...\n");
    int sair;
    scanf("%d", &sair);
    if (sair == 1)
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe89(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11c0 <main+0x90>
jmp    11c5 <main+0x95>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xedd(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xed4(%rip),%r13
lea    0xeee(%rip),%rbx
lea    0xf1b(%rip),%rbp
mov    %rsp,%r14
nop
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xe72(%rip),%xmm1
addsd  0xe72(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x1,(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Graus Celsius:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"\0ACelsius: %.1f\0AFahrenheit: %.1f\0A\00"
@.str.3 = [52 x i8] c"Digite 1 para sair ou 2 para uma nova conversao...\0A\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %18
%5 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.800000e+00, double 3.200000e+01)
%11 = fptrunc double %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), float %7, float %11)
%13 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %4
br label %19
18: ; preds = %4
br label %4
19: ; preds = %17
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"Graus Celsius:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"\0ACelsius: %.1f\0AFahrenheit: %.1f\0A\00"
@.str.3 = [52 x i8] c"Digite 1 para sair ou 2 para uma nova conversao...\0A\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.800000e+00, double 3.200000e+01)
%11 = fptrunc double %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), float %8, float %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %5
17: ; preds = %5
ret i32 0
}