// File: kazel1990[P]Inception-v4/generator.cpp
// Function: convolution(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, int, int, int)
void convolution(std::string name, std::string bot, std::string top,
        int output, int pad_h, int pad_w, int kernel_h, int kernel_w,
        int stride)
{
    print("layer {");
    sprintf(buf,"name: \"%s\"",name.c_str());
    print(buf);
    print("type: \"Convolution\"");
    in_out(bot,top);
    print("param {");
    print("lr_mult: 1");
    print("decay_mult: 1");
    print("}");
    print("param {");
    print("lr_mult: 2");
    print("decay_mult: 0");
    print("}");

    print("convolution_param {");
    sprintf(buf,"num_output: %d",output);
    print(buf);
    if(pad_h == pad_w)
    {
        sprintf(buf,"pad: %d",pad_h);
        print(buf);
    }
    else
    {
        sprintf(buf,"pad_h: %d",pad_h);
        print(buf);
        sprintf(buf,"pad_w: %d",pad_w);
        print(buf);
    }
    if(kernel_h == kernel_w)
    {
        sprintf(buf,"kernel_size: %d",kernel_h);
        print(buf);
    }
    else
    {
        sprintf(buf,"kernel_h: %d",kernel_h);
        print(buf);
        sprintf(buf,"kernel_w: %d",kernel_w);
        print(buf);
    }
    sprintf(buf,"stride: %d",stride);
    print(buf);

    print("weight_filler {");
    print("type: \"xavier\"");
    sprintf(buf,"std: %s",conv_xavier_std);
    print(buf);
    print("}");

    print("bias_filler {");
    print("type: \"constant\"");
    print("value: 0.2");
    print("}");

    print("}");

    print("}");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdx, -0x80(%rbp)
movq %rsi, -0x88(%rbp)
movq %rdi, -0x98(%rbp)
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
leaq 0xaa7a(%rip), %rdi      # 0xd01e
callq 0x2370
movq -0x98(%rbp), %rdi
callq 0x20a0
movq %rax, %rdx
leaq 0xebb1(%rip), %rdi      # 0x11170
movq %rdi, -0x90(%rbp)
leaq 0xaa59(%rip), %rsi      # 0xd026
xorl %eax, %eax
callq 0x2060
movq -0x90(%rbp), %rdi
callq 0x2370
leaq 0xaa4a(%rip), %rdi      # 0xd031
callq 0x2370
movq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x20b0
movq -0x80(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0x260b
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x24f0
jmp 0x261a
leaq -0x68(%rbp), %rdi
callq 0x20e0
leaq -0x48(%rbp), %rdi
callq 0x20e0
leaq 0xac95(%rip), %rdi      # 0xd2c8
callq 0x2370
leaq 0xaa06(%rip), %rdi      # 0xd045
callq 0x2370
leaq 0xaa05(%rip), %rdi      # 0xd050
callq 0x2370
leaq 0xaa07(%rip), %rdi      # 0xd05e
callq 0x2370
leaq 0xac65(%rip), %rdi      # 0xd2c8
callq 0x2370
leaq 0xa9f1(%rip), %rdi      # 0xd060
callq 0x2370
leaq 0xa9f0(%rip), %rdi      # 0xd06b
callq 0x2370
leaq 0xa9d7(%rip), %rdi      # 0xd05e
callq 0x2370
leaq 0xa9e6(%rip), %rdi      # 0xd079
callq 0x2370
movl -0x1c(%rbp), %edx
leaq 0xeace(%rip), %rdi      # 0x11170
leaq 0xa9e4(%rip), %rsi      # 0xd08d
movb $0x0, %al
callq 0x2060
leaq 0xeab9(%rip), %rdi      # 0x11170
callq 0x2370
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x271b
movl -0x20(%rbp), %edx
leaq 0xeaa2(%rip), %rdi      # 0x11170
leaq 0xa9c7(%rip), %rsi      # 0xd09c
movb $0x0, %al
callq 0x2060
leaq 0xea8d(%rip), %rdi      # 0x11170
callq 0x2370
jmp 0x2763
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x270d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x20e0
leaq -0x48(%rbp), %rdi
callq 0x20e0
jmp 0x289a
movl -0x20(%rbp), %edx
leaq 0xea4b(%rip), %rdi      # 0x11170
leaq 0xa978(%rip), %rsi      # 0xd0a4
movb $0x0, %al
callq 0x2060
leaq 0xea36(%rip), %rdi      # 0x11170
callq 0x2370
movl -0x24(%rbp), %edx
leaq 0xea27(%rip), %rdi      # 0x11170
leaq 0xa95e(%rip), %rsi      # 0xd0ae
movb $0x0, %al
callq 0x2060
leaq 0xea12(%rip), %rdi      # 0x11170
callq 0x2370
movl 0x10(%rbp), %eax
cmpl 0x18(%rbp), %eax
jne 0x2791
movl 0x10(%rbp), %edx
leaq 0xe9fb(%rip), %rdi      # 0x11170
leaq 0xa93c(%rip), %rsi      # 0xd0b8
movb $0x0, %al
callq 0x2060
leaq 0xe9e6(%rip), %rdi      # 0x11170
callq 0x2370
jmp 0x27d9
movl 0x10(%rbp), %edx
leaq 0xe9d5(%rip), %rdi      # 0x11170
leaq 0xa926(%rip), %rsi      # 0xd0c8
movb $0x0, %al
callq 0x2060
leaq 0xe9c0(%rip), %rdi      # 0x11170
callq 0x2370
movl 0x18(%rbp), %edx
leaq 0xe9b1(%rip), %rdi      # 0x11170
leaq 0xa90f(%rip), %rsi      # 0xd0d5
movb $0x0, %al
callq 0x2060
leaq 0xe99c(%rip), %rdi      # 0x11170
callq 0x2370
movl 0x20(%rbp), %edx
leaq 0xe98d(%rip), %rdi      # 0x11170
leaq 0xa8f8(%rip), %rsi      # 0xd0e2
movb $0x0, %al
callq 0x2060
leaq 0xe978(%rip), %rdi      # 0x11170
callq 0x2370
leaq 0xa8e9(%rip), %rdi      # 0xd0ed
callq 0x2370
leaq 0xa8ed(%rip), %rdi      # 0xd0fd
callq 0x2370
leaq 0xe954(%rip), %rdi      # 0x11170
leaq 0xa8e9(%rip), %rsi      # 0xd10c
leaq 0xaf66(%rip), %rdx      # 0xd790
movb $0x0, %al
callq 0x2060
leaq 0xe938(%rip), %rdi      # 0x11170
callq 0x2370
leaq 0xa81a(%rip), %rdi      # 0xd05e
callq 0x2370
leaq 0xa8c4(%rip), %rdi      # 0xd114
callq 0x2370
leaq 0xa8c6(%rip), %rdi      # 0xd122
callq 0x2370
leaq 0xa8cb(%rip), %rdi      # 0xd133
callq 0x2370
leaq 0xa7ea(%rip), %rdi      # 0xd05e
callq 0x2370
leaq 0xa7de(%rip), %rdi      # 0xd05e
callq 0x2370
leaq 0xa7d2(%rip), %rdi      # 0xd05e
callq 0x2370
addq $0xa0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x2220
nopw %cs:(%rax,%rax)