#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__ pow(int, int);
comprobarDigitosNum(int numero, int n) {
  if (numero / (int)pow(10, n) != 0)
    return 1;
  else if (numero / (int)pow(10, n - 1) == 0)
    return 1;
  else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<comprobarDigitosNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%eax
je     114f <comprobarDigitosNum+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    118a <comprobarDigitosNum+0x7a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    1183 <comprobarDigitosNum+0x73>
movl   $0x1,-0x4(%rbp)
jmp    118a <comprobarDigitosNum+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comprobarDigitosNum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1154 <comprobarDigitosNum+0x44>
add    $0xffffffff,%ebp
mov    $0xa,%edi
mov    %ebp,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @comprobarDigitosNum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i64 @pow(i32 10, i32 %7)
%9 = trunc i64 %8 to i32
%10 = sdiv i32 %6, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %23
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = call i64 @pow(i32 10, i32 %16)
%18 = trunc i64 %17 to i32
%19 = sdiv i32 %14, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %3
br label %23
22: ; preds = %13
store i32 0, i32* %3
br label %23
23: ; preds = %22, %21, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @comprobarDigitosNum(i32 %0, i32 %1) {
%3 = tail call i64 @pow(i32 10, i32 %1)
%4 = trunc i64 %3 to i32
%5 = sdiv i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i64 @pow(i32 10, i32 %8)
%10 = trunc i64 %9 to i32
%11 = sdiv i32 %0, %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %2
%15 = phi i32 [ 1, %2 ], [ %13, %7 ]
ret i32 %15
}