#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 *, ...);
float round(float);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float f;
  int Q = 0;
  int D = 0;
  int N = 0;
  int P = 0;
  do {
    printf("How much change do you have?\n");
    scanf("%f", &f);
  } while (f < 0);
  f = f * 100;
  f = round(f);
  while (f >= 25) {
    f = f - 25;
    Q++;
  }
  printf("Quarters = %i\n", Q);
  while (f >= 10) {
    f = f - 10;
    D++;
  }
  printf("Dimes = %i\n", D);
  while (f >= 5) {
    f = f - 5;
    N++;
  }
  printf("Nickels = %i\n", N);
  while (f >= 1) {
    f = f - 1;
    P++;
  }
  printf("Pennies = %i\n", P);
  printf("%i\n", P + N + D + Q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     115b <main+0x2b>
movss  0xe72(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <round@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe50(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11e1 <main+0xb1>
movss  -0x8(%rbp),%xmm0
movss  0xe3a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a7 <main+0x77>
mov    -0xc(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe09(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     122c <main+0xfc>
movss  -0x8(%rbp),%xmm0
movss  0xdf3(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f2 <main+0xc2>
mov    -0x10(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xdc2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1277 <main+0x147>
movss  -0x8(%rbp),%xmm0
movss  0xdac(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    123d <main+0x10d>
mov    -0x14(%rbp),%esi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xd7b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12c2 <main+0x192>
movss  -0x8(%rbp),%xmm0
movss  0xd65(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1288 <main+0x158>
mov    -0x18(%rbp),%esi
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
add    -0x14(%rbp),%esi
add    -0x10(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xd82(%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   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf14(%rip),%r14
lea    0xed3(%rip),%rbp
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1160 <main+0x20>
mulss  0xe77(%rip),%xmm0
call   1060 <roundf@plt>
movss  %xmm0,0x4(%rsp)
xor    %r14d,%r14d
ucomiss 0xe66(%rip),%xmm0
mov    $0x0,%r15d
jb     11d3 <main+0x93>
xor    %r15d,%r15d
movss  0xe57(%rip),%xmm1
movss  0xe4b(%rip),%xmm2
nopl   0x0(%rax)
addss  %xmm1,%xmm0
add    $0x1,%r15d
ucomiss %xmm2,%xmm0
jae    11c0 <main+0x80>
movss  %xmm0,0x4(%rsp)
lea    0xe51(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe1b(%rip),%xmm0
jb     1223 <main+0xe3>
xor    %r14d,%r14d
movss  0xe12(%rip),%xmm1
movss  0xe06(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
addss  %xmm1,%xmm0
add    $0x1,%r14d
ucomiss %xmm2,%xmm0
jae    1210 <main+0xd0>
movss  %xmm0,0x4(%rsp)
lea    0xe10(%rip),%rdi
xor    %ebx,%ebx
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xdd1(%rip),%xmm0
mov    $0x0,%ebp
jb     1272 <main+0x132>
xor    %ebp,%ebp
movss  0xdc4(%rip),%xmm1
movss  0xdb8(%rip),%xmm2
nopl   0x0(%rax)
addss  %xmm1,%xmm0
add    $0x1,%ebp
ucomiss %xmm2,%xmm0
jae    1260 <main+0x120>
movss  %xmm0,0x4(%rsp)
lea    0xdcd(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xd8d(%rip),%xmm0
jb     12c2 <main+0x182>
xor    %ebx,%ebx
movss  0xd85(%rip),%xmm1
movss  0xd79(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addss  %xmm1,%xmm0
add    $0x1,%ebx
ucomiss %xmm2,%xmm0
jae    12b0 <main+0x170>
movss  %xmm0,0x4(%rsp)
lea    0xd8b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %r15d,%r14d
add    %ebp,%r14d
add    %ebx,%r14d
lea    0xd7c(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"How much change do you have?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"Quarters = %i\0A\00"
@.str.3 = [12 x i8] c"Dimes = %i\0A\00"
@.str.4 = [14 x i8] c"Nickels = %i\0A\00"
@.str.5 = [14 x i8] c"Pennies = %i\0A\00"
@.str.6 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %10, %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %10
10: ; preds = %7
%11 = load float, float* %2
%12 = fcmp olt float %11, 0.000000e+00
br i1 %12, label %7, label %13
13: ; preds = %10
%14 = load float, float* %2
%15 = fmul float %14, 1.000000e+02
store float %15, float* %2
%16 = load float, float* %2
%17 = call float @round(float %16)
store float %17, float* %2
br label %18
18: ; preds = %21, %13
%19 = load float, float* %2
%20 = fcmp oge float %19, 2.500000e+01
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load float, float* %2
%23 = fsub float %22, 2.500000e+01
store float %23, float* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %18
26: ; preds = %18
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %32, %26
%30 = load float, float* %2
%31 = fcmp oge float %30, 1.000000e+01
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load float, float* %2
%34 = fsub float %33, 1.000000e+01
store float %34, float* %2
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %29
37: ; preds = %29
%38 = load i32, i32* %4
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %43, %37
%41 = load float, float* %2
%42 = fcmp oge float %41, 5.000000e+00
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = load float, float* %2
%45 = fsub float %44, 5.000000e+00
store float %45, float* %2
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %40
48: ; preds = %40
%49 = load i32, i32* %5
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %54, %48
%52 = load float, float* %2
%53 = fcmp oge float %52, 1.000000e+00
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = load float, float* %2
%56 = fsub float %55, 1.000000e+00
store float %56, float* %2
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
br label %51
59: ; preds = %51
%60 = load i32, i32* %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %6
%63 = load i32, i32* %5
%64 = add nsw i32 %62, %63
%65 = load i32, i32* %4
%66 = add nsw i32 %64, %65
%67 = load i32, i32* %3
%68 = add nsw i32 %66, %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %68)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"Quarters = %i\0A\00"
@.str.3 = [12 x i8] c"Dimes = %i\0A\00"
@.str.4 = [14 x i8] c"Nickels = %i\0A\00"
@.str.5 = [14 x i8] c"Pennies = %i\0A\00"
@.str.6 = [4 x i8] c"%i\0A\00"
@str = [29 x i8] c"How much change do you have?\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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* %1)
%6 = load float, float* %1
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = fmul float %6, 1.000000e+02
%10 = call float @llvm.round.f32(float %9)
store float %10, float* %1
%11 = fcmp ult float %10, 2.500000e+01
br i1 %11, label %19, label %12
12: ; preds = %8, %12
%13 = phi i32 [ %16, %12 ], [ 0, %8 ]
%14 = phi float [ %15, %12 ], [ %10, %8 ]
%15 = fadd float %14, -2.500000e+01
%16 = add nuw nsw i32 %13, 1
%17 = fcmp ult float %15, 2.500000e+01
br i1 %17, label %18, label %12
18: ; preds = %12
store float %15, float* %1
br label %19
19: ; preds = %18, %8
%20 = phi i32 [ %16, %18 ], [ 0, %8 ]
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load float, float* %1
%23 = fcmp ult float %22, 1.000000e+01
br i1 %23, label %31, label %24
24: ; preds = %19, %24
%25 = phi i32 [ %28, %24 ], [ 0, %19 ]
%26 = phi float [ %27, %24 ], [ %22, %19 ]
%27 = fadd float %26, -1.000000e+01
%28 = add nuw nsw i32 %25, 1
%29 = fcmp ult float %27, 1.000000e+01
br i1 %29, label %30, label %24
30: ; preds = %24
store float %27, float* %1
br label %31
31: ; preds = %30, %19
%32 = phi i32 [ %28, %30 ], [ 0, %19 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = load float, float* %1
%35 = fcmp ult float %34, 5.000000e+00
br i1 %35, label %43, label %36
36: ; preds = %31, %36
%37 = phi i32 [ %40, %36 ], [ 0, %31 ]
%38 = phi float [ %39, %36 ], [ %34, %31 ]
%39 = fadd float %38, -5.000000e+00
%40 = add nuw nsw i32 %37, 1
%41 = fcmp ult float %39, 5.000000e+00
br i1 %41, label %42, label %36
42: ; preds = %36
store float %39, float* %1
br label %43
43: ; preds = %42, %31
%44 = phi i32 [ %40, %42 ], [ 0, %31 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load float, float* %1
%47 = fcmp ult float %46, 1.000000e+00
br i1 %47, label %55, label %48
48: ; preds = %43, %48
%49 = phi i32 [ %52, %48 ], [ 0, %43 ]
%50 = phi float [ %51, %48 ], [ %46, %43 ]
%51 = fadd float %50, -1.000000e+00
%52 = add nuw nsw i32 %49, 1
%53 = fcmp ult float %51, 1.000000e+00
br i1 %53, label %54, label %48
54: ; preds = %48
store float %51, float* %1
br label %55
55: ; preds = %54, %43
%56 = phi i32 [ %52, %54 ], [ 0, %43 ]
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %56)
%58 = add i32 %32, %20
%59 = add i32 %58, %44
%60 = add i32 %59, %56
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %60)
ret i32 0
}