// File: /workspace/github_c_makefile_star2_O1/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 0x6f51(%rip), %rdi      # 0xc2e8
leaq 0x3030(%rip), %rsi      # 0x83ce
callq 0x4d54
movq %rax, %r14
movq 0x6f3b(%rip), %rdi      # 0xc2e8
leaq 0x301d(%rip), %rsi      # 0x83d1
callq 0x4d54
movq %rax, %rbx
movl $0x8, %edi
callq 0x2300
movq %rax, %r15
movl $0x201, %edi            # imm = 0x201
callq 0x2300
movq %rax, %rbp
movl $0x201, %edi            # imm = 0x201
callq 0x2300
movq %rax, %r13
movl $0x400, %edi            # imm = 0x400
callq 0x2300
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 0x6eba(%rip), %r9       # 0xc2d8
leaq 0x2faf(%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 0x6e99(%rip)            # 0xc2e0
callq 0x23c0
addq $0x10, %rsp
cmpb $0x1, 0x6e31(%rip)      # 0xc288
je 0x550f
leaq 0x20(%rsp), %r14
movl $0x1c, %edx
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x44e4
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rcx
callq 0x477a
cmpb $0x1, 0x6dfb(%rip)      # 0xc288
je 0x551c
movq %rbp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x4b1d
movq 0x6e31(%rip), %r8       # 0xc2d8
leaq 0x3003(%rip), %rdx      # 0x84b1
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %rax, %rcx
movq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x23c0
cmpb $0x1, 0x6dbc(%rip)      # 0xc288
je 0x5529
movq %rbp, %rdi
callq 0x2280
movq %r13, %rdi
callq 0x2280
movq %r15, %rdi
callq 0x2280
movq 0x18(%rsp), %rdi
callq 0x2280
movq 0x10(%rsp), %rdi
callq 0x2280
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 0x2cd5
jmp 0x545d
movq %rbp, %rdi
callq 0x2d10
jmp 0x5493
movq 0x6aa8(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
leaq 0x2fb1(%rip), %rsi      # 0x84eb
movq %r12, %rdx
xorl %eax, %eax
callq 0x2330
jmp 0x54ce