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

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int /*<<< orphan*/ strncmp(char *, char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
int __is_valid_dynamic_token(char *password) {
  char *token = (char *)malloc(30 * sizeof(char));
  time_t time1;
  memset((char *)token, '\0', 30);
  sprintf(token, "%s_%d", "\x5f\x75\x43\x30\x6e\x5f\x00", (int)time(&time1));
  if (!strncmp(token, password, 18)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<__is_valid_dynamic_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1e,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <time@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
lea    0xe68(%rip),%rsi
lea    0xe67(%rip),%rdx
call   1070 <sprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11cb <__is_valid_dynamic_token+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    11d2 <__is_valid_dynamic_token+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_valid_dynamic_token>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1e,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
lea    0xe7c(%rip),%rsi
lea    0xe7b(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%ecx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%d\00"
@.str.1 = [8 x i8] c"_uC0n_\00\00"
define i32 @__is_valid_dynamic_token(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i64 @malloc(i32 30)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 30)
%10 = load i8*, i8** %4
%11 = call i64 @time(i32* %5)
%12 = trunc i64 %11 to i32
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strncmp(i8* %14, i8* %15, i32 18)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %1
store i32 1, i32* %2
br label %20
19: ; preds = %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%d\00"
@.str.1 = [8 x i8] c"_uC0n_\00\00"
define i32 @__is_valid_dynamic_token(i8* %0) {
%2 = alloca i32
%3 = tail call i64 @malloc(i32 30)
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @memset(i8* %4, i8 signext 0, i32 30)
%7 = call i64 @time(i32* %2)
%8 = trunc i64 %7 to i32
%9 = call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @strncmp(i8* %4, i8* %0, i32 18)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}