#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_putchar(char);
void my_showmem_line_addr(long nbr, char *base, int l, int nb) {
  if (nb > 1) {
    my_showmem_line_addr(nbr / l, base, l, nb - 1);
  }
  my_putchar(base[nbr % l]);
  if (nb == 8) {
    my_putchar(':');
    my_putchar(' ');
  }
}


x86 assembly (clang, -O0):
<my_showmem_line_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jle    1162 <my_showmem_line_addr+0x42>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
call   1030 <my_showmem_line_addr@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
mov    -0x20(%rbp),%rax
movsbl (%rax,%rdx,1),%edi
call   1040 <my_putchar@plt>
cmpl   $0x8,-0x18(%rbp)
jne    11a2 <my_showmem_line_addr+0x82>
mov    $0x3a,%edi
call   1040 <my_putchar@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_showmem_line_addr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,%rbx
movslq %edx,%rbp
cmp    $0x2,%ecx
jl     116b <my_showmem_line_addr+0x4b>
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1152 <my_showmem_line_addr+0x32>
mov    %rbx,%rax
cqto
idiv   %rbp
jmp    1159 <my_showmem_line_addr+0x39>
mov    %ebx,%eax
xor    %edx,%edx
div    %r12d
lea    -0x1(%r15),%ecx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1030 <my_showmem_line_addr@plt>
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1181 <my_showmem_line_addr+0x61>
mov    %rbx,%rax
cqto
idiv   %rbp
jmp    1188 <my_showmem_line_addr+0x68>
mov    %ebx,%eax
xor    %edx,%edx
div    %r12d
movsbl (%r14,%rdx,1),%edi
call   1040 <my_putchar@plt>
cmp    $0x8,%r15d
jne    11b4 <my_showmem_line_addr+0x94>
mov    $0x3a,%edi
call   1040 <my_putchar@plt>
mov    $0x20,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <my_putchar@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @my_showmem_line_addr(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i64, i64* %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = sdiv i64 %12, %14
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = sub nsw i32 %18, 1
br label %20
20: ; preds = %11, %4
%21 = load i8*, i8** %6
%22 = load i64, i64* %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = srem i64 %22, %24
%26 = getelementptr inbounds i8, i8* %21, i64 %25
%27 = load i8, i8* %26
%28 = call i32 @my_putchar(i8 signext %27)
%29 = load i32, i32* %8
%30 = icmp eq i32 %29, 8
br i1 %30, label %31, label %34
31: ; preds = %20
%32 = call i32 @my_putchar(i8 signext 58)
%33 = call i32 @my_putchar(i8 signext 32)
br label %34
34: ; preds = %31, %20
ret void
}

LLVM IR (-O2):
define void @my_showmem_line_addr(i64 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 1
%6 = sext i32 %2 to i64
br i1 %5, label %7, label %10
7: ; preds = %4
%8 = sdiv i64 %0, %6
%9 = add nsw i32 %3, -1
tail call void @my_showmem_line_addr(i64 %8, i8* %1, i32 %2, i32 %9)
br label %10
10: ; preds = %4, %7
%11 = srem i64 %0, %6
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = tail call i32 @my_putchar(i8 signext %13)
%15 = icmp eq i32 %3, 8
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = tail call i32 @my_putchar(i8 signext 58)
%18 = tail call i32 @my_putchar(i8 signext 32)
br label %19
19: ; preds = %16, %10
ret void
}