#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int Vl, Q1, Q2, Q3, Q4, R1, R2, R3, R4;
  printf("\n\n** Calculo de notas possiveis em X Reais **\n");
  printf("\nInforme um valor em Reais:");
  scanf("%i", &Vl);
  Q1 = Vl / 100;
  R1 = Vl % 100;
  Q2 = R1 / 50;
  R2 = R1 % 50;
  Q3 = R2 / 10;
  R3 = R2 % 10;
  Q4 = R3 / 5;
  R4 = R3 % 5;
  printf("\nEm %i,00 sao possiveis:\n\n%i nota(s) de cem;\n%i nota(s) de "
         "cinquenta;\n%i nota(s) de dez;\n%i nota(s) de cinco;\n%i nota(s) de "
         "um real.\n",
         Vl, Q1, Q2, Q3, Q4, R4);
  printf("\n\n<< Marco Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x24(%rbp),%eax
lea    0xe5f(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0x14(%rsp),%rsi
imul   $0x51eb851f,%rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x25,%rdx
add    %eax,%edx
imul   $0x64,%edx,%ecx
mov    %esi,%eax
sub    %ecx,%eax
movsbl %al,%ecx
lea    (%rcx,%rcx,4),%edi
lea    (%rcx,%rdi,8),%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
shr    $0xb,%edi
add    %cl,%dil
movsbl %dil,%ecx
movzbl %cl,%edi
imul   $0x32,%edi,%edi
sub    %dil,%al
movsbl %al,%eax
imul   $0x67,%eax,%r8d
movzwl %r8w,%edi
shr    $0xa,%r8d
shr    $0xf,%edi
add    %r8b,%dil
movsbl %dil,%r8d
movzbl %r8b,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%al
movsbl %al,%eax
imul   $0x67,%eax,%r9d
movzwl %r9w,%edi
shr    $0x9,%r9d
shr    $0xf,%edi
add    %r9b,%dil
movsbl %dil,%r9d
movzbl %r9b,%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%al
movsbl %al,%eax
mov    %eax,(%rsp)
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\0A\0A** Calculo de notas possiveis em X Reais **\0A\00"
@.str.1 = [28 x i8] c"\0AInforme um valor em Reais:\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [134 x i8] c"\0AEm %i,00 sao possiveis:\0A\0A%i nota(s) de cem;\0A%i nota(s) de cinquenta;\0A%i nota(s) de dez;\0A%i nota(s) de cinco;\0A%i nota(s) de um real.\0A\00"
@.str.4 = [21 x i8] c"\0A\0A<< Marco Tulio >>\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
%8 = alloca i32
%9 = alloca i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = sdiv i32 %13, 100
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = srem i32 %15, 100
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = sdiv i32 %17, 50
store i32 %18, i32* %3
%19 = load i32, i32* %6
%20 = srem i32 %19, 50
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = sdiv i32 %21, 10
store i32 %22, i32* %4
%23 = load i32, i32* %7
%24 = srem i32 %23, 10
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = sdiv i32 %25, 5
store i32 %26, i32* %5
%27 = load i32, i32* %8
%28 = srem i32 %27, 5
store i32 %28, i32* %9
%29 = load i32, i32* %1
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = load i32, i32* %9
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%37 = call i32 (...) @getchar()
%38 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"\0AInforme um valor em Reais:\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [134 x i8] c"\0AEm %i,00 sao possiveis:\0A\0A%i nota(s) de cem;\0A%i nota(s) de cinquenta;\0A%i nota(s) de dez;\0A%i nota(s) de cinco;\0A%i nota(s) de um real.\0A\00"
@str = [46 x i8] c"\0A\0A** Calculo de notas possiveis em X Reais **\00"
@str.5 = [20 x i8] c"\0A\0A<< Marco Tulio >>\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 100
%8 = srem i32 %6, 100
%9 = trunc i32 %8 to i8
%10 = sdiv i8 %9, 50
%11 = sext i8 %10 to i32
%12 = srem i8 %9, 50
%13 = sdiv i8 %12, 10
%14 = sext i8 %13 to i32
%15 = srem i8 %12, 10
%16 = sdiv i8 %15, 5
%17 = sext i8 %16 to i32
%18 = srem i8 %15, 5
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([134 x i8], [134 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %7, i32 %11, i32 %14, i32 %17, i32 %19)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%22 = call i32 (...) @getchar()
%23 = call i32 (...) @getchar()
ret i32 0
}