// File: /workspace/github_cpp_makefile_star2_O1/mdpkh[P]retro6k/src/main.cpp
// Function: RoundWinCorners(SDL_Surface*, unsigned int, unsigned int, unsigned int)
void RoundWinCorners(SDL_Surface* destsurf, unsigned int key, unsigned int bg, unsigned int fg)
{
#define r0 wincornercliprect[i]
	for (int i = 0; i < NWINCORNERCLIPRECTS; ++i)
	{
		SDL_Rect r1 = wincornercliprect[i];
		SDL_Rect r2 = wincornercliprect[i];
		SDL_Rect r3 = wincornercliprect[i];
		r1.x = r3.x = destsurf->w - r0.x - r0.w;
		r2.y = r3.y = destsurf->h - r0.y - r0.h;
		SDL_FillRect(destsurf, &r0, key);
		SDL_FillRect(destsurf, &r1, key);
		SDL_FillRect(destsurf, &r2, key);
		SDL_FillRect(destsurf, &r3, key);
	}
#undef r0
#define r0 wincornerborder0rect[i]
	for (int i = 0; i < NWINCORNERBORDER0RECTS; ++i)
	{
		SDL_Rect r1 = wincornerborder0rect[i];
		SDL_Rect r2 = wincornerborder0rect[i];
		SDL_Rect r3 = wincornerborder0rect[i];
		r1.x = r3.x = destsurf->w - r0.x - r0.w;
		r2.y = r3.y = destsurf->h - r0.y - r0.h;
		SDL_FillRect(destsurf, &r0, bg);
		SDL_FillRect(destsurf, &r1, bg);
		SDL_FillRect(destsurf, &r2, bg);
		SDL_FillRect(destsurf, &r3, bg);
	}
#undef r0
#define r0 wincornerborder1rect[i]
	for (int i = 0; i < NWINCORNERBORDER1RECTS; ++i)
	{
		SDL_Rect r2 = wincornerborder1rect[i];
		SDL_Rect r3 = wincornerborder1rect[i];
		r3.x        = destsurf->w - r0.x - r0.w;
		r2.y = r3.y = destsurf->h - r0.y - r0.h;
		SDL_FillRect(destsurf, &r2, fg);
		SDL_FillRect(destsurf, &r3, fg);
	}
#undef r0
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0x6faa(%rip), %r12      # 0x13b00
leaq (%r12,%r13), %rsi
movups (%r13,%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x20(%rsp)
movl 0x10(%r14), %eax
movl (%r13,%r12), %ecx
movl 0x4(%r13,%r12), %edx
addl 0x8(%r13,%r12), %ecx
subl %ecx, %eax
movl %eax, 0x20(%rsp)
movl %eax, 0x10(%rsp)
addl 0xc(%r13,%r12), %edx
movl 0x14(%r14), %eax
subl %edx, %eax
movl %eax, 0x24(%rsp)
movl %eax, 0x4(%rsp)
movq %r14, %rdi
movl %r15d, %edx
callq 0x6060
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movl %r15d, %edx
callq 0x6060
movq %r14, %rdi
movq %rsp, %rsi
movl %r15d, %edx
callq 0x6060
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
movl %r15d, %edx
callq 0x6060
addq $0x10, %r13
cmpq $0x90, %r13
jne 0xcb56
xorl %r15d, %r15d
leaq 0x6f9e(%rip), %r12      # 0x13b90
leaq 0x20(%rsp), %r13
leaq (%r12,%r15), %rsi
movups (%r15,%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x20(%rsp)
movl 0x10(%r14), %eax
movl (%r15,%r12), %ecx
movl 0x4(%r15,%r12), %edx
addl 0x8(%r15,%r12), %ecx
subl %ecx, %eax
movl %eax, 0x20(%rsp)
movl %eax, 0x10(%rsp)
addl 0xc(%r15,%r12), %edx
movl 0x14(%r14), %eax
subl %edx, %eax
movl %eax, 0x24(%rsp)
movl %eax, 0x4(%rsp)
movq %r14, %rdi
movl %ebp, %edx
callq 0x6060
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x6060
movq %r14, %rdi
movq %rsp, %rsi
movl %ebp, %edx
callq 0x6060
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x6060
addq $0x10, %r15
cmpq $0x80, %r15
jne 0xcbf7
xorl %r13d, %r13d
leaq 0x6f85(%rip), %rbp      # 0x13c10
leaq 0x10(%rsp), %r15
movq %rsp, %r12
movups (%r13,%rbp), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x10(%r14), %eax
movl (%r13,%rbp), %ecx
movl 0x4(%r13,%rbp), %edx
addl 0x8(%r13,%rbp), %ecx
subl %ecx, %eax
movl %eax, (%rsp)
addl 0xc(%r13,%rbp), %edx
movl 0x14(%r14), %eax
subl %edx, %eax
movl %eax, 0x4(%rsp)
movl %eax, 0x14(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x6060
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x6060
addq $0x10, %r13
cmpq $0x70, %r13
jne 0xcc93
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq