#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 rint(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x;
  int a;
  scanf("%lf", &x);
  a = rint(x * 100);
  printf("NOTAS:\n");
  printf("%d nota(s) de R$ 100.00\n", a / 10000);
  a %= 10000;
  printf("%d nota(s) de R$ 50.00\n", a / 5000);
  a %= 5000;
  printf("%d nota(s) de R$ 20.00\n", a / 2000);
  a %= 2000;
  printf("%d nota(s) de R$ 10.00\n", a / 1000);
  a %= 1000;
  printf("%d nota(s) de R$ 5.00\n", a / 500);
  a %= 500;
  printf("%d nota(s) de R$ 2.00\n", a / 200);
  a %= 200;
  printf("MOEDAS:\n");
  printf("%d moeda(s) de R$ 1.00\n", a / 100);
  a %= 100;
  printf("%d moeda(s) de R$ 0.50\n", a / 50);
  a %= 50;
  printf("%d moeda(s) de R$ 0.25\n", a / 25);
  a %= 25;
  printf("%d moeda(s) de R$ 0.10\n", a / 10);
  a %= 10;
  printf("%d moeda(s) de R$ 0.05\n", a / 5);
  a %= 5;
  printf("%d moeda(s) de R$ 0.01\n", a / 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xea9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <rint@plt>
mov    %eax,-0x14(%rbp)
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x1388,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x1388,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x7d0,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x7d0,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x1f4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x1f4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xc8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xc8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb9(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xe99(%rip),%xmm0
call   1050 <rint@plt>
mov    %eax,%ebx
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
movslq %ebx,%r14
imul   $0x68db8bad,%r14,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x2c,%rbx
add    %eax,%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x2710,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%eax
imul   $0x1a37,%eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x19,%ebx
add    %eax,%ebx
movswl %bx,%esi
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x1388,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%eax
imul   $0xffff8313,%eax,%eax
shr    $0x10,%eax
add    %r14d,%eax
movzwl %ax,%eax
movswl %ax,%ebx
shr    $0xf,%eax
sar    $0xa,%ebx
add    %eax,%ebx
movswl %bx,%esi
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x7d0,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%eax
imul   $0xffff8313,%eax,%eax
shr    $0x10,%eax
add    %r14d,%eax
movzwl %ax,%eax
movswl %ax,%ebx
shr    $0xf,%eax
sar    $0x9,%ebx
add    %eax,%ebx
movswl %bx,%esi
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x3e8,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%eax
imul   $0xffff8313,%eax,%eax
shr    $0x10,%eax
add    %r14d,%eax
movzwl %ax,%eax
movswl %ax,%ebx
shr    $0xf,%eax
sar    $0x8,%ebx
add    %eax,%ebx
movswl %bx,%esi
lea    0xdfd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x1f4,%ebx,%eax
sub    %eax,%r14d
lea    0xdfd(%rip),%rdi
movswl %r14w,%eax
imul   $0x147b,%eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x14,%ebx
add    %eax,%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0xc8,%ebx,%eax
sub    %eax,%r14d
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xddb(%rip),%rdi
movswl %r14w,%eax
imul   $0x147b,%eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x13,%ebx
add    %eax,%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x64,%ebx,%eax
sub    %eax,%r14d
movsbl %r14b,%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
lea    0xdae(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
imul   $0x32,%eax,%eax
sub    %al,%r14b
movsbl %r14b,%ebx
lea    (%rbx,%rbx,4),%eax
lea    (%rbx,%rax,8),%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebp
lea    0xd95(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bpl,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bl
movsbl %bl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
lea    0xd7d(%rip),%rdi
mov    %ebx,%esi
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
lea    0xd65(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%esi
lea    0xd60(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"NOTAS:\0A\00"
@.str.2 = [25 x i8] c"%d nota(s) de R$ 100.00\0A\00"
@.str.3 = [24 x i8] c"%d nota(s) de R$ 50.00\0A\00"
@.str.4 = [24 x i8] c"%d nota(s) de R$ 20.00\0A\00"
@.str.5 = [24 x i8] c"%d nota(s) de R$ 10.00\0A\00"
@.str.6 = [23 x i8] c"%d nota(s) de R$ 5.00\0A\00"
@.str.7 = [23 x i8] c"%d nota(s) de R$ 2.00\0A\00"
@.str.8 = [9 x i8] c"MOEDAS:\0A\00"
@.str.9 = [24 x i8] c"%d moeda(s) de R$ 1.00\0A\00"
@.str.10 = [24 x i8] c"%d moeda(s) de R$ 0.50\0A\00"
@.str.11 = [24 x i8] c"%d moeda(s) de R$ 0.25\0A\00"
@.str.12 = [24 x i8] c"%d moeda(s) de R$ 0.10\0A\00"
@.str.13 = [24 x i8] c"%d moeda(s) de R$ 0.05\0A\00"
@.str.14 = [24 x i8] c"%d moeda(s) de R$ 0.01\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fmul double %5, 1.000000e+02
%7 = call i32 @rint(double %6)
store i32 %7, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 10000
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = srem i32 %12, 10000
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 5000
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = srem i32 %17, 5000
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 2000
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = srem i32 %22, 2000
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 1000
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %3
%28 = srem i32 %27, 1000
store i32 %28, i32* %3
%29 = load i32, i32* %3
%30 = sdiv i32 %29, 500
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %3
%33 = srem i32 %32, 500
store i32 %33, i32* %3
%34 = load i32, i32* %3
%35 = sdiv i32 %34, 200
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %3
%38 = srem i32 %37, 200
store i32 %38, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%40 = load i32, i32* %3
%41 = sdiv i32 %40, 100
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %3
%44 = srem i32 %43, 100
store i32 %44, i32* %3
%45 = load i32, i32* %3
%46 = sdiv i32 %45, 50
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %3
%49 = srem i32 %48, 50
store i32 %49, i32* %3
%50 = load i32, i32* %3
%51 = sdiv i32 %50, 25
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %3
%54 = srem i32 %53, 25
store i32 %54, i32* %3
%55 = load i32, i32* %3
%56 = sdiv i32 %55, 10
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %3
%59 = srem i32 %58, 10
store i32 %59, i32* %3
%60 = load i32, i32* %3
%61 = sdiv i32 %60, 5
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %3
%64 = srem i32 %63, 5
store i32 %64, i32* %3
%65 = load i32, i32* %3
%66 = sdiv i32 %65, 1
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i32 %66)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.2 = [25 x i8] c"%d nota(s) de R$ 100.00\0A\00"
@.str.3 = [24 x i8] c"%d nota(s) de R$ 50.00\0A\00"
@.str.4 = [24 x i8] c"%d nota(s) de R$ 20.00\0A\00"
@.str.5 = [24 x i8] c"%d nota(s) de R$ 10.00\0A\00"
@.str.6 = [23 x i8] c"%d nota(s) de R$ 5.00\0A\00"
@.str.7 = [23 x i8] c"%d nota(s) de R$ 2.00\0A\00"
@.str.9 = [24 x i8] c"%d moeda(s) de R$ 1.00\0A\00"
@.str.10 = [24 x i8] c"%d moeda(s) de R$ 0.50\0A\00"
@.str.11 = [24 x i8] c"%d moeda(s) de R$ 0.25\0A\00"
@.str.12 = [24 x i8] c"%d moeda(s) de R$ 0.10\0A\00"
@.str.13 = [24 x i8] c"%d moeda(s) de R$ 0.05\0A\00"
@.str.14 = [24 x i8] c"%d moeda(s) de R$ 0.01\0A\00"
@str = [7 x i8] c"NOTAS:\00"
@str.15 = [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 = fmul double %4, 1.000000e+02
%6 = call i32 @rint(double %5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%8 = sdiv i32 %6, 10000
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = srem i32 %6, 10000
%11 = trunc i32 %10 to i16
%12 = sdiv i16 %11, 5000
%13 = sext i16 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = srem i16 %11, 5000
%16 = sdiv i16 %15, 2000
%17 = sext i16 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = srem i16 %15, 2000
%20 = sdiv i16 %19, 1000
%21 = sext i16 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = srem i16 %19, 1000
%24 = sdiv i16 %23, 500
%25 = sext i16 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = srem i16 %23, 500
%28 = sdiv i16 %27, 200
%29 = sext i16 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %29)
%31 = srem i16 %27, 200
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.15, i64 0, i64 0))
%33 = sdiv i16 %31, 100
%34 = sext i16 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %34)
%36 = srem i16 %31, 100
%37 = trunc i16 %36 to i8
%38 = sdiv i8 %37, 50
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %39)
%41 = srem i8 %37, 50
%42 = sdiv i8 %41, 25
%43 = sext i8 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %43)
%45 = srem i8 %41, 25
%46 = sdiv i8 %45, 10
%47 = sext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %47)
%49 = srem i8 %45, 10
%50 = sdiv i8 %49, 5
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i32 %51)
%53 = srem i8 %49, 5
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i32 %54)
ret i32 0
}