#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 */
scalar_t__ isspace(char);
void formata_cpf(int *n, char *cpf) {
  int i = 0;
  while (i < 11)
    if (isspace(*cpf))
      *cpf++ = n[i++] + '0';
    else
      cpf++;
}


x86 assembly (clang, -O0):
<formata_cpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jge    1188 <formata_cpf+0x78>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1177 <formata_cpf+0x67>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1183 <formata_cpf+0x73>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <formata_cpf+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formata_cpf>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %ebp,%ebp
jmp    1129 <formata_cpf+0x19>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0xb,%ebp
jge    1147 <formata_cpf+0x37>
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1120 <formata_cpf+0x10>
movslq %ebp,%rax
add    $0x1,%ebp
movzbl (%r14,%rax,4),%eax
add    $0x30,%al
mov    %al,(%rbx)
jmp    1120 <formata_cpf+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @formata_cpf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %28, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 11
br i1 %8, label %9, label %29
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 48
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
store i8 %22, i8* %23
br label %28
25: ; preds = %9
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %28
28: ; preds = %25, %14
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @formata_cpf(i32* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %2, %16
%4 = phi i32 [ 0, %2 ], [ %17, %16 ]
%5 = phi i8* [ %1, %2 ], [ %18, %16 ]
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %3
%10 = add nsw i32 %4, 1
%11 = sext i32 %4 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = trunc i32 %13 to i8
%15 = add i8 %14, 48
store i8 %15, i8* %5
br label %16
16: ; preds = %3, %9
%17 = phi i32 [ %10, %9 ], [ %4, %3 ]
%18 = getelementptr inbounds i8, i8* %5, i64 1
%19 = icmp slt i32 %17, 11
br i1 %19, label %3, label %20
20: ; preds = %16
ret void
}