#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 */
char *my_itoa(int, char *);
void scrivi_intero(char **o, int number) {
  char buff[(8192)];
  char *b;
  b = my_itoa(number, buff);
  while (*b != '\0') {
    **o = *b;
    ++(*o);
    ++b;
  }
}


x86 assembly (clang, -O0):
<scrivi_intero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x2010(%rbp),%rsi
call   1030 <my_itoa@plt>
mov    %rax,-0x2018(%rbp)
mov    -0x2018(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1182 <scrivi_intero+0x72>
mov    -0x2018(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x2018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2018(%rbp)
jmp    1138 <scrivi_intero+0x28>
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrivi_intero>:
push   %rbx
sub    $0x2000,%rsp
mov    %esi,%eax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    %eax,%edi
call   1030 <my_itoa@plt>
mov    (%rax),%cl
test   %cl,%cl
je     1157 <scrivi_intero+0x47>
mov    (%rbx),%rdx
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %cl,(%rdx)
mov    (%rbx),%rdx
add    $0x1,%rdx
mov    %rdx,(%rbx)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1140 <scrivi_intero+0x30>
add    $0x2000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @scrivi_intero(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca [8192 x i8]
%6 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%9 = call i8* @my_itoa(i32 %7, i8* %8)
store i8* %9, i8** %6
br label %10
10: ; preds = %15, %2
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load i8*, i8** %6
%17 = load i8, i8* %16
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
store i8 %17, i8* %19
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %6
br label %10
25: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @scrivi_intero(i8** nocapture %0, i32 %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = call i8* @my_itoa(i32 %1, i8* %4)
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %19, label %8
8: ; preds = %2
%9 = load i8*, i8** %0
br label %10
10: ; preds = %8, %10
%11 = phi i8* [ %15, %10 ], [ %9, %8 ]
%12 = phi i8 [ %17, %10 ], [ %6, %8 ]
%13 = phi i8* [ %16, %10 ], [ %5, %8 ]
store i8 %12, i8* %11
%14 = load i8*, i8** %0
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %0
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %2
ret void
}