#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() {
  double n;
  int money;
  int temp;
  int i = 0;
  scanf("%lf", &n);
  money = n * 100;
  int notes[12] = {10000, 5000, 2000, 1000, 500, 200, 100, 50, 25, 10, 5, 1};
  float a[12] = {100, 50, 20, 10, 5, 2, 1, .5, .25, .1, .05, .01};
  printf("NOTAS:\n");
  while (i < 6) {
    temp = money / notes[i];
    money = money - temp * notes[i];
    printf("%d nota(s) de R$ %.2lf\n", temp, a[i]);
    i++;
  }
  printf("MOEDAS:\n");
  while (i < 12) {
    temp = money / notes[i];
    money = money - temp * notes[i];
    printf("%d moeda(s) de R$ %.2lf\n", temp, a[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xe9f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xef3(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x6,-0x1c(%rbp)
jge    11ff <main+0xcf>
mov    -0x14(%rbp),%eax
movslq -0x1c(%rbp),%rcx
cltd
idivl  -0x50(%rbp,%rcx,4)
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
movslq -0x1c(%rbp),%rdx
imul   -0x50(%rbp,%rdx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
movslq -0x1c(%rbp),%rax
movss  -0x80(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a5 <main+0x75>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xc,-0x1c(%rbp)
jge    1267 <main+0x137>
mov    -0x14(%rbp),%eax
movslq -0x1c(%rbp),%rcx
cltd
idivl  -0x50(%rbp,%rcx,4)
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
movslq -0x1c(%rbp),%rdx
imul   -0x50(%rbp,%rdx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
movslq -0x1c(%rbp),%rax
movss  -0x80(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120d <main+0xdd>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf25(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
cvttsd2si %xmm0,%ebx
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
movslq %ebx,%rbx
imul   $0x68db8bad,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x2c,%rsi
add    %eax,%esi
imul   $0xffffd8f0,%esi,%eax
add    %eax,%ebx
lea    0xede(%rip),%r14
mov    %r14,%rdi
movsd  0xe6f(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x68db8bad,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x2b,%rsi
add    %eax,%esi
imul   $0xffffec78,%esi,%eax
add    %eax,%ebx
movsd  0xe49(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x10624dd3,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x27,%rsi
add    %eax,%esi
imul   $0xfffff830,%esi,%eax
add    %eax,%ebx
movsd  0xe20(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x10624dd3,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x26,%rsi
add    %eax,%esi
imul   $0xfffffc18,%esi,%eax
add    %eax,%ebx
movsd  0xdf7(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x10624dd3,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
imul   $0xfffffe0c,%esi,%eax
add    %eax,%ebx
movsd  0xdce(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x51eb851f,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x26,%rsi
add    %eax,%esi
imul   $0xffffff38,%esi,%eax
add    %eax,%ebx
movsd  0xda5(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe08(%rip),%rdi
call   1030 <puts@plt>
movslq %ebx,%rbx
imul   $0x51eb851f,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
imul   $0xffffff9c,%esi,%eax
add    %eax,%ebx
lea    0xdc0(%rip),%r14
movsd  0xd6c(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x51eb851f,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x24,%rsi
add    %eax,%esi
imul   $0xffffffce,%esi,%eax
add    %eax,%ebx
movsd  0xd46(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x51eb851f,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x23,%rsi
add    %eax,%esi
imul   $0xffffffe7,%esi,%eax
add    %eax,%ebx
movsd  0xd20(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x66666667,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
movsd  0xcf7(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movslq %ebx,%rbx
imul   $0x66666667,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x21,%rsi
add    %eax,%esi
lea    (%rsi,%rsi,4),%eax
sub    %eax,%ebx
movsd  0xcd1(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xcc7(%rip),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@__const.main.notes = [12 x i32] [i32 10000, i32 5000, i32 2000, i32 1000, i32 500, i32 200, i32 100, i32 50, i32 25, i32 10, i32 5, i32 1]
@__const.main.a = [12 x float] [float 1.000000e+02, float 5.000000e+01, float 2.000000e+01, float 1.000000e+01, float 5.000000e+00, float 2.000000e+00, float 1.000000e+00, float 5.000000e-01, float 2.500000e-01, float 0x3FB99999A0000000, float 0x3FA99999A0000000, float 0x3F847AE140000000]
@.str.1 = [8 x i8] c"NOTAS:\0A\00"
@.str.2 = [24 x i8] c"%d nota(s) de R$ %.2lf\0A\00"
@.str.3 = [9 x i8] c"MOEDAS:\0A\00"
@.str.4 = [25 x i8] c"%d moeda(s) de R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [12 x i32]
%7 = alloca [12 x float]
store i32 0, i32* %1
store i32 0, i32* %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%9 = load double, double* %2
%10 = fmul double %9, 1.000000e+02
%11 = fptosi double %10 to i32
store i32 %11, i32* %3
%12 = bitcast [12 x i32]* %6 to i8*
%13 = bitcast [12 x float]* %7 to i8*
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %18, %0
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 6
br i1 %17, label %18, label %42
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = sdiv i32 %19, %23
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = mul nsw i32 %26, %30
%32 = sub nsw i32 %25, %31
store i32 %32, i32* %3
%33 = load i32, i32* %4
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [12 x float], [12 x float]* %7, i64 0, i64 %35
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %33, double %38)
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %15
42: ; preds = %15
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %44
44: ; preds = %47, %42
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 12
br i1 %46, label %47, label %71
47: ; preds = %44
%48 = load i32, i32* %3
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = sdiv i32 %48, %52
store i32 %53, i32* %4
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = load i32, i32* %5
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = mul nsw i32 %55, %59
%61 = sub nsw i32 %54, %60
store i32 %61, i32* %3
%62 = load i32, i32* %4
%63 = load i32, i32* %5
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [12 x float], [12 x float]* %7, i64 0, i64 %64
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %62, double %67)
%69 = load i32, i32* %5
%70 = add nsw i32 %69, 1
store i32 %70, i32* %5
br label %44
71: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.2 = [24 x i8] c"%d nota(s) de R$ %.2lf\0A\00"
@.str.4 = [25 x i8] c"%d moeda(s) de R$ %.2lf\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 = fmul double %4, 1.000000e+02
%6 = fptosi double %5 to i32
%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 = mul nsw i32 %8, -10000
%10 = add i32 %9, %6
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8, double 1.000000e+02)
%12 = sdiv i32 %10, 5000
%13 = mul nsw i32 %12, -5000
%14 = add i32 %13, %10
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %12, double 5.000000e+01)
%16 = sdiv i32 %14, 2000
%17 = mul nsw i32 %16, -2000
%18 = add i32 %17, %14
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %16, double 2.000000e+01)
%20 = sdiv i32 %18, 1000
%21 = mul nsw i32 %20, -1000
%22 = add i32 %21, %18
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %20, double 1.000000e+01)
%24 = sdiv i32 %22, 500
%25 = mul nsw i32 %24, -500
%26 = add i32 %25, %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %24, double 5.000000e+00)
%28 = sdiv i32 %26, 200
%29 = mul nsw i32 %28, -200
%30 = add i32 %29, %26
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %28, double 2.000000e+00)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%33 = sdiv i32 %30, 100
%34 = mul nsw i32 %33, -100
%35 = add i32 %34, %30
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %33, double 1.000000e+00)
%37 = sdiv i32 %35, 50
%38 = mul nsw i32 %37, -50
%39 = add i32 %38, %35
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %37, double 5.000000e-01)
%41 = sdiv i32 %39, 25
%42 = mul nsw i32 %41, -25
%43 = add i32 %42, %39
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %41, double 2.500000e-01)
%45 = sdiv i32 %43, 10
%46 = mul nsw i32 %45, -10
%47 = add i32 %46, %43
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %45, double 0x3FB99999A0000000)
%49 = sdiv i32 %47, 5
%50 = mul nsw i32 %49, -5
%51 = add i32 %50, %47
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %49, double 0x3FA99999A0000000)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %51, double 0x3F847AE140000000)
ret i32 0
}