#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*/ BLOCKFRONT_LOG(int, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char);
void print_oid(char *p_oid, char *p_oid_str) {
  int counter = 0;
  for (; counter < 12; counter++)
    snprintf(p_oid_str, 12 * 2 + 1, "%02X", (unsigned char)p_oid[counter]);
  BLOCKFRONT_LOG(2, "OID:%s", p_oid_str);
}


x86 assembly (clang, -O0):
<print_oid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    1170 <print_oid+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    $0x19,%esi
lea    0xea7(%rip),%rdx
movzbl (%rax,%rcx,1),%ecx
call   1040 <snprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <print_oid+0x17>
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
lea    0xe85(%rip),%rsi
call   1030 <BLOCKFRONT_LOG@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_oid>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
movzbl (%rdi),%ecx
lea    0xecb(%rip),%r14
mov    %rsi,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x1(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x2(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x3(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x4(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x5(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x6(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x7(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x8(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0x9(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0xa(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
movzbl 0xb(%rbx),%ecx
mov    %r15,%rdi
mov    $0x19,%esi
mov    %r14,%rdx
call   1040 <snprintf@plt>
lea    0xddd(%rip),%rsi
mov    $0x2,%edi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <BLOCKFRONT_LOG@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02X\00"
@.str.1 = [7 x i8] c"OID:%s\00"
define void @print_oid(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @snprintf(i8* %10, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i8*, i8** %4
%22 = call i32 @BLOCKFRONT_LOG(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
@.str.1 = [7 x i8] c"OID:%s\00"
define void @print_oid(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %12)
%14 = getelementptr inbounds i8, i8* %0, i64 4
%15 = load i8, i8* %14
%16 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = getelementptr inbounds i8, i8* %0, i64 5
%18 = load i8, i8* %17
%19 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %18)
%20 = getelementptr inbounds i8, i8* %0, i64 6
%21 = load i8, i8* %20
%22 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %21)
%23 = getelementptr inbounds i8, i8* %0, i64 7
%24 = load i8, i8* %23
%25 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %24)
%26 = getelementptr inbounds i8, i8* %0, i64 8
%27 = load i8, i8* %26
%28 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %27)
%29 = getelementptr inbounds i8, i8* %0, i64 9
%30 = load i8, i8* %29
%31 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %30)
%32 = getelementptr inbounds i8, i8* %0, i64 10
%33 = load i8, i8* %32
%34 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %33)
%35 = getelementptr inbounds i8, i8* %0, i64 11
%36 = load i8, i8* %35
%37 = tail call i32 @snprintf(i8* %1, i32 25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %36)
%38 = tail call i32 @BLOCKFRONT_LOG(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}