#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*/ my_nb_isneg(int);
int /*<<< orphan*/ my_putchar(int);
void my_nb_islimit(int n) {
  int tab[10];
  int i;
  int nbrlen;
  if (n == -2147483648) {
    i = 0;
    n = 2147483647;
    while (n > 0) {
      if (i == 0)
        tab[i] = (n % 10) + 1;
      else
        tab[i] = (n % 10);
      n = n / 10;
      i++;
    }
    nbrlen = i - 1;
    for (i = nbrlen; i > (-1); i--)
      my_putchar(tab[i] + 48);
  } else
    my_nb_isneg(n);
}


x86 assembly (clang, -O0):
<my_nb_islimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0xffffffff80000000,%rax
jne    11e3 <my_nb_islimit+0xc3>
movl   $0x0,-0x34(%rbp)
movl   $0x7fffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    11a7 <my_nb_islimit+0x87>
cmpl   $0x0,-0x34(%rbp)
jne    1178 <my_nb_islimit+0x58>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
movslq -0x34(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
jmp    118b <my_nb_islimit+0x6b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x34(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1149 <my_nb_islimit+0x29>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jle    11de <my_nb_islimit+0xbe>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
add    $0x30,%edi
call   1030 <my_putchar@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    11b6 <my_nb_islimit+0x96>
jmp    11eb <my_nb_islimit+0xcb>
mov    -0x4(%rbp),%edi
call   1040 <my_nb_isneg@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_nb_islimit>:
cmp    $0x80000000,%edi
jne    118e <my_nb_islimit+0x6e>
push   %rax
mov    $0x32,%edi
call   1030 <my_putchar@plt>
mov    $0x31,%edi
call   1030 <my_putchar@plt>
mov    $0x34,%edi
call   1030 <my_putchar@plt>
mov    $0x37,%edi
call   1030 <my_putchar@plt>
mov    $0x34,%edi
call   1030 <my_putchar@plt>
mov    $0x38,%edi
call   1030 <my_putchar@plt>
mov    $0x33,%edi
call   1030 <my_putchar@plt>
mov    $0x36,%edi
call   1030 <my_putchar@plt>
mov    $0x34,%edi
call   1030 <my_putchar@plt>
mov    $0x38,%edi
pop    %rax
jmp    1030 <my_putchar@plt>
jmp    1040 <my_nb_isneg@plt>

LLVM IR (-O0):
define void @my_nb_islimit(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, -2147483648
br i1 %8, label %9, label %52
9: ; preds = %1
store i32 0, i32* %4
store i32 2147483647, i32* %2
br label %10
10: ; preds = %29, %9
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %21
store i32 %19, i32* %22
br label %29
23: ; preds = %13
%24 = load i32, i32* %2
%25 = srem i32 %24, 10
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %27
store i32 %25, i32* %28
br label %29
29: ; preds = %23, %16
%30 = load i32, i32* %2
%31 = sdiv i32 %30, 10
store i32 %31, i32* %2
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %10
34: ; preds = %10
%35 = load i32, i32* %4
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %5
%37 = load i32, i32* %5
store i32 %37, i32* %4
br label %38
38: ; preds = %48, %34
%39 = load i32, i32* %4
%40 = icmp sgt i32 %39, -1
br i1 %40, label %41, label %51
41: ; preds = %38
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 48
%47 = call i32 @my_putchar(i32 %46)
br label %48
48: ; preds = %41
%49 = load i32, i32* %4
%50 = add nsw i32 %49, -1
store i32 %50, i32* %4
br label %38
51: ; preds = %38
br label %55
52: ; preds = %1
%53 = load i32, i32* %2
%54 = call i32 @my_nb_isneg(i32 %53)
br label %55
55: ; preds = %52, %51
ret void
}

LLVM IR (-O2):
define void @my_nb_islimit(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = tail call i32 @my_putchar(i32 50)
%5 = tail call i32 @my_putchar(i32 49)
%6 = tail call i32 @my_putchar(i32 52)
%7 = tail call i32 @my_putchar(i32 55)
%8 = tail call i32 @my_putchar(i32 52)
%9 = tail call i32 @my_putchar(i32 56)
%10 = tail call i32 @my_putchar(i32 51)
%11 = tail call i32 @my_putchar(i32 54)
%12 = tail call i32 @my_putchar(i32 52)
%13 = tail call i32 @my_putchar(i32 56)
br label %16
14: ; preds = %1
%15 = tail call i32 @my_nb_isneg(i32 %0)
br label %16
16: ; preds = %3, %14
ret void
}