#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 main() {
  int importe = 0;
  int cont100 = 0;
  int cont50 = 0;
  int cont10 = 0;
  int cont5 = 0;
  int cont1 = 0;
  printf("Ingrese el importe \n");
  scanf("%d", &importe);
  while (importe >= 100) {
    importe = importe - 100;
    cont100 = cont100 + 1;
  }
  printf("Entregue %d billetes de 100 \n", cont100);
  while (importe >= 50) {
    importe = importe - 50;
    cont50 = cont50 + 1;
  }
  printf("Entregue %d billetes se 50 \n", cont50);
  while (importe >= 10) {
    importe = importe - 10;
    cont10 = cont10 + 1;
  }
  printf("Entregue %d billetes de 10 \n", cont10);
  while (importe >= 5) {
    importe = importe - 5;
    cont5 = cont5 + 1;
  }
  printf("Entregue %d billetes de 5 \n", cont5);
  while (importe >= 1) {
    importe = importe - 1;
    cont1 = cont1 + 1;
  }
  printf("Entregue %d billetes de 1 \n", cont1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x64,-0x8(%rbp)
jl     1198 <main+0x78>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x57>
mov    -0xc(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x32,-0x8(%rbp)
jl     11ca <main+0xaa>
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a9 <main+0x89>
mov    -0x10(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
jl     11fc <main+0xdc>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11db <main+0xbb>
mov    -0x14(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jl     122e <main+0x10e>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120d <main+0xed>
mov    -0x18(%rbp),%esi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1260 <main+0x140>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    123f <main+0x11f>
mov    -0x1c(%rbp),%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ebx,%ebx
mov    $0x0,%esi
cmp    $0x64,%eax
jl     1197 <main+0x67>
cmp    $0xc7,%eax
mov    $0xc7,%ecx
cmovl  %eax,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x63,%ecx
imul   $0x51eb851f,%rcx,%rsi
shr    $0x25,%rsi
imul   $0xffffff9c,%esi,%ecx
add    %ecx,%eax
add    $0xffffff9c,%eax
add    $0x1,%esi
mov    %eax,0x4(%rsp)
lea    0xe65(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    $0x32,%eax
jl     11da <main+0xaa>
cmp    $0x63,%eax
mov    $0x63,%ecx
cmovl  %eax,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x31,%ecx
imul   $0x51eb851f,%rcx,%rbx
shr    $0x24,%rbx
imul   $0xffffffce,%ebx,%ecx
add    %ecx,%eax
add    $0xffffffce,%eax
add    $0x1,%ebx
mov    %eax,0x4(%rsp)
lea    0xe40(%rip),%rdi
xor    %r14d,%r14d
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
mov    $0x0,%esi
cmp    $0xa,%eax
jl     122e <main+0xfe>
cmp    $0x13,%eax
mov    $0x13,%ecx
cmovl  %eax,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x9,%ecx
mov    $0xcccccccd,%esi
imul   %rcx,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xfffffff6,%eax
add    $0x1,%esi
mov    %eax,0x4(%rsp)
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
jl     1278 <main+0x148>
cmp    $0x9,%eax
mov    $0x9,%ecx
cmovl  %eax,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x4,%ecx
mov    $0xcccccccd,%r14d
imul   %rcx,%r14
shr    $0x22,%r14
lea    (%r14,%r14,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xfffffffb,%eax
add    $0x1,%r14d
mov    %eax,0x4(%rsp)
lea    0xddc(%rip),%rdi
xor    %ebx,%ebx
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    129d <main+0x16d>
movl   $0x0,0x4(%rsp)
mov    %eax,%ebx
lea    0xdd3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Ingrese el importe \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Entregue %d billetes de 100 \0A\00"
@.str.3 = [29 x i8] c"Entregue %d billetes se 50 \0A\00"
@.str.4 = [29 x i8] c"Entregue %d billetes de 10 \0A\00"
@.str.5 = [28 x i8] c"Entregue %d billetes de 5 \0A\00"
@.str.6 = [28 x i8] c"Entregue %d billetes de 1 \0A\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
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 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)
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 100
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 100
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %24, %18
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 50
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, 50
store i32 %26, i32* %2
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %21
29: ; preds = %21
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %35, %29
%33 = load i32, i32* %2
%34 = icmp sge i32 %33, 10
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* %2
%37 = sub nsw i32 %36, 10
store i32 %37, i32* %2
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %32
40: ; preds = %32
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %46, %40
%44 = load i32, i32* %2
%45 = icmp sge i32 %44, 5
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = load i32, i32* %2
%48 = sub nsw i32 %47, 5
store i32 %48, i32* %2
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %43
51: ; preds = %43
%52 = load i32, i32* %6
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %57, %51
%55 = load i32, i32* %2
%56 = icmp sge i32 %55, 1
br i1 %56, label %57, label %62
57: ; preds = %54
%58 = load i32, i32* %2
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %2
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %54
62: ; preds = %54
%63 = load i32, i32* %7
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %63)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Entregue %d billetes de 100 \0A\00"
@.str.3 = [29 x i8] c"Entregue %d billetes se 50 \0A\00"
@.str.4 = [29 x i8] c"Entregue %d billetes de 10 \0A\00"
@.str.5 = [28 x i8] c"Entregue %d billetes de 5 \0A\00"
@.str.6 = [28 x i8] c"Entregue %d billetes de 1 \0A\00"
@str = [20 x i8] c"Ingrese el importe \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 99
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = add nsw i32 %5, -100
%9 = add nuw i32 %5, 99
%10 = call i32 @llvm.smin.i32(i32 %5, i32 199)
%11 = sub nuw i32 %9, %10
%12 = udiv i32 %11, 100
%13 = mul nsw i32 %12, -100
%14 = add nsw i32 %13, %8
%15 = add nuw nsw i32 %12, 1
store i32 %14, i32* %1
br label %16
16: ; preds = %7, %0
%17 = phi i32 [ %15, %7 ], [ 0, %0 ]
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
%20 = icmp sgt i32 %19, 49
br i1 %20, label %21, label %30
21: ; preds = %16
%22 = add nsw i32 %19, -50
%23 = add nuw i32 %19, 49
%24 = call i32 @llvm.smin.i32(i32 %19, i32 99)
%25 = sub nuw i32 %23, %24
%26 = udiv i32 %25, 50
%27 = mul nsw i32 %26, -50
%28 = add nsw i32 %27, %22
%29 = add nuw nsw i32 %26, 1
store i32 %28, i32* %1
br label %30
30: ; preds = %21, %16
%31 = phi i32 [ %29, %21 ], [ 0, %16 ]
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %1
%34 = icmp sgt i32 %33, 9
br i1 %34, label %35, label %44
35: ; preds = %30
%36 = add nsw i32 %33, -10
%37 = add nuw i32 %33, 9
%38 = call i32 @llvm.smin.i32(i32 %33, i32 19)
%39 = sub nuw i32 %37, %38
%40 = udiv i32 %39, 10
%41 = mul nsw i32 %40, -10
%42 = add nsw i32 %41, %36
%43 = add nuw nsw i32 %40, 1
store i32 %42, i32* %1
br label %44
44: ; preds = %35, %30
%45 = phi i32 [ %43, %35 ], [ 0, %30 ]
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %1
%48 = icmp sgt i32 %47, 4
br i1 %48, label %49, label %58
49: ; preds = %44
%50 = add nsw i32 %47, -5
%51 = add nuw i32 %47, 4
%52 = call i32 @llvm.smin.i32(i32 %47, i32 9)
%53 = sub nuw i32 %51, %52
%54 = udiv i32 %53, 5
%55 = mul nsw i32 %54, -5
%56 = add nsw i32 %55, %50
%57 = add nuw nsw i32 %54, 1
store i32 %56, i32* %1
br label %58
58: ; preds = %49, %44
%59 = phi i32 [ %57, %49 ], [ 0, %44 ]
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %1
%62 = icmp sgt i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 0, i32* %1
br label %64
64: ; preds = %63, %58
%65 = phi i32 [ %61, %63 ], [ 0, %58 ]
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %65)
ret i32 0
}