#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 scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
void stringToBlock(char *str, uint8_t block[16]) {
  int i;
  for (i = 0; i < 16; i++) {
    int temp;
    sscanf(&str[2 * i], "%02X", &temp);
    block[i] = (uint8_t)temp;
  }
}


x86 assembly (clang, -O0):
<stringToBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    116e <stringToBlock+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
lea    0xeb9(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <sscanf@plt>
movslq -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <stringToBlock+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToBlock>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedb(%rip),%r15
lea    0x4(%rsp),%r12
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,(%r14)
lea    0x2(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x8(%r14)
lea    0x4(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x10(%r14)
lea    0x6(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x18(%r14)
lea    0x8(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x20(%r14)
lea    0xa(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x28(%r14)
lea    0xc(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x30(%r14)
lea    0xe(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x38(%r14)
lea    0x10(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x40(%r14)
lea    0x12(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x48(%r14)
lea    0x14(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x50(%r14)
lea    0x16(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x58(%r14)
lea    0x18(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x60(%r14)
lea    0x1a(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x68(%r14)
lea    0x1c(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x70(%r14)
add    $0x1e,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <sscanf@plt>
movslq 0x4(%rsp),%rax
mov    %rax,0x78(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @stringToBlock(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %1
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %11, i64* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %16, i64* %17
%18 = getelementptr inbounds i8, i8* %0, i64 6
%19 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %1, i64 3
store i64 %21, i64* %22
%23 = getelementptr inbounds i8, i8* %0, i64 8
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i64, i64* %1, i64 4
store i64 %26, i64* %27
%28 = getelementptr inbounds i8, i8* %0, i64 10
%29 = call i32 @sscanf(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i64, i64* %1, i64 5
store i64 %31, i64* %32
%33 = getelementptr inbounds i8, i8* %0, i64 12
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i64, i64* %1, i64 6
store i64 %36, i64* %37
%38 = getelementptr inbounds i8, i8* %0, i64 14
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i64, i64* %1, i64 7
store i64 %41, i64* %42
%43 = getelementptr inbounds i8, i8* %0, i64 16
%44 = call i32 @sscanf(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i64, i64* %1, i64 8
store i64 %46, i64* %47
%48 = getelementptr inbounds i8, i8* %0, i64 18
%49 = call i32 @sscanf(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i64, i64* %1, i64 9
store i64 %51, i64* %52
%53 = getelementptr inbounds i8, i8* %0, i64 20
%54 = call i32 @sscanf(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i64, i64* %1, i64 10
store i64 %56, i64* %57
%58 = getelementptr inbounds i8, i8* %0, i64 22
%59 = call i32 @sscanf(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i64, i64* %1, i64 11
store i64 %61, i64* %62
%63 = getelementptr inbounds i8, i8* %0, i64 24
%64 = call i32 @sscanf(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i64, i64* %1, i64 12
store i64 %66, i64* %67
%68 = getelementptr inbounds i8, i8* %0, i64 26
%69 = call i32 @sscanf(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i64, i64* %1, i64 13
store i64 %71, i64* %72
%73 = getelementptr inbounds i8, i8* %0, i64 28
%74 = call i32 @sscanf(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%75 = load i32, i32* %3
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i64, i64* %1, i64 14
store i64 %76, i64* %77
%78 = getelementptr inbounds i8, i8* %0, i64 30
%79 = call i32 @sscanf(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%80 = load i32, i32* %3
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i64, i64* %1, i64 15
store i64 %81, i64* %82
ret void
}