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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int /*<<< orphan*/ mrtd_bac_get_kmrz(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
void mrtd_bac_get_kmrz_from_mrz(const uint8_t *mrz, uint8_t *kmrz) {
  uint8_t pn[9];
  uint8_t dob[6];
  uint8_t eov[6];
  memcpy(pn, mrz, 9);
  memcpy(dob, mrz + 13, 6);
  memcpy(eov, mrz + 21, 6);
  mrtd_bac_get_kmrz(pn, dob, eov, kmrz);
}


x86 assembly (clang, -O0):
<mrtd_bac_get_kmrz_from_mrz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x9,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x34,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x54,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x80(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <mrtd_bac_get_kmrz@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrtd_bac_get_kmrz_from_mrz>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x40(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x9,%edx
call   1040 <memcpy@plt>
lea    0x34(%rbx),%rsi
lea    0x20(%rsp),%r12
mov    %r12,%rdi
mov    $0x6,%edx
call   1040 <memcpy@plt>
add    $0x54,%rbx
mov    %rsp,%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
call   1030 <mrtd_bac_get_kmrz@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mrtd_bac_get_kmrz_from_mrz(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [9 x i32]
%6 = alloca [6 x i32]
%7 = alloca [6 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @memcpy(i32* %8, i32* %9, i32 9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 13
%14 = call i32 @memcpy(i32* %11, i32* %13, i32 6)
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 21
%18 = call i32 @memcpy(i32* %15, i32* %17, i32 6)
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%22 = load i32*, i32** %4
%23 = call i32 @mrtd_bac_get_kmrz(i32* %19, i32* %20, i32* %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @mrtd_bac_get_kmrz_from_mrz(i32* %0, i32* %1) {
%3 = alloca [9 x i32]
%4 = alloca [6 x i32]
%5 = alloca [6 x i32]
%6 = bitcast [9 x i32]* %3 to i8*
%7 = bitcast [6 x i32]* %4 to i8*
%8 = bitcast [6 x i32]* %5 to i8*
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%10 = call i32 @memcpy(i32* %9, i32* %0, i32 9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %0, i64 13
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 6)
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%15 = getelementptr inbounds i32, i32* %0, i64 21
%16 = call i32 @memcpy(i32* %14, i32* %15, i32 6)
%17 = call i32 @mrtd_bac_get_kmrz(i32* %9, i32* %11, i32* %14, i32* %1)
ret void
}