#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*/ instruct();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ thanks();
int main(void) {
  int change_amount, bill_of_50, bill_of_10, bill_of_5, bill_of_1;
  instruct();
  printf("\n\nEnter the amount of change >\a\n");
  scanf("%d", &change_amount);
  bill_of_50 = change_amount / 50;
  bill_of_10 = (change_amount % 50) / 10;
  bill_of_5 = (change_amount % 10) / 5;
  bill_of_1 = (change_amount % 5) / 1;
  printf("\nBill of 50 = %d\n", bill_of_50);
  printf("Bill of 10 = %d\n", bill_of_10);
  printf("Bill of 5  = %d\n", bill_of_5);
  printf("Bill of 1  = %d\n", bill_of_1);
  thanks();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <instruct@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <thanks@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <instruct@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8e(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rbx
imul   $0x51eb851f,%rbx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x24,%rsi
add    %eax,%esi
imul   $0x32,%esi,%eax
mov    %ebx,%ecx
sub    %eax,%ecx
movsbl %cl,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%r14d
imul   $0x66666667,%rbx,%rax
mov    %rax,%rdx
shr    $0x22,%rdx
mov    %rax,%rcx
shr    $0x3f,%rcx
add    %ecx,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
mov    %ebx,%edi
sub    %edx,%edi
movsbl %dil,%edx
imul   $0x67,%edx,%edx
movzwl %dx,%edx
movswl %dx,%edi
shr    $0xf,%edx
shr    $0x9,%edi
add    %dl,%dil
movsbl %dil,%ebp
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    0xe03(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe07(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe07(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe08(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <thanks@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A\0AEnter the amount of change >\07\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0ABill of 50 = %d\0A\00"
@.str.3 = [17 x i8] c"Bill of 10 = %d\0A\00"
@.str.4 = [17 x i8] c"Bill of 5 = %d\0A\00"
@.str.5 = [17 x i8] c"Bill of 1 = %d\0A\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 (...) @instruct()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 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), i32* %2)
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 50
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = srem i32 %12, 50
%14 = sdiv i32 %13, 10
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
%17 = sdiv i32 %16, 5
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = srem i32 %18, 5
%20 = sdiv i32 %19, 1
store i32 %20, i32* %6
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %6
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = call i32 (...) @thanks()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0ABill of 50 = %d\0A\00"
@.str.3 = [17 x i8] c"Bill of 10 = %d\0A\00"
@.str.4 = [17 x i8] c"Bill of 5 = %d\0A\00"
@.str.5 = [17 x i8] c"Bill of 1 = %d\0A\00"
@str = [32 x i8] c"\0A\0AEnter the amount of change >\07\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @instruct()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 50
%8 = srem i32 %6, 50
%9 = trunc i32 %8 to i8
%10 = sdiv i8 %9, 10
%11 = sext i8 %10 to i32
%12 = srem i32 %6, 10
%13 = trunc i32 %12 to i8
%14 = sdiv i8 %13, 5
%15 = sext i8 %14 to i32
%16 = srem i32 %6, 5
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%21 = call i32 (...) @thanks()
ret i32 0
}