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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
unsigned int checkPsk(SSL *ssl, const char *identity, unsigned char *psk,
                      unsigned int max_psk_len) {
  psk[0] = 'P';
  psk[1] = 'A';
  psk[2] = 'S';
  psk[3] = 'S';
  psk[4] = 'W';
  psk[5] = 'O';
  psk[6] = 'R';
  psk[7] = 'D';
  printf("Authentication being checked:\n"
         "Identity: %s\n",
         identity);
  return 8;
}


x86 assembly (clang, -O0):
<checkPsk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x50,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x41,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x53,0x2(%rax)
mov    -0x18(%rbp),%rax
movb   $0x53,0x3(%rax)
mov    -0x18(%rbp),%rax
movb   $0x57,0x4(%rax)
mov    -0x18(%rbp),%rax
movb   $0x4f,0x5(%rax)
mov    -0x18(%rbp),%rax
movb   $0x52,0x6(%rax)
mov    -0x18(%rbp),%rax
movb   $0x44,0x7(%rax)
mov    -0x10(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPsk>:
push   %rax
movabs $0x44524f5753534150,%rax
4f 52 44
mov    %rax,(%rdx)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Authentication being checked:\0AIdentity: %s\0A\00"
define i32 @checkPsk(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 80, i8* %10
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 65, i8* %12
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 83, i8* %14
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 83, i8* %16
%17 = load i8*, i8** %7
%18 = getelementptr inbounds i8, i8* %17, i64 4
store i8 87, i8* %18
%19 = load i8*, i8** %7
%20 = getelementptr inbounds i8, i8* %19, i64 5
store i8 79, i8* %20
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 6
store i8 82, i8* %22
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i64 7
store i8 68, i8* %24
%25 = load i8*, i8** %6
%26 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %25)
ret i32 8
}

LLVM IR (-O2):
@.str = [44 x i8] c"Authentication being checked:\0AIdentity: %s\0A\00"
define i32 @checkPsk(i32* nocapture readnone %0, i8* %1, i8* nocapture writeonly %2, i32 %3) {
store i8 80, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8 65, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 2
store i8 83, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 3
store i8 83, i8* %7
%8 = getelementptr inbounds i8, i8* %2, i64 4
store i8 87, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 5
store i8 79, i8* %9
%10 = getelementptr inbounds i8, i8* %2, i64 6
store i8 82, i8* %10
%11 = getelementptr inbounds i8, i8* %2, i64 7
store i8 68, i8* %11
%12 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 8
}