#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 */
unsigned int my_abs(int);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putnbr(unsigned int, int);
int my_putnbr_u(unsigned int nombre, int base) {
  char base16[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                     '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  if (nombre >= base) {
    my_putnbr(nombre / base, base);
  }
  my_putchar(base16[nombre % my_abs(base)]);
}


x86 assembly (clang, -O0):
<my_putnbr_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1172 <my_putnbr_u+0x42>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <my_putnbr@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <my_abs@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
movsbl -0x20(%rbp,%rax,1),%edi
call   1040 <my_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnbr_u>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmp    %esi,%edi
jb     114a <my_putnbr_u+0x1a>
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <my_putnbr@plt>
mov    %ebp,%edi
call   1030 <my_abs@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
lea    0xea0(%rip),%rax
movsbl (%rdx,%rax,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <my_putchar@plt>

LLVM IR (-O0):
@__const.my_putnbr_u.base16 = [16 x i8] c"0123456789abcdef"
define i32 @my_putnbr_u(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [16 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = bitcast [16 x i8]* %6 to i8*
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp uge i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = udiv i32 %12, %13
%15 = load i32, i32* %5
%16 = call i32 @my_putnbr(i32 %14, i32 %15)
br label %17
17: ; preds = %11, %2
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 @my_abs(i32 %19)
%21 = urem i32 %18, %20
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = call i32 @my_putchar(i8 signext %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@__const.my_putnbr_u.base16 = [16 x i8] c"0123456789abcdef"
define i32 @my_putnbr_u(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = udiv i32 %0, %1
%6 = tail call i32 @my_putnbr(i32 %5, i32 %1)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 @my_abs(i32 %1)
%9 = urem i32 %0, %8
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.my_putnbr_u.base16, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @my_putchar(i8 signext %12)
ret i32 undef
}