// File: /workspace/github_c_makefile_star2_O2/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 0x7ee0(%rip), %rdi      # 0xc2f8
leaq 0x3faf(%rip), %rsi      # 0x83ce
callq 0x3911
movq %rax, %r14
movq 0x7eca(%rip), %rdi      # 0xc2f8
leaq 0x3f9c(%rip), %rsi      # 0x83d1
callq 0x3911
movq %rax, %rbx
pushq $0x8
popq %rdi
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)
pushq $0x64
popq %rsi
movl $0x200, %edx            # imm = 0x200
movq %r13, %rdi
callq 0x2100
movb $0x0, 0x200(%r13)
movq 0x7e4d(%rip), %r9       # 0xc2e8
leaq 0x3f32(%rip), %rdx      # 0x83d4
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 0x7e2c(%rip)            # 0xc2f0
callq 0x23d0
popq %rcx
popq %rdx
cmpb $0x1, 0x7dc6(%rip)      # 0xc298
je 0x458c
leaq 0x20(%rsp), %r14
pushq $0x1c
popq %rdx
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x308c
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rcx
callq 0x32ef
cmpb $0x1, 0x7d92(%rip)      # 0xc298
je 0x45be
movq %rbp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x3703
movq 0x7dc8(%rip), %r8       # 0xc2e8
leaq 0x3f8a(%rip), %rdx      # 0x84b1
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %rax, %rcx
movq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x23d0
cmpb $0x1, 0x7d53(%rip)      # 0xc298
je 0x45f5
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 0x7a45(%rip), %r14      # 0xbfd8
movq (%r14), %rsi
leaq 0x3edc(%rip), %rdi      # 0x8479
callq 0x2250
movq %rbp, %rdi
callq 0x3a8d
movq (%r14), %rsi
leaq 0x41f0(%rip), %rdi      # 0x87a4
callq 0x2250
jmp 0x44d8
movq 0x7a13(%rip), %rbx      # 0xbfd8
movq (%rbx), %rsi
leaq 0x3ec6(%rip), %rdi      # 0x8495
callq 0x2250
movq %rbp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x3b4f
movq (%rbx), %rsi
leaq 0x41b9(%rip), %rdi      # 0x87a4
callq 0x2250
jmp 0x450c
movq 0x79dc(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
leaq 0x3ee5(%rip), %rsi      # 0x84eb
movq %r12, %rdx
xorl %eax, %eax
callq 0x2340
jmp 0x454b