#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 */
typedef int uint32_t;

/* Variables and functions */
void print_word_hex(uint32_t *c) {
  int i;
  uint32_t a;
  for (i = 0x7; i >= 0x0; i--) {
    a = *c & (0xf << (i * 0x4));
    a >>= (i * 0x4);
    while ((*((volatile uint32_t *)(((volatile uint32_t *const)0x20201000 +
                                     0x18)))) &
           (1 << 5)) {
    }
    if (a <= 9)
      (*((volatile uint32_t *)((volatile uint32_t *const)0x20201000)) =
           (volatile uint32_t)((uint32_t)(a + (uint32_t)'0')));
    else if (a <= 0xf)
      (*((volatile uint32_t *)((volatile uint32_t *const)0x20201000)) =
           (volatile uint32_t)((uint32_t)((a - 0xa) + (uint32_t)'a')));
    else
      (*((volatile uint32_t *)((volatile uint32_t *const)0x20201000)) =
           (volatile uint32_t)((uint32_t)('?')));
  }
}


x86 assembly (clang, -O0):
<print_word_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11b8 <print_word_hex+0xb8>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
mov    $0xf,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    $0x20201000,%eax
mov    0x60(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     115a <print_word_hex+0x5a>
jmp    1141 <print_word_hex+0x41>
cmpl   $0x9,-0x10(%rbp)
jg     1176 <print_word_hex+0x76>
mov    -0x10(%rbp),%ecx
add    $0x30,%ecx
mov    $0x20201000,%eax
mov    %ecx,(%rax)
jmp    11a5 <print_word_hex+0xa5>
cmpl   $0xf,-0x10(%rbp)
jg     1195 <print_word_hex+0x95>
mov    -0x10(%rbp),%ecx
sub    $0xa,%ecx
add    $0x61,%ecx
mov    $0x20201000,%eax
mov    %ecx,(%rax)
jmp    11a0 <print_word_hex+0xa0>
mov    $0x20201000,%eax
movl   $0x3f,(%rax)
jmp    11a5 <print_word_hex+0xa5>
jmp    11aa <print_word_hex+0xaa>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <print_word_hex+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_word_hex>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x20,0x20201060
jne    1110 <print_word_hex+0x10>
sar    $0x1c,%eax
add    $0x30,%eax
mov    %eax,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax)
testl  $0x20,0x20201060
jne    1130 <print_word_hex+0x30>
shr    $0x18,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    1160 <print_word_hex+0x60>
shr    $0x14,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    1190 <print_word_hex+0x90>
shr    $0x10,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    11c0 <print_word_hex+0xc0>
shr    $0xc,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    11f0 <print_word_hex+0xf0>
shr    $0x8,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    1220 <print_word_hex+0x120>
shr    $0x4,%eax
and    $0xf,%eax
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
mov    (%rdi),%eax
and    $0xf,%eax
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x20201060
jne    1250 <print_word_hex+0x150>
lea    0x30(%rax),%ecx
lea    0x57(%rax),%edx
cmp    $0xa,%eax
cmovb  %ecx,%edx
mov    %edx,0x20201000
ret

