#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*/ generateOTP(char *, int /*<<< orphan*/, char *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/,
                               int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char secret[] = "0x3132333435363738393031323334353637383930";
  char data[] = "hellotestdddfdasfdasfkjdashfkldhasfdkjasfhdaskjfhdasfa";
  char result[10] = {0};
  generateOTP(secret, strlen(secret), data, strlen(data), 6, 0, 0, result);
  printf("result:%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x2b,%edx
call   1070 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x37,%edx
call   1070 <memcpy@plt>
lea    -0x7a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x8c(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x98(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x88(%rbp),%rdx
mov    %eax,%ecx
lea    -0x7a(%rbp),%rax
mov    $0x6,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <generateOTP@plt>
lea    -0x7a(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x78,%rsp
movups 0xeda(%rip),%xmm0
movups %xmm0,0x2b(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movabs $0x61667361646866,%rax
mov    %rax,0x6f(%rsp)
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    $0x6,%r8d
xor    %r9d,%r9d
push   %r15
push   $0x0
call   1030 <generateOTP@plt>
add    $0x10,%rsp
lea    0xe81(%rip),%rdi
mov    %r15,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.secret = [43 x i8] c"0x3132333435363738393031323334353637383930\00"
@__const.main.data = [55 x i8] c"hellotestdddfdasfdasfkjdashfkldhasfdkjasfhdaskjfhdasfa\00"
@.str = [11 x i8] c"result:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [43 x i8]
%3 = alloca [55 x i8]
%4 = alloca [10 x i8]
store i32 0, i32* %1
%5 = bitcast [43 x i8]* %2 to i8*
%6 = bitcast [55 x i8]* %3 to i8*
%7 = bitcast [10 x i8]* %4 to i8*
%8 = getelementptr inbounds [43 x i8], [43 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [43 x i8], [43 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = getelementptr inbounds [55 x i8], [55 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [55 x i8], [55 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%15 = call i32 @generateOTP(i8* %8, i32 %10, i8* %11, i32 %13, i32 6, i32 0, i32 0, i8* %14)
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.secret = [43 x i8] c"0x3132333435363738393031323334353637383930\00"
@__const.main.data = [55 x i8] c"hellotestdddfdasfdasfkjdashfkldhasfdkjasfhdaskjfhdasfa\00"
@.str = [11 x i8] c"result:%s\0A\00"
define i32 @main() {
%1 = alloca [43 x i8]
%2 = alloca [55 x i8]
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [55 x i8], [55 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @strlen(i8* %5)
%9 = call i32 @generateOTP(i8* %4, i32 %7, i8* %5, i32 %8, i32 6, i32 0, i32 0, i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}