#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_aff_int(int);
int /*<<< orphan*/ my_aff_str(char *);
int /*<<< orphan*/ my_putchar(char);
void my_put_nbr(int n) {
  int s;
  s = n;
  if (n == -2147483648) {
    my_aff_str("-2147483648");
  } else if (n < 0) {
    my_putchar('-');
    s = s * (-1);
    my_aff_int(s);
  } else
    my_aff_int(s);
}


x86 assembly (clang, -O0):
<my_put_nbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0xffffffff80000000,%rax
jne    1162 <my_put_nbr+0x32>
lea    0xea8(%rip),%rdi
call   1030 <my_aff_str@plt>
jmp    1197 <my_put_nbr+0x67>
cmpl   $0x0,-0x4(%rbp)
jge    118a <my_put_nbr+0x5a>
mov    $0x2d,%edi
call   1040 <my_putchar@plt>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <my_aff_int@plt>
jmp    1192 <my_put_nbr+0x62>
mov    -0x8(%rbp),%edi
call   1050 <my_aff_int@plt>
jmp    1197 <my_put_nbr+0x67>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr>:
push   %rbx
cmp    $0x80000000,%edi
jne    1146 <my_put_nbr+0x16>
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <my_aff_str@plt>
mov    %edi,%ebx
test   %edi,%edi
jns    1158 <my_put_nbr+0x28>
mov    $0x2d,%edi
call   1040 <my_putchar@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1050 <my_aff_int@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"-2147483648\00"
define void @my_put_nbr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %6, -2147483648
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @my_aff_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %23
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = call i32 @my_putchar(i8 signext 45)
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, -1
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @my_aff_int(i32 %17)
br label %22
19: ; preds = %10
%20 = load i32, i32* %3
%21 = call i32 @my_aff_int(i32 %20)
br label %22
22: ; preds = %19, %13
br label %23
23: ; preds = %22, %8
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_aff_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i32 @my_putchar(i8 signext 45)
%9 = sub nsw i32 0, %0
%10 = tail call i32 @my_aff_int(i32 %9)
br label %13
11: ; preds = %5
%12 = tail call i32 @my_aff_int(i32 %0)
br label %13
13: ; preds = %7, %11, %3
ret void
}