// File: /workspace/github_c_makefile_star2_O3/otrtool[P]otrtool/src/main.c
// Function: generateRequest
char * generateRequest(void *bigkey, char *date) {
  char *headerFN = queryGetParam(header, "FN");
  char *thatohthing = queryGetParam(header, "OH");
  char *iv = malloc(BF_IV_LEN);
  char *code = malloc(513);
  char *dump = malloc(513);
  char *result = malloc(1024); // base64-encoded code is 680 bytes
  
  memset(iv, 0x42, BF_IV_LEN);
  memset(dump, 'd', 512);
  dump[512] = 0;
  
  snprintf(code, 513, "FOOOOBAR\
&OS=01677e4c0ae5468b9b8b823487f14524\
&M=01677e4c0ae5468b9b8b823487f14524\
&LN=DE\
&VN=1.4.1132\
&IR=TRUE\
&IK=aFzW1tL7nP9vXd8yUfB5kLoSyATQ\
&FN=%s\
&OH=%s\
&A=%s\
&P=%s\
&D=%s", headerFN, thatohthing, email, password, dump);
  
  if (opts.verbosity >= VERB_DEBUG) {
    fputs("\nGenerated request-'code':\n", stderr);
    dumpQuerystring(code);
    fputs("\n", stderr);
  }
  
  bf_state_t blowfish;
  bf_init(&blowfish, bigkey, 28);
  bf_cbc_encrypt(&blowfish, code, 512, iv);
  
  if (opts.verbosity >= VERB_DEBUG) {
    fputs("\nEncrypted request-'code':\n", stderr);
    dumpHex(code, 512);
    fputs("\n", stderr);
  }
  
  snprintf(result, 1024, "http://185.195.80.111/quelle_neu1.php\
?code=%s\
&AA=%s\
&ZZ=%s", base64Encode(code, 512), email, date);
  
  if (opts.verbosity >= VERB_DEBUG) {
    fprintf(stderr, "\nRequest:\n%s\n\n", result);
  }
  
  free(code);
  free(dump);
  free(iv);
  free(headerFN);
  free(thatohthing);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
movq 0x7d67(%rip), %rdi      # 0xd2f8
leaq 0x3f06(%rip), %rsi      # 0x949e
callq 0x4f51
movq %rax, %r14
movq 0x7d51(%rip), %rdi      # 0xd2f8
leaq 0x3ef3(%rip), %rsi      # 0x94a1
callq 0x4f51
movq %rax, %rbx
movl $0x8, %edi
callq 0x2310
movq %rax, %r15
movl $0x201, %edi            # imm = 0x201
callq 0x2310
movq %rax, %rbp
movl $0x201, %edi            # imm = 0x201
callq 0x2310
movq %rax, %r13
movl $0x400, %edi            # imm = 0x400
callq 0x2310
movq %rax, %r12
movabsq $0x4242424242424242, %rax # imm = 0x4242424242424242
movq %rax, (%r15)
movl $0x200, %edx            # imm = 0x200
movq %r13, %rdi
movl $0x64, %esi
callq 0x2100
movb $0x0, 0x200(%r13)
movq 0x7cd0(%rip), %r9       # 0xd2e8
leaq 0x3e85(%rip), %rdx      # 0x94a4
movl $0x201, %esi            # imm = 0x201
movq %rbp, %rdi
movq %r14, 0x18(%rsp)
movq %r14, %rcx
movq %rbx, 0x10(%rsp)
movq %rbx, %r8
xorl %eax, %eax
pushq %r13
pushq 0x7caf(%rip)            # 0xd2f0
callq 0x23d0
addq $0x10, %rsp
cmpb $0x1, 0x7c47(%rip)      # 0xd298
je 0x5709
leaq 0x20(%rsp), %r14
movl $0x1c, %edx
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x46fc
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rcx
callq 0x4992
cmpb $0x1, 0x7c11(%rip)      # 0xd298
je 0x5716
movq %rbp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x4d1a
movq 0x7c47(%rip), %r8       # 0xd2e8
leaq 0x3ed9(%rip), %rdx      # 0x9581
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %rax, %rcx
movq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x23d0
cmpb $0x1, 0x7bd2(%rip)      # 0xd298
je 0x5723
movq %rbp, %rdi
callq 0x2290
movq %r13, %rdi
callq 0x2290
movq %r15, %rdi
callq 0x2290
movq 0x18(%rsp), %rdi
callq 0x2290
movq 0x10(%rsp), %rdi
callq 0x2290
movq %r12, %rax
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
callq 0x2ebc
jmp 0x5657
movq %rbp, %rdi
callq 0x2ef7
jmp 0x568d
movq 0x78ae(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
leaq 0x3e87(%rip), %rsi      # 0x95bb
movq %r12, %rdx
xorl %eax, %eax
callq 0x2340
jmp 0x56c8