// File: /workspace/github_cpp_makefile_star2_O1/brianwu02[P]ImageProcessing/error_diffusion1.cpp
// Function: main
int main(int argc, char** argv) {
    int mtd, serpentine;
    float gamma;
    imageP I1, I2;

    cout << "input: " << argv[1] << endl;
    cout << "mtd: " << argv[2] << endl;
    cout << "serpentine: " << argv[3] << endl;
    cout << "gamma: " << argv[4] << endl;
    cout << "outfile " << argv[5] << endl;

    I1 = IP_readImage(argv[1]);
    I2 = NEWIMAGE;

    mtd = atoi(argv[2]);
    serpentine = atoi(argv[3]);
    gamma = atof(argv[4]);


    error_diffusion(I1, mtd, serpentine, gamma, I2);

    IP_saveImage(I2, argv[5]);

    IP_freeImage(I1);
    IP_freeImage(I2);

    cout << "done!" << endl;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq 0x3c32(%rip), %rbx      # 0x5fd0
leaq 0x1c7b(%rip), %rsi      # 0x4020
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2100
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x23d7
movq %r15, %rdi
callq 0x2070
movq 0x3c06(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x23ee
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0x1c0c(%rip), %rsi      # 0x4028
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2100
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x244e
movq %r15, %rdi
callq 0x2070
movq 0x3b8f(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x2465
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0x1b9b(%rip), %rsi      # 0x402e
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2100
movq 0x18(%r14), %r15
testq %r15, %r15
je 0x24c5
movq %r15, %rdi
callq 0x2070
movq 0x3b18(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x24dc
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0x1b31(%rip), %rsi      # 0x403b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2100
movq 0x20(%r14), %r15
testq %r15, %r15
je 0x253c
movq %r15, %rdi
callq 0x2070
movq 0x3aa1(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x2553
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0x1ac2(%rip), %rsi      # 0x4043
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2100
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x25b3
movq %r15, %rdi
callq 0x2070
movq 0x3a2a(%rip), %rdi      # 0x5fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x25ca
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq 0x8(%r14), %rdi
callq 0x2a88
movq %rax, %r15
movl $0x10, %edi
callq 0x2160
movq %rax, %r12
movq 0x18(%r14), %rdi
callq 0x21a0
movl %eax, %ebp
movq 0x20(%r14), %rdi
callq 0x2130
cvtsd2ss %xmm0, %xmm0
movq %r15, %rdi
movl %ebp, %edx
movq %r12, %rcx
callq 0x2694
movq 0x28(%r14), %rsi
movq %r12, %rdi
callq 0x2cae
movq %r15, %rdi
callq 0x2e5f
movq %r12, %rdi
callq 0x2e5f
leaq 0x19fa(%rip), %rsi      # 0x404c
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq