#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_print_b_16(unsigned long, int);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
void my_show_row(char *str, int beg, int len) {
  unsigned long my_adr;
  int lp;
  my_adr = (unsigned long)&str[beg];
  my_print_b_16(my_adr, 8);
  lp = 0;
  my_putstr(": ");
  while (lp < 16) {
    if (lp > len)
      my_putstr("0000");
    else {
      my_print_b_16((unsigned long)&str[beg + lp], 2);
      my_print_b_16((unsigned long)&str[beg + lp + 1], 2);
    }
    my_putchar(' ');
    lp += 2;
  }
}


x86 assembly (clang, -O0):
<my_show_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1030 <my_print_b_16@plt>
movl   $0x0,-0x1c(%rbp)
lea    0xe93(%rip),%rdi
call   1050 <my_putstr@plt>
cmpl   $0x10,-0x1c(%rbp)
jge    11e6 <my_show_row+0xb6>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1199 <my_show_row+0x69>
lea    0xe74(%rip),%rdi
call   1050 <my_putstr@plt>
jmp    11ce <my_show_row+0x9e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
cltq
add    %rax,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    1172 <my_show_row+0x42>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_show_row>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rdi,%rbx
movslq %esi,%r15
lea    (%rdi,%r15,1),%rbp
mov    %rbp,%rdi
mov    $0x8,%esi
call   1030 <my_print_b_16@plt>
lea    0xea8(%rip),%rdi
call   1050 <my_putstr@plt>
test   %r14d,%r14d
js     1312 <my_show_row+0x1e2>
mov    %rbp,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0x1,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0x1,%r14d
jbe    1328 <my_show_row+0x1f8>
lea    (%r15,%rbx,1),%rdi
add    $0x2,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0x3,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0x3,%r14d
jbe    133e <my_show_row+0x20e>
lea    (%r15,%rbx,1),%rdi
add    $0x4,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0x5,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0x5,%r14d
jbe    1354 <my_show_row+0x224>
lea    (%r15,%rbx,1),%rdi
add    $0x6,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0x7,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0x7,%r14d
jbe    136a <my_show_row+0x23a>
lea    (%r15,%rbx,1),%rdi
add    $0x8,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0x9,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0x9,%r14d
jbe    1380 <my_show_row+0x250>
lea    (%r15,%rbx,1),%rdi
add    $0xa,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0xb,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0xb,%r14d
jbe    1396 <my_show_row+0x266>
lea    (%r15,%rbx,1),%rdi
add    $0xc,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0xd,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
cmp    $0xe,%r14d
jb     13ac <my_show_row+0x27c>
lea    (%r15,%rbx,1),%rdi
add    $0xe,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
lea    (%r15,%rbx,1),%rdi
add    $0xf,%rdi
mov    $0x2,%esi
call   1030 <my_print_b_16@plt>
jmp    13b8 <my_show_row+0x288>
lea    0xcea(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xcd4(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xcbe(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xca8(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xc92(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xc7c(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xc66(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
call   1040 <my_putchar@plt>
lea    0xc50(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <my_putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
@.str.1 = [5 x i8] c"0000\00"
define void @my_show_row(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = call i32 @my_print_b_16(i64 %14, i32 8)
store i32 0, i32* %8
%16 = call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %44, %3
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %48
20: ; preds = %17
%21 = load i32, i32* %8
%22 = load i32, i32* %6
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %44
26: ; preds = %20
%27 = load i8*, i8** %4
%28 = load i32, i32* %5
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %27, i64 %31
%33 = ptrtoint i8* %32 to i64
%34 = call i32 @my_print_b_16(i64 %33, i32 2)
%35 = load i8*, i8** %4
%36 = load i32, i32* %5
%37 = load i32, i32* %8
%38 = add nsw i32 %36, %37
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %35, i64 %40
%42 = ptrtoint i8* %41 to i64
%43 = call i32 @my_print_b_16(i64 %42, i32 2)
br label %44
44: ; preds = %26, %24
%45 = call i32 @my_putchar(i8 signext 32)
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 2
store i32 %47, i32* %8
br label %17
48: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@.str.1 = [5 x i8] c"0000\00"
define void @my_show_row(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = ptrtoint i8* %5 to i64
%7 = tail call i32 @my_print_b_16(i64 %6, i32 8)
%8 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp slt i32 %2, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @my_putchar(i8 signext 32)
br label %21
13: ; preds = %3
%14 = tail call i32 @my_print_b_16(i64 %6, i32 2)
%15 = add nsw i64 %4, 1
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = ptrtoint i8* %16 to i64
%18 = tail call i32 @my_print_b_16(i64 %17, i32 2)
%19 = tail call i32 @my_putchar(i8 signext 32)
%20 = icmp ult i32 %2, 2
br i1 %20, label %21, label %24
21: ; preds = %13, %10
%22 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 @my_putchar(i8 signext 32)
br label %35
24: ; preds = %13
%25 = add nsw i64 %4, 2
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = ptrtoint i8* %26 to i64
%28 = tail call i32 @my_print_b_16(i64 %27, i32 2)
%29 = add nsw i64 %4, 3
%30 = getelementptr inbounds i8, i8* %0, i64 %29
%31 = ptrtoint i8* %30 to i64
%32 = tail call i32 @my_print_b_16(i64 %31, i32 2)
%33 = tail call i32 @my_putchar(i8 signext 32)
%34 = icmp ult i32 %2, 4
br i1 %34, label %35, label %38
35: ; preds = %24, %21
%36 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @my_putchar(i8 signext 32)
br label %49
38: ; preds = %24
%39 = add nsw i64 %4, 4
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = ptrtoint i8* %40 to i64
%42 = tail call i32 @my_print_b_16(i64 %41, i32 2)
%43 = add nsw i64 %4, 5
%44 = getelementptr inbounds i8, i8* %0, i64 %43
%45 = ptrtoint i8* %44 to i64
%46 = tail call i32 @my_print_b_16(i64 %45, i32 2)
%47 = tail call i32 @my_putchar(i8 signext 32)
%48 = icmp ult i32 %2, 6
br i1 %48, label %49, label %52
49: ; preds = %38, %35
%50 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%51 = tail call i32 @my_putchar(i8 signext 32)
br label %63
52: ; preds = %38
%53 = add nsw i64 %4, 6
%54 = getelementptr inbounds i8, i8* %0, i64 %53
%55 = ptrtoint i8* %54 to i64
%56 = tail call i32 @my_print_b_16(i64 %55, i32 2)
%57 = add nsw i64 %4, 7
%58 = getelementptr inbounds i8, i8* %0, i64 %57
%59 = ptrtoint i8* %58 to i64
%60 = tail call i32 @my_print_b_16(i64 %59, i32 2)
%61 = tail call i32 @my_putchar(i8 signext 32)
%62 = icmp ult i32 %2, 8
br i1 %62, label %63, label %66
63: ; preds = %52, %49
%64 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%65 = tail call i32 @my_putchar(i8 signext 32)
br label %77
66: ; preds = %52
%67 = add nsw i64 %4, 8
%68 = getelementptr inbounds i8, i8* %0, i64 %67
%69 = ptrtoint i8* %68 to i64
%70 = tail call i32 @my_print_b_16(i64 %69, i32 2)
%71 = add nsw i64 %4, 9
%72 = getelementptr inbounds i8, i8* %0, i64 %71
%73 = ptrtoint i8* %72 to i64
%74 = tail call i32 @my_print_b_16(i64 %73, i32 2)
%75 = tail call i32 @my_putchar(i8 signext 32)
%76 = icmp ult i32 %2, 10
br i1 %76, label %77, label %80
77: ; preds = %66, %63
%78 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%79 = tail call i32 @my_putchar(i8 signext 32)
br label %91
80: ; preds = %66
%81 = add nsw i64 %4, 10
%82 = getelementptr inbounds i8, i8* %0, i64 %81
%83 = ptrtoint i8* %82 to i64
%84 = tail call i32 @my_print_b_16(i64 %83, i32 2)
%85 = add nsw i64 %4, 11
%86 = getelementptr inbounds i8, i8* %0, i64 %85
%87 = ptrtoint i8* %86 to i64
%88 = tail call i32 @my_print_b_16(i64 %87, i32 2)
%89 = tail call i32 @my_putchar(i8 signext 32)
%90 = icmp ult i32 %2, 12
br i1 %90, label %91, label %94
91: ; preds = %80, %77
%92 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%93 = tail call i32 @my_putchar(i8 signext 32)
br label %114
94: ; preds = %80
%95 = add nsw i64 %4, 12
%96 = getelementptr inbounds i8, i8* %0, i64 %95
%97 = ptrtoint i8* %96 to i64
%98 = tail call i32 @my_print_b_16(i64 %97, i32 2)
%99 = add nsw i64 %4, 13
%100 = getelementptr inbounds i8, i8* %0, i64 %99
%101 = ptrtoint i8* %100 to i64
%102 = tail call i32 @my_print_b_16(i64 %101, i32 2)
%103 = tail call i32 @my_putchar(i8 signext 32)
%104 = icmp ult i32 %2, 14
br i1 %104, label %114, label %105
105: ; preds = %94
%106 = add nsw i64 %4, 14
%107 = getelementptr inbounds i8, i8* %0, i64 %106
%108 = ptrtoint i8* %107 to i64
%109 = tail call i32 @my_print_b_16(i64 %108, i32 2)
%110 = add nsw i64 %4, 15
%111 = getelementptr inbounds i8, i8* %0, i64 %110
%112 = ptrtoint i8* %111 to i64
%113 = tail call i32 @my_print_b_16(i64 %112, i32 2)
br label %116
114: ; preds = %91, %94
%115 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %116
116: ; preds = %114, %105
%117 = tail call i32 @my_putchar(i8 signext 32)
ret void
}