#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 *, int *);
int main() {
  int c, q, d, n, p;
  printf("Enter money (in cents)");
  scanf("%d", &c);
  q = c / 25;
  d = (c - 25 * q) / 10;
  n = (c - 25 * q - d * 10) / 5;
  p = c - 25 * q - d * 10 - 5 * n;
  printf("\n %d quarter(s), %d dime(s), %d nickel(s), %d penny(ies)", q, d, n,
         p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x19,-0xc(%rbp),%ecx
sub    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x19,-0xc(%rbp),%ecx
sub    %ecx,%eax
imul   $0xa,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x19,-0xc(%rbp),%ecx
sub    %ecx,%eax
imul   $0xa,-0x10(%rbp),%ecx
sub    %ecx,%eax
imul   $0x5,-0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x51eb851f,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rsi
add    %ecx,%esi
imul   $0xffffffe7,%esi,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %eax,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x21,%rcx
add    %eax,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%r8d
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter money (in cents)\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [57 x i8] c"\0A %d quarter(s), %d dime(s), %d nickel(s), %d penny(ies)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 25
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = mul nsw i32 25, %12
%14 = sub nsw i32 %11, %13
%15 = sdiv i32 %14, 10
store i32 %15, i32* %4
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = mul nsw i32 25, %17
%19 = sub nsw i32 %16, %18
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 10
%22 = sub nsw i32 %19, %21
%23 = sdiv i32 %22, 5
store i32 %23, i32* %5
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = mul nsw i32 25, %25
%27 = sub nsw i32 %24, %26
%28 = load i32, i32* %4
%29 = mul nsw i32 %28, 10
%30 = sub nsw i32 %27, %29
%31 = load i32, i32* %5
%32 = mul nsw i32 5, %31
%33 = sub nsw i32 %30, %32
store i32 %33, i32* %6
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %35, i32 %36, i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter money (in cents)\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [57 x i8] c"\0A %d quarter(s), %d dime(s), %d nickel(s), %d penny(ies)\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sdiv i32 %5, 25
%7 = mul nsw i32 %6, -25
%8 = add i32 %7, %5
%9 = sdiv i32 %8, 10
%10 = mul nsw i32 %9, -10
%11 = add i32 %10, %8
%12 = sdiv i32 %11, 5
%13 = mul nsw i32 %12, -5
%14 = add i32 %13, %11
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %14)
ret i32 0
}