#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 *, int *, int *);
void main() {
  int pennies;
  int nickels;
  int dimes;
  int quarters;
  int temp, left;
  printf("Enter the number of quarters, dimes, nickels, and pennies: ");
  scanf("%d %d %d %d", &quarters, &dimes, &nickels, &pennies);
  left = 25 * quarters + 10 * dimes + 5 * nickels + pennies;
  printf("Your collection is worth\n ");
  temp = left / 100;
  printf("\t%d dollar", temp);
  if (temp == 1)
    printf(", ");
  else
    printf("s, ");
  left = left % 100;
  temp = left / 25;
  printf("%d quarter", temp);
  if (temp == 1)
    printf(", ");
  else
    printf("s, ");
  left = left % 25;
  temp = left / 10;
  printf("%d dime", temp);
  printf((temp == 1) ? ", " : "s, ");
  left = left % 10;
  temp = left / 5;
  printf("%d nickel", temp);
  if (temp == 1)
    printf(", and ");
  else
    printf("s, and ");
  left = left % 5;
  printf("%d penn", left);
  if (left == 1)
    printf("y\n");
  else
    printf("ies\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x8(%rbp),%rcx
lea    -0x4(%rbp),%r8
call   1040 <scanf@plt>
imul   $0x19,-0x10(%rbp),%eax
imul   $0xa,-0xc(%rbp),%ecx
add    %ecx,%eax
imul   $0x5,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    11b2 <main+0x92>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    120a <main+0xea>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%ecx
lea    0xe1f(%rip),%rdi
lea    0xe19(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    12ae <main+0x18e>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bc <main+0x19c>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    12f8 <main+0x1d8>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1306 <main+0x1e6>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1050 <scanf@plt>
mov    (%rsp),%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
mov    0x4(%rsp),%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
mov    0x8(%rsp),%ecx
lea    (%rcx,%rcx,4),%ebp
add    %eax,%ebp
mov    0xc(%rsp),%r14d
lea    (%r14,%rbp,1),%ebx
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
movslq %ebx,%r12
imul   $0x51eb851f,%r12,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r14,%rbp,1),%eax
add    $0xffffff9c,%eax
cmp    $0x64,%eax
lea    0xe9c(%rip),%r15
lea    0xe94(%rip),%r14
mov    %r14,%rdi
cmovb  %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x64,%ebx,%eax
sub    %eax,%r12d
movsbl %r12b,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,8),%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%ebx
lea    0xe62(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%eax
add    $0xffffffe7,%eax
cmp    $0x19,%eax
mov    %r14,%rdi
cmovb  %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%eax
sub    %al,%r12b
movsbl %r12b,%ebx
imul   $0x67,%ebx,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebp
lea    0xe25(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0xa(%rbx),%eax
cmp    $0xa,%al
cmovb  %r15,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bpl,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bl
movsbl %bl,%ebp
imul   $0x67,%ebp,%eax
movzwl %ax,%ecx
shr    $0x9,%eax
shr    $0xf,%ecx
add    %al,%cl
movsbl %cl,%ebx
lea    0xdeb(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x5(%rbp),%eax
cmp    $0x5,%al
lea    0xde1(%rip),%rax
lea    0xdd9(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl %bl,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
movsbl %bpl,%ebx
lea    0xdc2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%bl
lea    0xdbb(%rip),%rax
lea    0xdb0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [60 x i8] c"Enter the number of quarters, dimes, nickels, and pennies: \00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [27 x i8] c"Your collection is worth\0A \00"
@.str.3 = [11 x i8] c"\09%d dollar\00"
@.str.4 = [3 x i8] c", \00"
@.str.5 = [4 x i8] c"s, \00"
@.str.6 = [11 x i8] c"%d quarter\00"
@.str.7 = [8 x i8] c"%d dime\00"
@.str.8 = [10 x i8] c"%d nickel\00"
@.str.9 = [7 x i8] c", and \00"
@.str.10 = [8 x i8] c"s, and \00"
@.str.11 = [8 x i8] c"%d penn\00"
@.str.12 = [3 x i8] c"y\0A\00"
@.str.13 = [5 x i8] c"ies\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %3, i32* %2, i32* %1)
%9 = load i32, i32* %4
%10 = mul nsw i32 25, %9
%11 = load i32, i32* %3
%12 = mul nsw i32 10, %11
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %2
%15 = mul nsw i32 5, %14
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %1
%18 = add nsw i32 %16, %17
store i32 %18, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %6
%21 = sdiv i32 %20, 100
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %30
28: ; preds = %0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = load i32, i32* %6
%32 = srem i32 %31, 100
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = sdiv i32 %33, 25
store i32 %34, i32* %5
%35 = load i32, i32* %5
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %30
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %43
41: ; preds = %30
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
%44 = load i32, i32* %6
%45 = srem i32 %44, 25
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = sdiv i32 %46, 10
store i32 %47, i32* %5
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %5
%51 = icmp eq i32 %50, 1
%52 = zext i1 %51 to i64
%53 = select i1 %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%54 = call i32 (i8*, ...) @printf(i8* %53)
%55 = load i32, i32* %6
%56 = srem i32 %55, 10
store i32 %56, i32* %6
%57 = load i32, i32* %6
%58 = sdiv i32 %57, 5
store i32 %58, i32* %5
%59 = load i32, i32* %5
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %5
%62 = icmp eq i32 %61, 1
br i1 %62, label %63, label %65
63: ; preds = %43
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %67
65: ; preds = %43
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
%68 = load i32, i32* %6
%69 = srem i32 %68, 5
store i32 %69, i32* %6
%70 = load i32, i32* %6
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %6
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %76
74: ; preds = %67
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %78
76: ; preds = %67
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %78
78: ; preds = %76, %74
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Enter the number of quarters, dimes, nickels, and pennies: \00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [27 x i8] c"Your collection is worth\0A \00"
@.str.3 = [11 x i8] c"\09%d dollar\00"
@.str.4 = [3 x i8] c", \00"
@.str.5 = [4 x i8] c"s, \00"
@.str.6 = [11 x i8] c"%d quarter\00"
@.str.7 = [8 x i8] c"%d dime\00"
@.str.8 = [10 x i8] c"%d nickel\00"
@.str.9 = [7 x i8] c", and \00"
@.str.10 = [8 x i8] c"s, and \00"
@.str.11 = [8 x i8] c"%d penn\00"
@str = [4 x i8] c"ies\00"
@str.14 = [2 x i8] c"y\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %3, i32* %2, i32* %1)
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 25
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 10
%15 = add nsw i32 %14, %12
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, 5
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %1
%20 = add nsw i32 %18, %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%22 = sdiv i32 %20, 100
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = add i32 %20, -100
%25 = icmp ult i32 %24, 100
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %26)
%28 = srem i32 %20, 100
%29 = trunc i32 %28 to i8
%30 = sdiv i8 %29, 25
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %31)
%33 = add nsw i32 %28, -25
%34 = icmp ult i32 %33, 25
%35 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %35)
%37 = srem i8 %29, 25
%38 = sdiv i8 %37, 10
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = add nsw i8 %37, -10
%42 = icmp ult i8 %41, 10
%43 = select i1 %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %43)
%45 = srem i8 %37, 10
%46 = sdiv i8 %45, 5
%47 = sext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %47)
%49 = add nsw i8 %45, -5
%50 = icmp ult i8 %49, 5
%51 = select i1 %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %51)
%53 = srem i8 %45, 5
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %54)
%56 = icmp eq i8 %53, 1
%57 = select i1 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)
%58 = call i32 @puts(i8* dereferenceable(1) %57)
ret void
}