LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/util.c
// Function: printutf8pad
void
printutf8pad(FILE *fp, const char *s, size_t len, int pad)
{
	wchar_t wc;
	size_t col = 0, i, slen;
	int rl, w;

	if (!len)
		return;

	slen = strlen(s);
	for (i = 0; i < slen; i += rl) {
		if ((rl = mbtowc(&wc, s + i, slen - i < 4 ? slen - i : 4)) <= 0)
			break;
		if ((w = wcwidth(wc)) == -1)
			continue;
		if (col + w > len || (col + w == len && s[i + rl])) {
			fputs("\xe2\x80\xa6", fp);
			col++;
			break;
		}
		fwrite(&s[i], 1, rl, fp);
		col += w;
	}
	for (; col < len; ++col)
		putc(pad, fp);
}

// Assembly:
testq %rdx, %rdx
je 0x1f98
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movl %ecx, 0x8(%rsp)
movq %rsi, %rdi
callq 0x1070
movq %rax, 0x18(%rsp)
xorl %eax, %eax
xorl %r15d, %r15d
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %rdx
subq %rax, %rdx
jbe 0x1f72
movq %rax, 0x20(%rsp)
leaq (%rbx,%rax), %rbp
cmpq $0x4, %rdx
pushq $0x4
popq %rax
cmovaeq %rax, %rdx
leaq 0xc(%rsp), %rdi
movq %rbp, %rsi
callq 0x1130
testl %eax, %eax
jle 0x1f72
movl %eax, %r13d
movl 0xc(%rsp), %edi
callq 0x1160
movl %r13d, %r13d
cmpl $-0x1, %eax
je 0x1f4e
movq %r12, %rcx
movslq %eax, %r12
addq %r15, %r12
cmpq %rcx, %r12
ja 0x1f5b
jne 0x1f35
cmpb $0x0, (%rbp,%r13)
jne 0x1f5b
movq %rbp, %rdi
pushq $0x1
popq %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x11b0
movq %r12, %r15
movq 0x10(%rsp), %r12
movq 0x20(%rsp), %rax
addq %r13, %rax
jmp 0x1ed6
leaq 0x15fc(%rip), %rdi      # 0x355e
movq %r14, %rsi
callq 0x10b0
incq %r15
movq 0x10(%rsp), %r12
movl 0x8(%rsp), %ebx
cmpq %r12, %r15
jae 0x1f8a
movl %ebx, %edi
movq %r14, %rsi
callq 0x1100
incq %r15
jmp 0x1f76
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/strlcat.c
// Function: strlcat
size_t
strlcat(char *dst, const char *src, size_t dsize)
{
	const char *odst = dst;
	const char *osrc = src;
	size_t n = dsize;
	size_t dlen;

	/* Find the end of dst and adjust bytes left but don't go past end. */
	while (n-- != 0 && *dst != '\0')
		dst++;
	dlen = dst - odst;
	n = dsize - dlen;

	if (n-- == 0)
		return(dlen + strlen(src));
	while (*src != '\0') {
		if (n != 0) {
			*dst++ = *src;
			n--;
		}
		src++;
	}
	*dst = '\0';

	return(dlen + (src - osrc));	/* count does not include NUL */
}

// Assembly:
leaq (%rdi,%rdx), %rcx
xorl %eax, %eax
cmpq %rax, %rdx
je 0x1fb8
cmpb $0x0, (%rdi,%rax)
je 0x1fb2
incq %rax
jmp 0x1fa2
addq %rdi, %rax
movq %rax, %rcx
pushq %rbx
movq %rcx, %rbx
subq %rdi, %rbx
cmpq %rdx, %rbx
jne 0x1fce
movq %rsi, %rdi
callq 0x1070
jmp 0x1ff9
movq %rbx, %rdi
notq %rdi
addq %rdx, %rdi
xorl %eax, %eax
movb (%rsi,%rax), %dl
testb %dl, %dl
je 0x1ff6
testq %rdi, %rdi
je 0x1fef
movb %dl, (%rcx)
incq %rcx
decq %rdi
jmp 0x1ff1
xorl %edi, %edi
incq %rax
jmp 0x1fd9
movb $0x0, (%rcx)
addq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/strlcpy.c
// Function: strlcpy
size_t
strlcpy(char *dst, const char *src, size_t dsize)
{
	const char *osrc = src;
	size_t nleft = dsize;

	/* Copy as many bytes as will fit. */
	if (nleft != 0) {
		while (--nleft != 0) {
			if ((*dst++ = *src++) == '\0')
				break;
		}
	}

	/* Not enough room in dst, add NUL and traverse rest of src. */
	if (nleft == 0) {
		if (dsize != 0)
			*dst = '\0';		/* NUL-terminate dst */
		while (*src++)
			;
	}

	return(src - osrc - 1);	/* count does not include NUL */
}

