#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, int, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n50, n10, n5, v, i = 0;
  scanf("%d", &v);
  while (v > 0) {
    n50 = v / 50;
    v = v % 50;
    n10 = v / 10;
    v = v % 10;
    n5 = v / 5;
    v = v % 5;
    printf("Teste %d\n%d %d %d %d\n\n", ++i, n50, n10, n5, v);
    scanf("%d", &v);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    11dc <main+0xbc>
mov    -0x14(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11c5 <main+0xa5>
mov    $0x1,%ebx
lea    0xeb2(%rip),%r14
lea    0xea8(%rip),%r15
lea    0x4(%rsp),%r12
nopl   (%rax)
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rdx
shr    $0x24,%rdx
imul   $0x32,%edx,%ecx
sub    %ecx,%eax
imul   $0xcd,%eax,%ecx
movzwl %cx,%ecx
shr    $0xb,%ecx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %sil,%al
movzbl %al,%eax
imul   $0xcd,%eax,%r8d
shr    $0xa,%r8d
lea    (%r8,%r8,4),%esi
sub    %sil,%al
movzbl %al,%r9d
mov    %r9d,0x4(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%ebx
test   %eax,%eax
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"Teste %d\0A%d %d %d %d\0A\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
store i32 0, i32* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %32
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 50
store i32 %13, i32* %2
%14 = load i32, i32* %5
%15 = srem i32 %14, 50
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 10
store i32 %17, i32* %3
%18 = load i32, i32* %5
%19 = srem i32 %18, 10
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 5
store i32 %21, i32* %4
%22 = load i32, i32* %5
%23 = srem i32 %22, 5
store i32 %23, i32* %5
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28, i32 %29)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
br label %8
32: ; preds = %8
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"Teste %d\0A%d %d %d %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %0, %6
%7 = phi i32 [ %22, %6 ], [ %4, %0 ]
%8 = phi i32 [ %19, %6 ], [ 0, %0 ]
%9 = udiv i32 %7, 50
%10 = urem i32 %7, 50
%11 = trunc i32 %10 to i8
%12 = udiv i8 %11, 10
%13 = zext i8 %12 to i32
%14 = urem i8 %11, 10
%15 = udiv i8 %14, 5
%16 = zext i8 %15 to i32
%17 = urem i8 %14, 5
%18 = zext i8 %17 to i32
store i32 %18, i32* %1
%19 = add nuw nsw i32 %8, 1
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %9, i32 %13, i32 %16, i32 %18)
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%22 = load i32, i32* %1
%23 = icmp sgt i32 %22, 0
br i1 %23, label %6, label %24
24: ; preds = %6, %0
ret i32 0
}