#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 */
struct vm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dispense_eighteen_dollars_eighty_five_cents(int *,
                                                               struct vm *);
int /*<<< orphan*/ dispense_no_change(int *, struct vm *);
int /*<<< orphan*/ dispense_one_dollar_change(int *, struct vm *);
int /*<<< orphan*/ dispense_one_dollar_change_cascade(int *, struct vm *);
int /*<<< orphan*/ printf(char *);
void dispense_change_tests(int stats[3], struct vm *vm) {
  printf("Testing dispense change:\n");
  dispense_no_change(stats, vm);
  dispense_one_dollar_change(stats, vm);
  dispense_one_dollar_change_cascade(stats, vm);
  dispense_eighteen_dollars_eighty_five_cents(stats, vm);
  printf("\n");
}


x86 assembly (clang, -O0):
<dispense_change_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <dispense_no_change@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <dispense_one_dollar_change@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dispense_one_dollar_change_cascade@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <dispense_eighteen_dollars_eighty_five_cents@plt>
lea    0xe71(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispense_change_tests>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <dispense_no_change@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <dispense_one_dollar_change@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <dispense_one_dollar_change_cascade@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <dispense_eighteen_dollars_eighty_five_cents@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.vm = type { i32 }
@.str = [26 x i8] c"Testing dispense change:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dispense_change_tests(i32* %0, %struct.vm* %1) {
%3 = alloca i32*
%4 = alloca %struct.vm*
store i32* %0, i32** %3
store %struct.vm* %1, %struct.vm** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load %struct.vm*, %struct.vm** %4
%8 = call i32 @dispense_no_change(i32* %6, %struct.vm* %7)
%9 = load i32*, i32** %3
%10 = load %struct.vm*, %struct.vm** %4
%11 = call i32 @dispense_one_dollar_change(i32* %9, %struct.vm* %10)
%12 = load i32*, i32** %3
%13 = load %struct.vm*, %struct.vm** %4
%14 = call i32 @dispense_one_dollar_change_cascade(i32* %12, %struct.vm* %13)
%15 = load i32*, i32** %3
%16 = load %struct.vm*, %struct.vm** %4
%17 = call i32 @dispense_eighteen_dollars_eighty_five_cents(i32* %15, %struct.vm* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.vm = type { i32 }
@str = [25 x i8] c"Testing dispense change:\00"
define void @dispense_change_tests(i32* %0, %struct.vm* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @dispense_no_change(i32* %0, %struct.vm* %1)
%5 = tail call i32 @dispense_one_dollar_change(i32* %0, %struct.vm* %1)
%6 = tail call i32 @dispense_one_dollar_change_cascade(i32* %0, %struct.vm* %1)
%7 = tail call i32 @dispense_eighteen_dollars_eighty_five_cents(i32* %0, %struct.vm* %1)
%8 = tail call i32 @putchar(i32 10)
ret void
}