// Assembly:
movq %rsi, %rax
movq %rsi, %rcx
testq %rdx, %rdx
je 0x2034
decq %rdx
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x202d
movb (%rax,%rcx), %sil
movb %sil, (%rdi,%rcx)
incq %rcx
testb %sil, %sil
jne 0x2010
addq %rax, %rcx
movq %rcx, %rdx
jmp 0x2040
movb $0x0, (%rdi,%rcx)
addq %rax, %rcx
leaq 0x1(%rcx), %rdx
cmpb $0x0, (%rcx)
movq %rdx, %rcx
jne 0x2034
notq %rax
addq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/curve25519/donna_c64/../test.c
// Function: main
int
main() {
  uint8_t out[32], a[32], b[32];

  memset(a, 42, sizeof(a));
  memset(b, 64, sizeof(b));
  curve25519(out, a, b);
  return 0 != memcmp(out, "\x0eY\xe5-\xdc|%AV\x9eR\xe0\xba!\xf1T]>\xff\xca\xcaSS\x9c\xc4_\xec`O*\xd6\x03", 32);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movaps 0x1ec4(%rip), %xmm0     # 0x3010
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps 0x1ec2(%rip), %xmm0     # 0x3020
leaq -0x30(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x1198
leaq 0x1eb4(%rip), %rsi      # 0x3030
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0x1030
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/curve25519/donna_c64/smult.c
// Function: swap_conditional
static void
swap_conditional(felem *a, felem *b, unsigned len, felem iswap) {
  unsigned i;
  const felem swap = -iswap;

  for (i = 0; i < len; ++i) {
    const felem x = swap & (a[i] ^ b[i]);
    a[i] ^= x;
    b[i] ^= x;
  }
}

// Assembly:
negq %rdx
xorl %eax, %eax
cmpq $0x5, %rax
je 0x1e49
movq (%rdi,%rax,8), %rcx
movq (%rsi,%rax,8), %r8
xorq %rcx, %r8
andq %rdx, %r8
xorq %r8, %rcx
movq %rcx, (%rdi,%rax,8)
xorq %r8, (%rsi,%rax,8)
incq %rax
jmp 0x1e25
retq
// File: /workspace/github_c_makefile_star2_O2/zhoudian64[P]OS2-exp/mount_example.c
// Function: main
int main()
{
   const char* src  = "none";
   const char* trgt = "./tmp_example";
   const char* type = "tmpfs";
   const unsigned long mntflags = 0;
   const char* opts = "mode=0777,uid=65534";   /* 65534 is the uid of nobody */

   int result = mount(src, trgt, type, mntflags, opts);

   if (result == 0)
   {
      printf("Mount created at %s...\n", trgt);
      printf("Press <return> to unmount the volume: ");
      getchar();

      umount(trgt);
   }
   else
   {
     printf("Error : Failed to mount %s\n"
             "Reason: %s [%d]\n",
             src, strerror(errno), errno);
      return -1;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xe6a(%rip), %rdi       # 0x2004
leaq 0xe68(%rip), %rsi       # 0x2009
leaq 0xe6f(%rip), %rdx       # 0x2017
leaq 0xe6e(%rip), %r8        # 0x201d
xorl %ebx, %ebx
xorl %ecx, %ecx
callq 0x1050
testl %eax, %eax
je 0x11ea
callq 0x1030
movq %rax, %rbx
movl (%rax), %edi
callq 0x1080
movl (%rbx), %ecx
leaq 0xe9c(%rip), %rdi       # 0x2070
leaq 0xe29(%rip), %rsi       # 0x2004
movq %rax, %rdx
xorl %eax, %eax
callq 0x1060
pushq $-0x1
popq %rbx
jmp 0x121d
leaq 0xe40(%rip), %rdi       # 0x2031
leaq 0xe11(%rip), %r14       # 0x2009
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0xe40(%rip), %rdi       # 0x2049
xorl %eax, %eax
callq 0x1060
callq 0x1070
movq %r14, %rdi
callq 0x1040
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/soso7885[P]OPCUA_example/demo_src/client.c
// Function: nodeIter
static UA_StatusCode
nodeIter(UA_NodeId childId, UA_Boolean isInverse, UA_NodeId referenceTypeId, void *handle) {  
  UA_NodeId *parent = (UA_NodeId *) handle;
  
  if(!isInverse) {
    printf("%d, %d --- %d ---> NodeId %d, %d\n",
           parent->namespaceIndex, parent->identifier.numeric,
           referenceTypeId.identifier.numeric, childId.namespaceIndex,
           childId.identifier.numeric);
  }
  return UA_STATUSCODE_GOOD;
}

// Assembly:
testl %edi, %edi
jne 0x207b
pushq %rbp
movq %rsp, %rbp
leaq 0x28(%rbp), %rcx
leaq 0x10(%rbp), %rdi
movzwl (%rsi), %eax
movl 0x8(%rsi), %edx
movl 0x8(%rcx), %ecx
movzwl (%rdi), %r8d
movl 0x8(%rdi), %r9d
leaq 0x1303(%rip), %rdi      # 0x3374
movl %eax, %esi
xorl %eax, %eax
callq 0x10b0
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/fritzw[P]cube-utils/cube-encoder.c
// Function: fsize
long int fsize(FILE *f) {
    long int original, size;
    original = ftell(f);
    fseek(f, 0, SEEK_END);
    size = ftell(f);
    fseek(f, original, SEEK_SET);
    return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x10a0
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10d0
movq %rbx, %rdi
callq 0x10a0
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10d0
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/fritzw[P]cube-utils/blowfish.c
// Function: blowfish_key_setup
void blowfish_key_setup(const BYTE user_key[], BLOWFISH_KEY *keystruct, size_t len)
{
    BYTE block[8];
    int idx,idx2;

    // Copy over the constant init array vals (so the originals aren't destroyed).
    memcpy(keystruct->p,p_perm,sizeof(WORD) * 18);
    memcpy(keystruct->s,s_perm,sizeof(WORD) * 1024);

    // Combine the key with the P box. Assume key is standard 448 bits (56 bytes) or less.
    for (idx = 0, idx2 = 0; idx < 18; ++idx, idx2 += 4)
        keystruct->p[idx] ^= (user_key[idx2 % len] << 24) | (user_key[(idx2+1) % len] << 16)
            | (user_key[(idx2+2) % len] << 8) | (user_key[(idx2+3) % len]);
    // Re-calculate the P box.
    memset(block, 0, 8);
    for (idx = 0; idx < 18; idx += 2) {
        blowfish_encrypt(block,block,keystruct, 0);
        keystruct->p[idx] = (block[0] << 24) | (block[1] << 16) | (block[2] << 8) | block[3];
        keystruct->p[idx+1]=(block[4] << 24) | (block[5] << 16) | (block[6] << 8) | block[7];
    }
    // Recalculate the S-boxes.
    for (idx = 0; idx < 4; ++idx) {
        for (idx2 = 0; idx2 < 256; idx2 += 2) {
            blowfish_encrypt(block,block,keystruct, 0);
            keystruct->s[idx][idx2] = (block[0] << 24) | (block[1] << 16) |
                (block[2] << 8) | block[3];
            keystruct->s[idx][idx2+1] = (block[4] << 24) | (block[5] << 16) |
                (block[6] << 8) | block[7];
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x12ad(%rip), %rsi      # 0x3200
pushq $0x12
popq %rcx
movq %rbx, %rdi
rep  movsl (%rsi), %es:(%rdi)
leaq 0x48(%rbx), %rdi
leaq 0x12ea(%rip), %rsi      # 0x3250
movl $0x1000, %edx           # imm = 0x1000
callq 0x10b0
xorl %ecx, %ecx
cmpq $0x48, %rcx
je 0x1fc7
movq %rcx, %rax
xorl %edx, %edx
divq %r14
movzbl (%r15,%rdx), %esi
shll $0x18, %esi
leaq 0x1(%rcx), %rax
xorl %edx, %edx
divq %r14
movzbl (%r15,%rdx), %edi
shll $0x10, %edi
orl %esi, %edi
leaq 0x2(%rcx), %rax
xorl %edx, %edx
divq %r14
movzbl (%r15,%rdx), %esi
shll $0x8, %esi
orl %edi, %esi
leaq 0x3(%rcx), %rax
xorl %edx, %edx
divq %r14
movzbl (%r15,%rdx), %eax
orl %esi, %eax
xorl %eax, (%rbx,%rcx)
addq $0x4, %rcx
jmp 0x1f72
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
xorl %r15d, %r15d
cmpq $0x12, %r15
jae 0x2004
movq %r14, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1570
movl 0x8(%rsp), %eax
bswapl %eax
movl %eax, (%rbx,%r15,4)
movl 0xc(%rsp), %eax
bswapl %eax
movl %eax, 0x4(%rbx,%r15,4)
addq $0x2, %r15
jmp 0x1fd3
leaq 0x4c(%rbx), %r15
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
cmpq $0x4, %r12
je 0x2059
xorl %r13d, %r13d
cmpq $0xff, %r13
ja 0x204d
movq %r14, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1570
movl 0x8(%rsp), %eax
bswapl %eax
movl %eax, -0x4(%r15,%r13,4)
movl 0xc(%rsp), %eax
bswapl %eax
movl %eax, (%r15,%r13,4)
addq $0x2, %r13
jmp 0x2019
incq %r12
addq $0x400, %r15            # imm = 0x400
jmp 0x2010
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test
static int _test(String * s)
{
	size_t len;
	size_t i;

	/* string_get_length */
	printf("%s: Testing %s\n", PROGNAME, "string_get_length()");
	if((len = string_get_length(s)) == 0)
		return 2;
	printf("\"%s\" => %zu\n", s, len);
	/* string_clear */
	printf("%s: Testing %s\n", PROGNAME, "string_clear()");
	string_clear(s);
	for(i = 0; i <= len; i++)
		if(s[i] != '\0')
			return 4;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x8a4(%rip), %rdi       # 0x206a
leaq 0x8ad(%rip), %rsi       # 0x207a
leaq 0x8ad(%rip), %rdx       # 0x2081
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
callq 0x10c0
testq %rax, %rax
je 0x183f
movq %rax, %r15
leaq 0x8a3(%rip), %rdi       # 0x2095
xorl %r14d, %r14d
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1090
leaq 0x861(%rip), %rdi       # 0x206a
leaq 0x86a(%rip), %rsi       # 0x207a
leaq 0x88b(%rip), %rdx       # 0x20a2
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
callq 0x1110
pushq $0x4
popq %rax
xorl %ecx, %ecx
cmpq %r15, %rcx
ja 0x1843
cmpb $0x0, (%rbx,%rcx)
leaq 0x1(%rcx), %rcx
je 0x182b
movl %eax, %r14d
jmp 0x1843
pushq $0x2
popq %r14
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test2
static int _test2(String const * string, String const * rtrim, int rcount)
{
	int ret = 0;
	String * s;
	int res;

	if((s = string_new(string)) == NULL)
		return -1;
	/* string_rtrim */
	printf("%s: Testing %s\n", PROGNAME, "string_rtrim()");
	if((res = string_rtrim(s, rtrim)) != rcount)
	{
		printf("%s: %s, %s, %d: Test failed (expected: %d)\n", PROGNAME,
				string, rtrim, res, rcount);
		ret = 8;
	}
	string_delete(s);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x1050
testq %rax, %rax
je 0x18c6
movq %rax, %rbx
leaq 0x7fa(%rip), %rdi       # 0x206a
leaq 0x803(%rip), %rsi       # 0x207a
leaq 0x833(%rip), %rdx       # 0x20b1
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
cmpl %ebp, %eax
je 0x18bc
leaq 0x822(%rip), %rdi       # 0x20c0
leaq 0x7d5(%rip), %rsi       # 0x207a
movq %r15, %rdx
movq %r14, %rcx
movl %eax, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x1090
pushq $0x8
popq %r12
movq %rbx, %rdi
callq 0x1080
jmp 0x18ca
pushq $-0x1
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test3
static int _test3(String const * string, String const * ltrim, int lcount)
{
	int ret = 0;
	String * s;
	int res;

	if((s = string_new(string)) == NULL)
		return -1;
	/* string_rtrim */
	printf("%s: Testing %s\n", PROGNAME, "string_ltrim()");
	if((res = string_ltrim(s, ltrim)) != lcount)
	{
		printf("%s: %s, %s, %d: Test failed (expected: %d)\n", PROGNAME,
				string, ltrim, res, lcount);
		ret = 16;
	}
	string_delete(s);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x1050
testq %rax, %rax
je 0x1950
movq %rax, %rbx
leaq 0x770(%rip), %rdi       # 0x206a
leaq 0x779(%rip), %rsi       # 0x207a
leaq 0x7e4(%rip), %rdx       # 0x20ec
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10b0
cmpl %ebp, %eax
je 0x1946
leaq 0x798(%rip), %rdi       # 0x20c0
leaq 0x74b(%rip), %rsi       # 0x207a
movq %r15, %rdx
movq %r14, %rcx
movl %eax, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x1090
pushq $0x10
popq %r12
movq %rbx, %rdi
callq 0x1080
jmp 0x1954
pushq $-0x1
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test4
static int _test4(String const * string, String const * trim, int count)
{
	int ret = 0;
	String * s;
	int res;

	if((s = string_new(string)) == NULL)
		return -1;
	/* string_trim */
	printf("%s: Testing %s\n", PROGNAME, "string_trim()");
	if((res = string_trim(s, trim)) != count)
	{
		printf("%s: %s, %s, %d: Test failed (expected: %d)\n", PROGNAME,
				string, trim, res, count);
		ret = 32;
	}
	string_delete(s);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x1050
testq %rax, %rax
je 0x19da
movq %rax, %rbx
leaq 0x6e6(%rip), %rdi       # 0x206a
leaq 0x6ef(%rip), %rsi       # 0x207a
leaq 0x769(%rip), %rdx       # 0x20fb
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10f0
cmpl %ebp, %eax
je 0x19d0
leaq 0x70e(%rip), %rdi       # 0x20c0
leaq 0x6c1(%rip), %rsi       # 0x207a
movq %r15, %rdx
movq %r14, %rcx
movl %eax, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x1090
pushq $0x20
popq %r12
movq %rbx, %rdi
callq 0x1080
jmp 0x19de
pushq $-0x1
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test7
static int _test7(String const * string, size_t length,
		String const * expected)
{
	int ret = 0;
	String * s;

	printf("%s: Testing %s\n", PROGNAME, "string_new_length()");
	if((s = string_new_length(string, length)) == NULL)
		return 2;
	if(string_compare(s, expected) != 0)
	{
		printf("%s: %s, %zu, \"%s\": Test failed (expected: \"%s\")\n",
				PROGNAME, string, length, s, expected);
		ret = 2;
	}
	string_delete(s);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x58a(%rip), %rdi       # 0x206a
leaq 0x593(%rip), %rsi       # 0x207a
leaq 0x668(%rip), %rdx       # 0x2156
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movq %r15, %rdi
movq %r14, %rsi
callq 0x1040
testq %rax, %rax
je 0x1b47
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1070
testl %eax, %eax
je 0x1b3d
leaq 0x64a(%rip), %rdi       # 0x216a
leaq 0x553(%rip), %rsi       # 0x207a
movq %r15, %rdx
movq %r14, %rcx
movq %r12, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x1090
pushq $0x2
popq %rbp
movq %r12, %rdi
callq 0x1080
jmp 0x1b4a
pushq $0x2
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test8
static int _test8(String const * string, String const * expected)
{
	int ret = 0;
	String * s;

	printf("%s: Testing %s\n", PROGNAME, "string_tolower()");
	if((s = string_new(string)) == NULL)
		return 2;
	string_tolower(s);
	if(string_compare(s, expected) != 0)
	{
		printf("%s: %s, \"%s\": Test failed (expected: \"%s\")\n",
				PROGNAME, string, s, expected);
		ret = 2;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x500(%rip), %rdi       # 0x206a
leaq 0x509(%rip), %rsi       # 0x207a
leaq 0x623(%rip), %rdx       # 0x219b
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movq %r14, %rdi
callq 0x1050
pushq $0x2
popq %r12
testq %rax, %rax
je 0x1bca
movq %rax, %r15
movq %rax, %rdi
callq 0x10e0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1070
testl %eax, %eax
je 0x1bcd
leaq 0x5f9(%rip), %rdi       # 0x21ac
leaq 0x4c0(%rip), %rsi       # 0x207a
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1090
movl %r12d, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/string.c
// Function: test9
static int _test9(String const * string, String const * expected)
{
	int ret = 0;
	String * s;

	printf("%s: Testing %s\n", PROGNAME, "string_toupper()");
	if((s = string_new(string)) == NULL)
		return 2;
	string_toupper(s);
	if(string_compare(s, expected) != 0)
	{
		printf("%s: %s, \"%s\": Test failed (expected: \"%s\")\n",
				PROGNAME, string, s, expected);
		ret = 2;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x47d(%rip), %rdi       # 0x206a
leaq 0x486(%rip), %rsi       # 0x207a
leaq 0x5dd(%rip), %rdx       # 0x21d8
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movq %r14, %rdi
callq 0x1050
pushq $0x2
popq %r12
testq %rax, %rax
je 0x1c4d
movq %rax, %r15
movq %rax, %rdi
callq 0x10d0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1070
testl %eax, %eax
je 0x1c50
leaq 0x576(%rip), %rdi       # 0x21ac
leaq 0x43d(%rip), %rsi       # 0x207a
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1090
movl %r12d, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/aes.c
// Function: aesKeySetupEnc
void aesKeySetupEnc(u32 rk[], const u8 key[]) {
   	int i = 0;
	u32 temp;

	rk[0] = GETU32(key     );
	rk[1] = GETU32(key +  4);
	rk[2] = GETU32(key +  8);
	rk[3] = GETU32(key + 12);

    for (i=0; i<10; ++i) {
		temp  = rk[3];
		rk[4] = rk[0] ^
			(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
			(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
			(Te4[(temp      ) & 0xff] & 0x0000ff00) ^
			(Te4[(temp >> 24)       ] & 0x000000ff) ^
			rcon[i];
		rk[5] = rk[1] ^ rk[4];
		rk[6] = rk[2] ^ rk[5];
		rk[7] = rk[3] ^ rk[6];

		rk += 4;
	}
}

// Assembly:
movl (%rsi), %r8d
movbel %r8d, (%rdi)
movl 0x4(%rsi), %eax
movbel %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
movbel %eax, 0x8(%rdi)
movl 0xc(%rsi), %eax
movbel %eax, 0xc(%rdi)
bswapl %r8d
xorl %eax, %eax
leaq 0x3c58(%rip), %rcx      # 0x6000
movl $0xff, %edx
leaq 0x404c(%rip), %rsi      # 0x6400
cmpq $0x28, %rax
je 0x2448
movl 0xc(%rdi,%rax,4), %r9d
movl %r9d, %r10d
shrl $0xe, %r10d
andl $0x3fc, %r10d           # imm = 0x3FC
movzbl 0x3(%r10,%rcx), %r10d
shll $0x18, %r10d
xorl %r8d, %r10d
movl %r9d, %r8d
shrl $0x8, %r8d
andl %edx, %r8d
movzbl 0x2(%rcx,%r8,4), %r8d
shll $0x10, %r8d
movl %r9d, %r11d
andl %edx, %r11d
movzbl 0x1(%rcx,%r11,4), %r11d
shll $0x8, %r11d
xorl %r8d, %r11d
xorl %r10d, %r11d
movl %r9d, %r8d
shrl $0x18, %r8d
movzbl (%rcx,%r8,4), %r8d
xorl %r11d, %r8d
xorl (%rax,%rsi), %r8d
movl %r8d, 0x10(%rdi,%rax,4)
movl 0x4(%rdi,%rax,4), %r10d
xorl %r8d, %r10d
movl %r10d, 0x14(%rdi,%rax,4)
xorl 0x8(%rdi,%rax,4), %r10d
movl %r10d, 0x18(%rdi,%rax,4)
xorl %r9d, %r10d
movl %r10d, 0x1c(%rdi,%rax,4)
addq $0x4, %rax
jmp 0x23b4
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: printf_byte_string
void printf_byte_string(const u8 b[], unsigned long long int blen){
    unsigned long long int i;

    for(i=0; i<blen; ++i){
        printf("%3x", b[i]);

        if(i%16==15&&i!=0){
            printf("\n");
        }
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x78c3(%rip), %r15      # 0xb040
pushq $0xa
popq %rbp
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x37ac
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2050
movl %r12d, %eax
notl %eax
testb $0xf, %al
jne 0x37a7
movl %ebp, %edi
callq 0x20c0
incq %r12
jmp 0x3783
pushq $0xa
popq %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: checksum_state_string
void checksum_state_string(const u8 byte1[], u8 checksum[], unsigned long long int blen){
    memset(checksum, 0x00, 16);

    while(blen!=0){
        xor_byte_string(byte1, checksum, 16);
        byte1+=16;
        blen-=16;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, (%rsi)
pushq $0x10
popq %r12
testq %rbx, %rbx
je 0x3809
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2250
addq $0x10, %r15
addq $-0x10, %rbx
jmp 0x37ec
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: double_mask
void double_mask(u8 maskstate[]){
    int i;
    u8 msb;
    u8 tempbyte;

    msb=(maskstate[0] & 0x80)?1:0;

    u8 carry=0;

    for(i=15; i>=0; --i){
        tempbyte=maskstate[i];
        maskstate[i]=(tempbyte<<1)|carry;
        carry=tempbyte>>7;
    }

    if(msb){
        maskstate[15]^=0x87;
    }
}

// Assembly:
movb (%rdi), %al
pushq $0xf
popq %rcx
xorl %edx, %edx
testl %ecx, %ecx
js 0x383c
movl %ecx, %esi
movb (%rdi,%rsi), %r8b
leal (%r8,%r8), %r9d
orb %dl, %r9b
movb %r9b, (%rdi,%rsi)
shrb $0x7, %r8b
decl %ecx
movl %r8d, %edx
jmp 0x381c
testb %al, %al
js 0x3841
retq
xorb $-0x79, 0xf(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: MIX
void MIX(u8 byte1[], u8 byte2[], unsigned int blen){
    u8 temp[blen];
    u8 tempbyte;
    int i;
    u8 carry;

    memcpy(temp, byte1, blen);
    xor_byte_string(byte2, temp, blen);

    /*left rotate temp[] by one bit*/
    carry=temp[0]>>7;
    for(i=blen-1; i>=0; --i){
        tempbyte=temp[i];
        temp[i]=tempbyte<<1;
        temp[i]|=carry;
        carry=tempbyte>>7;
    }

    xor_byte_string(temp, byte1, blen);
    xor_byte_string(temp, byte2, blen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsi, -0x30(%rbp)
movq %rdi, %rsi
movl %edx, %r14d
movq %rsp, %rbx
leaq 0xf(%r14), %r15
andq $-0x10, %r15
movq %rbx, %r13
subq %r15, %r13
movq %r13, %rsp
negq %r15
movq %r13, %rdi
movq %rsi, -0x38(%rbp)
movq %r14, %rdx
callq 0x2280
movq -0x30(%rbp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2250
movb (%rbx,%r15), %al
decl %r12d
testl %r12d, %r12d
js 0x38c2
movl %r12d, %ecx
movb (%r13,%rcx), %dl
leal (%rdx,%rdx), %esi
shrb $0x7, %al
orb %sil, %al
movb %al, (%r13,%rcx)
decl %r12d
movl %edx, %eax
jmp 0x38a0
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x2250
movq %r13, %rdi
movq -0x30(%rbp), %rsi
movq %r14, %rdx
callq 0x2250
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: KeySetupEnc
void KeySetupEnc(u32 mk[], u32 sk[], u8 L[], u8 Lprime[], u8 keyprime[], const u32 rk[], const u8 key[]){

    u8 pt[16];
    u8 ct[16];

    int i;


    /* generate Keyprime for CENC*/
    for(i=0; i<16; ++i){
        keyprime[i]=key[i]^0xF0;
    }

    /* produce L for masks of AES*/
    memset(pt, 0x00, 16);
    aesEncrypt(rk, pt, L);

    /*produce the subkeys for auxiliary permutations*/
    for(i=1; i<=3*d; ++i){
        pt[15]=i;
        aesEncrypt(rk, pt, ct);

        sk[0]=GETU32(ct);
        sk[1]=GETU32(ct+4);
        sk[2]=GETU32(ct+8);
        sk[3]=GETU32(ct+12);

        sk=sk+4;
    }

    /*produce the mask keys for auxiliary permutations*/
    for(i=3*d+1; i<=4*d; ++i){
        pt[15]=i;

        aesEncrypt(rk, pt, ct);

        mk[0]=GETU32(ct);
        mk[1]=GETU32(ct+4);
        mk[2]=GETU32(ct+8);
        mk[3]=GETU32(ct+12);

        mk=mk+4;
    }

    /*produce Lprime for XEX layer*/

    memset(pt, 0xFF, 16);
    aesEncrypt(rk, pt, Lprime);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %rcx, 0x20(%rsp)
movq %rsi, %r12
movq %rdi, %r15
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x3929
movb (%rax,%rcx), %sil
xorb $-0x10, %sil
movb %sil, (%r8,%rcx)
incq %rcx
jmp 0x3912
vpxor %xmm0, %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
vmovdqa %xmm0, (%rsi)
movq %r14, %rdi
callq 0x2210
movb $0x1, %bl
xorl %r13d, %r13d
movq %rsp, %rbp
cmpl $0xf0, %r13d
je 0x3995
movb %bl, 0x1f(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x2210
movl (%rsp), %eax
movbel %eax, (%r12,%r13)
movl 0x4(%rsp), %eax
movbel %eax, 0x4(%r12,%r13)
movl 0x8(%rsp), %eax
movbel %eax, 0x8(%r12,%r13)
movl 0xc(%rsp), %eax
movbel %eax, 0xc(%r12,%r13)
addq $0x10, %r13
incb %bl
jmp 0x3946
movb $0x10, %bpl
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
movq %rsp, %r13
cmpl $0x50, %ebx
je 0x39ed
movb %bpl, 0x1f(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2210
movl (%rsp), %eax
movbel %eax, (%r15,%rbx)
movl 0x4(%rsp), %eax
movbel %eax, 0x4(%r15,%rbx)
movl 0x8(%rsp), %eax
movbel %eax, 0x8(%r15,%rbx)
movl 0xc(%rsp), %eax
movbel %eax, 0xc(%r15,%rbx)
addq $0x10, %rbx
incb %bpl
jmp 0x39a2
vpcmpeqd %xmm0, %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
vmovdqa %xmm0, (%rsi)
movq %r14, %rdi
movq 0x20(%rsp), %rdx
callq 0x2210
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: KeySetupDec
void KeySetupDec(u32 mk[], u32 sk[], u32 isk[], u8 L[], u8 Lprime[], u8 keyprime[], const u32 rk[], const u8 key[]){

    int i;
    u32 temp;

    KeySetupEnc(mk, sk, L, Lprime, keyprime, rk, key);

    memcpy(isk, sk, 48*d);

    /*inverse the order of round keys for each auxiliary permutation */
    for(i=0; i<d; ++i){
        temp=isk[12*i  ]; isk[12*i  ]=isk[12*i+ 8]; isk[12*i+ 8]=temp;
        temp=isk[12*i+1]; isk[12*i+1]=isk[12*i+ 9]; isk[12*i+ 9]=temp;
        temp=isk[12*i+2]; isk[12*i+2]=isk[12*i+10]; isk[12*i+10]=temp;
        temp=isk[12*i+3]; isk[12*i+3]=isk[12*i+11]; isk[12*i+11]=temp;
    }


    /*apply inverse mixcolumn to the round keys*/
    for(i=0; i< 12*d; ++i){
        isk[i] =
			Td0[Te4[(isk[i] >> 24)       ] & 0xff] ^
			Td1[Te4[(isk[i] >> 16) & 0xff] & 0xff] ^
			Td2[Te4[(isk[i] >>  8) & 0xff] & 0xff] ^
			Td3[Te4[(isk[i]      ) & 0xff] & 0xff];
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r9, %rax
movq %rdx, %rbx
movq %rsi, %r14
movq 0x30(%rsp), %r9
movq 0x38(%rsp), %rdx
movq %rdx, (%rsp)
movq %rcx, %rdx
movq %r8, %rcx
movq %rax, %r8
callq 0x2240
movl $0xf0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2280
xorl %eax, %eax
cmpq $0xf0, %rax
je 0x3a79
vmovups (%rbx,%rax), %xmm0
vmovups 0x20(%rbx,%rax), %xmm1
vmovups %xmm1, (%rbx,%rax)
vmovups %xmm0, 0x20(%rbx,%rax)
addq $0x30, %rax
jmp 0x3a55
xorl %eax, %eax
leaq 0x79ce(%rip), %rcx      # 0xb450
leaq 0x75c7(%rip), %rdx      # 0xb050
leaq 0x7dc0(%rip), %rsi      # 0xb850
movl $0xff, %edi
leaq 0x81b4(%rip), %r8       # 0xbc50
leaq 0x85ad(%rip), %r9       # 0xc050
cmpq $0x3c, %rax
je 0x3afb
movl (%rbx,%rax,4), %r10d
movl %r10d, %r11d
shrl $0x18, %r11d
movzbl (%rcx,%r11,4), %r11d
movl %r10d, %r14d
shrl $0xe, %r14d
andl $0x3fc, %r14d           # imm = 0x3FC
movzbl (%r14,%rcx), %r14d
movl (%rsi,%r14,4), %ebp
xorl (%rdx,%r11,4), %ebp
movl %r10d, %r11d
shrl $0x8, %r11d
andl %edi, %r11d
movzbl (%rcx,%r11,4), %r11d
xorl (%r8,%r11,4), %ebp
andl %edi, %r10d
movzbl (%rcx,%r10,4), %r10d
xorl (%r9,%r10,4), %ebp
movl %ebp, (%rbx,%rax,4)
incq %rax
jmp 0x3aa3
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: PXMAC
void PXMAC(const u32 mk[], const u32 sk[], const u8 L[], u8 V[], const u32 rk[], const u8 ad[], unsigned long long int adlen){

      int i=0;
      u8 pt[16], ct[16];
      u8 final_block_mask[16];


      memset(pt, 0, 16);
      memset(ct, 0, 16);

      /*process associated data except the last block*/
      memset(V, 0x00, 16);

      while(adlen>16){
            aesReducedEnc(mk+4*i, sk+12*i, ad, ct);
            xor_byte_string(ct, V, 16);

            ++i;
            ad+=16;
            adlen-=16;

            if(i==d){
                aesEncrypt(rk, V, ct);
                memcpy(V, ct, 16);
                i=0;
            }
      }

      /*process the last block*/
      memcpy(final_block_mask, L, 16);
      double_mask(final_block_mask);

      memcpy(pt, ad, adlen);

      if(adlen!=16){
            double_mask(final_block_mask);

            pt[adlen]=0x80;
            memset(pt+adlen+1, 0x00, 15-adlen);
      }

      aesReducedEnc(mk+4*i, sk+12*i, pt, ct);
      xor_byte_string(ct, V, 16);

      xor_byte_string(final_block_mask, V, 16);

      /*the finalization AES*/
      aesEncrypt(rk, V, ct);
      memcpy(V, ct, 16);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r15
movq %r8, (%rsp)
movq %rcx, %rbx
movq %rdx, 0x28(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r13
movq 0x90(%rsp), %rbp
leaq 0x10(%rsp), %rax
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, (%rax)
leaq 0x40(%rsp), %r14
vmovaps %xmm0, (%r14)
vmovups %xmm0, (%rcx)
xorl %r12d, %r12d
cmpq $0x11, %rbp
jb 0x3bc1
leal (,%r12,4), %eax
cltq
leaq (,%rax,4), %rdi
addq %r13, %rdi
imull $0xc, %r12d, %eax
cltq
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2030
movq %r14, %rdi
movq %rbx, %rsi
pushq $0x10
popq %rdx
callq 0x2250
incl %r12d
cmpl $0x5, %r12d
jne 0x3bb7
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
vmovaps 0x40(%rsp), %xmm0
vmovups %xmm0, (%rbx)
xorl %r12d, %r12d
addq $0x10, %r15
addq $-0x10, %rbp
jmp 0x3b4f
movq 0x28(%rsp), %rax
vmovups (%rax), %xmm0
leaq 0x30(%rsp), %rdi
vmovaps %xmm0, (%rdi)
callq 0x21f0
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2280
cmpq $0x10, %rbp
je 0x3c11
leaq 0x30(%rsp), %rdi
callq 0x21f0
leaq (%rsp,%rbp), %rdi
addq $0x11, %rdi
movb $-0x80, -0x1(%rdi)
pushq $0xf
popq %rdx
subq %rbp, %rdx
xorl %esi, %esi
callq 0x2070
leal (,%r12,4), %eax
cltq
leaq (,%rax,4), %rdi
addq %r13, %rdi
imull $0xc, %r12d, %eax
cltq
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
leaq 0x40(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rcx
callq 0x2030
pushq $0x10
popq %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2250
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2250
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
vmovaps (%r14), %xmm0
vmovups %xmm0, (%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: PXENC
void PXENC(const u32 mk[], const u32 sk[], const u8 L[], u8 V[], u8 Z[], const u32 rk[], const u8 I[], unsigned long long int ptlen){

    int i=0;
    u8 ct[16];

    u8 final_block_mask[16];

    /*process I[] except the last block*/
    while(ptlen>16){
        aesReducedEnc(mk+4*i, sk+12*i, I, ct);
        xor_byte_string(ct, V, 16);

        memcpy(Z, V, 16);

        Z+=16;
        I+=16;
        ptlen-=16;
        ++i;

        if(i==d){
                aesEncrypt(rk, V, ct);
                memcpy(V, ct, 16);
                i=0;
        }

    }

    /*process the last block of I[]*/
    aesReducedEnc(mk+4*i, sk+12*i, I, ct);
    xor_byte_string(ct, V, 16);

    memcpy(final_block_mask, L, 16);
    double_mask(final_block_mask);
    double_mask(final_block_mask);
    double_mask(final_block_mask);

    xor_byte_string(final_block_mask, V, 16);

    memcpy(Z, V, 16);

    /*the finalization AES*/
    aesEncrypt(rk, V, ct);
    memcpy(V, ct, 16);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, (%rsp)
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x88(%rsp), %r13
movq 0x80(%rsp), %r12
xorl %ebp, %ebp
leaq 0x20(%rsp), %r14
leal (,%rbp,4), %eax
cltq
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
imull $0xc, %ebp, %eax
cltq
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2030
movq %r14, %rdi
movq %rbx, %rsi
pushq $0x10
popq %rdx
callq 0x2250
cmpq $0x11, %r13
jb 0x3ee2
vmovups (%rbx), %xmm0
vmovups %xmm0, (%r15)
incl %ebp
cmpl $0x5, %ebp
jne 0x3ed4
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
vmovaps 0x20(%rsp), %xmm0
vmovups %xmm0, (%rbx)
xorl %ebp, %ebp
addq $0x10, %r15
addq $0x10, %r12
addq $-0x10, %r13
jmp 0x3e6a
movq 0x8(%rsp), %rax
vmovups (%rax), %xmm0
leaq 0x30(%rsp), %r14
vmovaps %xmm0, (%r14)
movq %r14, %rdi
callq 0x21f0
movq %r14, %rdi
callq 0x21f0
movq %r14, %rdi
callq 0x21f0
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2250
vmovups (%rbx), %xmm0
vmovups %xmm0, (%r15)
leaq 0x20(%rsp), %r14
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
vmovaps (%r14), %xmm0
vmovups %xmm0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: PXDEC
void PXDEC(const u32 mk[], const u32 isk[], const u8 L[], u8 V[], const u8 Z[], const u32 rk[], u8 I[], unsigned long long int ctlen){

    int i=0;

    u8 ct[16];
    u8 final_block_mask[16];

    /*process the output Z[] of XEXLayerDec except the last block*/
    while(ctlen>16){
        xor_byte_string(Z, V, 16);
        aesReducedDec(mk+4*i, isk+12*i, V, ct);

        memcpy(I, ct, 16);
        memcpy(V, Z, 16);

        Z+=16;
        I+=16;
        ctlen-=16;
        ++i;

        if(i==d){
            i=0;
            aesEncrypt(rk, V, ct);
            memcpy(V, ct, 16);
        }
    }

    /*process the last block*/
    memcpy(final_block_mask, L, 16);
    double_mask(final_block_mask);
    double_mask(final_block_mask);
    double_mask(final_block_mask);


    xor_byte_string(Z, V, 16);
    xor_byte_string(final_block_mask, V, 16);

    aesReducedDec(mk+4*i, isk+12*i, V, I);

    /*apply the finalization AES*/
    memcpy(V, Z, 16);
    aesEncrypt(rk, V, ct);
    memcpy(V, ct, 16);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, (%rsp)
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, 0x28(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbp
movq 0x88(%rsp), %r13
movq 0x80(%rsp), %r12
xorl %r14d, %r14d
cmpq $0x11, %r13
jb 0x401e
movq %r15, %rdi
movq %rbx, %rsi
pushq $0x10
popq %rdx
callq 0x2250
leal (,%r14,4), %eax
cltq
leaq (,%rax,4), %rdi
addq %rbp, %rdi
imull $0xc, %r14d, %eax
cltq
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdx
leaq 0x10(%rsp), %rcx
callq 0x2230
vmovaps 0x10(%rsp), %xmm0
vmovups %xmm0, (%r12)
vmovups (%r15), %xmm0
vmovups %xmm0, (%rbx)
incl %r14d
cmpl $0x5, %r14d
jne 0x400d
movq (%rsp), %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
callq 0x2210
vmovaps 0x10(%rsp), %xmm0
vmovups %xmm0, (%rbx)
xorl %r14d, %r14d
addq $0x10, %r15
addq $0x10, %r12
addq $-0x10, %r13
jmp 0x3f88
movq 0x28(%rsp), %rax
vmovups (%rax), %xmm0
leaq 0x30(%rsp), %r13
vmovaps %xmm0, (%r13)
movq %r13, %rdi
callq 0x21f0
movq %r13, %rdi
callq 0x21f0
movq %r13, %rdi
callq 0x21f0
pushq $0x10
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2250
movq %r13, %rdi
movq %rbx, %rsi
pushq $0x10
popq %rdx
callq 0x2250
leal (,%r14,4), %eax
cltq
leaq (,%rax,4), %rdi
addq %rbp, %rdi
imull $0xc, %r14d, %eax
cltq
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x2230
vmovups (%r15), %xmm0
vmovups %xmm0, (%rbx)
leaq 0x10(%rsp), %r14
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
vmovaps (%r14), %xmm0
vmovups %xmm0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: XEXLayerEnc
void XEXLayerEnc(const u32 rk[], const u8 Lprime[], const u8 Z[], u8 C[], unsigned long long int ctlen){

    u8 mask[16];
    u8 temp[16];
    u8 ct[16];

    memcpy(mask, Lprime, 16);

    while(ctlen!=0){
        double_mask(mask);

        memcpy(temp, Z, 16);

        xor_byte_string(mask, temp, 16);
        aesEncrypt(rk, temp, ct);
        xor_byte_string(mask, ct, 16);
        memcpy(C, ct, 16);

        C+=16;
        Z+=16;
        ctlen-=16;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rdi, (%rsp)
vmovups (%rsi), %xmm0
leaq 0x40(%rsp), %r13
vmovaps %xmm0, (%r13)
xorl %ebx, %ebx
pushq $0x10
popq %r14
leaq 0x20(%rsp), %r15
cmpq %rbx, 0x18(%rsp)
je 0x4173
movq 0x8(%rsp), %rax
leaq (%rax,%rbx), %r12
movq 0x10(%rsp), %rax
leaq (%rax,%rbx), %rbp
movq %r13, %rdi
callq 0x21f0
vmovups (%r12), %xmm0
vmovaps %xmm0, 0x30(%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x2250
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2210
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2250
vmovaps 0x20(%rsp), %xmm0
vmovups %xmm0, (%rbp)
addq $0x10, %rbx
jmp 0x4105
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: XEXLayerDec
void XEXLayerDec(const u32 irk[], const u8 Lprime[], const u8 C[], u8 Z[], unsigned long long int ctlen){

    u8 mask[16];
    u8 temp[16];
    u8 pt[16];

    memcpy(mask, Lprime, 16);

    while(ctlen!=0){
        double_mask(mask);

        memcpy(temp, C, 16);
        xor_byte_string(mask, temp, 16);
        aesDecrypt(irk, temp, pt);
        xor_byte_string(mask, pt, 16);

        memcpy(Z, pt, 16);

        C+=16;
        Z+=16;
        ctlen-=16;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rdi, (%rsp)
vmovups (%rsi), %xmm0
leaq 0x40(%rsp), %r13
vmovaps %xmm0, (%r13)
xorl %ebx, %ebx
pushq $0x10
popq %r14
leaq 0x20(%rsp), %r15
cmpq %rbx, 0x18(%rsp)
je 0x422b
movq 0x8(%rsp), %rax
leaq (%rax,%rbx), %r12
movq 0x10(%rsp), %rax
leaq (%rax,%rbx), %rbp
movq %r13, %rdi
callq 0x21f0
vmovups (%r12), %xmm0
vmovaps %xmm0, 0x30(%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x2250
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x20b0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2250
vmovaps 0x20(%rsp), %xmm0
vmovups %xmm0, (%rbp)
addq $0x10, %rbx
jmp 0x41bd
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: tagGen
void tagGen(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], u8 T[], unsigned long long int ptlen){
    u8 mask1[16], mask2[16];
    u8 temp[16];

    /*generate 3*Lprime and 7*Lprime and store them in mask1[] and mask2[] respectively*/
    memcpy(mask1, Lprime, 16);
    double_mask(mask1);
    memcpy(mask2, mask1, 16);
    xor_byte_string(Lprime, mask1, 16);

    double_mask(mask2);
    xor_byte_string(mask1, mask2, 16);

    /*generate 2^{lm+1}*3*Lprime and 2^{lm+1}*7*Lprime and store them in mask1[] and mask2[] respectively*/
    while(ptlen!=0){
        double_mask(mask1);
        double_mask(mask2);
        ptlen-=16;
    }
    double_mask(mask1);
    double_mask(mask2);

    /*produce the tag value*/
    xor_byte_string(checksum, mask1, 16);

    aesEncrypt(rk, mask1, temp);
    xor_byte_string(U, temp, 16);
    xor_byte_string(mask2, temp, 16);

    aesEncrypt(rk, temp, T);
    xor_byte_string(mask2, T, 16);
    xor_byte_string(F, T, 16);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %rbx
movq %r8, 0x18(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, (%rsp)
movq %rdi, 0x10(%rsp)
movq 0x90(%rsp), %r15
vmovups (%rdx), %xmm0
leaq 0x30(%rsp), %rbp
vmovaps %xmm0, (%rbp)
movq %rbp, %rdi
callq 0x21f0
vmovaps (%rbp), %xmm0
leaq 0x20(%rsp), %r14
vmovaps %xmm0, (%r14)
pushq $0x10
popq %r13
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2250
movq %r14, %rdi
callq 0x21f0
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2250
addq $0x10, %r15
movq %rbp, %rdi
callq 0x21f0
movq %r14, %rdi
callq 0x21f0
addq $-0x10, %r15
jne 0x42ba
leaq 0x30(%rsp), %r14
pushq $0x10
popq %rbp
movq (%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2250
leaq 0x40(%rsp), %r12
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2210
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2250
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2250
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2210
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2250
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2250
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: tagVef
int tagVef(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], const u8 T[], unsigned long long int ptlen){

    u8 tempT[16];
    int flag=1;
    int i;

    tagGen(rk, checksum, Lprime, U, F, tempT, ptlen);

    for(i=0; i<16; ++i){
        if(tempT[i]!=T[i]){
            flag=0;
        }
    }
    return flag;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r9
callq 0x2080
pushq $0x1
popq %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x10, %rdx
je 0x4396
movb 0x10(%rsp,%rdx), %sil
cmpb (%rbx,%rdx), %sil
cmovnel %ecx, %eax
incq %rdx
jmp 0x437f
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: shellaesEnc
void shellaesEnc(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], unsigned long long int ctlen){

    u8 tag[16];


    if(ptlen<16){
        /*plaintext is shorter than one block*/
        shellaesEnc_short(key, nonce, ad, adlen, p, ptlen, c, tag);
    }
    else if (ptlen%16==0){
        /*plaintext is multiple blocks long */
        shellaesEnc_fb(key, nonce, ad, adlen, p, ptlen, c, tag);
    }
    else{
         /*plaintext is longer than one block, and has a length that is not a mutiple of block length */
        shellaesEnc_nfb(key, nonce, ad, adlen, p, ptlen, c, tag);
    }

    /*append the tag to ciphertext*/
    memcpy(c+ptlen, tag, 16);

    /*
    printf("the ciphertext and the tag is \n");
    printf_byte_string(c, ctlen);
    */
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq 0x30(%rsp), %r14
movq %rsp, %rax
cmpq $0xf, %r9
ja 0x5c72
movq %rbx, %r9
pushq %rax
pushq %r14
callq 0x2120
jmp 0x5c8c
movq %rbx, %r9
testb $0xf, %bl
je 0x5c84
pushq %rax
pushq %r14
callq 0x2270
jmp 0x5c8c
pushq %rax
pushq %r14
callq 0x2290
popq %rax
popq %rcx
vmovaps (%rsp), %xmm0
vmovups %xmm0, (%r14,%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: shellaesDec
int shellaesDec(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], unsigned long long int ptlen){

    u8 tag[16];
    int flag;

    memcpy(tag, c+ptlen, 16);

    if(ptlen<16){
        /*plaintext is shorter than one block*/
        flag=shellaesDec_short(key, nonce, ad, adlen, c, ptlen, p, tag);
    }
    else if (ptlen%16==0){
        /*plaintext is multiple blocks long */
        flag=shellaesDecVef_fb(key, nonce, ad, adlen, c, ptlen, p, tag);
    }
    else{
        /*plaintext is longer than one block, and has a length that is not a mutiple of block length */
        flag=shellaesDec_nfb(key, nonce, ad, adlen, c, ptlen, p, tag);
    }

    return flag;
}

// Assembly:
subq $0x18, %rsp
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %rax
vmovups (%r8,%r9), %xmm0
vmovaps %xmm0, (%rsp)
movq %rsp, %r10
cmpq $0xf, %r9
ja 0x5ccd
pushq %r10
pushq %rax
callq 0x20d0
jmp 0x5ce5
testb $0xf, %r9b
je 0x5cdd
pushq %r10
pushq %rax
callq 0x2110
jmp 0x5ce5
pushq %r10
pushq %rax
callq 0x2100
addq $0x10, %rsp
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ZombiesYard[P]MPU6050-DMP-raspberry-pi/main.c
// Function: main
int main() 
{
	//初始化mpu6050的dmp
	ms_open();
	do{
		ms_update();
		printf("yaw = %2.1f\tpitch = %2.1f\troll = %2.1f\ttemperature = %2.1f\tcompass = %2.1f, %2.1f, %2.1f\n",
		 ypr[YAW], ypr[PITCH], ypr[ROLL], temp, compass[0], compass[1], compass[2]);
		delay_ms(5);
	}while(1);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x129c
leaq 0x7f34(%rip), %r14      # 0x9174
leaq 0x7f39(%rip), %r15      # 0x9180
leaq 0x7f4e(%rip), %r12      # 0x919c
leaq 0x3daf(%rip), %rbx      # 0x5004
callq 0x1591
cvtss2sd (%r14), %xmm0
cvtss2sd 0x4(%r14), %xmm1
cvtss2sd 0x8(%r14), %xmm2
cvtss2sd (%r15), %xmm3
cvtss2sd (%r12), %xmm4
cvtss2sd 0x4(%r12), %xmm5
cvtss2sd 0x8(%r12), %xmm6
movq %rbx, %rdi
movb $0x7, %al
callq 0x1040
movl $0x1388, %edi           # imm = 0x1388
callq 0x10e0
jmp 0x1255
nop