#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*/ displayW(int, int);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
void my_put_nbr(int n) {
  int sizeTemp;
  int tempNumber;
  sizeTemp = 1;
  if (n < -2147483647) {
    my_putstr("-2147483648");
  } else {
    if (n < 0) {
      my_putchar('-');
      n = -n;
    }
    tempNumber = n;
    while ((tempNumber /= 10) > 0) {
      sizeTemp *= 10;
    }
    tempNumber = n;
    displayW(tempNumber, sizeTemp);
  }
}


x86 assembly (clang, -O0):
<my_put_nbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x80000001,-0x4(%rbp)
jge    1160 <my_put_nbr+0x30>
lea    0xeaa(%rip),%rdi
call   1040 <my_putstr@plt>
jmp    11b6 <my_put_nbr+0x86>
cmpl   $0x0,-0x4(%rbp)
jge    117c <my_put_nbr+0x4c>
mov    $0x2d,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    11a5 <my_put_nbr+0x75>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1182 <my_put_nbr+0x52>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <displayW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr>:
cmp    $0x80000000,%edi
jne    1144 <my_put_nbr+0x14>
lea    0xec1(%rip),%rdi
jmp    1040 <my_putstr@plt>
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1157 <my_put_nbr+0x27>
mov    $0x2d,%edi
call   1030 <my_putchar@plt>
neg    %ebx
mov    $0x1,%esi
cmp    $0xa,%ebx
jb     1186 <my_put_nbr+0x56>
mov    $0x1,%esi
mov    $0xcccccccd,%eax
mov    %ebx,%ecx
nopl   (%rax)
mov    %ecx,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
cmp    $0x63,%ecx
mov    %edx,%ecx
ja     1170 <my_put_nbr+0x40>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <displayW@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"-2147483648\00"
define void @my_put_nbr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, -2147483647
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @my_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %30
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = call i32 @my_putchar(i8 signext 45)
%14 = load i32, i32* %2
%15 = sub nsw i32 0, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %9
%17 = load i32, i32* %2
store i32 %17, i32* %4
br label %18
18: ; preds = %22, %16
%19 = load i32, i32* %4
%20 = sdiv i32 %19, 10
store i32 %20, i32* %4
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* %3
%24 = mul nsw i32 %23, 10
store i32 %24, i32* %3
br label %18
25: ; preds = %18
%26 = load i32, i32* %2
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = load i32, i32* %3
%29 = call i32 @displayW(i32 %27, i32 %28)
br label %30
30: ; preds = %25, %7
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"-2147483648\00"
define void @my_put_nbr(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @my_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %22
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @my_putchar(i8 signext 45)
%9 = sub nsw i32 0, %0
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %9, %7 ], [ %0, %5 ]
%12 = icmp ugt i32 %11, 9
br i1 %12, label %13, label %19
13: ; preds = %10, %13
%14 = phi i32 [ %16, %13 ], [ %11, %10 ]
%15 = phi i32 [ %17, %13 ], [ 1, %10 ]
%16 = udiv i32 %14, 10
%17 = mul nsw i32 %15, 10
%18 = icmp ugt i32 %14, 99
br i1 %18, label %13, label %19
19: ; preds = %13, %10
%20 = phi i32 [ 1, %10 ], [ %17, %13 ]
%21 = tail call i32 @displayW(i32 %11, i32 %20)
br label %22
22: ; preds = %19, %3
ret void
}