#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*/ scanf(char *, char *);
void hex_input(char num1[], char num2[], char num3[]) {
  char str[7];
  scanf("%s", str);
  num1[0] = str[1];
  num1[1] = str[2];
  num2[0] = str[3];
  num2[1] = str[4];
  num3[0] = str[5];
  num3[1] = str[6];
}


x86 assembly (clang, -O0):
<hex_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1f(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x1e(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1d(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x1c(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1b(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x1a(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_input>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xed7(%rip),%rdi
lea    0x9(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xa(%rsp),%al
mov    %al,(%rbx)
mov    0xb(%rsp),%al
mov    %al,0x1(%rbx)
mov    0xc(%rsp),%al
mov    %al,(%r15)
mov    0xd(%rsp),%al
mov    %al,0x1(%r15)
mov    0xe(%rsp),%al
mov    %al,(%r14)
mov    0xf(%rsp),%al
mov    %al,0x1(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @hex_input(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [7 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 3
%19 = load i8, i8* %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
%22 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 4
%23 = load i8, i8* %22
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 %23, i8* %25
%26 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 5
%27 = load i8, i8* %26
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 %27, i8* %29
%30 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 6
%31 = load i8, i8* %30
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i64 1
store i8 %31, i8* %33
ret void
}

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