#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
void lfill(long int n, long int x, long int y, long int xf, long int yf) {
  if (n == 1)
    return;
  if (xf >= n / 2 && yf >= n / 2) {
    printf("Location : (%d,%d) and Shape : 1\n", x + n / 2 - 1, y + n / 2 - 1);
    lfill(n / 2, x, y, n / 2 - 1, n / 2 - 1);
    lfill(n / 2, x, y + n / 2, n / 2 - 1, 0);
    lfill(n / 2, x + n / 2, y, 0, n / 2 - 1);
    lfill(n / 2, x + n / 2, y + n / 2, xf - n / 2, yf - n / 2);
  } else if (xf >= n / 2 && yf < n / 2) {
    printf("Location : (%d,%d) and Shape : 2\n", x + n / 2 - 1, y + n / 2);
    lfill(n / 2, x, y, n / 2 - 1, n / 2 - 1);
    lfill(n / 2, x, y + n / 2, n / 2 - 1, 0);
    lfill(n / 2, x + n / 2, y, xf - n / 2, yf);
    lfill(n / 2, x + n / 2, y + n / 2, 0, 0);
  } else if (yf >= n / 2) {
    printf("Location : (%d,%d) and Shape : 3\n", x + n / 2, y + n / 2 - 1);
    lfill(n / 2, x, y, n / 2 - 1, n / 2 - 1);
    lfill(n / 2, x, y + n / 2, xf, yf - n / 2);
    lfill(n / 2, x + n / 2, y, 0, n / 2 - 1);
    lfill(n / 2, x + n / 2, y + n / 2, 0, 0);
  } else {
    printf("Location : (%d,%d) and Shape : 4\n", x + n / 2, y + n / 2);
    lfill(n / 2, x, y, xf, yf);
    lfill(n / 2, x, y + n / 2, n / 2 - 1, 0);
    lfill(n / 2, x + n / 2, y, 0, n / 2 - 1);
    lfill(n / 2, x + n / 2, y + n / 2, 0, 0);
  }
}


x86 assembly (clang, -O0):
<lfill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x1,-0x8(%rbp)
jne    114f <lfill+0x2f>
jmp    18d3 <lfill+0x7b3>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jl     1362 <lfill+0x242>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
jl     1362 <lfill+0x242>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
sub    $0x1,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x70(%rbp),%rdx
add    %rax,%rdx
sub    $0x1,%rdx
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    $0x2,%r8d
cqto
idiv   %r8
mov    -0x68(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
sub    $0x1,%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x50(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    $0x2,%r8d
cqto
idiv   %r8
sub    %rax,%rcx
mov    -0x28(%rbp),%r8
mov    -0x8(%rbp),%rax
mov    $0x2,%r9d
cqto
idiv   %r9
mov    -0x40(%rbp),%rdx
sub    %rax,%r8
call   1040 <lfill@plt>
jmp    18d3 <lfill+0x7b3>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
cmp    %rcx,%rax
jl     1567 <lfill+0x447>
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
cmp    %rcx,%rax
jge    1567 <lfill+0x447>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
sub    $0x1,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xb0(%rbp),%rdx
add    %rax,%rdx
lea    0xc31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    $0x2,%r8d
cqto
idiv   %r8
mov    -0xa8(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x98(%rbp),%rdx
mov    %rax,%rcx
sub    $0x1,%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    $0x2,%r8d
cqto
idiv   %r8
mov    -0x90(%rbp),%rdx
sub    %rax,%rcx
mov    -0x28(%rbp),%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x88(%rbp),%rdx
add    %rax,%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1040 <lfill@plt>
jmp    18ce <lfill+0x7ae>
mov    -0x28(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0xb8(%rbp),%rax
cmp    %rcx,%rax
jl     174b <lfill+0x62b>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xe8(%rbp),%rdx
add    %rax,%rdx
sub    $0x1,%rdx
lea    0xa6e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    $0x2,%r8d
cqto
idiv   %r8
mov    -0xe0(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0xd8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xd0(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x8(%rbp),%rax
mov    $0x2,%r9d
cqto
idiv   %r9
mov    -0xd0(%rbp),%rdx
sub    %rax,%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xc8(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xc0(%rbp),%rdx
add    %rax,%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1040 <lfill@plt>
jmp    18c9 <lfill+0x7a9>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x110(%rbp),%rdx
add    %rax,%rdx
lea    0x8dc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x108(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x100(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x100(%rbp),%rdx
mov    %rax,%rcx
sub    $0x1,%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xf8(%rbp),%rdx
mov    %rax,%r8
sub    $0x1,%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <lfill@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0xf0(%rbp),%rdx
add    %rax,%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1040 <lfill@plt>
jmp    18ce <lfill+0x7ae>
jmp    18d3 <lfill+0x7b3>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfill>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x1,%rdi
jne    1143 <lfill+0x23>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r8,%rbp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
jmp    11f1 <lfill+0xd1>
nopw   0x0(%rax,%rax,1)
lea    (%rbx,%r12,1),%rdx
mov    %rdx,0x8(%rsp)
lea    (%rbx,%r12,1),%rsi
add    $0xffffffffffffffff,%rsi
lea    (%r15,%rbx,1),%r14
lea    (%r15,%rbx,1),%rdx
add    $0xffffffffffffffff,%rdx
lea    0xe7c(%rip),%rdi
mov    %rcx,(%rsp)
call   1030 <printf@plt>
lea    -0x1(%rbx),%rbp
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%r12
mov    %r14,%rdx
mov    %rbp,%rcx
xor    %r8d,%r8d
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    (%rsp),%rcx
mov    %r14,%r15
mov    0x10(%rsp),%rax
and    $0xfffffffffffffffe,%rax
mov    %r13,%rbp
mov    %rcx,%r14
cmp    $0x2,%rax
je     1134 <lfill+0x14>
mov    %rbx,%rax
shr    $0x3f,%rbx
add    %rax,%rbx
sar    %rbx
sub    %rbx,%rcx
mov    %rax,0x10(%rsp)
jl     1214 <lfill+0xf4>
mov    %rbp,%r13
sub    %rbx,%r13
jge    1160 <lfill+0x40>
lea    (%rbx,%r12,1),%rcx
cmp    %rbx,%rbp
mov    %rcx,0x8(%rsp)
jge    12b0 <lfill+0x190>
mov    %r14,%rdx
sub    %rbx,%rdx
jl     12b0 <lfill+0x190>
lea    -0x1(%rcx),%rsi
lea    (%r15,%rbx,1),%r13
lea    0xde1(%rip),%rdi
mov    %rdx,(%rsp)
mov    %r13,%rdx
call   1030 <printf@plt>
lea    -0x1(%rbx),%r14
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r14,%r8
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%r12
mov    %r13,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    (%rsp),%rcx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    %r13,%r15
mov    0x10(%rsp),%rax
xor    %ecx,%ecx
xor    %r13d,%r13d
jmp    11dd <lfill+0xbd>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r15,%rbx,1),%rax
mov    %rbp,%r13
sub    %rbx,%r13
jge    131a <lfill+0x1fa>
lea    0xda3(%rip),%rdi
mov    %rcx,%rsi
mov    %rax,%r13
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %rbp,%r8
call   1040 <lfill@plt>
lea    -0x1(%rbx),%rbp
mov    %rbx,%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%r12
mov    %r13,%rdx
mov    %rbp,%rcx
xor    %r8d,%r8d
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    %r13,%r15
jmp    137e <lfill+0x25e>
mov    %rax,(%rsp)
mov    (%rsp),%rax
lea    -0x1(%rax),%rdx
lea    0xd17(%rip),%rdi
mov    %rcx,%rsi
call   1030 <printf@plt>
lea    -0x1(%rbx),%rbp
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%r12
mov    (%rsp),%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1040 <lfill@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %rbp,%r8
call   1040 <lfill@plt>
mov    (%rsp),%r15
xor    %ecx,%ecx
xor    %r13d,%r13d
jmp    11d8 <lfill+0xb8>

LLVM IR (-O0):
@.str = [34 x i8] c"Location : (%d,%d) and Shape : 1\0A\00"
@.str.1 = [34 x i8] c"Location : (%d,%d) and Shape : 2\0A\00"
@.str.2 = [34 x i8] c"Location : (%d,%d) and Shape : 3\0A\00"
@.str.3 = [34 x i8] c"Location : (%d,%d) and Shape : 4\0A\00"
define void @lfill(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %6
%12 = icmp eq i64 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %5
br label %253
14: ; preds = %5
%15 = load i64, i64* %9
%16 = load i64, i64* %6
%17 = sdiv i64 %16, 2
%18 = icmp sge i64 %15, %17
br i1 %18, label %19, label %84
19: ; preds = %14
%20 = load i64, i64* %10
%21 = load i64, i64* %6
%22 = sdiv i64 %21, 2
%23 = icmp sge i64 %20, %22
br i1 %23, label %24, label %84
24: ; preds = %19
%25 = load i64, i64* %7
%26 = load i64, i64* %6
%27 = sdiv i64 %26, 2
%28 = add nsw i64 %25, %27
%29 = sub nsw i64 %28, 1
%30 = load i64, i64* %8
%31 = load i64, i64* %6
%32 = sdiv i64 %31, 2
%33 = add nsw i64 %30, %32
%34 = sub nsw i64 %33, 1
%35 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %29, i64 %34)
%36 = load i64, i64* %6
%37 = sdiv i64 %36, 2
%38 = load i64, i64* %7
%39 = load i64, i64* %8
%40 = load i64, i64* %6
%41 = sdiv i64 %40, 2
%42 = sub nsw i64 %41, 1
%43 = load i64, i64* %6
%44 = sdiv i64 %43, 2
%45 = sub nsw i64 %44, 1
%46 = load i64, i64* %6
%47 = sdiv i64 %46, 2
%48 = load i64, i64* %7
%49 = load i64, i64* %8
%50 = load i64, i64* %6
%51 = sdiv i64 %50, 2
%52 = add nsw i64 %49, %51
%53 = load i64, i64* %6
%54 = sdiv i64 %53, 2
%55 = sub nsw i64 %54, 1
%56 = load i64, i64* %6
%57 = sdiv i64 %56, 2
%58 = load i64, i64* %7
%59 = load i64, i64* %6
%60 = sdiv i64 %59, 2
%61 = add nsw i64 %58, %60
%62 = load i64, i64* %8
%63 = load i64, i64* %6
%64 = sdiv i64 %63, 2
%65 = sub nsw i64 %64, 1
%66 = load i64, i64* %6
%67 = sdiv i64 %66, 2
%68 = load i64, i64* %7
%69 = load i64, i64* %6
%70 = sdiv i64 %69, 2
%71 = add nsw i64 %68, %70
%72 = load i64, i64* %8
%73 = load i64, i64* %6
%74 = sdiv i64 %73, 2
%75 = add nsw i64 %72, %74
%76 = load i64, i64* %9
%77 = load i64, i64* %6
%78 = sdiv i64 %77, 2
%79 = sub nsw i64 %76, %78
%80 = load i64, i64* %10
%81 = load i64, i64* %6
%82 = sdiv i64 %81, 2
%83 = sub nsw i64 %80, %82
br label %253
84: ; preds = %19, %14
%85 = load i64, i64* %9
%86 = load i64, i64* %6
%87 = sdiv i64 %86, 2
%88 = icmp sge i64 %85, %87
br i1 %88, label %89, label %147
89: ; preds = %84
%90 = load i64, i64* %10
%91 = load i64, i64* %6
%92 = sdiv i64 %91, 2
%93 = icmp slt i64 %90, %92
br i1 %93, label %94, label %147
94: ; preds = %89
%95 = load i64, i64* %7
%96 = load i64, i64* %6
%97 = sdiv i64 %96, 2
%98 = add nsw i64 %95, %97
%99 = sub nsw i64 %98, 1
%100 = load i64, i64* %8
%101 = load i64, i64* %6
%102 = sdiv i64 %101, 2
%103 = add nsw i64 %100, %102
%104 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %99, i64 %103)
%105 = load i64, i64* %6
%106 = sdiv i64 %105, 2
%107 = load i64, i64* %7
%108 = load i64, i64* %8
%109 = load i64, i64* %6
%110 = sdiv i64 %109, 2
%111 = sub nsw i64 %110, 1
%112 = load i64, i64* %6
%113 = sdiv i64 %112, 2
%114 = sub nsw i64 %113, 1
%115 = load i64, i64* %6
%116 = sdiv i64 %115, 2
%117 = load i64, i64* %7
%118 = load i64, i64* %8
%119 = load i64, i64* %6
%120 = sdiv i64 %119, 2
%121 = add nsw i64 %118, %120
%122 = load i64, i64* %6
%123 = sdiv i64 %122, 2
%124 = sub nsw i64 %123, 1
%125 = load i64, i64* %6
%126 = sdiv i64 %125, 2
%127 = load i64, i64* %7
%128 = load i64, i64* %6
%129 = sdiv i64 %128, 2
%130 = add nsw i64 %127, %129
%131 = load i64, i64* %8
%132 = load i64, i64* %9
%133 = load i64, i64* %6
%134 = sdiv i64 %133, 2
%135 = sub nsw i64 %132, %134
%136 = load i64, i64* %10
%137 = load i64, i64* %6
%138 = sdiv i64 %137, 2
%139 = load i64, i64* %7
%140 = load i64, i64* %6
%141 = sdiv i64 %140, 2
%142 = add nsw i64 %139, %141
%143 = load i64, i64* %8
%144 = load i64, i64* %6
%145 = sdiv i64 %144, 2
%146 = add nsw i64 %143, %145
br label %252
147: ; preds = %89, %84
%148 = load i64, i64* %10
%149 = load i64, i64* %6
%150 = sdiv i64 %149, 2
%151 = icmp sge i64 %148, %150
br i1 %151, label %152, label %205
152: ; preds = %147
%153 = load i64, i64* %7
%154 = load i64, i64* %6
%155 = sdiv i64 %154, 2
%156 = add nsw i64 %153, %155
%157 = load i64, i64* %8
%158 = load i64, i64* %6
%159 = sdiv i64 %158, 2
%160 = add nsw i64 %157, %159
%161 = sub nsw i64 %160, 1
%162 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %156, i64 %161)
%163 = load i64, i64* %6
%164 = sdiv i64 %163, 2
%165 = load i64, i64* %7
%166 = load i64, i64* %8
%167 = load i64, i64* %6
%168 = sdiv i64 %167, 2
%169 = sub nsw i64 %168, 1
%170 = load i64, i64* %6
%171 = sdiv i64 %170, 2
%172 = sub nsw i64 %171, 1
%173 = load i64, i64* %6
%174 = sdiv i64 %173, 2
%175 = load i64, i64* %7
%176 = load i64, i64* %8
%177 = load i64, i64* %6
%178 = sdiv i64 %177, 2
%179 = add nsw i64 %176, %178
%180 = load i64, i64* %9
%181 = load i64, i64* %10
%182 = load i64, i64* %6
%183 = sdiv i64 %182, 2
%184 = sub nsw i64 %181, %183
%185 = load i64, i64* %6
%186 = sdiv i64 %185, 2
%187 = load i64, i64* %7
%188 = load i64, i64* %6
%189 = sdiv i64 %188, 2
%190 = add nsw i64 %187, %189
%191 = load i64, i64* %8
%192 = load i64, i64* %6
%193 = sdiv i64 %192, 2
%194 = sub nsw i64 %193, 1
%195 = load i64, i64* %6
%196 = sdiv i64 %195, 2
%197 = load i64, i64* %7
%198 = load i64, i64* %6
%199 = sdiv i64 %198, 2
%200 = add nsw i64 %197, %199
%201 = load i64, i64* %8
%202 = load i64, i64* %6
%203 = sdiv i64 %202, 2
%204 = add nsw i64 %201, %203
br label %251
205: ; preds = %147
%206 = load i64, i64* %7
%207 = load i64, i64* %6
%208 = sdiv i64 %207, 2
%209 = add nsw i64 %206, %208
%210 = load i64, i64* %8
%211 = load i64, i64* %6
%212 = sdiv i64 %211, 2
%213 = add nsw i64 %210, %212
%214 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %209, i64 %213)
%215 = load i64, i64* %6
%216 = sdiv i64 %215, 2
%217 = load i64, i64* %7
%218 = load i64, i64* %8
%219 = load i64, i64* %9
%220 = load i64, i64* %10
%221 = load i64, i64* %6
%222 = sdiv i64 %221, 2
%223 = load i64, i64* %7
%224 = load i64, i64* %8
%225 = load i64, i64* %6
%226 = sdiv i64 %225, 2
%227 = add nsw i64 %224, %226
%228 = load i64, i64* %6
%229 = sdiv i64 %228, 2
%230 = sub nsw i64 %229, 1
%231 = load i64, i64* %6
%232 = sdiv i64 %231, 2
%233 = load i64, i64* %7
%234 = load i64, i64* %6
%235 = sdiv i64 %234, 2
%236 = add nsw i64 %233, %235
%237 = load i64, i64* %8
%238 = load i64, i64* %6
%239 = sdiv i64 %238, 2
%240 = sub nsw i64 %239, 1
%241 = load i64, i64* %6
%242 = sdiv i64 %241, 2
%243 = load i64, i64* %7
%244 = load i64, i64* %6
%245 = sdiv i64 %244, 2
%246 = add nsw i64 %243, %245
%247 = load i64, i64* %8
%248 = load i64, i64* %6
%249 = sdiv i64 %248, 2
%250 = add nsw i64 %247, %249
br label %251
251: ; preds = %205, %152
br label %252
252: ; preds = %251, %94
br label %253
253: ; preds = %13, %252, %24
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Location : (%d,%d) and Shape : 1\0A\00"
@.str.1 = [34 x i8] c"Location : (%d,%d) and Shape : 2\0A\00"
@.str.2 = [34 x i8] c"Location : (%d,%d) and Shape : 3\0A\00"
@.str.3 = [34 x i8] c"Location : (%d,%d) and Shape : 4\0A\00"
define void @lfill(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = icmp eq i64 %0, 1
br i1 %6, label %53, label %7
7: ; preds = %5, %26
%8 = phi i64 [ %30, %26 ], [ %4, %5 ]
%9 = phi i64 [ %29, %26 ], [ %3, %5 ]
%10 = phi i64 [ %28, %26 ], [ %2, %5 ]
%11 = phi i64 [ %27, %26 ], [ %1, %5 ]
%12 = phi i64 [ %13, %26 ], [ %0, %5 ]
%13 = sdiv i64 %12, 2
%14 = icmp slt i64 %9, %13
%15 = icmp slt i64 %8, %13
%16 = or i1 %14, %15
br i1 %16, label %33, label %17
17: ; preds = %7
%18 = add nsw i64 %13, %11
%19 = add nsw i64 %18, -1
%20 = add nsw i64 %10, %13
%21 = add nsw i64 %20, -1
%22 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %19, i64 %21)
%23 = add nsw i64 %13, -1
tail call void @lfill(i64 %13, i64 %11, i64 %10, i64 %23, i64 %23)
tail call void @lfill(i64 %13, i64 %11, i64 %20, i64 %23, i64 0)
tail call void @lfill(i64 %13, i64 %18, i64 %10, i64 0, i64 %23)
%24 = sub nsw i64 %9, %13
%25 = sub nsw i64 %8, %13
br label %26
26: ; preds = %17, %37, %45, %50
%27 = phi i64 [ %18, %17 ], [ %36, %37 ], [ %36, %45 ], [ %36, %50 ]
%28 = phi i64 [ %20, %17 ], [ %39, %37 ], [ %44, %45 ], [ %44, %50 ]
%29 = phi i64 [ %24, %17 ], [ 0, %37 ], [ 0, %45 ], [ 0, %50 ]
%30 = phi i64 [ %25, %17 ], [ 0, %37 ], [ 0, %45 ], [ 0, %50 ]
%31 = and i64 %12, -2
%32 = icmp eq i64 %31, 2
br i1 %32, label %53, label %7
33: ; preds = %7
%34 = xor i1 %14, true
%35 = and i1 %15, %34
%36 = add nsw i64 %13, %11
br i1 %35, label %37, label %43
37: ; preds = %33
%38 = add nsw i64 %36, -1
%39 = add nsw i64 %10, %13
%40 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %38, i64 %39)
%41 = add nsw i64 %13, -1
tail call void @lfill(i64 %13, i64 %11, i64 %10, i64 %41, i64 %41)
tail call void @lfill(i64 %13, i64 %11, i64 %39, i64 %41, i64 0)
%42 = sub nsw i64 %9, %13
tail call void @lfill(i64 %13, i64 %36, i64 %10, i64 %42, i64 %8)
br label %26
43: ; preds = %33
%44 = add nsw i64 %10, %13
br i1 %15, label %50, label %45
45: ; preds = %43
%46 = add nsw i64 %44, -1
%47 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %36, i64 %46)
%48 = add nsw i64 %13, -1
tail call void @lfill(i64 %13, i64 %11, i64 %10, i64 %48, i64 %48)
%49 = sub nsw i64 %8, %13
tail call void @lfill(i64 %13, i64 %11, i64 %44, i64 %9, i64 %49)
tail call void @lfill(i64 %13, i64 %36, i64 %10, i64 0, i64 %48)
br label %26
50: ; preds = %43
%51 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %36, i64 %44)
tail call void @lfill(i64 %13, i64 %11, i64 %10, i64 %9, i64 %8)
%52 = add nsw i64 %13, -1
tail call void @lfill(i64 %13, i64 %11, i64 %44, i64 %52, i64 0)
tail call void @lfill(i64 %13, i64 %36, i64 %10, i64 0, i64 %52)
br label %26
53: ; preds = %26, %5
ret void
}