// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10a0, %rsp           # imm = 0x10A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x790e(%rip), %rdi      # 0xd2f8
leaq 0x4a4d(%rip), %rsi      # 0xa43e
callq 0x49e0
movq %rax, -0x18(%rbp)
movq 0x78f7(%rip), %rdi      # 0xd2f8
leaq 0x4a39(%rip), %rsi      # 0xa441
callq 0x49e0
movq %rax, -0x20(%rbp)
movl $0x8, %edi
callq 0x2300
movq %rax, -0x28(%rbp)
movl $0x201, %edi            # imm = 0x201
callq 0x2300
movq %rax, -0x30(%rbp)
movl $0x201, %edi            # imm = 0x201
callq 0x2300
movq %rax, -0x38(%rbp)
movl $0x400, %edi            # imm = 0x400
callq 0x2300
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
movl $0x42, %esi
movl $0x8, %edx
callq 0x2110
movq -0x38(%rbp), %rdi
movl $0x64, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2110
movq -0x38(%rbp), %rax
movb $0x0, 0x200(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq 0x785b(%rip), %r9       # 0xd2e8
movq 0x785c(%rip), %r10      # 0xd2f0
movq -0x38(%rbp), %rax
movl $0x201, %esi            # imm = 0x201
leaq 0x49a0(%rip), %rdx      # 0xa444
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x23c0
cmpl $0x1, 0x77e9(%rip)      # 0xd2a4
jb 0x5af2
movq 0x7514(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x4a1b(%rip), %rdi      # 0xa4e9
callq 0x2240
movq -0x30(%rbp), %rdi
callq 0x4c20
movq 0x74f5(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x4d29(%rip), %rdi      # 0xa816
callq 0x2240
movq -0x8(%rbp), %rsi
leaq -0x1088(%rbp), %rdi
movl $0x1c, %edx
callq 0x3a50
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq -0x1088(%rbp), %rdi
movl $0x200, %edx            # imm = 0x200
callq 0x3f50
cmpl $0x1, 0x777d(%rip)      # 0xd2a4
jb 0x5b63
movq 0x74a8(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x49cb(%rip), %rdi      # 0xa505
callq 0x2240
movq -0x30(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x4d40
movq 0x7484(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x4cb8(%rip), %rdi      # 0xa816
callq 0x2240
movq -0x40(%rbp), %rax
movq %rax, -0x1090(%rbp)
movq -0x30(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x45c0
movq -0x1090(%rbp), %rdi
movq %rax, %rcx
movq 0x775b(%rip), %r8       # 0xd2e8
movq -0x10(%rbp), %r9
movl $0x400, %esi            # imm = 0x400
leaq 0x4984(%rip), %rdx      # 0xa521
movb $0x0, %al
callq 0x23c0
cmpl $0x1, 0x76f9(%rip)      # 0xd2a4
jb 0x5bc9
movq 0x7424(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movq -0x40(%rbp), %rdx
leaq 0x4999(%rip), %rsi      # 0xa55b
movb $0x0, %al
callq 0x2330
movq -0x30(%rbp), %rdi
callq 0x2280
movq -0x38(%rbp), %rdi
callq 0x2280
movq -0x28(%rbp), %rdi
callq 0x2280
movq -0x18(%rbp), %rdi
callq 0x2280
movq -0x20(%rbp), %rdi
callq 0x2280
movq -0x40(%rbp), %rax
addq $0x10a0, %rsp           # imm = 0x10A0
popq %rbp
retq
nopw %cs:(%rax,%rax)