#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 /*<<< orphan*/ hex;

/* Variables and functions */
int convert_hex_to_decimal(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char hex[98] = "49276d206b696c6c696e6720796f757220627261696e206c696b652061207"
                 "06f69736f6e6f7573206d757368726f6f6d";
  char ascii[49];
  int i, j = 0;
  for (i = 0; i < sizeof(hex); i = i + 2) {
    int a = convert_hex_to_decimal(&hex[i]);
    int b = convert_hex_to_decimal(&hex[i + 1]);
    a *= 16;
    ascii[j] = a + b;
    j++;
  }
  printf("%s", ascii);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x62,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0xb8(%rbp)
movl   $0x0,-0xb4(%rbp)
movslq -0xb4(%rbp),%rax
cmp    $0x62,%rax
jae    1200 <main+0xd0>
movslq -0xb4(%rbp),%rax
lea    -0x70(%rbp),%rdi
add    %rax,%rdi
call   1050 <convert_hex_to_decimal@plt>
mov    %eax,-0xbc(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x70(%rbp),%rdi
add    %rax,%rdi
call   1050 <convert_hex_to_decimal@plt>
mov    %eax,-0xc0(%rbp)
mov    -0xbc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
add    -0xc0(%rbp),%eax
mov    %al,%cl
movslq -0xb8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xb4(%rbp)
jmp    116b <main+0x3b>
lea    -0xb0(%rbp),%rsi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xb0,%rsp
movaps 0xf1e(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x0,0x60(%rsp)
mov    %rsp,%r14
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <convert_hex_to_decimal@plt>
mov    %eax,%ebp
lea    0x1(%r14),%rdi
call   1040 <convert_hex_to_decimal@plt>
shl    $0x4,%ebp
add    %eax,%ebp
mov    %bpl,0x70(%rsp,%rbx,1)
add    $0x1,%rbx
add    $0x2,%r14
cmp    $0x31,%rbx
jne    1180 <main+0x60>
lea    0xeb0(%rip),%rdi
lea    0x70(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.hex = [98 x i8] c"49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [98 x i8]
%3 = alloca [49 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [98 x i8]* %2 to i8*
store i32 0, i32* %5
store i32 0, i32* %4
br label %9
9: ; preds = %34, %0
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 98
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [98 x i8], [98 x i8]* %2, i64 0, i64 %15
%17 = call i32 @convert_hex_to_decimal(i8* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [98 x i8], [98 x i8]* %2, i64 0, i64 %20
%22 = call i32 @convert_hex_to_decimal(i8* %21)
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = mul nsw i32 %23, 16
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = add nsw i32 %25, %26
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [49 x i8], [49 x i8]* %3, i64 0, i64 %30
store i8 %28, i8* %31
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %34
34: ; preds = %13
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 2
store i32 %36, i32* %4
br label %9
37: ; preds = %9
%38 = getelementptr inbounds [49 x i8], [49 x i8]* %3, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@__const.main.hex = [98 x i8] c"49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [98 x i8]
%2 = alloca [49 x i8]
%3 = getelementptr inbounds [98 x i8], [98 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [49 x i8], [49 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %17, %5 ]
%7 = phi i64 [ 0, %0 ], [ %18, %5 ]
%8 = getelementptr inbounds [98 x i8], [98 x i8]* %1, i64 0, i64 %7
%9 = call i32 @convert_hex_to_decimal(i8* %8)
%10 = or i64 %7, 1
%11 = getelementptr inbounds [98 x i8], [98 x i8]* %1, i64 0, i64 %10
%12 = call i32 @convert_hex_to_decimal(i8* %11)
%13 = shl nsw i32 %9, 4
%14 = add nsw i32 %13, %12
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [49 x i8], [49 x i8]* %2, i64 0, i64 %6
store i8 %15, i8* %16
%17 = add nuw nsw i64 %6, 1
%18 = add nuw nsw i64 %7, 2
%19 = icmp eq i64 %17, 49
br i1 %19, label %20, label %5
20: ; preds = %5
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}