#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 divisores(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n1 = 0;
  do {
    printf("Digite um numero: ");
    scanf("%d", &n1);
    if (n1 == 0)
      printf("Voce nao pode digitar zero!");
    else {
      printf("O numero %d tem %d divisores", n1, divisores(n1));
    }
  } while (n1 == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1181 <main+0x51>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a2 <main+0x72>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <divisores@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a7 <main+0x77>
cmpl   $0x0,-0x8(%rbp)
je     1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeb6(%rip),%r14
lea    0xec2(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xeb9(%rip),%r12
lea    0xece(%rip),%r13
jmp    118c <main+0x5c>
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <divisores@plt>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jne    11ba <main+0x8a>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jne    1170 <main+0x40>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
je     118c <main+0x5c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Voce nao pode digitar zero!\00"
@.str.3 = [29 x i8] c"O numero %d tem %d divisores\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %16, %0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %15
10: ; preds = %3
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @divisores(i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %13)
br label %15
15: ; preds = %10, %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 0
br i1 %18, label %3, label %19
19: ; preds = %16
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Voce nao pode digitar zero!\00"
@.str.3 = [29 x i8] c"O numero %d tem %d divisores\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %13
10: ; preds = %3
%11 = call i32 @divisores(i32 %6)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %11)
br label %13
13: ; preds = %8, %10
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 0
br i1 %15, label %3, label %16
16: ; preds = %13
ret i32 0
}