LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_Final
void sha512_Final(SHA512_CTX* context, sha2_byte digest[]) {
	/* If no digest buffer is passed, we don't bother doing this: */
	if (digest != (sha2_byte*)0) {
		sha512_Last(context);

		/* Save the hash data for output: */
#if BYTE_ORDER == LITTLE_ENDIAN
		/* Convert FROM host byte order */
		for (int j = 0; j < 8; j++) {
			REVERSE64(context->state[j],context->state[j]);
		}
#endif
		MEMCPY_BCOPY(digest, context->state, SHA512_DIGEST_LENGTH);
	}

	/* Zero out state data */
	memzero(context, sizeof(SHA512_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x98e6
movq %rsi, %r14
movl 0x40(%rbx), %esi
shrl $0x3, %esi
andl $0x7f, %esi
leaq 0x50(%rbx), %r15
leal 0x1(%rsi), %eax
movb $-0x80, 0x50(%rbx,%rsi)
cmpl $0x70, %esi
jb 0x9860
movl %eax, %edi
addq %r15, %rdi
xorl $0x7f, %esi
callq 0x81bc
movl $0xa, %eax
movq (%rbx,%rax,8), %rcx
bswapq %rcx
movq %rcx, (%rbx,%rax,8)
incq %rax
cmpq $0x1a, %rax
jne 0x983c
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9449
xorl %eax, %eax
movl %eax, %edi
addq %r15, %rdi
movl $0x70, %esi
subl %eax, %esi
callq 0x81bc
movl $0xa, %eax
movq (%rbx,%rax,8), %rcx
bswapq %rcx
movq %rcx, (%rbx,%rax,8)
incq %rax
cmpq $0x18, %rax
jne 0x9876
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
movq %rcx, 0xc0(%rbx)
movq %rax, 0xc8(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9449
xorl %eax, %eax
movq (%rbx,%rax,8), %rcx
bswapq %rcx
movq %rcx, (%rbx,%rax,8)
incq %rax
cmpq $0x8, %rax
jne 0x98b0
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%r14)
movups %xmm2, 0x20(%r14)
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movl $0xd0, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_End
char *sha512_End(SHA512_CTX* context, char buffer[]) {
	sha2_byte	digest[SHA512_DIGEST_LENGTH], *d = digest;
	int		i;

	if (buffer != (char*)0) {
		sha512_Final(context, digest);

		for (i = 0; i < SHA512_DIGEST_LENGTH; i++) {
			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
			*buffer++ = sha2_hex_digits[*d & 0x0f];
			d++;
		}
		*buffer = (char)0;
	} else {
		memzero(context, sizeof(SHA512_CTX));
	}
	memzero(digest, SHA512_DIGEST_LENGTH);
	return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x9956
movq %rsi, %rbx
leaq -0x50(%rbp), %rsi
callq 0x97f7
xorl %eax, %eax
leaq 0x2af0(%rip), %rcx      # 0xc410
xorl %edx, %edx
movzbl -0x50(%rbp,%rdx), %esi
movl %esi, %edi
shrl $0x4, %edi
movb (%rdi,%rcx), %dil
movb %dil, (%rbx,%rdx,2)
andl $0xf, %esi
movb (%rsi,%rcx), %sil
movb %sil, 0x1(%rbx,%rdx,2)
incq %rdx
addq $-0x2, %rax
cmpq $0x40, %rdx
jne 0x9922
movb $0x0, (%rbx,%rdx,2)
subq %rax, %rbx
jmp 0x9962
movl $0xd0, %esi
callq 0x81bc
xorl %ebx, %ebx
leaq -0x50(%rbp), %rdi
movl $0x40, %esi
callq 0x81bc
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_Raw
void sha512_Raw(const sha2_byte* data, size_t len, uint8_t digest[SHA512_DIGEST_LENGTH]) {
	SHA512_CTX	context;
	sha512_Init(&context);
	sha512_Update(&context, data, len);
	sha512_Final(&context, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movaps 0x26e4(%rip), %xmm0     # 0xc080
leaq -0xa0(%rbp), %r12
movaps %xmm0, -0x20(%r12)
movaps 0x26c0(%rip), %xmm0     # 0xc070
movaps %xmm0, -0x30(%r12)
movaps 0x26a3(%rip), %xmm0     # 0xc060
movaps %xmm0, -0x40(%r12)
movaps 0x2686(%rip), %xmm0     # 0xc050
movaps %xmm0, -0x50(%r12)
movl $0x80, %esi
movq %r12, %rdi
callq 0x81bc
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%r12)
leaq -0xf0(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x96a8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x97f7
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/sha2.c
// Function: sha512_Data
char* sha512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) {
	SHA512_CTX	context;

	sha512_Init(&context);
	sha512_Update(&context, data, len);
	return sha512_End(&context, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movaps 0x2648(%rip), %xmm0     # 0xc080
leaq -0xa0(%rbp), %r12
movaps %xmm0, -0x20(%r12)
movaps 0x2624(%rip), %xmm0     # 0xc070
movaps %xmm0, -0x30(%r12)
movaps 0x2607(%rip), %xmm0     # 0xc060
movaps %xmm0, -0x40(%r12)
movaps 0x25ea(%rip), %xmm0     # 0xc050
movaps %xmm0, -0x50(%r12)
movl $0x80, %esi
movq %r12, %rdi
callq 0x81bc
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%r12)
leaq -0xf0(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x96a8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x98fd
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha256_Init
void hmac_sha256_Init(HMAC_SHA256_CTX *hctx, const uint8_t *key,
                      const uint32_t keylen) {
  static CONFIDENTIAL uint8_t i_key_pad[SHA256_BLOCK_LENGTH];
  memzero(i_key_pad, SHA256_BLOCK_LENGTH);
  if (keylen > SHA256_BLOCK_LENGTH) {
    sha256_Raw(key, keylen, i_key_pad);
  } else {
    memcpy(i_key_pad, key, keylen);
  }
  for (int i = 0; i < SHA256_BLOCK_LENGTH; i++) {
    hctx->o_key_pad[i] = i_key_pad[i] ^ 0x5c;
    i_key_pad[i] ^= 0x36;
  }
  sha256_Init(&(hctx->ctx));
  sha256_Update(&(hctx->ctx), i_key_pad, SHA256_BLOCK_LENGTH);
  memzero(i_key_pad, sizeof(i_key_pad));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xf031(%rip), %r14      # 0x18b00
movl $0x40, %esi
movq %r14, %rdi
callq 0x81bc
movl %r12d, %edx
cmpl $0x41, %r12d
jb 0x9afc
leaq 0xf014(%rip), %rax      # 0x18b00
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x9302
jmp 0x9b0b
leaq 0xeffd(%rip), %rdi      # 0x18b00
movq %r15, %rsi
callq 0x8080
xorl %eax, %eax
movb (%rax,%r14), %cl
xorb $0x5c, %cl
movb %cl, (%rbx,%rax)
xorb $0x36, (%rax,%r14)
incq %rax
cmpq $0x40, %rax
jne 0x9b0d
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x8e00
leaq 0xefc8(%rip), %r14      # 0x18b00
movl $0x40, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x906b
movl $0x40, %esi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha256_Final
void hmac_sha256_Final(HMAC_SHA256_CTX *hctx, uint8_t *hmac) {
  sha256_Final(&(hctx->ctx), hmac);
  sha256_Init(&(hctx->ctx));
  sha256_Update(&(hctx->ctx), hctx->o_key_pad, SHA256_BLOCK_LENGTH);
  sha256_Update(&(hctx->ctx), hmac, SHA256_DIGEST_LENGTH);
  sha256_Final(&(hctx->ctx), hmac);
  memzero(hctx, sizeof(HMAC_SHA256_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x40(%rdi), %r15
movq %r15, %rdi
callq 0x91a4
movq %r15, %rdi
callq 0x8e00
movl $0x40, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x906b
movl $0x20, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x906b
movq %r15, %rdi
movq %r14, %rsi
callq 0x91a4
movl $0xa8, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha256
void hmac_sha256(const uint8_t *key, const uint32_t keylen, const uint8_t *msg,
                 const uint32_t msglen, uint8_t *hmac) {
  static CONFIDENTIAL HMAC_SHA256_CTX hctx;
  hmac_sha256_Init(&hctx, key, keylen);
  hmac_sha256_Update(&hctx, msg, msglen);
  hmac_sha256_Final(&hctx, hmac);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movl %ecx, %r14d
movq %rdx, %r15
movl %esi, %edx
movq %rdi, %rsi
leaq 0xef4d(%rip), %r12      # 0x18b40
movq %r12, %rdi
callq 0x9ab4
movl %r14d, %edx
leaq 0xef7b(%rip), %rdi      # 0x18b80
movq %r15, %rsi
callq 0x906b
movq %r12, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9b6d
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha256_prepare
void hmac_sha256_prepare(const uint8_t *key, const uint32_t keylen,
                         uint32_t *opad_digest, uint32_t *ipad_digest) {
  static CONFIDENTIAL uint32_t key_pad[SHA256_BLOCK_LENGTH / sizeof(uint32_t)];

  memzero(key_pad, sizeof(key_pad));
  if (keylen > SHA256_BLOCK_LENGTH) {
    static CONFIDENTIAL SHA256_CTX context;
    sha256_Init(&context);
    sha256_Update(&context, key, keylen);
    sha256_Final(&context, (uint8_t *)key_pad);
  } else {
    memcpy(key_pad, key, keylen);
  }

  /* compute o_key_pad and its digest */
  for (int i = 0; i < SHA256_BLOCK_LENGTH / (int)sizeof(uint32_t); i++) {
    uint32_t data;
#if BYTE_ORDER == LITTLE_ENDIAN
    REVERSE32(key_pad[i], data);
#else
    data = key_pad[i];
#endif
    key_pad[i] = data ^ 0x5c5c5c5c;
  }
  sha256_Transform(sha256_initial_hash_value, key_pad, opad_digest);

  /* convert o_key_pad to i_key_pad and compute its digest */
  for (int i = 0; i < SHA256_BLOCK_LENGTH / (int)sizeof(uint32_t); i++) {
    key_pad[i] = key_pad[i] ^ 0x5c5c5c5c ^ 0x36363636;
  }
  sha256_Transform(sha256_initial_hash_value, key_pad, ipad_digest);
  memzero(key_pad, sizeof(key_pad));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, -0x30(%rbp)
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %r12
leaq 0xefae(%rip), %r14      # 0x18bf0
movl $0x40, %esi
movq %r14, %rdi
callq 0x81bc
cmpl $0x41, %r13d
jb 0x9c83
leaq 0xefd4(%rip), %rbx      # 0x18c30
movq %rbx, %rdi
callq 0x8e00
movl %r13d, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x906b
leaq 0xef77(%rip), %rsi      # 0x18bf0
movq %rbx, %rdi
callq 0x91a4
jmp 0x9c95
movl %r13d, %edx
leaq 0xef63(%rip), %rdi      # 0x18bf0
movq %r12, %rsi
callq 0x8080
xorl %eax, %eax
movl $0x5c5c5c5c, %ecx       # imm = 0x5C5C5C5C
movl (%rax,%r14), %edx
xorl %ecx, %edx
bswapl %edx
movl %edx, (%rax,%r14)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x9c9c
leaq 0x2377(%rip), %rdi      # 0xc030
movq %r14, %rsi
movq %r15, %rdx
callq 0x8e40
xorl %eax, %eax
xorl $0x6a6a6a6a, (%rax,%r14) # imm = 0x6A6A6A6A
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x9cc6
leaq 0x2351(%rip), %rdi      # 0xc030
leaq 0xef0a(%rip), %rbx      # 0x18bf0
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
callq 0x8e40
movl $0x40, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha512_Init
void hmac_sha512_Init(HMAC_SHA512_CTX *hctx, const uint8_t *key,
                      const uint32_t keylen) {
  static CONFIDENTIAL uint8_t i_key_pad[SHA512_BLOCK_LENGTH];
  memzero(i_key_pad, SHA512_BLOCK_LENGTH);
  if (keylen > SHA512_BLOCK_LENGTH) {
    sha512_Raw(key, keylen, i_key_pad);
  } else {
    memcpy(i_key_pad, key, keylen);
  }
  for (int i = 0; i < SHA512_BLOCK_LENGTH; i++) {
    hctx->o_key_pad[i] = i_key_pad[i] ^ 0x5c;
    i_key_pad[i] ^= 0x36;
  }
  sha512_Init(&(hctx->ctx));
  sha512_Update(&(hctx->ctx), i_key_pad, SHA512_BLOCK_LENGTH);
  memzero(i_key_pad, sizeof(i_key_pad));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xef78(%rip), %r14      # 0x18ca0
movl $0x80, %esi
movq %r14, %rdi
callq 0x81bc
movl %r12d, %edx
cmpl $0x81, %r12d
jb 0x9d58
leaq 0xef58(%rip), %rax      # 0x18ca0
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x997a
jmp 0x9d67
leaq 0xef41(%rip), %rdi      # 0x18ca0
movq %r15, %rsi
callq 0x8080
xorl %eax, %eax
movb (%rax,%r14), %cl
xorb $0x5c, %cl
movb %cl, (%rbx,%rax)
xorb $0x36, (%rax,%r14)
incq %rax
cmpq $0x80, %rax
jne 0x9d69
subq $-0x80, %rbx
movq %rbx, %rdi
callq 0x93f4
leaq 0xef0a(%rip), %r14      # 0x18ca0
movl $0x80, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96a8
movl $0x80, %esi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha512_Final
void hmac_sha512_Final(HMAC_SHA512_CTX *hctx, uint8_t *hmac) {
  sha512_Final(&(hctx->ctx), hmac);
  sha512_Init(&(hctx->ctx));
  sha512_Update(&(hctx->ctx), hctx->o_key_pad, SHA512_BLOCK_LENGTH);
  sha512_Update(&(hctx->ctx), hmac, SHA512_DIGEST_LENGTH);
  sha512_Final(&(hctx->ctx), hmac);
  memzero(hctx, sizeof(HMAC_SHA512_CTX));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
movq %r15, %rdi
callq 0x97f7
movq %r15, %rdi
callq 0x93f4
movl $0x80, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x96a8
movl $0x40, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x96a8
movq %r15, %rdi
movq %r14, %rsi
callq 0x97f7
movl $0x150, %esi            # imm = 0x150
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha512
void hmac_sha512(const uint8_t *key, const uint32_t keylen, const uint8_t *msg,
                 const uint32_t msglen, uint8_t *hmac) {
  HMAC_SHA512_CTX hctx;
  hmac_sha512_Init(&hctx, key, keylen);
  hmac_sha512_Update(&hctx, msg, msglen);
  hmac_sha512_Final(&hctx, hmac);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %r8, %rbx
movl %ecx, %r14d
movq %rdx, %r15
movl %esi, %edx
movq %rdi, %rsi
leaq -0x170(%rbp), %r12
movq %r12, %rdi
callq 0x9d0d
leaq -0xf0(%rbp), %rdi
movl %r14d, %edx
movq %r15, %rsi
callq 0x96a8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9dcb
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/hmac.c
// Function: hmac_sha512_prepare
void hmac_sha512_prepare(const uint8_t *key, const uint32_t keylen,
                         uint64_t *opad_digest, uint64_t *ipad_digest) {
  static CONFIDENTIAL uint64_t key_pad[SHA512_BLOCK_LENGTH / sizeof(uint64_t)];

  memzero(key_pad, sizeof(key_pad));
  if (keylen > SHA512_BLOCK_LENGTH) {
    static CONFIDENTIAL SHA512_CTX context;
    sha512_Init(&context);
    sha512_Update(&context, key, keylen);
    sha512_Final(&context, (uint8_t *)key_pad);
  } else {
    memcpy(key_pad, key, keylen);
  }

  /* compute o_key_pad and its digest */
  for (int i = 0; i < SHA512_BLOCK_LENGTH / (int)sizeof(uint64_t); i++) {
    uint64_t data;
#if BYTE_ORDER == LITTLE_ENDIAN
    REVERSE64(key_pad[i], data);
#else
    data = key_pad[i];
#endif
    key_pad[i] = data ^ 0x5c5c5c5c5c5c5c5c;
  }
  sha512_Transform(sha512_initial_hash_value, key_pad, opad_digest);

  /* convert o_key_pad to i_key_pad and compute its digest */
  for (int i = 0; i < SHA512_BLOCK_LENGTH / (int)sizeof(uint64_t); i++) {
    key_pad[i] = key_pad[i] ^ 0x5c5c5c5c5c5c5c5c ^ 0x3636363636363636;
  }
  sha512_Transform(sha512_initial_hash_value, key_pad, ipad_digest);
  memzero(key_pad, sizeof(key_pad));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, -0x30(%rbp)
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %r12
leaq 0xee6e(%rip), %r14      # 0x18d20
movl $0x80, %esi
movq %r14, %rdi
callq 0x81bc
cmpl $0x81, %r13d
jb 0x9ef6
leaq 0xeed1(%rip), %rbx      # 0x18da0
movq %rbx, %rdi
callq 0x93f4
movl %r13d, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x96a8
leaq 0xee34(%rip), %rsi      # 0x18d20
movq %rbx, %rdi
callq 0x97f7
jmp 0x9f08
movl %r13d, %edx
leaq 0xee20(%rip), %rdi      # 0x18d20
movq %r12, %rsi
callq 0x8080
xorl %eax, %eax
movabsq $0x5c5c5c5c5c5c5c5c, %rcx # imm = 0x5C5C5C5C5C5C5C5C
movq (%rax,%r14), %rdx
xorq %rcx, %rdx
bswapq %rdx
movq %rdx, (%rax,%r14)
addq $0x8, %rax
cmpq $0x80, %rax
jne 0x9f14
leaq 0x211b(%rip), %rdi      # 0xc050
movq %r14, %rsi
movq %r15, %rdx
callq 0x9449
xorl %eax, %eax
movabsq $0x6a6a6a6a6a6a6a6a, %rcx # imm = 0x6A6A6A6A6A6A6A6A
xorq %rcx, (%rax,%r14)
addq $0x8, %rax
cmpq $0x80, %rax
jne 0x9f4c
leaq 0x20ed(%rip), %rdi      # 0xc050
leaq 0xedb6(%rip), %rbx      # 0x18d20
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
callq 0x9449
movl $0x80, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81bc
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/rand.c
// Function: random_buffer
void __attribute__((weak)) random_buffer(uint8_t *buf, size_t len) {
  uint32_t r = 0;
  for (size_t i = 0; i < len; i++) {
    if (i % 4 == 0) {
      r = random32();
    }
    buf[i] = (r >> ((i % 4) * 8)) & 0xFF;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
je 0xa002
xorl %eax, %eax
movl 0xeea4(%rip), %edx      # 0x18e70
xorl %r8d, %r8d
movq %rax, %rcx
andq $0x3, %rcx
jne 0x9fed
imull $0x19660d, %edx, %edx   # imm = 0x19660D
addl $0x3c6ef35f, %edx       # imm = 0x3C6EF35F
movl %edx, 0xee86(%rip)      # 0x18e70
movl %edx, %r8d
shll $0x3, %ecx
movl %r8d, %r9d
shrl %cl, %r9d
movb %r9b, (%rdi,%rax)
incq %rax
cmpq %rax, %rsi
jne 0x9fcf
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/trezor-crypto/rand.c
// Function: random_permute
void random_permute(char *str, size_t len) {
  for (int i = len - 1; i >= 1; i--) {
    int j = random_uniform(i + 1);
    char t = str[j];
    str[j] = str[i];
    str[i] = t;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rsi), %eax
testl %eax, %eax
jle 0xa0a3
movl 0xee20(%rip), %ecx      # 0x18e70
movl %eax, %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %edx, %edx
divl %esi
movl %edx, %eax
notl %eax
imull $0x19660d, %ecx, %ecx   # imm = 0x19660D
addl $0x3c6ef35f, %ecx       # imm = 0x3C6EF35F
cmpl %eax, %ecx
jae 0xa060
xorl %edx, %edx
divl %esi
movl %eax, %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
cltq
movb (%rdi,%rax), %dl
movb (%rdi,%r8), %sil
movb %sil, (%rdi,%rax)
movb %dl, (%rdi,%r8)
movl %r8d, %esi
leaq -0x1(%r8), %rax
cmpq $0x1, %r8
movq %rax, %r8
jg 0xa053
movl %ecx, 0xedcd(%rip)      # 0x18e70
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/test.c
// Function: simple_test
int simple_test(void)
{
    uint8_t master_secret[32];
    int master_secret_len;
    uint16_t gt;
    int i, j;
    int gn = 5;
    char *ml[gn];
    char *dml[5];
    uint8_t ms[32];
    int msl;

    // create

    #if 1
    master_secret_len = sizeof(master_secret);
    fromhex(master_secret, &master_secret_len, "dbc4ac53fcc6d33e38c63fde60dae89f");
    #else
    master_secret_len = 16;
    random_buffer(master_secret, master_secret_len);
    #endif

    printf("master secret\n");
    dumphex(master_secret, master_secret_len);

    for (i = 0; i < gn; i++)
        ml[i] = (char *)malloc(MNEMONIC_LIST_LEN);

    gt = 3;
    generate_mnemonics(gt, gn, master_secret, master_secret_len,
            NULL, 0, 0, ml);

    printf("\n");
    for (i = 0; i < gn; i++)
        printf("%s\n", ml[i]);
    printf("\n");

    // choice 4, 3, 0 for decode
    dml[0] = ml[4];
    dml[1] = ml[3];
    dml[2] = ml[0];
    msl = sizeof(ms);
    combine_mnemonics(gt, dml, NULL, 0, ms, &msl);

    printf("master secret\n");
    dumphex(ms, msl);

    if ((msl == master_secret_len) &&
        memcmp(master_secret, ms, msl) == 0)
    {
        printf("\n--- pass ---\n\n");
    }
    else
    {
        printf("\n--- fail ---\n\n");
    }

    for (i = 0; i < gn; i++)
        free(ml[i]);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rsp, %r15
leaq -0x1c(%rbp), %rbx
movl $0x20, (%rbx)
leaq 0x2355(%rip), %rdx      # 0xc421
leaq -0x70(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb7a4
leaq 0x3d9a(%rip), %rdi      # 0xde7c
callq 0x8050
movl (%rbx), %esi
movq %r14, %rdi
callq 0xb868
xorl %ebx, %ebx
movl $0x16b, %edi            # imm = 0x16B
callq 0x8090
movq %rax, -0x50(%rbp,%rbx,8)
incq %rbx
cmpq $0x5, %rbx
jne 0xa0f3
movl -0x1c(%rbp), %ecx
leaq -0x50(%rbp), %rax
xorl %ebx, %ebx
leaq -0x70(%rbp), %rdx
movl $0x3, %edi
movl $0x5, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq $0x0
callq 0xa220
addq $0x10, %rsp
movl $0xa, %edi
callq 0x8040
movq -0x50(%rbp,%rbx,8), %rdi
callq 0x8050
incq %rbx
cmpq $0x5, %rbx
jne 0xa13e
movl $0xa, %edi
callq 0x8040
movq -0x30(%rbp), %rax
leaq -0xc0(%rbp), %rsi
movq %rax, (%rsi)
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq -0x20(%rbp), %rbx
movl $0x20, (%rbx)
leaq -0x90(%rbp), %r14
movl $0x3, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
movq %rbx, %r9
callq 0xae06
leaq 0x3cd7(%rip), %rdi      # 0xde7c
callq 0x8050
movl (%rbx), %esi
movq %r14, %rdi
callq 0xb868
movslq (%rbx), %rdx
cmpl -0x1c(%rbp), %edx
jne 0xa1d0
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x80a0
testl %eax, %eax
je 0xa204
leaq 0x226b(%rip), %rdi      # 0xc442
callq 0x8050
xorl %ebx, %ebx
movq -0x50(%rbp,%rbx,8), %rdi
callq 0x8030
incq %rbx
cmpq $0x5, %rbx
jne 0xa1de
movq %r15, %rsp
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2246(%rip), %rdi      # 0xc451
jmp 0xa1d7
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/slip39.c
// Function: recover_secret
static int _recover_secret(uint8_t t, int sl, uint8_t *gsi, const uint8_t **gs, uint8_t *result)
{
    int i, j;
    uint8_t shared_secret[sl];
    uint8_t digest_share[sl];
    uint8_t hash[SHA256_DIGEST_LENGTH];

    if (t == 1)
    {
        memcpy(result, gs[0], sl);
        return 0;
    }

    if (!shamir_interpolate(shared_secret, SECRET_INDEX, gsi, gs, t, sl))
        return -1;
    if (!shamir_interpolate(digest_share, DIGEST_INDEX, gsi, gs, t, sl))
        return -2;

    /* check digest_share hash */
    hmac_sha256(&digest_share[DIGEST_LENGTH_BYTES], sl - DIGEST_LENGTH_BYTES, shared_secret, sl, hash);
    if(memcmp(digest_share, hash, DIGEST_LENGTH_BYTES) != 0)
        return -3;  // digest error

    memcpy(result, shared_secret, sl);

    memzero(shared_secret, sl);
    memzero(digest_share, sl);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movl %esi, %ebx
movq %rsp, %r15
leaq 0xf(%rbx), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
cmpl $0x1, %edi
jne 0xb2cf
movq (%r14), %rsi
movq %r8, %rdi
movq %rbx, %rdx
callq 0x8080
xorl %eax, %eax
jmp 0xb378
movq %rsi, -0x38(%rbp)
movq %r8, -0x30(%rbp)
movzbl %dil, %r13d
movq %r15, %rdi
movl $0xff, %esi
movq %rdx, -0x40(%rbp)
movq %r14, %rcx
movl %r13d, %r8d
movq %rbx, %r9
callq 0xb610
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
je 0xb378
movq %r12, %rdi
movl $0xfe, %esi
movq -0x40(%rbp), %rdx
movq %r14, %rcx
movl %r13d, %r8d
movq %rbx, %r9
callq 0xb610
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testb %cl, %cl
je 0xb378
leaq 0x4(%r12), %rdi
movq -0x38(%rbp), %rcx
leal -0x4(%rcx), %esi
leaq -0x60(%rbp), %r14
movq %r15, %rdx
movq %r14, %r8
callq 0x9bd3
movl (%r12), %ecx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
cmpl (%r14), %ecx
jne 0xb378
movq -0x30(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x8080
movq %r15, %rdi
movq %rbx, %rsi
callq 0x81bc
movq %r12, %rdi
movq %rbx, %rsi
callq 0x81bc
jmp 0xb2c8
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/slip39.c
// Function: rs1024_polymod_update
static void _rs1024_polymod_update(RS1024_CTX* c, uint32_t *val, int val_len)
{
    uint32_t b, v;
    int i, j;
    static uint32_t GEN[] = {
        0x00E0E040,
        0x01C1C080,
        0x03838100,
        0x07070200,
        0x0E0E0009,
        0x1C0C2412,
        0x38086C24,
        0x3090FC48,
        0x21B1F890,
        0x03F3F120,
    };

    for (j = 0; j < val_len; j++)
    {
        v = *val++;
        b = c->c >> 20;
        c->c = (c->c & 0xFFFFF) << 10 ^ v;
        for (i = 0; i < 10; i++)
            if ((b >> i) & 1)
                c->c ^= GEN[i];
            else
                c->c ^= 0;
    }
}

// Assembly:
testl %edx, %edx
jle 0xb60f
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
xorl %ecx, %ecx
leaq 0x28dd(%rip), %r8       # 0xdeb0
movl %eax, %r9d
shll $0xa, %eax
andl $0x3ffffc00, %eax       # imm = 0x3FFFFC00
xorl (%rsi), %eax
shrl $0x14, %r9d
movl %eax, (%rdi)
movq %r8, %r10
xorl %r11d, %r11d
btl %r11d, %r9d
jae 0xb5f7
xorl (%r10), %eax
movl %eax, (%rdi)
incq %r11
addq $0x4, %r10
cmpq $0xa, %r11
jne 0xb5ec
addq $0x4, %rsi
incl %ecx
cmpl %edx, %ecx
jne 0xb5d3
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/misc.c
// Function: fromhex
int fromhex(uint8_t *buf, uint32_t *buf_len, const char *str)
{
    size_t i, len = strlen(str) / 2;

    if (len > *buf_len)
        return -1;

    for (i = 0; i < len; i++) {
        uint8_t c = 0;
        if (str[i * 2] >= '0' && str[i*2] <= '9') c += (str[i * 2] - '0') << 4;
        if ((str[i * 2] & ~0x20) >= 'A' && (str[i*2] & ~0x20) <= 'F') c += (10 + (str[i * 2] & ~0x20) - 'A') << 4;
        if (str[i * 2 + 1] >= '0' && str[i * 2 + 1] <= '9') c += (str[i * 2 + 1] - '0');
        if ((str[i * 2 + 1] & ~0x20) >= 'A' && (str[i * 2 + 1] & ~0x20) <= 'F') c += (10 + (str[i * 2 + 1] & ~0x20) - 'A');
        buf[i] = c;
    }
    *buf_len = len;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rdi
callq 0x8060
movq %rax, %rdx
shrq %rdx
movl (%rbx), %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
ja 0xb85b
cmpq $0x2, %rax
jb 0xb857
xorl %eax, %eax
xorl %ecx, %ecx
movb (%r14,%rcx,2), %dil
movb 0x1(%r14,%rcx,2), %sil
leal -0x30(%rdi), %r8d
movl %edi, %r9d
shlb $0x4, %r9b
cmpb $0xa, %r8b
movzbl %r9b, %r8d
movl $0x0, %r9d
cmovbl %r8d, %r9d
andb $-0x21, %dil
addb $-0x41, %dil
addb $-0x70, %r8b
cmpb $0x6, %dil
movzbl %r8b, %edi
cmovael %eax, %edi
leal -0x30(%rsi), %r8d
cmpb $0xa, %r8b
movzbl %r8b, %r8d
cmovael %eax, %r8d
addb %r9b, %r8b
addb %dil, %r8b
andb $-0x21, %sil
leal -0x41(%rsi), %edi
addb $-0x37, %sil
cmpb $0x6, %dil
movzbl %sil, %esi
cmovael %eax, %esi
addb %r8b, %sil
movb %sil, (%r15,%rcx)
incq %rcx
cmpq %rcx, %rdx
jne 0xb7df
movl %edx, (%rbx)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/misc.c
// Function: dumphex
void dumphex(uint8_t *b, int l)
{
    int i, c;
    char obuf[32 * 2 + 1];

    if (b == NULL)
        return;

    while (l >= 32)
    {
        memset(obuf, 0, sizeof(obuf));
        for (i = 0; i < 32; i++)
        {
            int c0, c1;

            c = *b++; l--;
            c0 = (c >> 4) & 0xf;
            c1 = c & 0x0f;
            obuf[i*2] = hex_table[c0];
            obuf[i*2+1] = hex_table[c1];
            obuf[i*2+2] = 0;
        }
        printf("%s\n", obuf);
    }
    if (l > 0)
    {
        memset(obuf, 0, sizeof(obuf));
        for (i = 0; i < l; i++)
        {
            int c0, c1;

            c = *b++;
            c0 = (c >> 4) & 0xf;
            c1 = c & 0x0f;
            obuf[i*2] = hex_table[c0];
            obuf[i*2+1] = hex_table[c1];
            obuf[i*2+2] = 0;
        }
        printf("%s\n", obuf);
    }
}

// Assembly:
testq %rdi, %rdi
je 0xb961
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
leaq 0x2855(%rip), %r15      # 0xe0e0
cmpl $0x20, %esi
jl 0xb8fc
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movb $0x0, -0x30(%rbp)
xorl %r13d, %r13d
movzbl (%r12,%r13), %eax
movl %eax, %ecx
shrl $0x4, %ecx
andl $0xf, %eax
movb (%rcx,%r15), %cl
movb %cl, -0x70(%rbp,%r13,2)
movb (%rax,%r15), %al
movb %al, -0x6f(%rbp,%r13,2)
movb $0x0, -0x6e(%rbp,%r13,2)
incq %r13
cmpq $0x20, %r13
jne 0xb8ad
leal -0x20(%rbx), %r14d
leaq -0x70(%rbp), %rdi
callq 0x8050
leaq (%r12,%r13), %rdi
cmpl $0x3f, %ebx
movl %r14d, %ebx
jg 0xb890
addq %r13, %r12
movq %r12, %rdi
jmp 0xb8ff
movl %ebx, %r14d
testl %r14d, %r14d
jle 0xb953
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movb $0x0, -0x30(%rbp)
movl %r14d, %eax
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
movl %edx, %esi
shrl $0x4, %esi
andl $0xf, %edx
movb (%rsi,%r15), %sil
movb %sil, -0x70(%rbp,%rcx,2)
movb (%rdx,%r15), %dl
movb %dl, -0x6f(%rbp,%rcx,2)
movb $0x0, -0x6e(%rbp,%rcx,2)
incq %rcx
cmpq %rcx, %rax
jne 0xb920
leaq -0x70(%rbp), %rdi
callq 0x8050
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Seclabs-htc[P]slip39/vectors.c
// Function: test_vectors
int test_vectors(void)
{

    int i, gn, sl;
    char **ml;
    char pass[] = "TREZOR";
    uint8_t ms[32];
    int msl;
    uint8_t vs[32];
    int vsl;
    int ret;


    for (i = 0; i < 40; i++)
    {
        ml = vectors[i].mnemonic;

        gn = 0;
        while (ml[gn] != 0)
            gn++;

        printf("%s\n", vectors[i].description);
        sl = strlen(vectors[i].secret);
        msl = sizeof(ms);
        ret = combine_mnemonics(gn ,ml, pass, strlen(pass), ms, &msl);

        if (ret == 0)
        {
            vsl = sizeof(vs);
            fromhex(vs, &vsl, vectors[i].secret);

            if (vsl == msl)
            {
                if (memcmp(ms, vs, msl) == 0)
                    printf("--> PASS\n");
                else
                {
                    printf("--> FAIL <--------\n");
                }
            }
            else
            {
                printf("--> FAIL <--------\n");
            }
        }
        else
        {
            if (strlen(vectors[i].secret) == 0)
                printf("--> PASS\n");
            else
                printf("--> FAIL <--------\n");
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq -0x38(%rbp), %rax
movl $0x524f5a, 0x3(%rax)    # imm = 0x524F5A
movl $0x5a455254, (%rax)     # imm = 0x5A455254
leaq 0xa6c7(%rip), %r15      # 0x16078
xorl %r14d, %r14d
imulq $0x110, %r14, %rax      # imm = 0x110
leaq 0xa6ae(%rip), %rcx      # 0x16070
leaq (%rcx,%rax), %rbx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r15, %rax
incl %r12d
cmpq $0x0, (%rax)
leaq 0x8(%rax), %rax
jne 0xb9da
movq (%rbx), %rdi
callq 0x8050
movl $0x20, -0x30(%rbp)
leaq -0x38(%rbp), %r13
movq %r13, %rdi
callq 0x8060
movl %r12d, %edi
movq -0x40(%rbp), %rsi
movq %r13, %rdx
movl %eax, %ecx
leaq -0x80(%rbp), %r8
leaq -0x30(%rbp), %r9
callq 0xae06
testl %eax, %eax
je 0xba2b
movq 0x108(%rbx), %rax
cmpb $0x0, (%rax)
jmp 0xba65
movl $0x20, -0x2c(%rbp)
movq 0x108(%rbx), %rdx
leaq -0x60(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0xb7a4
movslq -0x2c(%rbp), %rdx
leaq 0x5934(%rip), %rdi      # 0x11385
cmpl -0x30(%rbp), %edx
jne 0xba77
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x80a0
testl %eax, %eax
leaq 0x5919(%rip), %rdi      # 0x11385
leaq 0x5925(%rip), %rax      # 0x11398
cmoveq %rax, %rdi
callq 0x8050
incq %r14
addq $0x110, %r15            # imm = 0x110
cmpq $0x28, %r14
jne 0xb9b4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: restart
void
restart(const Arg *arg)
{
   fprintf(stderr, "restarting dwm..");
   systray_freeicons();
   if (arg->v) {
      execvp(((char **)arg->v)[0], (char **)arg->v);
   } else {
      execlp("dwm", "dwm", "-r", NULL);
   }
   systray_acquire();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xc81d(%rip), %rax      # 0x11fe8
movq (%rax), %rcx
leaq 0x8763(%rip), %rdi      # 0xdf38
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x56c0
callq 0x8500
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x57f7
movq (%rsi), %rdi
callq 0x5120
jmp 0x5811
leaq 0x7cf3(%rip), %rdi      # 0xd4f1
leaq 0x788a(%rip), %rdx      # 0xd08f
movq %rdi, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x51e0
popq %rbx
jmp 0x68c4
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: xerror
int
xerror(Display *dpy, XErrorEvent *ee) {
   if(ee->error_code == BadWindow
         || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
         || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)
         || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable)
         || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable)
         || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch)
         || (ee->request_code == X_GrabButton && ee->error_code == BadAccess)
         || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)
         || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
      return 0;
   fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
         ee->request_code, ee->error_code);
   return xerrorxlib(dpy, ee); /* may call exit */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movzbl 0x20(%rsi), %ecx
cmpl $0x3, %ecx
je 0x6510
movq %rsi, %rbx
movzbl 0x21(%rsi), %edx
movl %edx, %eax
xorb $0x2a, %al
movl %ecx, %esi
xorb $0x8, %sil
orb %al, %sil
je 0x6510
movq %rdi, %r14
cmpl $0x3d, %edx
jle 0x64eb
cmpl $0x45, %edx
jg 0x6501
cmpl $0x3e, %edx
je 0x650b
cmpl $0x42, %edx
je 0x650b
jmp 0x651f
cmpl $0xc, %edx
je 0x651a
cmpl $0x1c, %edx
je 0x64fa
cmpl $0x21, %edx
jne 0x651f
cmpl $0xa, %ecx
je 0x6510
jmp 0x651f
cmpl $0x46, %edx
je 0x650b
cmpl $0x4a, %edx
jne 0x651f
cmpl $0x9, %ecx
jne 0x651f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x8, %ecx
je 0x6510
movq 0xbac2(%rip), %rax      # 0x11fe8
movq (%rax), %rdi
leaq 0x6bdd(%rip), %rsi      # 0xd10d
xorl %eax, %eax
callq 0x5730
movq 0xd122(%rip), %rax      # 0x13660
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: getcolor
unsigned long
#ifndef XFT
getcolor(const char *colstr) {
#else
getcolor(const char *colstr, XftColor *color) {
#endif
   Colormap cmap = DefaultColormap(dpy, screen);
#ifndef XFT
   XColor color;

   if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
      die("error, cannot allocate color '%s'\n", colstr);
   return color.pixel;
#else
   Visual *vis = DefaultVisual(dpy, screen);
   if(!XftColorAllocName(dpy,vis,cmap,colstr, color))
      die("error, cannot allocate color '%s'\n", colstr);

   return color->pixel;
#endif
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0xcd43(%rip), %rdi      # 0x13488
movq 0xe8(%rdi), %rax
movslq 0xcf15(%rip), %rcx      # 0x13668
shlq $0x7, %rcx
movq 0x50(%rax,%rcx), %rsi
movq %rsp, %rcx
movq %rbx, %rdx
movq %rcx, %r8
callq 0x51f0
testl %eax, %eax
je 0x6778
movq (%rsp), %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x6bb2(%rip), %rdi      # 0xd331
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6408
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: updatebars
void
updatebars(void) {
   Monitor *m;
   XSetWindowAttributes wa;
   int b = 0;

   wa.override_redirect = True;
   wa.background_pixmap = ParentRelative;
   wa.event_mask = ButtonPressMask|ExposureMask;
   for(m = mons; m; m = m->next) {
      m->barwin = XCreateWindow(dpy, root, m->bx, m->by, m->bw, m->bh, 0, DefaultDepth(dpy, screen),
            CopyFromParent, DefaultVisual(dpy, screen),
            CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
      XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
      XMapRaised(dpy, m->barwin);
      b++;
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl $0x1, 0x58(%rsp)
movq $0x1, (%rsp)
movq $0x8004, 0x48(%rsp)     # imm = 0x8004
movq 0xccb6(%rip), %rbx      # 0x13468
testq %rbx, %rbx
je 0x684f
movq %rsp, %r14
xorl %r15d, %r15d
movq 0xccc0(%rip), %rdi      # 0x13488
movq 0xce81(%rip), %rsi      # 0x13650
movl 0x18(%rbx), %edx
movl 0x1c(%rbx), %ecx
movl 0x20(%rbx), %r8d
movl 0x24(%rbx), %r9d
movq 0xe8(%rdi), %rax
movslq 0xce7d(%rip), %r10      # 0x13668
shlq $0x7, %r10
movl 0x38(%rax,%r10), %r11d
pushq %r14
pushq $0xa01                  # imm = 0xA01
pushq 0x40(%rax,%r10)
pushq %r15
pushq %r11
pushq %r15
callq 0x5230
addq $0x30, %rsp
movq %rax, 0x98(%rbx)
movq 0xcc6b(%rip), %rdi      # 0x13488
movq 0xce5c(%rip), %rdx      # 0x13680
movq %rax, %rsi
callq 0x5590
movq 0xcc55(%rip), %rdi      # 0x13488
movq 0x98(%rbx), %rsi
callq 0x5710
movq 0x90(%rbx), %rbx
testq %rbx, %rbx
jne 0x67c1
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: updatestatus
void
updatestatus(void) {
   if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
      strcpy(stext, VERSION);
#ifndef STATUS_MONITOR
   if(!alwaysdrawstatus && !inversestatus)
      drawbar(selmon);
   else
      drawbars();
#else
   drawbars();
#endif
}

// Assembly:
pushq %rbx
movq 0xcdef(%rip), %rdi      # 0x13650
leaq 0xcea8(%rip), %rdx      # 0x13710
movl $0x27, %esi
movl $0x100, %ecx            # imm = 0x100
callq 0x770a
testl %eax, %eax
jne 0x68a5
movups 0x6aeb(%rip), %xmm0     # 0xd36d
movups %xmm0, 0xcea0(%rip)     # 0x13729
movups 0x6ad4(%rip), %xmm0     # 0xd364
movaps %xmm0, 0xce89(%rip)     # 0x13720
movups 0x6ab6(%rip), %xmm0     # 0xd354
movaps %xmm0, 0xce6b(%rip)     # 0x13710
movq 0xcbbc(%rip), %rbx      # 0x13468
testq %rbx, %rbx
je 0x68c2
movq %rbx, %rdi
callq 0x77d8
movq 0x90(%rbx), %rbx
jmp 0x68ac
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: grabkeys
void
grabkeys(void) {
   updatenumlockmask();
   {
      unsigned int i, j;
      unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
      KeyCode code;

      XUngrabKey(dpy, AnyKey, AnyModifier, root);
      for(i = 0; i < LENGTH(keys); i++) {
         if((code = XKeysymToKeycode(dpy, keys[i].keysym)))
            for(j = 0; j < LENGTH(modifiers); j++)
               XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
                     True, GrabModeAsync, GrabModeAsync);
      }
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
callq 0x862f
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, 0x10(%rsp)
movl 0xcdad(%rip), %eax      # 0x13818
movl %eax, 0x18(%rsp)
orl $0x2, %eax
movl %eax, 0x1c(%rsp)
movq 0xca0b(%rip), %rdi      # 0x13488
movq 0xcbcc(%rip), %rcx      # 0x13650
xorl %r14d, %r14d
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x5220
leaq 0xbab6(%rip), %r15      # 0x12550
movq 0xc9e7(%rip), %rdi      # 0x13488
movq %r14, %r12
shlq $0x5, %r12
movq 0x8(%r12,%r15), %rsi
callq 0x5620
testb %al, %al
je 0x6af9
addq %r15, %r12
movzbl %al, %ebx
xorl %r13d, %r13d
movq 0xc9c2(%rip), %rdi      # 0x13488
movl 0x10(%rsp,%r13,4), %edx
orl (%r12), %edx
movq 0xcb7a(%rip), %rcx      # 0x13650
movl $0x1, (%rsp)
movl %ebx, %esi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x5660
incq %r13
cmpq $0x4, %r13
jne 0x6abf
incq %r14
cmpq $0x49, %r14
jne 0x6a9a
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: updatebarpos
void
updatebarpos(Monitor *m) {
   /* original */
   m->by = m->oy;
   m->wy = m->oy;
   m->wh = m->oh;

   /* get right stuff */
   if(m->showbar) {
      m->wh -= m->bh;
      m->by = m->topbar ? m->wy : m->wy + m->wh;
      m->wy = m->topbar ? m->wy + bh + m->margin->y : m->wy;
      m->wh -= m->margin->h;
   }
   else
      m->by = -m->bh;
}

// Assembly:
movl 0x24(%rdi), %edx
movl 0x4c(%rdi), %ecx
movl %ecx, 0x3c(%rdi)
movl 0x54(%rdi), %eax
movl %eax, 0x44(%rdi)
cmpl $0x0, 0x68(%rdi)
je 0x6b49
subl %edx, %eax
cmpl $0x0, 0x70(%rdi)
je 0x6b4f
movl 0xcb40(%rip), %r8d      # 0x13674
addl %ecx, %r8d
movq 0xc0(%rdi), %rdx
addl 0x4(%rdx), %r8d
movl %ecx, %esi
movl %r8d, %ecx
jmp 0x6b59
negl %edx
movl %edx, 0x1c(%rdi)
retq
leal (%rax,%rcx), %esi
movq 0xc0(%rdi), %rdx
movl %esi, 0x1c(%rdi)
movl %ecx, 0x3c(%rdi)
subl 0xc(%rdx), %eax
movl %eax, 0x44(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: wintomon
Monitor *
wintomon(Window w) {
   int x, y;
   Client *c;
   Monitor *m;

   if(w == root && getrootptr(&x, &y))
      return ptrtomon(x, y);
   for(m = mons; m; m = m->next)
      if(w == m->barwin)
         return m;
   if((c = wintoclient(w)))
      return c->mon;
   return selmon;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpq %rdi, 0xcadb(%rip)      # 0x13650
jne 0x6bc2
movq 0xc90a(%rip), %rdi      # 0x13488
subq $0x8, %rsp
leaq 0x18(%rsp), %rax
leaq 0x1c(%rsp), %r10
leaq 0x20(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x10(%rsp), %r9
movq %rbx, %rsi
movq %rcx, %rdx
pushq %rax
pushq %r10
pushq %r10
callq 0x5610
addq $0x20, %rsp
testl %eax, %eax
je 0x6bc2
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
callq 0x76d1
jmp 0x6c1f
movq 0xc89f(%rip), %rcx      # 0x13468
testq %rcx, %rcx
je 0x6c0f
movq %rcx, %rax
cmpq %rbx, 0x98(%rax)
je 0x6c1f
movq 0x90(%rax), %rax
testq %rax, %rax
jne 0x6bd1
jmp 0x6c0a
movq 0x78(%rcx), %rax
testq %rax, %rax
je 0x6c03
cmpq %rbx, 0x1a8(%rax)
je 0x6c18
movq 0x190(%rax), %rax
jmp 0x6bec
movq 0x90(%rcx), %rcx
testq %rcx, %rcx
jne 0x6be8
movq 0xc85a(%rip), %rax      # 0x13470
jmp 0x6c1f
movq 0x1a0(%rax), %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: tile
void
tile(Monitor *m) {
   int x, y, h, w, mw;
   unsigned int i, n;
   Client *c;

   for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
   if(n == 0)
      return;
   /* master */
   c = nexttiled(m->clients);
   mw = m->mfact * m->ww;
   resize(c, m->wx, m->wy, (n == 1 ? m->ww : mw) - 2 * c->bw, m->wh - 2 * c->bw, False);
   if(--n == 0)
      return;
   /* tile stack */
   x = (m->wx + mw > c->x + c->w) ? c->x + c->w + 2 * c->bw : m->wx + mw;
   y = m->wy;
   w = (m->wx + mw > c->x + c->w) ? m->wx + m->ww - x : m->ww - mw;
   h = m->wh / n;
   if(h < m->bh)
      h = m->wh;
   for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
      resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
               ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
      if(h != m->wh)
         y = c->y + HEIGHT(c);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
callq 0x730b
testq %rax, %rax
je 0x6da3
movq %rax, %r14
xorl %r13d, %r13d
movq 0x190(%rax), %rdi
callq 0x730b
decl %r13d
testq %rax, %rax
jne 0x6c4e
testl %r13d, %r13d
je 0x6da3
movl 0x40(%rbx), %ecx
cvtsi2ss %ecx, %xmm0
mulss 0x10(%rbx), %xmm0
cvttss2si %xmm0, %r15d
movl 0x38(%rbx), %esi
movl 0x3c(%rbx), %edx
cmpl $-0x1, %r13d
cmovnel %r15d, %ecx
movl 0x150(%r14), %eax
addl %eax, %eax
subl %eax, %ecx
movl 0x44(%rbx), %r8d
subl %eax, %r8d
movq %r14, %rdi
xorl %r9d, %r9d
callq 0x7353
cmpl $-0x1, %r13d
je 0x6da3
movl %r13d, %ecx
notl %ecx
movl 0x38(%rbx), %esi
leal (%rsi,%r15), %edx
movl 0x110(%r14), %eax
addl 0x108(%r14), %eax
movl %edx, 0xc(%rsp)
cmpl %eax, %edx
jle 0x6ced
movl 0x150(%r14), %edx
leal (%rax,%rdx,2), %eax
addl 0x40(%rbx), %esi
movl %eax, 0xc(%rsp)
subl %eax, %esi
movq %rsi, 0x10(%rsp)
jmp 0x6cf8
movl 0x40(%rbx), %eax
subl %r15d, %eax
movq %rax, 0x10(%rsp)
movl 0x44(%rbx), %r12d
movl %r12d, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r15d
cmpl 0x24(%rbx), %eax
cmovll %r12d, %r15d
movq 0x190(%r14), %rdi
callq 0x730b
testq %rax, %rax
je 0x6da3
movq %rax, %r14
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
subl %r13d, %ebp
movl 0x3c(%rbx), %r13d
movl 0x150(%r14), %eax
addl %eax, %eax
subl $0x1, %ebp
jae 0x6d4e
movl 0x3c(%rbx), %r8d
subl %eax, %r8d
subl %r13d, %r8d
addl %r12d, %r8d
jmp 0x6d54
movl %r15d, %r8d
subl %eax, %r8d
movq 0x10(%rsp), %rcx
subl %eax, %ecx
movq %r14, %rdi
movl 0xc(%rsp), %esi
movl %r13d, %edx
xorl %r9d, %r9d
callq 0x7353
movl 0x44(%rbx), %r12d
cmpl %r12d, %r15d
je 0x6d8f
movl 0x114(%r14), %eax
movl 0x150(%r14), %ecx
addl 0x10c(%r14), %eax
leal (%rax,%rcx,2), %r13d
movq 0x190(%r14), %rdi
callq 0x730b
movq %rax, %r14
testq %rax, %rax
jne 0x6d31
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: bstackhoriz
static void
bstackhoriz(Monitor *m) {
   int x, y, h, w, mh;
   unsigned int i, n;
   Client *c;

   for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
   if(n == 0)
      return;
   /* master */
   c = nexttiled(m->clients);
   mh = m->mfact * m->wh;
   resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
   if(--n == 0)
      return;
   /* tile stack */
   x = m->wx;
   y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
   w = m->ww;
   h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
   h /= n;
   if(h < m->bh)
      h = m->wh;
   for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
      resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
               ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
      if(h != m->wh)
         y = c->y + HEIGHT(c);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x78(%rdi), %rdi
callq 0x730b
testq %rax, %rax
je 0x6f3c
movq %rax, %r15
xorl %r13d, %r13d
movq 0x190(%rax), %rdi
callq 0x730b
decl %r13d
testq %rax, %rax
jne 0x6ddd
testl %r13d, %r13d
je 0x6f3c
movq 0x8(%rsp), %rax
movl 0x44(%rax), %r8d
cvtsi2ss %r8d, %xmm0
mulss 0x10(%rax), %xmm0
cvttss2si %xmm0, %ebx
movl 0x38(%rax), %esi
movl 0x3c(%rax), %edx
movl 0x40(%rax), %ecx
movl 0x150(%r15), %eax
addl %eax, %eax
subl %eax, %ecx
cmpl $-0x1, %r13d
cmovnel %ebx, %r8d
subl %eax, %r8d
movq %r15, %rdi
xorl %r9d, %r9d
callq 0x7353
cmpl $-0x1, %r13d
je 0x6f3c
movl %r13d, %ecx
notl %ecx
movq 0x8(%rsp), %rdi
movl 0x3c(%rdi), %eax
leal (%rax,%rbx), %r14d
movl 0x114(%r15), %edx
addl 0x10c(%r15), %edx
cmpl %edx, %r14d
jle 0x6e7e
movl 0x150(%r15), %esi
leal (%rdx,%rsi,2), %r14d
movl 0x44(%rdi), %ebp
addl %ebp, %eax
subl %r14d, %eax
jmp 0x6e85
movl 0x44(%rdi), %ebp
movl %ebp, %eax
subl %ebx, %eax
movl 0x38(%rdi), %edx
movl %edx, 0x14(%rsp)
movl 0x40(%rdi), %edx
movl %edx, 0x10(%rsp)
xorl %edx, %edx
divl %ecx
movl %eax, %r12d
cmpl 0x24(%rdi), %eax
cmovll %ebp, %r12d
movq 0x190(%r15), %rdi
callq 0x730b
testq %rax, %rax
je 0x6f3c
movq %rax, %r15
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
subl %r13d, %ebx
movl 0x150(%r15), %eax
addl %eax, %eax
subl $0x1, %ebx
jae 0x6ee3
movq 0x8(%rsp), %r13
movl 0x3c(%r13), %r8d
subl %eax, %r8d
subl %r14d, %r8d
addl %ebp, %r8d
jmp 0x6eee
movl %r12d, %r8d
subl %eax, %r8d
movq 0x8(%rsp), %r13
movl 0x10(%rsp), %ecx
subl %eax, %ecx
movq %r15, %rdi
movl 0x14(%rsp), %esi
movl %r14d, %edx
xorl %r9d, %r9d
callq 0x7353
movl 0x44(%r13), %ebp
cmpl %ebp, %r12d
je 0x6f28
movl 0x114(%r15), %eax
movl 0x150(%r15), %ecx
addl 0x10c(%r15), %eax
leal (%rax,%rcx,2), %r14d
movq 0x190(%r15), %rdi
callq 0x730b
movq %rax, %r15
testq %rax, %rax
jne 0x6ec1
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq