#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, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int pennies;
  scanf("%d", &pennies);
  int quarters = pennies / 25;
  pennies %= 25;
  int dimes = pennies / 10;
  pennies %= 10;
  int nickels = pennies / 5;
  pennies %= 5;
  printf("%d quarters, %d dimes, %d nickels and %d pennies\n", quarters, dimes,
         nickels, pennies);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%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
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%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
lea    (%rsi,%rsi,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movsbl %al,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
movsbl %dl,%edx
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movsbl %al,%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edi
shr    $0x9,%ecx
shr    $0xf,%edi
add    %cl,%dil
movsbl %dil,%ecx
movzbl %cl,%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%al
movsbl %al,%r8d
mov    %r8d,0x4(%rsp)
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [50 x i8] c"%d quarters, %d dimes, %d nickels and %d pennies\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 25
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = srem i32 %9, 25
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 10
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = srem i32 %13, 10
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 5
store i32 %16, i32* %5
%17 = load i32, i32* %2
%18 = srem i32 %17, 5
store i32 %18, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %20, i32 %21, i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [50 x i8] c"%d quarters, %d dimes, %d nickels and %d pennies\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 25
%6 = srem i32 %4, 25
%7 = trunc i32 %6 to i8
%8 = sdiv i8 %7, 10
%9 = sext i8 %8 to i32
%10 = srem i8 %7, 10
%11 = sdiv i8 %10, 5
%12 = sext i8 %11 to i32
%13 = srem i8 %10, 5
%14 = sext i8 %13 to i32
store i32 %14, i32* %1
%15 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %9, i32 %12, i32 %14)
ret i32 0
}