#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 *, double *);
int main(void) {
  double valor;
  int i;
  int reais;
  int centavos;
  int cedulas[] = {100, 50, 20, 10, 5, 2, 0};
  int moedas[] = {100, 50, 25, 10, 5, 1, 0};
  scanf("%lf", &valor);
  reais = (int)valor;
  centavos = (valor - reais) * 100;
  printf("NOTAS:\n");
  i = 0;
  while (cedulas[i] != 0) {
    printf("%d nota(s) de R$ %d.00\n", reais / cedulas[i], cedulas[i]);
    reais = reais % cedulas[i];
    i++;
  }
  centavos += reais * 100;
  printf("MOEDAS:\n");
  i = 0;
  while (moedas[i] != 0) {
    printf("%d moeda(s) de R$ %.2f\n", centavos / moedas[i], moedas[i] / 100.0);
    centavos = centavos % moedas[i];
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x48(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe4f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
je     1221 <main+0x101>
mov    -0x18(%rbp),%eax
movslq -0x14(%rbp),%rcx
cltd
idivl  -0x40(%rbp,%rcx,4)
mov    %eax,%esi
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
movslq -0x14(%rbp),%rcx
cltd
idivl  -0x40(%rbp,%rcx,4)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d1 <main+0xb1>
imul   $0x64,-0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmpl   $0x0,-0x60(%rbp,%rax,4)
je     129e <main+0x17e>
mov    -0x1c(%rbp),%eax
movslq -0x14(%rbp),%rcx
cltd
idivl  -0x60(%rbp,%rcx,4)
mov    %eax,%esi
movslq -0x14(%rbp),%rax
cvtsi2sdl -0x60(%rbp,%rax,4),%xmm0
movsd  0xd91(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xdff(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
movslq -0x14(%rbp),%rcx
cltd
idivl  -0x60(%rbp,%rcx,4)
mov    %edx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1240 <main+0x120>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xef7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%ebx
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
subsd  %xmm0,%xmm1
mulsd  0xe97(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%r14
movslq %ebx,%r15
imul   $0x51eb851f,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x64,%ebx,%eax
sub    %eax,%r15d
movsbl %r15b,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xb,%ecx
add    %al,%cl
movsbl %cl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x32,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
imul   $0x32,%eax,%eax
sub    %al,%r15b
movsbl %r15b,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0xb,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0x9,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
mov    %ebp,%ebx
shr    $0x7,%bl
add    %bpl,%bl
mov    %ebx,%eax
sar    %al
movsbl %al,%esi
mov    %r14,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
and    $0xfe,%bl
sub    %bl,%bpl
movsbl %bpl,%eax
cvttsd2si 0x10(%rsp),%ecx
imul   $0x64,%eax,%ebx
add    %ecx,%ebx
lea    0xdc2(%rip),%rdi
call   1030 <puts@plt>
lea    0xd97(%rip),%r14
movslq %ebx,%r15
imul   $0x51eb851f,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
movsd  0xd2c(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
imul   $0x64,%ebx,%eax
sub    %eax,%r15d
movsbl %r15b,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xb,%ecx
add    %al,%cl
movsbl %cl,%ebx
movsd  0xcff(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movzbl %bl,%eax
imul   $0x32,%eax,%eax
sub    %al,%r15b
movsbl %r15b,%ebp
lea    0x0(%rbp,%rbp,4),%eax
lea    0x0(%rbp,%rax,8),%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
movsd  0xcd0(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
movsd  0xca3(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movzbl %bl,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0x9,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
movsd  0xc77(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%esi
movsd  0xc5e(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.cedulas = [7 x i32] [i32 100, i32 50, i32 20, i32 10, i32 5, i32 2, i32 0]
@__const.main.moedas = [7 x i32] [i32 100, i32 50, i32 25, i32 10, i32 5, i32 1, i32 0]
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"NOTAS:\0A\00"
@.str.2 = [24 x i8] c"%d nota(s) de R$ %d.00\0A\00"
@.str.3 = [9 x i8] c"MOEDAS:\0A\00"
@.str.4 = [24 x i8] c"%d moeda(s) de R$ %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [7 x i32]
%7 = alloca [7 x i32]
store i32 0, i32* %1
%8 = bitcast [7 x i32]* %6 to i8*
%9 = bitcast [7 x i32]* %7 to i8*
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%11 = load double, double* %2
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
%13 = load double, double* %2
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = fsub double %13, %15
%17 = fmul double %16, 1.000000e+02
%18 = fptosi double %17 to i32
store i32 %18, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %20
20: ; preds = %26, %0
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %46
26: ; preds = %20
%27 = load i32, i32* %4
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = sdiv i32 %27, %31
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %32, i32 %36)
%38 = load i32, i32* %4
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = srem i32 %38, %42
store i32 %43, i32* %4
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %20
46: ; preds = %20
%47 = load i32, i32* %4
%48 = mul nsw i32 %47, 100
%49 = load i32, i32* %5
%50 = add nsw i32 %49, %48
store i32 %50, i32* %5
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %52
52: ; preds = %58, %46
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [7 x i32], [7 x i32]* %7, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %80
58: ; preds = %52
%59 = load i32, i32* %5
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [7 x i32], [7 x i32]* %7, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = sdiv i32 %59, %63
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [7 x i32], [7 x i32]* %7, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = sitofp i32 %68 to double
%70 = fdiv double %69, 1.000000e+02
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %64, double %70)
%72 = load i32, i32* %5
%73 = load i32, i32* %3
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [7 x i32], [7 x i32]* %7, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = srem i32 %72, %76
store i32 %77, i32* %5
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %3
br label %52
80: ; preds = %52
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.2 = [24 x i8] c"%d nota(s) de R$ %d.00\0A\00"
@.str.4 = [24 x i8] c"%d moeda(s) de R$ %.2f\0A\00"
@str = [7 x i8] c"NOTAS:\00"
@str.5 = [8 x i8] c"MOEDAS:\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %4, %6
%8 = fmul double %7, 1.000000e+02
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%10 = sdiv i32 %5, 100
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 100)
%12 = srem i32 %5, 100
%13 = trunc i32 %12 to i8
%14 = sdiv i8 %13, 50
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 50)
%17 = trunc i32 %12 to i8
%18 = srem i8 %17, 50
%19 = sdiv i8 %18, 20
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 20)
%22 = srem i8 %18, 20
%23 = sdiv i8 %22, 10
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 10)
%26 = srem i8 %22, 10
%27 = sdiv i8 %26, 5
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 5)
%30 = srem i8 %26, 5
%31 = sdiv i8 %30, 2
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %32, i32 2)
%34 = srem i8 %30, 2
%35 = sext i8 %34 to i32
%36 = fptosi double %8 to i32
%37 = mul nsw i32 %35, 100
%38 = add nsw i32 %37, %36
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%40 = sdiv i32 %38, 100
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %40, double 1.000000e+00)
%42 = srem i32 %38, 100
%43 = trunc i32 %42 to i8
%44 = sdiv i8 %43, 50
%45 = sext i8 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %45, double 5.000000e-01)
%47 = trunc i32 %42 to i8
%48 = srem i8 %47, 50
%49 = sdiv i8 %48, 25
%50 = sext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %50, double 2.500000e-01)
%52 = srem i8 %48, 25
%53 = sdiv i8 %52, 10
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %54, double 1.000000e-01)
%56 = srem i8 %52, 10
%57 = sdiv i8 %56, 5
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %58, double 5.000000e-02)
%60 = srem i8 %56, 5
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %61, double 1.000000e-02)
ret i32 0
}