#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_01e() {
  char hex[] = "FFFFFFFFF";
  char expected[] = "000FFFFFFFFF";
  char buffer[normalized_hex_string_length(hex) + 1];
  normalize_hex_string(buffer, hex);
  do {
    if (!(strcmp(buffer, expected) == 0))
      return "normalize strings without leading '0x's and only 9 characters";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<normalize_hex_string_01e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movabs $0x4646464646464646,%rax
46 46 46
mov    %rax,-0x18(%rbp)
movw   $0x46,-0x10(%rbp)
movabs $0x46464646464646,%rax
mov    %rax,-0x23(%rbp)
movabs $0x4646464646303030,%rax
46 46 46
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <normalized_hex_string_length@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x48(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
lea    -0x18(%rbp),%rsi
call   1040 <normalize_hex_string@plt>
mov    -0x48(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11ce <normalize_hex_string_01e+0x9e>
lea    0xe4f(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    11e7 <normalize_hex_string_01e+0xb7>
jmp    11d3 <normalize_hex_string_01e+0xa3>
jmp    11d8 <normalize_hex_string_01e+0xa8>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_hex_string_01e>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
movabs $0x4646464646464646,%rax
46 46 46
mov    %rax,-0x28(%rbp)
movw   $0x46,-0x20(%rbp)
movabs $0x46464646464646,%rax
mov    %rax,-0x33(%rbp)
movabs $0x4646464646303030,%rax
46 46 46
mov    %rax,-0x38(%rbp)
lea    -0x28(%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    -0x38(%rbp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
lea    0xe5c(%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_01e.hex = [10 x i8] c"FFFFFFFFF\00"
@__const.normalize_hex_string_01e.expected = [13 x i8] c"000FFFFFFFFF\00"
@.str = [62 x i8] c"normalize strings without leading '0x's and only 9 characters\00"
define i8* @normalize_hex_string_01e() {
%1 = alloca i8*
%2 = alloca [10 x i8]
%3 = alloca [13 x i8]
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = bitcast [10 x i8]* %2 to i8*
%8 = bitcast [13 x i8]* %3 to i8*
%9 = getelementptr inbounds [10 x i8], [10 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 [10 x i8], [10 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 [13 x i8], [13 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 ([62 x i8], [62 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_01e.hex = [10 x i8] c"FFFFFFFFF\00"
@__const.normalize_hex_string_01e.expected = [13 x i8] c"000FFFFFFFFF\00"
@.str = [62 x i8] c"normalize strings without leading '0x's and only 9 characters\00"
define i8* @normalize_hex_string_01e() {
%1 = alloca [10 x i8]
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [13 x i8], [13 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 ([62 x i8], [62 x i8]* @.str, i64 0, i64 0)
ret i8* %13
}