#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 getPositiveFloat();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  static int quarter = 25;
  static int dime = 10;
  static int nickel = 5;
  static int penny = 1;
  int n = getPositiveFloat();
  int t = 0;
  while (n > 0) {
    if (n >= quarter) {
      n = n - quarter;
    } else if (n >= dime) {
      n = n - dime;
    } else if (n >= nickel) {
      n = n - nickel;
    } else {
      n = n - penny;
    }
    t = t + 1;
  };
  printf("%i\n", t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getPositiveFloat@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11ce <main+0xae>
mov    -0x8(%rbp),%eax
cmp    0x2edd(%rip),%eax
jl     116a <main+0x4a>
mov    -0x8(%rbp),%eax
sub    0x2ece(%rip),%eax
mov    %eax,-0x8(%rbp)
jmp    11c0 <main+0xa0>
mov    -0x8(%rbp),%eax
cmp    0x2ec1(%rip),%eax
jl     118a <main+0x6a>
mov    -0x8(%rbp),%eax
sub    0x2eb2(%rip),%eax
mov    %eax,-0x8(%rbp)
jmp    11bb <main+0x9b>
mov    -0x8(%rbp),%eax
cmp    0x2ea5(%rip),%eax
jl     11aa <main+0x8a>
mov    -0x8(%rbp),%eax
sub    0x2e96(%rip),%eax
mov    %eax,-0x8(%rbp)
jmp    11b6 <main+0x96>
mov    -0x8(%rbp),%eax
sub    0x2e89(%rip),%eax
mov    %eax,-0x8(%rbp)
jmp    11bb <main+0x9b>
jmp    11c0 <main+0xa0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main+0x20>
mov    -0xc(%rbp),%esi
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getPositiveFloat@plt>
test   %eax,%eax
jle    116b <main+0x4b>
xor    %ebx,%ebx
jmp    1147 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
add    %ecx,%eax
je     116b <main+0x4b>
mov    $0xffffffe7,%ecx
cmp    $0x18,%eax
ja     1140 <main+0x20>
mov    $0xfffffff6,%ecx
cmp    $0x9,%eax
ja     1140 <main+0x20>
xor    %ecx,%ecx
cmp    $0x5,%eax
setb   %cl
shl    $0x2,%ecx
or     $0xfffffffb,%ecx
jmp    1140 <main+0x20>
lea    0xe8e(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.quarter = internal global i32 25
@main.dime = internal global i32 10
@main.nickel = internal global i32 5
@main.penny = internal global i32 1
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getPositiveFloat()
store i32 %4, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %41
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* @main.quarter
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* @main.quarter
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %2
br label %38
16: ; preds = %8
%17 = load i32, i32* %2
%18 = load i32, i32* @main.dime
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* %2
%22 = load i32, i32* @main.dime
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %2
br label %37
24: ; preds = %16
%25 = load i32, i32* %2
%26 = load i32, i32* @main.nickel
%27 = icmp sge i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i32, i32* %2
%30 = load i32, i32* @main.nickel
%31 = sub nsw i32 %29, %30
store i32 %31, i32* %2
br label %36
32: ; preds = %24
%33 = load i32, i32* %2
%34 = load i32, i32* @main.penny
%35 = sub nsw i32 %33, %34
store i32 %35, i32* %2
br label %36
36: ; preds = %32, %28
br label %37
37: ; preds = %36, %20
br label %38
38: ; preds = %37, %12
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %5
41: ; preds = %5
%42 = load i32, i32* %3
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getPositiveFloat()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %17
3: ; preds = %0, %12
%4 = phi i32 [ %15, %12 ], [ 0, %0 ]
%5 = phi i32 [ %14, %12 ], [ %1, %0 ]
%6 = icmp ugt i32 %5, 24
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = icmp ugt i32 %5, 9
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ugt i32 %5, 4
%11 = select i1 %10, i32 -5, i32 -1
br label %12
12: ; preds = %9, %7, %3
%13 = phi i32 [ -25, %3 ], [ -10, %7 ], [ %11, %9 ]
%14 = add nsw i32 %5, %13
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %14, 0
br i1 %16, label %17, label %3
17: ; preds = %12, %0
%18 = phi i32 [ 0, %0 ], [ %15, %12 ]
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}