#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float aSales;
  while (1) {
    printf("\nEnter the amount of sales (-1, to end): ");
    scanf("%f", &aSales);
    if (aSales == -1)
      break;
    printf("Salary: $%.2f", aSales * 9 / 100 + 200);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    116e <main+0x4e>
jp     116e <main+0x4e>
jmp    11aa <main+0x8a>
movss  0xe96(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xe85(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe75(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xeac(%rip),%xmm0
jne    1158 <main+0x38>
jnp    11cc <main+0xac>
lea    0xede(%rip),%r14
lea    0xeaa(%rip),%r15
lea    0xecd(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulss  0xe7c(%rip),%xmm0
divss  0xe78(%rip),%xmm0
addss  0xe74(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe38(%rip),%xmm0
jne    1180 <main+0x60>
jp     1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0AEnter the amount of sales (-1, to end): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"Salary: $%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
br label %3
3: ; preds = %0, %9
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fcmp oeq float %6, -1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %3
br label %16
9: ; preds = %3
%10 = load float, float* %2
%11 = fmul float %10, 9.000000e+00
%12 = fdiv float %11, 1.000000e+02
%13 = fadd float %12, 2.000000e+02
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %14)
br label %3
16: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0AEnter the amount of sales (-1, to end): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"Salary: $%.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp oeq float %5, -1.000000e+00
br i1 %6, label %18, label %7
7: ; preds = %0, %7
%8 = phi float [ %16, %7 ], [ %5, %0 ]
%9 = fmul float %8, 9.000000e+00
%10 = fdiv float %9, 1.000000e+02
%11 = fadd float %10, 2.000000e+02
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%16 = load float, float* %1
%17 = fcmp oeq float %16, -1.000000e+00
br i1 %17, label %18, label %7
18: ; preds = %7, %0
ret i32 0
}