#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*/ sscanf(char *, char *, unsigned char *, unsigned char *,
                          unsigned char *, unsigned char *, unsigned char *,
                          unsigned char *, unsigned char *, unsigned char *);
void read_key(char *key, unsigned char *dst) {
  sscanf(key, "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx", dst, dst + 1, dst + 2,
         dst + 3, dst + 4, dst + 5, dst + 6, dst + 7);
}


x86 assembly (clang, -O0):
<read_key>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%r8
add    $0x2,%r8
mov    -0x18(%rbp),%r9
add    $0x3,%r9
mov    -0x18(%rbp),%rbx
add    $0x4,%rbx
mov    -0x18(%rbp),%r11
add    $0x5,%r11
mov    -0x18(%rbp),%r10
add    $0x6,%r10
mov    -0x18(%rbp),%rax
add    $0x7,%rax
lea    0xe98(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <sscanf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_key>:
push   %rbx
mov    %rsi,%rdx
lea    0x1(%rsi),%rcx
lea    0x2(%rsi),%r8
lea    0x3(%rsi),%r9
lea    0x4(%rsi),%r10
lea    0x5(%rsi),%r11
lea    0x6(%rsi),%rax
lea    0x7(%rsi),%rbx
lea    0xec9(%rip),%rsi
push   %rbx
push   %rax
push   %r11
push   %r10
call   1030 <sscanf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx\00"
define void @read_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 3
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 5
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 6
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 7
%21 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i8* %10, i8* %12, i8* %14, i8* %16, i8* %18, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx\00"
define void @read_key(i8* nocapture %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = getelementptr inbounds i8, i8* %1, i64 2
%5 = getelementptr inbounds i8, i8* %1, i64 3
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = getelementptr inbounds i8, i8* %1, i64 5
%8 = getelementptr inbounds i8, i8* %1, i64 6
%9 = getelementptr inbounds i8, i8* %1, i64 7
%10 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* %9)
ret void
}