#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, double, int, double);
int /*<<< orphan*/ scanf(char *, int *, double *);
int main() {
  int code = 0;
  double sale = 0;
  double maior = 0, menor = 99999;
  int less_code, large_code;
  int i;
  for (i = 0; i < 10; i++) {
    scanf("%d %lf", &code, &sale);
    if (sale <= 5000)
      sale *= 0.015;
    if (sale > 5000 && sale < 15000)
      sale *= 0.035;
    if (sale > 15000)
      sale *= 0.047;
    if (sale > maior) {
      maior = sale;
      large_code = code;
    }
    if (sale < menor) {
      menor = sale;
      less_code = code;
    }
  }
  printf("%d %.2lf %d %.2lf\n", large_code, maior, less_code, menor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xa,-0x2c(%rbp)
jge    1259 <main+0x139>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
movsd  0xe88(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     119d <main+0x7d>
movsd  0xe7d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11d9 <main+0xb9>
movsd  0xe5c(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11d9 <main+0xb9>
movsd  0xe51(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1202 <main+0xe2>
movsd  0xe30(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1222 <main+0x102>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1246 <main+0x126>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    124b <main+0x12b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115a <main+0x3a>
mov    -0x28(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0xc(%rsp)
movq   $0x0,0x10(%rsp)
xorpd  %xmm3,%xmm3
movsd  0xeb5(%rip),%xmm2
mov    $0xa,%r13d
lea    0xed8(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x10(%rsp),%r12
jmp    11c7 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm0,%xmm2
mulsd  0xeac(%rip),%xmm2
movapd %xmm3,%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movlpd %xmm1,0x10(%rsp)
ucomisd %xmm5,%xmm1
mov    0xc(%rsp),%eax
movapd %xmm1,%xmm0
cmova  %eax,%ebx
maxsd  %xmm5,%xmm0
ucomisd %xmm1,%xmm4
minsd  %xmm4,%xmm1
cmova  %eax,%ebp
movapd %xmm1,%xmm2
movapd %xmm0,%xmm3
add    $0xffffffff,%r13d
je     124e <main+0x12e>
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x20(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
movsd  0xe1f(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jb     1203 <main+0xe3>
mulsd  0xe13(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe0d(%rip),%xmm3
movsd  0x20(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
ucomisd %xmm0,%xmm1
seta   %al
ucomisd %xmm1,%xmm3
seta   %cl
movapd %xmm1,%xmm0
mulsd  0xdef(%rip),%xmm0
test   %cl,%al
jne    1239 <main+0x119>
movapd %xmm1,%xmm0
jne    1170 <main+0x50>
ucomisd %xmm3,%xmm0
jbe    1197 <main+0x77>
jmp    1170 <main+0x50>
lea    0xde2(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [19 x i8] c"%d %.2lf %d %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 9.999900e+04, double* %5
store i32 0, i32* %8
br label %9
9: ; preds = %49, %0
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %52
12: ; preds = %9
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, double* %3)
%14 = load double, double* %3
%15 = fcmp ole double %14, 5.000000e+03
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load double, double* %3
%18 = fmul double %17, 1.500000e-02
store double %18, double* %3
br label %19
19: ; preds = %16, %12
%20 = load double, double* %3
%21 = fcmp ogt double %20, 5.000000e+03
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load double, double* %3
%24 = fcmp olt double %23, 1.500000e+04
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load double, double* %3
%27 = fmul double %26, 3.500000e-02
store double %27, double* %3
br label %28
28: ; preds = %25, %22, %19
%29 = load double, double* %3
%30 = fcmp ogt double %29, 1.500000e+04
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load double, double* %3
%33 = fmul double %32, 4.700000e-02
store double %33, double* %3
br label %34
34: ; preds = %31, %28
%35 = load double, double* %3
%36 = load double, double* %4
%37 = fcmp ogt double %35, %36
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load double, double* %3
store double %39, double* %4
%40 = load i32, i32* %2
store i32 %40, i32* %7
br label %41
41: ; preds = %38, %34
%42 = load double, double* %3
%43 = load double, double* %5
%44 = fcmp olt double %42, %43
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load double, double* %3
store double %46, double* %5
%47 = load i32, i32* %2
store i32 %47, i32* %6
br label %48
48: ; preds = %45, %41
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %9
52: ; preds = %9
%53 = load i32, i32* %7
%54 = load double, double* %4
%55 = load i32, i32* %6
%56 = load double, double* %5
%57 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %53, double %54, i32 %55, double %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [19 x i8] c"%d %.2lf %d %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
br label %5
5: ; preds = %0, %28
%6 = phi i32 [ 0, %0 ], [ %37, %28 ]
%7 = phi i32 [ undef, %0 ], [ %33, %28 ]
%8 = phi i32 [ undef, %0 ], [ %36, %28 ]
%9 = phi double [ 9.999900e+04, %0 ], [ %35, %28 ]
%10 = phi double [ 0.000000e+00, %0 ], [ %32, %28 ]
%11 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%12 = load double, double* %2
%13 = fcmp ugt double %12, 5.000000e+03
br i1 %13, label %16, label %14
14: ; preds = %5
%15 = fmul double %12, 1.500000e-02
store double %15, double* %2
br label %16
16: ; preds = %14, %5
%17 = phi double [ %15, %14 ], [ %12, %5 ]
%18 = fcmp ogt double %17, 5.000000e+03
%19 = fcmp olt double %17, 1.500000e+04
%20 = and i1 %18, %19
%21 = fmul double %17, 3.500000e-02
%22 = select i1 %20, double %21, double %17
%23 = fcmp ogt double %22, 1.500000e+04
%24 = or i1 %20, %23
br i1 %24, label %25, label %28
25: ; preds = %16
%26 = fmul double %22, 4.700000e-02
%27 = select i1 %23, double %26, double %22
store double %27, double* %2
br label %28
28: ; preds = %16, %25
%29 = phi double [ %17, %16 ], [ %27, %25 ]
%30 = fcmp ogt double %29, %10
%31 = load i32, i32* %1
%32 = select i1 %30, double %29, double %10
%33 = select i1 %30, i32 %31, i32 %7
%34 = fcmp olt double %29, %9
%35 = select i1 %34, double %29, double %9
%36 = select i1 %34, i32 %31, i32 %8
%37 = add nuw nsw i32 %6, 1
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %5
39: ; preds = %28
%40 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %33, double %32, i32 %36, double %35)
ret i32 0
}