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

    cout << "argv[1] infile: " << argv[1] << endl;
    cout << "argv[2] m:      " << argv[2] << endl;
    cout << "argv[3] gamma:  " << argv[3] << endl;
    cout << "argv[4] outfile " << argv[4] << endl;

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

    m = atoi(argv[2]);
    gamma = atof(argv[3]);

    halftone(I1, m, gamma, I2);
    IP_saveImage(I2, argv[4]);

    IP_freeImage(I1);
    IP_freeImage(I2);
    
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x2c63(%rip), %r14      # 0x4fd0
leaq 0xca4(%rip), %rsi       # 0x3018
movl $0x10, %edx
movq %r14, %rdi
callq 0x2100
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x23a6
movq %r15, %rdi
callq 0x2070
movq 0x2c37(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x23be
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0xc3d(%rip), %rsi       # 0x3029
movl $0x10, %edx
movq %r14, %rdi
callq 0x2100
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x241e
movq %r15, %rdi
callq 0x2070
movq 0x2bbf(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x2436
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0xbd6(%rip), %rsi       # 0x303a
movl $0x10, %edx
movq %r14, %rdi
callq 0x2100
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0x2496
movq %r15, %rdi
callq 0x2070
movq 0x2b47(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x24ae
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq 0xb6f(%rip), %rsi       # 0x304b
movl $0x10, %edx
movq %r14, %rdi
callq 0x2100
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x250e
movq %r15, %rdi
callq 0x2070
movq 0x2acf(%rip), %rdi      # 0x4fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2100
jmp 0x2526
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq 0x8(%rbx), %rdi
callq 0x27f0
movq %rax, %r14
movl $0x10, %edi
callq 0x2160
movq %rax, %r15
movq 0x10(%rbx), %rdi
callq 0x21a0
movl %eax, %ebp
movq 0x18(%rbx), %rdi
callq 0x2130
cvtsd2ss %xmm0, %xmm0
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x25b7
movq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x2a16
movq %r14, %rdi
callq 0x2bc7
movq %r15, %rdi
callq 0x2bc7
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq