#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*/ normalize_hex_string(char *, char *);
int /*<<< orphan*/ normalized_hex_string_length(char *);
scalar_t__ strcmp(char *, char *);
char *normalize_hex_string_01b() {
  char hex[] =
      "0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  char expected[] =
      "B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  char buffer[normalized_hex_string_length(hex) + 1];
  normalize_hex_string(buffer, hex);
  do {
    if (!(strcmp(buffer, expected) == 0))
      return "normalize strings with leading '0X's";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<normalize_hex_string_01b>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movaps 0xeee(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
movl   $0x334132,-0x11(%rbp)
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,-0x90(%rbp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,-0xa0(%rbp)
movb   $0x0,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <normalized_hex_string_length@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xc0(%rbp)
mov    %rdi,%rsp
mov    %rax,-0xb0(%rbp)
lea    -0x50(%rbp),%rsi
call   1040 <normalize_hex_string@plt>
mov    -0xc0(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     121c <normalize_hex_string_01b+0xec>
lea    0xe88(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xb4(%rbp)
jmp    1238 <normalize_hex_string_01b+0x108>
jmp    1221 <normalize_hex_string_01b+0xf1>
jmp    1226 <normalize_hex_string_01b+0xf6>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0xb4(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_hex_string_01b>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
movaps 0xee9(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,-0x90(%rbp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,-0xb0(%rbp)
movl   $0x334132,-0x71(%rbp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
movb   $0x0,-0x20(%rbp)
lea    -0xb0(%rbp),%r14
mov    %r14,%rdi
call   1030 <normalized_hex_string_length@plt>
mov    %rsp,%r15
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <normalize_hex_string@plt>
lea    -0x60(%rbp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
lea    0xe9e(%rip),%rcx
cmovne %rcx,%rax
mov    %r15,%rsp
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.normalize_hex_string_01b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@__const.normalize_hex_string_01b.expected = [65 x i8] c"B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [37 x i8] c"normalize strings with leading '0X's\00"
define i8* @normalize_hex_string_01b() {
%1 = alloca i8*
%2 = alloca [67 x i8]
%3 = alloca [65 x i8]
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = bitcast [67 x i8]* %2 to i8*
%8 = bitcast [65 x i8]* %3 to i8*
%9 = getelementptr inbounds [67 x i8], [67 x i8]* %2, i64 0, i64 0
%10 = call i32 @normalized_hex_string_length(i8* %9)
%11 = add nsw i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %4
%14 = alloca i8, i64 %12
store i64 %12, i64* %5
%15 = getelementptr inbounds [67 x i8], [67 x i8]* %2, i64 0, i64 0
%16 = call i32 @normalize_hex_string(i8* %14, i8* %15)
br label %17
17: ; preds = %0
%18 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%19 = call i64 @strcmp(i8* %14, i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 1, i32* %6
br label %25
22: ; preds = %17
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
store i8* null, i8** %1
store i32 1, i32* %6
br label %25
25: ; preds = %24, %21
%26 = load i8*, i8** %4
%27 = load i8*, i8** %1
ret i8* %27
}

LLVM IR (-O2):
@__const.normalize_hex_string_01b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@__const.normalize_hex_string_01b.expected = [65 x i8] c"B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [37 x i8] c"normalize strings with leading '0X's\00"
define i8* @normalize_hex_string_01b() {
%1 = alloca [67 x i8]
%2 = alloca [65 x i8]
%3 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%5 = call i32 @normalized_hex_string_length(i8* %3)
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = call i32 @normalize_hex_string(i8* %9, i8* %3)
%11 = call i64 @strcmp(i8* %9, i8* %4)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* null, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
ret i8* %13
}