void dumpInfo(unsigned char *info, int length) {
  char log_str_buf[256];
  int index = 0;
  int j = 0;
  char buffer[128] = {0};
  memset(buffer, 0, 128);
  for (index = 0; index < length; index++, j += 2) {
    sprintf(&buffer[j], "%02x", info[index]);
  }
  snprintf(log_str_buf, 256, "dump info length = %d, %s\n", length, buffer);
  {
    char log_str[256];
    snprintf(log_str, 256, "[%s %s %d] %s",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/leoge0113/epoll-threadpool/refs/heads/"
             "master/server/g_net_update.c",
             __FUNCTION__, 353, log_str_buf);
    log_string((0x04), log_str);
  };
}


x86 assembly (clang, -O0):
<dumpInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x114(%rbp)
movl   $0x0,-0x118(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f6 <dumpInfo+0xb6>
movslq -0x118(%rbp),%rax
lea    -0x1a0(%rbp),%rdi
add    %rax,%rdi
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
mov    -0x118(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x118(%rbp)
jmp    1196 <dumpInfo+0x56>
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    -0x1a0(%rbp),%r8
mov    $0x100,%esi
lea    0xdf2(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0x2a0(%rbp),%rdi
lea    -0x110(%rbp),%rax
mov    $0x100,%esi
lea    0xdec(%rip),%rdx
lea    0xdf3(%rip),%rcx
lea    0xe89(%rip),%r8
mov    $0x161,%r9d
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0x2a0(%rbp),%rsi
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <log_string@plt>
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpInfo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
mov    %esi,%r14d
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
test   %esi,%esi
jle    11af <dumpInfo+0x7f>
mov    %rdi,%r12
mov    %r14d,%r13d
lea    0x10(%rsp),%rbp
lea    0xe78(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r12,%rbx,1),%edx
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <sprintf@plt>
add    $0x1,%rbx
add    $0x2,%rbp
cmp    %rbx,%r13
jne    1190 <dumpInfo+0x60>
lea    0xe4f(%rip),%rdx
lea    0x190(%rsp),%rbx
lea    0x10(%rsp),%r8
mov    $0x100,%esi
mov    %rbx,%rdi
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    %rbx,(%rsp)
lea    0xe40(%rip),%rdx
lea    0xe47(%rip),%rcx
lea    0xedd(%rip),%r8
lea    0x90(%rsp),%rbx
mov    $0x100,%esi
mov    %rbx,%rdi
mov    $0x161,%r9d
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <log_string@plt>
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
@.str.1 = [27 x i8] c"dump info length = %d, %s\0A\00"
@.str.2 = [14 x i8] c"[%s %s %d] %s\00"
@.str.3 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/leoge0113/epoll-threadpool/refs/heads/master/server/g_net_update.c\00"
@__FUNCTION__.dumpInfo = [9 x i8] c"dumpInfo\00"
define void @dumpInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [128 x i8]
%9 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %7
%10 = bitcast [128 x i8]* %8 to i8*
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
store i32 0, i32* %6
br label %12
12: ; preds = %27, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %32
16: ; preds = %12
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %16
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 2
store i32 %31, i32* %7
br label %12
32: ; preds = %12
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%34 = load i32, i32* %4
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%36 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %33, i64 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %34, i8* %35)
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%39 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %37, i64 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.dumpInfo, i64 0, i64 0), i32 353, i8* %38)
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%41 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @log_string to i32 (i32, i8*, ...)*)(i32 4, i8* %40)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
@.str.1 = [27 x i8] c"dump info length = %d, %s\0A\00"
@.str.2 = [14 x i8] c"[%s %s %d] %s\00"
@.str.3 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/leoge0113/epoll-threadpool/refs/heads/master/server/g_net_update.c\00"
@__FUNCTION__.dumpInfo = [9 x i8] c"dumpInfo\00"
define void @dumpInfo(i8* nocapture %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca [128 x i8]
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = icmp sgt i32 %1, 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
br i1 %8, label %10, label %23
10: ; preds = %2
%11 = zext i32 %1 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %20, %12 ]
%14 = phi i64 [ 0, %10 ], [ %21, %12 ]
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %14
%16 = getelementptr inbounds i8, i8* %0, i64 %13
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i64 %13, 1
%21 = add nuw nsw i64 %14, 2
%22 = icmp eq i64 %20, %11
br i1 %22, label %23, label %12
23: ; preds = %12, %2
%24 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %7)
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%26 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %25, i64 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.dumpInfo, i64 0, i64 0), i32 353, i8* %6)
%27 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @log_string to i32 (i32, i8*, ...)*)(i32 4, i8* %25)
ret void
}