#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, sum, a, b, c, d, e;
  scanf("%d", &x);
  sum = 100 - x;
  a = sum / 20;
  b = (sum - a * 20) / 10;
  c = (sum - a * 20 - b * 10) / 5;
  d = sum - a * 20 - b * 10 - c * 5;
  printf("$20 bills: %d\n", a);
  printf("$10 bills: %d\n", b);
  printf(" $5 bills: %d\n", c);
  printf(" $1 bills: %d", d);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf08(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x64,%eax
sub    0xc(%rsp),%eax
cltq
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rsi
add    %ecx,%esi
lea    0x0(,%rsi,4),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
imul   $0x66666667,%rax,%r15
mov    %r15,%rcx
shr    $0x3f,%rcx
sar    $0x22,%r15
add    %ecx,%r15d
lea    (%r15,%r15,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %eax,%r14
imul   $0x66666667,%r14,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x21,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%r14d
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    %r15d,%esi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"$20 bills: %d\0A\00"
@.str.2 = [15 x i8] c"$10 bills: %d\0A\00"
@.str.3 = [15 x i8] c" $5 bills: %d\0A\00"
@.str.4 = [14 x i8] c" $1 bills: %d\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 = sub nsw i32 100, %4
%6 = sdiv i32 %5, 20
%7 = mul nsw i32 %6, -20
%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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret i32 0
}