#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 quozienteDueNumeri(int, int);
void numeroIntervallato(int numeroA) {
  int quoziente;
  if (numeroA >= 10000) {
    printf("%d  ", quoziente = quozienteDueNumeri(numeroA, 10000));
    numeroA -= quoziente * 10000;
    numeroIntervallato(numeroA);
  } else if (numeroA >= 1000) {
    printf("%d  ", quoziente = quozienteDueNumeri(numeroA, 1000));
    numeroA -= quoziente * 1000;
    numeroIntervallato(numeroA);
  } else if (numeroA >= 100) {
    printf("%d  ", quoziente = quozienteDueNumeri(numeroA, 100));
    numeroA -= quoziente * 100;
    numeroIntervallato(numeroA);
  } else if (numeroA >= 10) {
    printf("%d  ", quoziente = quozienteDueNumeri(numeroA, 10));
    numeroA -= quoziente * 10;
    numeroIntervallato(numeroA);
  } else {
    printf("%d  ", numeroA);
  }
  return;
}


x86 assembly (clang, -O0):
<numeroIntervallato>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jl     1182 <numeroIntervallato+0x52>
mov    -0x4(%rbp),%edi
mov    $0x2710,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%esi
mov    %esi,-0x8(%rbp)
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
imul   $0x2710,-0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <numeroIntervallato@plt>
jmp    1269 <numeroIntervallato+0x139>
cmpl   $0x3e8,-0x4(%rbp)
jl     11c9 <numeroIntervallato+0x99>
mov    -0x4(%rbp),%edi
mov    $0x3e8,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%esi
mov    %esi,-0x8(%rbp)
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
imul   $0x3e8,-0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <numeroIntervallato@plt>
jmp    1264 <numeroIntervallato+0x134>
cmpl   $0x64,-0x4(%rbp)
jl     120a <numeroIntervallato+0xda>
mov    -0x4(%rbp),%edi
mov    $0x64,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%esi
mov    %esi,-0x8(%rbp)
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
imul   $0x64,-0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <numeroIntervallato@plt>
jmp    125f <numeroIntervallato+0x12f>
cmpl   $0xa,-0x4(%rbp)
jl     124b <numeroIntervallato+0x11b>
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%esi
mov    %esi,-0x8(%rbp)
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
imul   $0xa,-0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <numeroIntervallato@plt>
jmp    125a <numeroIntervallato+0x12a>
mov    -0x4(%rbp),%esi
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
jmp    125f <numeroIntervallato+0x12f>
jmp    1264 <numeroIntervallato+0x134>
jmp    1269 <numeroIntervallato+0x139>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroIntervallato>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed3(%rip),%r14
jmp    1150 <numeroIntervallato+0x30>
mov    %ebx,%edi
mov    $0x64,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
imul   $0xffffff9c,%ebp,%eax
add    %eax,%ebx
nopl   0x0(%rax)
cmp    $0x2710,%ebx
jge    1190 <numeroIntervallato+0x70>
cmp    $0x3e8,%ebx
jge    11c0 <numeroIntervallato+0xa0>
cmp    $0x64,%ebx
jge    112f <numeroIntervallato+0xf>
cmp    $0xa,%ebx
jl     11e5 <numeroIntervallato+0xc5>
mov    %ebx,%edi
mov    $0xa,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%eax
neg    %eax
add    %eax,%ebx
jmp    1150 <numeroIntervallato+0x30>
xchg   %ax,%ax
mov    %ebx,%edi
mov    $0x2710,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
imul   $0xffffd8f0,%ebp,%eax
add    %eax,%ebx
jmp    1150 <numeroIntervallato+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x3e8,%esi
call   1040 <quozienteDueNumeri@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
imul   $0xfffffc18,%ebp,%eax
add    %eax,%ebx
jmp    1150 <numeroIntervallato+0x30>
lea    0xe14(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
define void @numeroIntervallato(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 10000
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @quozienteDueNumeri(i32 %7, i32 10000)
store i32 %8, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 10000
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %2
br label %57
15: ; preds = %1
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 1000
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %2
%20 = call i32 @quozienteDueNumeri(i32 %19, i32 1000)
store i32 %20, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, 1000
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, %23
store i32 %25, i32* %2
%26 = load i32, i32* %2
br label %56
27: ; preds = %15
%28 = load i32, i32* %2
%29 = icmp sge i32 %28, 100
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = load i32, i32* %2
%32 = call i32 @quozienteDueNumeri(i32 %31, i32 100)
store i32 %32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %3
%35 = mul nsw i32 %34, 100
%36 = load i32, i32* %2
%37 = sub nsw i32 %36, %35
store i32 %37, i32* %2
%38 = load i32, i32* %2
br label %55
39: ; preds = %27
%40 = load i32, i32* %2
%41 = icmp sge i32 %40, 10
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = load i32, i32* %2
%44 = call i32 @quozienteDueNumeri(i32 %43, i32 10)
store i32 %44, i32* %3
%45 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %3
%47 = mul nsw i32 %46, 10
%48 = load i32, i32* %2
%49 = sub nsw i32 %48, %47
store i32 %49, i32* %2
%50 = load i32, i32* %2
br label %54
51: ; preds = %39
%52 = load i32, i32* %2
%53 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %42
br label %55
55: ; preds = %54, %30
br label %56
56: ; preds = %55, %18
br label %57
57: ; preds = %56, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define void @numeroIntervallato(i32 %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i32 [ %0, %1 ], [ %11, %9 ]
%4 = icmp sgt i32 %3, 9999
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i32 @quozienteDueNumeri(i32 %3, i32 10000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = mul i32 %6, -10000
br label %9
9: ; preds = %5, %14, %20, %26
%10 = phi i32 [ %8, %5 ], [ %17, %14 ], [ %23, %20 ], [ %29, %26 ]
%11 = add i32 %10, %3
br label %2
12: ; preds = %2
%13 = icmp sgt i32 %3, 999
br i1 %13, label %14, label %18
14: ; preds = %12
%15 = tail call i32 @quozienteDueNumeri(i32 %3, i32 1000)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = mul i32 %15, -1000
br label %9
18: ; preds = %12
%19 = icmp sgt i32 %3, 99
br i1 %19, label %20, label %24
20: ; preds = %18
%21 = tail call i32 @quozienteDueNumeri(i32 %3, i32 100)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = mul i32 %21, -100
br label %9
24: ; preds = %18
%25 = icmp sgt i32 %3, 9
br i1 %25, label %26, label %30
26: ; preds = %24
%27 = tail call i32 @quozienteDueNumeri(i32 %3, i32 10)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = mul i32 %27, -10
br label %9
30: ; preds = %24
%31 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}