// File: /workspace/github_cpp_makefile_star2_O1/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 0x3e17
leaq 0x221d(%rip), %rsi      # 0x602a
callq 0x31e0
movq %rax, %r15
jmp 0x3e21
movq 0x51a2(%rip), %rax      # 0x8fc0
movq (%rax), %r15
testq %r15, %r15
je 0x3fb9
movq 0x8(%rsp), %rax
movslq 0x1c(%rax), %rax
testq %rax, %rax
je 0x3f7a
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
leaq (%rcx,%rax,8), %rax
movq %rax, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq (%rcx), %rdx
movq %r15, %rdi
leaq 0x2272(%rip), %rsi      # 0x60d2
xorl %eax, %eax
callq 0x3150
movq 0x8(%rsp), %rax
movslq 0xc(%rax), %rax
testq %rax, %rax
je 0x3f59
movq 0x8(%rsp), %rcx
movq (%rcx), %r12
movq 0x20(%rcx), %rbp
shlq $0x4, %rax
leaq (%rax,%rax,4), %rbx
movb $0x1, %r14b
xorl %r13d, %r13d
cmpq $0x0, 0x28(%r12,%r13)
je 0x3ef8
movq 0x8(%rsp), %rcx
movslq 0x2c(%rcx), %rax
shlq $0x2, %rax
addq 0x20(%rcx), %rax
cmpq %rax, %rbp
je 0x3fca
testb $0x1, %r14b
jne 0x3ec8
movl $0x2c, %edi
movq %r15, %rsi
callq 0x3110
movl (%r12,%r13), %edx
addl $-0x8, %edx
movl (%rbp), %ecx
addl $-0x8, %ecx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x21f4(%rip), %rsi      # 0x60d6
xorl %eax, %eax
callq 0x3150
addq $0x4, %rbp
addq $0x50, %r13
cmpq %r13, %rbx
jne 0x3e93
jmp 0x3f59
cmpl $-0x1, 0x48(%r12,%r13)
je 0x3eed
testb $0x1, %r14b
jne 0x3f13
movl $0x2c, %edi
movq %r15, %rsi
callq 0x3110
movl (%r12,%r13), %edx
movl 0x48(%r12,%r13), %ecx
addl $-0x8, %edx
addl $-0x8, %ecx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x21a7(%rip), %rsi      # 0x60d6
xorl %eax, %eax
callq 0x3150
movl 0x4c(%r12,%r13), %edx
cmpl $-0x1, %edx
je 0x3eed
addl $-0x8, %edx
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x218c(%rip), %rsi      # 0x60dc
xorl %eax, %eax
callq 0x3150
jmp 0x3eed
movl $0xa, %edi
movq %r15, %rsi
callq 0x3110
movq 0x20(%rsp), %rcx
addq $0x8, %rcx
cmpq 0x18(%rsp), %rcx
jne 0x3e4e
movq 0x10(%rsp), %rax
cmpq $0x0, 0x40(%rax)
je 0x3f9c
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3070
movq 0x501d(%rip), %rax      # 0x8fc0
movq (%rax), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3190
leaq 0x206c(%rip), %rdi      # 0x602c
callq 0x31f0
jmp 0x3e2a
callq 0x3454