LLVM IR (-O0):
define void @print_word_hex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 7, i32* %3
br label %5
5: ; preds = %40, %1
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %43
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 4
%13 = shl i32 15, %12
%14 = and i32 %10, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 4
%17 = load i32, i32* %4
%18 = ashr i32 %17, %16
store i32 %18, i32* %4
br label %19
19: ; preds = %23, %8
%20 = load volatile i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 538972160 to i32*), i64 24)
%21 = and i32 %20, 32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
br label %19
24: ; preds = %19
%25 = load i32, i32* %4
%26 = icmp sle i32 %25, 9
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 48
store volatile i32 %29, i32* inttoptr (i64 538972160 to i32*)
br label %39
30: ; preds = %24
%31 = load i32, i32* %4
%32 = icmp sle i32 %31, 15
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load i32, i32* %4
%35 = sub nsw i32 %34, 10
%36 = add nsw i32 %35, 97
store volatile i32 %36, i32* inttoptr (i64 538972160 to i32*)
br label %38
37: ; preds = %30
store volatile i32 63, i32* inttoptr (i64 538972160 to i32*)
br label %38
38: ; preds = %37, %33
br label %39
39: ; preds = %38, %27
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, -1
store i32 %42, i32* %3
br label %5
43: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print_word_hex(i32* nocapture %0) {
%2 = load i32, i32* %0
br label %3
3: ; preds = %3, %1
%4 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = ashr i32 %2, 28
%9 = add nsw i32 %8, 48
store volatile i32 %9, i32* inttoptr (i64 538972160 to i32*)
%10 = load i32, i32* %0
br label %11
11: ; preds = %11, %7
%12 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%13 = and i32 %12, 32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %11
15: ; preds = %11
%16 = lshr i32 %10, 24
%17 = and i32 %16, 15
%18 = icmp ult i32 %17, 10
%19 = or i32 %17, 48
%20 = add nuw nsw i32 %17, 87
%21 = select i1 %18, i32 %19, i32 %20
store volatile i32 %21, i32* inttoptr (i64 538972160 to i32*)
%22 = load i32, i32* %0
br label %23
23: ; preds = %23, %15
%24 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%25 = and i32 %24, 32
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %23
27: ; preds = %23
%28 = lshr i32 %22, 20
%29 = and i32 %28, 15
%30 = icmp ult i32 %29, 10
%31 = or i32 %29, 48
%32 = add nuw nsw i32 %29, 87
%33 = select i1 %30, i32 %31, i32 %32
store volatile i32 %33, i32* inttoptr (i64 538972160 to i32*)
%34 = load i32, i32* %0
br label %35
35: ; preds = %35, %27
%36 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%37 = and i32 %36, 32
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %35
39: ; preds = %35
%40 = lshr i32 %34, 16
%41 = and i32 %40, 15
%42 = icmp ult i32 %41, 10
%43 = or i32 %41, 48
%44 = add nuw nsw i32 %41, 87
%45 = select i1 %42, i32 %43, i32 %44
store volatile i32 %45, i32* inttoptr (i64 538972160 to i32*)
%46 = load i32, i32* %0
br label %47
47: ; preds = %47, %39
%48 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%49 = and i32 %48, 32
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %47
51: ; preds = %47
%52 = lshr i32 %46, 12
%53 = and i32 %52, 15
%54 = icmp ult i32 %53, 10
%55 = or i32 %53, 48
%56 = add nuw nsw i32 %53, 87
%57 = select i1 %54, i32 %55, i32 %56
store volatile i32 %57, i32* inttoptr (i64 538972160 to i32*)
%58 = load i32, i32* %0
br label %59
59: ; preds = %59, %51
%60 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%61 = and i32 %60, 32
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %59
63: ; preds = %59
%64 = lshr i32 %58, 8
%65 = and i32 %64, 15
%66 = icmp ult i32 %65, 10
%67 = or i32 %65, 48
%68 = add nuw nsw i32 %65, 87
%69 = select i1 %66, i32 %67, i32 %68
store volatile i32 %69, i32* inttoptr (i64 538972160 to i32*)
%70 = load i32, i32* %0
br label %71
71: ; preds = %71, %63
%72 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%73 = and i32 %72, 32
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %71
75: ; preds = %71
%76 = lshr i32 %70, 4
%77 = and i32 %76, 15
%78 = icmp ult i32 %77, 10
%79 = or i32 %77, 48
%80 = add nuw nsw i32 %77, 87
%81 = select i1 %78, i32 %79, i32 %80
store volatile i32 %81, i32* inttoptr (i64 538972160 to i32*)
%82 = load i32, i32* %0
%83 = and i32 %82, 15
br label %84
84: ; preds = %84, %75
%85 = load volatile i32, i32* inttoptr (i64 538972256 to i32*)
%86 = and i32 %85, 32
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %84
88: ; preds = %84
%89 = icmp ult i32 %83, 10
%90 = or i32 %83, 48
%91 = add nuw nsw i32 %83, 87
%92 = select i1 %89, i32 %90, i32 %91
store volatile i32 %92, i32* inttoptr (i64 538972160 to i32*)
ret void
}