#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*/ lfill(long, int /*<<< orphan*/, int /*<<< orphan*/, long,
                         long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  printf("Location and Shape Definitions :-\n\n");
  printf(
      "Location gives the co-ordinates of the center element of the shape\n");
  printf("The co-ordinates go from (0,0) on BOTTOM LEFT to (n-1,n-1) on TOP "
         "RIGHT\n\n");
  printf("Shape gives the orientation of the L shaped tile\n");
  printf("Shape 1 means proper L shape\n");
  printf("Shape 2 means upside down L shape\n");
  printf("Shape 3 means mirrored L shape\n");
  printf("Shape 4 means mirrored upside down L shape\n\n\n");
  long int n, x, y;
  printf("Enter the value of 'n' (must be a power of 2) : ");
  scanf("%ld", &n);
  printf("Enter the co-ordinates of the missing cell :-\n");
  printf("x : ");
  scanf("%ld", &x);
  printf("y : ");
  scanf("%ld", &y);
  lfill(n, 0, 0, x, y);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
call   1030 <printf@plt>
lea    0xf97(%rip),%rdi
call   1030 <printf@plt>
lea    0xfab(%rip),%rdi
call   1030 <printf@plt>
lea    0xfcd(%rip),%rdi
call   1030 <printf@plt>
lea    0xff2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xfe6(%rip),%rdi
call   1030 <printf@plt>
lea    0x1009(%rip),%rdi
call   1030 <printf@plt>
lea    0xfca(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xff2(%rip),%rdi
call   1030 <printf@plt>
lea    0xfae(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edx,%edx
mov    %edx,%esi
call   1050 <lfill@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xfca(%rip),%rdi
call   1030 <puts@plt>
lea    0xfdd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
lea    0xe79(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xfde(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%r8
xor    %esi,%esi
xor    %edx,%edx
call   1060 <lfill@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Location and Shape Definitions :-\0A\0A\00"
@.str.1 = [68 x i8] c"Location gives the co-ordinates of the center element of the shape\0A\00"
@.str.2 = [74 x i8] c"The co-ordinates go from (0,0) on BOTTOM LEFT to (n-1,n-1) on TOP RIGHT\0A\0A\00"
@.str.3 = [50 x i8] c"Shape gives the orientation of the L shaped tile\0A\00"
@.str.4 = [30 x i8] c"Shape 1 means proper L shape\0A\00"
@.str.5 = [35 x i8] c"Shape 2 means upside down L shape\0A\00"
@.str.6 = [32 x i8] c"Shape 3 means mirrored L shape\0A\00"
@.str.7 = [46 x i8] c"Shape 4 means mirrored upside down L shape\0A\0A\0A\00"
@.str.8 = [49 x i8] c"Enter the value of 'n' (must be a power of 2) : \00"
@.str.9 = [4 x i8] c"%ld\00"
@.str.10 = [47 x i8] c"Enter the co-ordinates of the missing cell :-\0A\00"
@.str.11 = [5 x i8] c"x : \00"
@.str.12 = [5 x i8] c"y : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %2)
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %3)
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %4)
%20 = load i64, i64* %2
%21 = load i64, i64* %3
%22 = load i64, i64* %4
%23 = call i32 @lfill(i64 %20, i32 0, i32 0, i64 %21, i64 %22)
ret i32 1
}

LLVM IR (-O2):
@.str.8 = [49 x i8] c"Enter the value of 'n' (must be a power of 2) : \00"
@.str.9 = [4 x i8] c"%ld\00"
@.str.11 = [5 x i8] c"x : \00"
@.str.12 = [5 x i8] c"y : \00"
@str = [35 x i8] c"Location and Shape Definitions :-\0A\00"
@str.13 = [67 x i8] c"Location gives the co-ordinates of the center element of the shape\00"
@str.14 = [73 x i8] c"The co-ordinates go from (0,0) on BOTTOM LEFT to (n-1,n-1) on TOP RIGHT\0A\00"
@str.15 = [49 x i8] c"Shape gives the orientation of the L shaped tile\00"
@str.16 = [29 x i8] c"Shape 1 means proper L shape\00"
@str.17 = [34 x i8] c"Shape 2 means upside down L shape\00"
@str.18 = [31 x i8] c"Shape 3 means mirrored L shape\00"
@str.19 = [45 x i8] c"Shape 4 means mirrored upside down L shape\0A\0A\00"
@str.20 = [46 x i8] c"Enter the co-ordinates of the missing cell :-\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.19, i64 0, i64 0))
%12 = bitcast i64* %1 to i8*
%13 = bitcast i64* %2 to i8*
%14 = bitcast i64* %3 to i8*
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %1)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.20, i64 0, i64 0))
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %2)
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64* %3)
%22 = load i64, i64* %1
%23 = load i64, i64* %2
%24 = load i64, i64* %3
%25 = call i32 @lfill(i64 %22, i32 0, i32 0, i64 %23, i64 %24)
ret i32 1
}