// File: /workspace/github_cpp_makefile_star2_O2/exrok[P]evdoublebind/./src/make_config.cc
// Function: generate_hfile(Config&, Settings&)
void generate_hfile(Config &config, Settings &settings) {
     FILE * hfile;
     if (settings.evdoublebind_conf_output == NULL) {
         hfile = stdout;
     } else {
         hfile = fopen(settings.evdoublebind_conf_output, "w");
     }
     if (hfile == NULL) {
         perror("Failed Creating xkb config file: ");
     }
     for (auto &kbd : config.keyboards){
         fprintf(hfile,"%s ", kbd);
         auto unused = config.unused_keys.begin();
         bool first = true;
         for (auto & mapping: config.mappings) {
             if (mapping.tap_map[0] != NULL) {
                 if (unused == config.unused_keys.end()) {
                     fprintf(stderr,"ERROR: not enough unused keys specified for config\n");
                     exit(1);
                 }
                 if (!first) {
                     fprintf(hfile,",");
                 }
                 first = false;
                 fprintf(hfile,"%d:%d", mapping.keycode - 8, *unused - 8);
                 unused++;
             } else if (mapping.tap_raw[0] != -1) {
                 if (!first) {
                     fprintf(hfile,",");
                 }
                 first = false;
                 fprintf(hfile,"%d:%d", mapping.keycode - 8, mapping.tap_raw[0] - 8);
                 if (mapping.tap_raw[1] != -1) {
                     fprintf(hfile,"|%d", mapping.tap_raw[1] - 8);
                 }
             }
         }
         fprintf(hfile,"\n");
     }
     if (settings.evdoublebind_conf_output != NULL) {
         fclose(hfile); //don't close stdout
     } else {
         fflush(stdout);
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x40(%rsi), %rdi
testq %rdi, %rdi
je 0x3c3a
leaq 0x23fa(%rip), %rsi      # 0x602a
callq 0x31d0
movq %rax, %r15
jmp 0x3c44
movq 0x537f(%rip), %rax      # 0x8fc0
movq (%rax), %r15
testq %r15, %r15
je 0x3dc1
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movslq 0x1c(%rax), %rax
leaq (%rcx,%rax,8), %rax
movq %rax, 0x18(%rsp)
cmpq 0x18(%rsp), %rcx
je 0x3d82
movq %rcx, 0x20(%rsp)
movq (%rcx), %rdx
movq %r15, %rdi
leaq 0x2452(%rip), %rsi      # 0x60d2
xorl %eax, %eax
callq 0x3140
movq 0x8(%rsp), %rax
movq (%rax), %rbx
movq 0x20(%rax), %rbp
movslq 0xc(%rax), %rax
imulq $0x50, %rax, %r12
movb $0x1, %r14b
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x3d69
cmpq $0x0, 0x28(%rbx,%r13)
je 0x3d08
movq 0x8(%rsp), %rcx
movslq 0x2c(%rcx), %rax
shlq $0x2, %rax
addq 0x20(%rcx), %rax
cmpq %rax, %rbp
je 0x3dd2
testb $0x1, %r14b
jne 0x3cdd
pushq $0x2c
popq %rdi
movq %r15, %rsi
callq 0x3100
movl (%rbx,%r13), %edx
addl $-0x8, %edx
movl (%rbp), %ecx
addl $-0x8, %ecx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x23df(%rip), %rsi      # 0x60d6
xorl %eax, %eax
callq 0x3140
addq $0x4, %rbp
addq $0x50, %r13
jmp 0x3ca1
movl 0x48(%rbx,%r13), %ecx
cmpl $-0x1, %ecx
je 0x3d02
testb $0x1, %r14b
jne 0x3d28
pushq $0x2c
popq %rdi
movq %r15, %rsi
callq 0x3100
movl 0x48(%rbx,%r13), %ecx
movl (%rbx,%r13), %edx
addl $-0x8, %edx
addl $-0x8, %ecx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x2397(%rip), %rsi      # 0x60d6
xorl %eax, %eax
callq 0x3140
movl 0x4c(%rbx,%r13), %edx
cmpl $-0x1, %edx
je 0x3d02
addl $-0x8, %edx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x237c(%rip), %rsi      # 0x60dc
xorl %eax, %eax
callq 0x3140
jmp 0x3d02
pushq $0xa
popq %rdi
movq %r15, %rsi
callq 0x3100
movq 0x20(%rsp), %rcx
addq $0x8, %rcx
jmp 0x3c63
movq 0x10(%rsp), %rax
cmpq $0x0, 0x40(%rax)
je 0x3da4
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3070
movq 0x5215(%rip), %rax      # 0x8fc0
movq (%rax), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3180
leaq 0x2264(%rip), %rdi      # 0x602c
callq 0x31e0
jmp 0x3c4d
movq 0x521f(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x22bb(%rip), %rdi      # 0x609e
pushq $0x33
popq %rsi
pushq $0x1
popq %rdx
callq 0x3230
pushq $0x1
popq %rdi
callq 0x3220