#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void diversifiedInitializeUpdate(char *keysetId, char *hostChallenge,
                                 char *masterKeyDiversifier,
                                 char *d_init_up_apdu) {
  strcpy(d_init_up_apdu, "");
  strcat(d_init_up_apdu, "d050");
  strcat(d_init_up_apdu, keysetId);
  strcat(d_init_up_apdu, "1018");
  strcat(d_init_up_apdu, hostChallenge);
  strcat(d_init_up_apdu, masterKeyDiversifier);
}


x86 assembly (clang, -O0):
<diversifiedInitializeUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diversifiedInitializeUpdate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xec9(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcat@plt>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"d050\00"
@.str.2 = [5 x i8] c"1018\00"
define void @diversifiedInitializeUpdate(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %3, i8* %0)
%8 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %3, i8* %1)
%10 = tail call i32 @strcat(i8* %3, i8* %2)
ret void
}