#include <stdio.h>
#include <stdlib.h>

struct object {
    int val;
    int index;
};

static int compare(const void *a, const void *b) {
    return ((struct object *) a)->val - ((struct object *) b)->val;
}

int * twosum(int *nums, int numsSize, int target, int *returnSize) {
    int i, j;
    struct object *objs = malloc(numsSize * sizeof(*objs));
    for (i = 0; i < numsSize; i++) {
        objs[i].val = nums[i];
        objs[i].index = i;
    }
    qsort(objs, numsSize, sizeof(*objs), compare);

    int *results = malloc(2 * sizeof(int));
    i = 0;
    j = numsSize - 1;
    while (i < j) {
        int sum = objs[i].val + objs[j].val;
        if (sum < target) {
            i++;
        } else if (sum > target) {
            j--;
        } else {
            results[0] = objs[i].index;
            results[1] = objs[j].index;
            *returnSize = 2;
            return results;
        }
    }
    return NULL;
}

int main() {
    int nums0[] = {2, 7, 11, 15};
    int target0 = 9;

    int nums1[] = {3, 2, 4};
    int target1 = 6;

    int nums2[] = {3, 3};
    int target2 = 6;

    int returnSize0;
    int *result0 = twosum(nums0, 4, target0, &returnSize0);

    int returnSize1;
    int *result1 = twosum(nums1, 3, target1, &returnSize1);

    int returnSize2;
    int *result2 = twosum(nums2, 2, target2, &returnSize2);

    if (result0[0] == 0 && result0[1] == 1
        && result1[0] == 1&& result1[1] == 2
        && result2[0] == 0 && result2[1] == 1) {
        printf("<<<FUNCTION SUCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    if (result0 != NULL) {
        free(result0);
    }
    if (result1 != NULL) {
        free(result1);
    }
    if (result2 != NULL) {
        free(result2);
    }
    return 0;
}

	.text
compare:
	pushq	%rbp
	movq	%rsp, %rbp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movl	%edx, %eax
	popq	%rbp
	ret
	.globl	twosum
twosum:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movq	%rcx, -56(%rbp)
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L5
	movl	-44(%rbp), %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$8, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	$0, -4(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L6
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jge	.L7
	addl	$1, -4(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jle	.L8
	subl	$1, -8(%rbp)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	addq	$4, %rdx
	movl	4(%rax), %eax
	movl	%eax, (%rdx)
	movq	-56(%rbp), %rax
	movl	$2, (%rax)
	movq	-24(%rbp), %rax
	jmp	.L9
.L6:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	movl	$0, %eax
.L9:
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$96, %rsp
	movl	$2, -64(%rbp)
	movl	$7, -60(%rbp)
	movl	$11, -56(%rbp)
	movl	$15, -52(%rbp)
	movl	$9, -4(%rbp)
	movl	$3, -76(%rbp)
	movl	$2, -72(%rbp)
	movl	$4, -68(%rbp)
	movl	$6, -8(%rbp)
	movl	$3, -84(%rbp)
	movl	$3, -80(%rbp)
	movl	$6, -12(%rbp)
	leaq	-88(%rbp), %rcx
	movl	-4(%rbp), %edx
	leaq	-64(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	twosum
	movq	%rax, -24(%rbp)
	leaq	-92(%rbp), %rcx
	movl	-8(%rbp), %edx
	leaq	-76(%rbp), %rax
	movl	$3, %esi
	movq	%rax, %rdi
	call	twosum
	movq	%rax, -32(%rbp)
	leaq	-96(%rbp), %rcx
	movl	-12(%rbp), %edx
	leaq	-84(%rbp), %rax
	movl	$2, %esi
	movq	%rax, %rdi
	call	twosum
	movq	%rax, -40(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L12
	movq	-24(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movq	-32(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	$2, %eax
	jne	.L12
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L12
	movq	-40(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	cmpq	$0, -24(%rbp)
	je	.L14
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L14:
	cmpq	$0, -32(%rbp)
	je	.L15
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L15:
	cmpq	$0, -40(%rbp)
	je	.L16
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L16:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdbool.h>

bool isPalindrome(int x) {
    if (x < 0) return false;

    int t = x;
    int mask = 1;
    while (t >= 10) {
        mask *= 10;
        t /= 10;
    }

    int l, r;
    while (x) {
        r = x % 10;
        l = x / mask;
        if (l != r) return false;
        x = (x % mask) / 10;
        mask /= 100;
    }

    return true;
}

int main() {
    int x0 = 121;
    int x1 = -121;
    int x2 = 10;

    if (isPalindrome(x0) == true && isPalindrome(x1) == false && isPalindrome(x2) == false) {
        printf("<<<FUNCTION SUCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	isPalindrome
isPalindrome:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	%edi, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jns	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	movl	%edx, %ecx
	sarl	$2, %ecx
	cltd
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
.L4:
	cmpl	$9, -4(%rbp)
	jg	.L5
	jmp	.L6
.L8:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	movl	%eax, %ecx
	sarl	$2, %ecx
	movl	%edx, %eax
	sarl	$31, %eax
	subl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -12(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	je	.L7
	movl	$0, %eax
	jmp	.L3
.L7:
	movl	-20(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	movl	%edx, %ecx
	sarl	$2, %ecx
	cltd
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	movl	%edx, %ecx
	sarl	$5, %ecx
	cltd
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -8(%rbp)
.L6:
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	$1, %eax
.L3:
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$16, %rsp
	movl	$121, -4(%rbp)
	movl	$-121, -8(%rbp)
	movl	$10, -12(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isPalindrome
	testb	%al, %al
	je	.L10
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	isPalindrome
	xorl	$1, %eax
	testb	%al, %al
	je	.L10
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	isPalindrome
	xorl	$1, %eax
	testb	%al, %al
	je	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L11
.L10:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L11:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


	.text
	.globl	isValidSudoku
isValidSudoku:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$216, %rsp
	movq	%rdi, -312(%rbp)
	movl	%esi, -316(%rbp)
	movq	%rdx, -328(%rbp)
	leaq	-112(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	leaq	-208(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	leaq	-304(%rbp), %rdx
	movl	$0, %eax
	movl	$10, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	movl	$0, -4(%rbp)
	jmp	.L2
.L9:
	movl	$0, -8(%rbp)
	jmp	.L3
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-312(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L4
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-312(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$49, %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	addl	%eax, %eax
	leal	(%rax,%rdx), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	leal	(%rcx,%rdx), %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$208, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$304, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L6
.L5:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$304, %rax
	movb	$1, (%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$304, %rax
	movzbl	(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rsi, %rax
	subq	$208, %rax
	movb	%cl, (%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$208, %rax
	movzbl	(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rsi, %rax
	subq	$112, %rax
	movb	%cl, (%rax)
.L4:
	addl	$1, -8(%rbp)
.L3:
	cmpl	$8, -8(%rbp)
	jle	.L8
	addl	$1, -4(%rbp)
.L2:
	cmpl	$8, -4(%rbp)
	jle	.L9
	movl	$1, %eax
.L10:
	leave
	ret
	.section	.rodata
.LC0:
	.string	"53..7...."
.LC1:
	.string	"6..195..."
.LC2:
	.string	".98....6."
.LC3:
	.string	"8...6...3"
.LC4:
	.string	"4..8.3..1"
.LC5:
	.string	"7...2...6"
.LC6:
	.string	".6....28."
.LC7:
	.string	"...419..5"
.LC8:
	.string	"....8..79"
.LC9:
	.string	"83..7...."
.LC10:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC11:
	.string	"<<<FUNCTION FAILURE>>>"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$208, %rsp
	leaq	.LC0(%rip), %rax
	movq	%rax, -80(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -72(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -64(%rbp)
	leaq	.LC3(%rip), %rax
	movq	%rax, -56(%rbp)
	leaq	.LC4(%rip), %rax
	movq	%rax, -48(%rbp)
	leaq	.LC5(%rip), %rax
	movq	%rax, -40(%rbp)
	leaq	.LC6(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	.LC7(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	.LC8(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	.LC9(%rip), %rax
	movq	%rax, -160(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -152(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -144(%rbp)
	leaq	.LC3(%rip), %rax
	movq	%rax, -136(%rbp)
	leaq	.LC4(%rip), %rax
	movq	%rax, -128(%rbp)
	leaq	.LC5(%rip), %rax
	movq	%rax, -120(%rbp)
	leaq	.LC6(%rip), %rax
	movq	%rax, -112(%rbp)
	leaq	.LC7(%rip), %rax
	movq	%rax, -104(%rbp)
	leaq	.LC8(%rip), %rax
	movq	%rax, -96(%rbp)
	movl	$9, -208(%rbp)
	movl	$9, -204(%rbp)
	movl	$9, -200(%rbp)
	movl	$9, -196(%rbp)
	movl	$9, -192(%rbp)
	movl	$9, -188(%rbp)
	movl	$9, -184(%rbp)
	movl	$9, -180(%rbp)
	movl	$9, -176(%rbp)
	leaq	-208(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movl	$9, %esi
	movq	%rax, %rdi
	call	isValidSudoku
	movb	%al, -1(%rbp)
	leaq	-208(%rbp), %rdx
	leaq	-160(%rbp), %rax
	movl	$9, %esi
	movq	%rax, %rdi
	call	isValidSudoku
	movb	%al, -2(%rbp)
	cmpb	$0, -1(%rbp)
	je	.L12
	movzbl	-2(%rbp), %eax
	xorl	$1, %eax
	testb	%al, %al
	je	.L12
	leaq	.LC10(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC11(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char* toLowerCase(char* s) {
    for(int i=0; i<strlen(s); i++) {
        if(s[i] >= 65 && s[i] <= 90) {
             s[i] += 32;
        }
    }
    return s;
}

int main() {
    char str0[] = "Hello";
    char str1[] = "here";
    char str2[] = "LOVELY";

    if (strcmp(toLowerCase(str0), "hello") == 0 &&
        strcmp(toLowerCase(str1), "here") == 0 &&
        strcmp(toLowerCase(str2), "lovely") == 0) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	toLowerCase
toLowerCase:
	pushq	%rbp
	movq	%rsp, %rbp
	pushq	%rbx
	subq	$40, %rsp
	movq	%rdi, -40(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$64, %al
	jle	.L3
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$90, %al
	jg	.L3
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	leal	32(%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movb	%dl, (%rax)
.L3:
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	movslq	%eax, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L4
	movq	-40(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	ret
	.section	.rodata
.LC0:
	.string	"hello"
.LC1:
	.string	"here"
.LC2:
	.string	"lovely"
.LC3:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC4:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$32, %rsp
	movl	$1819043144, -6(%rbp)
	movw	$111, -2(%rbp)
	movl	$1701995880, -11(%rbp)
	movb	$0, -7(%rbp)
	movl	$1163284300, -18(%rbp)
	movl	$5852229, -15(%rbp)
	leaq	-6(%rbp), %rax
	movq	%rax, %rdi
	call	toLowerCase
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	leaq	-11(%rbp), %rax
	movq	%rax, %rdi
	call	toLowerCase
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	leaq	-18(%rbp), %rax
	movq	%rax, %rdi
	call	toLowerCase
	movq	%rax, %rdx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>

bool isValid(char * s) {
    char stack[strlen(s)];
    int top = -1;

    for (int i = 0; s[i] != '\0'; i++) {
        if (s[i] == '(' || s[i] == '{' || s[i] == '[') {
            stack[++top] = s[i]; // Push opening bracket
        } else {
            if (top == -1 ||
               (s[i] == ')' && stack[top] != '(') ||
               (s[i] == '}' && stack[top] != '{') ||
               (s[i] == ']' && stack[top] != '[')) {
                return false; // Invalid if no match
            }
            top--; // Pop the matching opening bracket
        }
    }
    return top == -1; // Valid if stack is empty
}

int main() {
    char* test1 = "()";
    if(!isValid(test1)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char* test2 = "()[]{}";
    if(!isValid(test2)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char* test3 = "(]";
    if(isValid(test3)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char* test4 = "([)]";
    if(isValid(test4)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char* test5 = "{[]}";
    if(!isValid(test5)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    printf("<<<FUNCTION SUCCESS>>>\n");
    return 0;
}

	.text
	.globl	isValid
isValid:
	pushq	%rbp
	movq	%rsp, %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	movq	%rdi, -88(%rbp)
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	-88(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	subq	$1, %rdx
	movq	%rdx, -64(%rbp)
	movq	%rax, %r14
	movl	$0, %r15d
	movq	%rax, %r12
	movl	$0, %r13d
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -72(%rbp)
	movl	$-1, -52(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L2
.L11:
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$40, %al
	je	.L3
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$123, %al
	je	.L3
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$91, %al
	jne	.L4
.L3:
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	addl	$1, -52(%rbp)
	movzbl	(%rax), %ecx
	movq	-72(%rbp), %rdx
	movl	-52(%rbp), %eax
	cltq
	movb	%cl, (%rdx,%rax)
	jmp	.L5
.L4:
	cmpl	$-1, -52(%rbp)
	je	.L6
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$41, %al
	jne	.L7
	movq	-72(%rbp), %rdx
	movl	-52(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$40, %al
	jne	.L6
.L7:
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$125, %al
	jne	.L8
	movq	-72(%rbp), %rdx
	movl	-52(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$123, %al
	jne	.L6
.L8:
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$93, %al
	jne	.L9
	movq	-72(%rbp), %rdx
	movl	-52(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$91, %al
	je	.L9
.L6:
	movl	$0, %eax
	jmp	.L10
.L9:
	subl	$1, -52(%rbp)
.L5:
	addl	$1, -56(%rbp)
.L2:
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L11
	cmpl	$-1, -52(%rbp)
	sete	%al
.L10:
	movq	%rbx, %rsp
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"()"
.LC1:
	.string	"<<<FUNCTION FAILURE>>>"
.LC2:
	.string	"()[]{}"
.LC3:
	.string	"(]"
.LC4:
	.string	"([)]"
.LC5:
	.string	"{[]}"
.LC6:
	.string	"<<<FUNCTION SUCCESS>>>"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$48, %rsp
	leaq	.LC0(%rip), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	isValid
	xorl	$1, %eax
	testb	%al, %al
	je	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	isValid
	xorl	$1, %eax
	testb	%al, %al
	je	.L16
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L15
.L16:
	leaq	.LC3(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	isValid
	testb	%al, %al
	je	.L17
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L15
.L17:
	leaq	.LC4(%rip), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	isValid
	testb	%al, %al
	je	.L18
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L15
.L18:
	leaq	.LC5(%rip), %rax
	movq	%rax, -40(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	isValid
	xorl	$1, %eax
	testb	%al, %al
	je	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L15
.L19:
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L15:
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int calPoints(char** operations, int operationsSize) {
    int *record = (int *) malloc(sizeof(int)*operationsSize);
    int s = 0, index = 0;
    for (int i = 0; i < operationsSize; i++) {
        if (strcmp(operations[i],"C") == 0) {
            record[index-1] = 0;
            index--;
        }
        else if (strcmp(operations[i],"D") == 0){
            record[index++] = record[index-1] * 2;
        }
        else if (strcmp(operations[i],"+") == 0){
            record[index++] = record[index - 1] + record[index - 2];
        }
        else{
            record[index++] = atoi(operations[i]);
        }
    }
    for (int i = 0; i < index; i++){
        s += record[i];
    }
    return s;
}

int main() {
    char *ops0[] = {"5", "2", "C", "D", "+"};
    char *ops1[] = {"5", "-2", "4", "C", "D", "9", "+", "+"};
    char *ops2[] = {"1", "C"};
    if (calPoints(ops0, 5) == 30 && calPoints(ops1, 8) == 27 && calPoints(ops2, 2) == 0) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.section	.rodata
.LC0:
	.string	"C"
.LC1:
	.string	"D"
.LC2:
	.string	"+"
	.text
	.globl	calPoints
calPoints:
	pushq	%rbp
	movq	%rsp, %rbp
	pushq	%rbx
	subq	$56, %rsp
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	-60(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L7:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	.LC0(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	subl	$1, -24(%rbp)
	jmp	.L4
.L3:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	leal	(%rcx,%rcx), %edx
	movl	%edx, (%rax)
	jmp	.L4
.L5:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	leaq	.LC2(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %esi
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	leal	(%rsi,%rcx), %edx
	movl	%edx, (%rax)
	jmp	.L4
.L6:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-40(%rbp), %rax
	leaq	(%rcx,%rax), %rbx
	movq	%rdx, %rdi
	call	atoi@PLT
	movl	%eax, (%rbx)
.L4:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L9:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -20(%rbp)
	addl	$1, -32(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	movl	-20(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	ret
	.section	.rodata
.LC3:
	.string	"5"
.LC4:
	.string	"2"
.LC5:
	.string	"-2"
.LC6:
	.string	"4"
.LC7:
	.string	"9"
.LC8:
	.string	"1"
.LC9:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC10:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	addq	$-128, %rsp
	leaq	.LC3(%rip), %rax
	movq	%rax, -48(%rbp)
	leaq	.LC4(%rip), %rax
	movq	%rax, -40(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	.LC3(%rip), %rax
	movq	%rax, -112(%rbp)
	leaq	.LC5(%rip), %rax
	movq	%rax, -104(%rbp)
	leaq	.LC6(%rip), %rax
	movq	%rax, -96(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, -88(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -80(%rbp)
	leaq	.LC7(%rip), %rax
	movq	%rax, -72(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -64(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -56(%rbp)
	leaq	.LC8(%rip), %rax
	movq	%rax, -128(%rbp)
	leaq	.LC0(%rip), %rax
	movq	%rax, -120(%rbp)
	leaq	-48(%rbp), %rax
	movl	$5, %esi
	movq	%rax, %rdi
	call	calPoints
	cmpl	$30, %eax
	jne	.L12
	leaq	-112(%rbp), %rax
	movl	$8, %esi
	movq	%rax, %rdi
	call	calPoints
	cmpl	$27, %eax
	jne	.L12
	leaq	-128(%rbp), %rax
	movl	$2, %esi
	movq	%rax, %rdi
	call	calPoints
	testl	%eax, %eax
	jne	.L12
	leaq	.LC9(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L13
.L12:
	leaq	.LC10(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L13:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdbool.h>
#include <string.h>
#include <stdio.h>

bool isAnagram(char * s, char * t){
    int len_s = strlen(s);
    int len_t = strlen(t);
    if (len_s != len_t) return false;

    int counts[26] = {0};
    for (int i = 0; i < len_s; i++) {
        counts[s[i] - 'a']++;
        counts[t[i] - 'a']--;
    }

    for (int i = 0; i < 26; i++) {
        if (counts[i] != 0) return false;
    }
    return true;
}

int main() {
    char s1[] = "anagram";
    char t1[] = "nagaram";
    if (!isAnagram(s1, t1)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char s2[] = "rat";
    char t2[] = "car";
    if (isAnagram(s2, t2)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    printf("<<<FUNCTION SUCCESS>>>\n");
    return 0;
}

	.text
	.globl	isAnagram
isAnagram:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$144, %rsp
	movq	%rdi, -136(%rbp)
	movq	%rsi, -144(%rbp)
	movq	-136(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	je	.L2
	movl	$0, %eax
	jmp	.L9
.L2:
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$13, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-128(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-144(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movslq	%eax, %rdx
	movl	-128(%rbp,%rdx,4), %edx
	subl	$1, %edx
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L5
	movl	$0, -8(%rbp)
	jmp	.L6
.L8:
	movl	-8(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L7
	movl	$0, %eax
	jmp	.L9
.L7:
	addl	$1, -8(%rbp)
.L6:
	cmpl	$25, -8(%rbp)
	jle	.L8
	movl	$1, %eax
.L9:
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION FAILURE>>>"
.LC1:
	.string	"<<<FUNCTION SUCCESS>>>"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$32, %rsp
	movabsq	$30787916450066017, %rax
	movq	%rax, -8(%rbp)
	movabsq	$30787916349792622, %rax
	movq	%rax, -16(%rbp)
	leaq	-16(%rbp), %rdx
	leaq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isAnagram
	xorl	$1, %eax
	testb	%al, %al
	je	.L11
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L14
.L11:
	movl	$7627122, -20(%rbp)
	movl	$7496035, -24(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isAnagram
	testb	%al, %al
	je	.L13
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L14:
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdbool.h>

bool threeConsecutiveOdds(int* arr, int arrSize) {
    for (int i = 0; i < arrSize - 2; i++) {
        if (arr[i] % 2 != 0 && arr[i + 1] % 2 != 0 && arr[i + 2] % 2 != 0) {
            return true;
        }
    }
    return false;
}

int main() {
    int arr1[] = {2, 6, 4, 1};
    int arr2[] = {1, 2, 34, 3, 4, 5, 7, 23, 12};
    int arr3[] = {1, 2, 3, 4};

    if (threeConsecutiveOdds(arr1, 4) == false &&
        threeConsecutiveOdds(arr2, 9) == true &&
        threeConsecutiveOdds(arr3, 4) == false) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	threeConsecutiveOdds
threeConsecutiveOdds:
	pushq	%rbp
	movq	%rsp, %rbp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-4(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-28(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
	movl	$0, %eax
.L4:
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$80, %rsp
	movl	$2, -16(%rbp)
	movl	$6, -12(%rbp)
	movl	$4, -8(%rbp)
	movl	$1, -4(%rbp)
	movl	$1, -64(%rbp)
	movl	$2, -60(%rbp)
	movl	$34, -56(%rbp)
	movl	$3, -52(%rbp)
	movl	$4, -48(%rbp)
	movl	$5, -44(%rbp)
	movl	$7, -40(%rbp)
	movl	$23, -36(%rbp)
	movl	$12, -32(%rbp)
	movl	$1, -80(%rbp)
	movl	$2, -76(%rbp)
	movl	$3, -72(%rbp)
	movl	$4, -68(%rbp)
	leaq	-16(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	threeConsecutiveOdds
	xorl	$1, %eax
	testb	%al, %al
	je	.L7
	leaq	-64(%rbp), %rax
	movl	$9, %esi
	movq	%rax, %rdi
	call	threeConsecutiveOdds
	testb	%al, %al
	je	.L7
	leaq	-80(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	threeConsecutiveOdds
	xorl	$1, %eax
	testb	%al, %al
	je	.L7
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>

void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n){
    int i = m - 1;
    int j = n -1;

    while (i>=0 && j>=0) {
        if(nums1[i] > nums2[j]) {
            nums1[i + j + 1] = nums1[i];
            i--;
        } else {
            nums1[i + j + 1] = nums2[j];
            j--;
        }
    }

    while (j >= 0) {
        nums1[i + j + 1] = nums2[j];
        j--;
    }
}

int main() {
    int nums1[10] = {1, 3, 5, 7, 9};
    int nums2[5] = {2, 4, 6, 8, 10};
    merge(nums1, 10, 5, nums2, 5, 5);

    int expected[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    int success = 1;
    for (int i = 0; i < 10; i++) {
        if (nums1[i] != expected[i]) {
            success = 0;
            break;
        }
    }

    if (success) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf("<<<FUNCTION FAILURE>>>\n");
    }

    return 0;
}

	.text
	.globl	merge
merge:
	pushq	%rbp
	movq	%rsp, %rbp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	%r8d, -44(%rbp)
	movl	%r9d, -48(%rbp)
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-48(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -8(%rbp)
.L2:
	cmpl	$0, -4(%rbp)
	js	.L6
	cmpl	$0, -8(%rbp)
	jns	.L5
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -8(%rbp)
.L6:
	cmpl	$0, -8(%rbp)
	jns	.L7
	nop
	nop
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	"<<<FUNCTION FAILURE>>>"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	addq	$-128, %rsp
	pxor	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -32(%rbp)
	movq	%xmm0, -16(%rbp)
	movl	$1, -48(%rbp)
	movl	$3, -44(%rbp)
	movl	$5, -40(%rbp)
	movl	$7, -36(%rbp)
	movl	$9, -32(%rbp)
	movl	$2, -80(%rbp)
	movl	$4, -76(%rbp)
	movl	$6, -72(%rbp)
	movl	$8, -68(%rbp)
	movl	$10, -64(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movl	$5, %r9d
	movl	$5, %r8d
	movq	%rdx, %rcx
	movl	$5, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	merge
	movl	$1, -128(%rbp)
	movl	$2, -124(%rbp)
	movl	$3, -120(%rbp)
	movl	$4, -116(%rbp)
	movl	$5, -112(%rbp)
	movl	$6, -108(%rbp)
	movl	$7, -104(%rbp)
	movl	$8, -100(%rbp)
	movl	$9, -96(%rbp)
	movl	$10, -92(%rbp)
	movl	$1, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L9
.L12:
	movl	-8(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-8(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L10
	movl	$0, -4(%rbp)
	jmp	.L11
.L10:
	addl	$1, -8(%rbp)
.L9:
	cmpl	$9, -8(%rbp)
	jle	.L12
.L11:
	cmpl	$0, -4(%rbp)
	je	.L13
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L14:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdlib.h>

int addDigits(int num) {
    if(num == 0) return 0;
    if(num < 10) return num;

    int rem;
    int sum = 0;
    while(num >= 10) {
        while(num > 0) {
            rem = num % 10;
            sum += rem;
            num /= 10;
        }
        num = sum;
        sum = 0;
    }
    return num;
}

int main() {
    int num0 = 38;
    int num1 = 0;

    if (addDigits(num0) == 2 && addDigits(num1) == 0) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	addDigits
addDigits:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	%edi, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	cmpl	$9, -20(%rbp)
	jg	.L4
	movl	-20(%rbp), %eax
	jmp	.L3
.L4:
	movl	$0, -4(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	movl	%eax, %ecx
	sarl	$2, %ecx
	movl	%edx, %eax
	sarl	$31, %eax
	subl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -8(%rbp)
	movl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	movl	%edx, %ecx
	sarl	$2, %ecx
	cltd
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
.L6:
	cmpl	$0, -20(%rbp)
	jg	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -4(%rbp)
.L5:
	cmpl	$9, -20(%rbp)
	jg	.L6
	movl	-20(%rbp), %eax
.L3:
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$16, %rsp
	movl	$38, -4(%rbp)
	movl	$0, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	addDigits
	cmpl	$2, %eax
	jne	.L10
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	addDigits
	testl	%eax, %eax
	jne	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L11
.L10:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L11:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>

int sumOfMultiples(int n) {
    int sum = 0;
    for (int i = 1; i <= n; i++) {
        if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) {
            sum += i;
        }
    }
    return sum;
}

int main() {
    int n0 = 7;
    int n1 = 10;
    int n2 = 9;

    if (sumOfMultiples(n0) == 21 && sumOfMultiples(n1) == 40 && sumOfMultiples(n2) == 30) {
        printf("<<<FUNCTION SUCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	sumOfMultiples
sumOfMultiples:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movq	%rax, %rdx
	movl	%ecx, %eax
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L3
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	sarl	%edx
	movl	%ecx, %eax
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L3
	movl	-8(%rbp), %edx
	movslq	%edx, %rax
	imulq	$-1840700269, %rax, %rax
	shrq	$32, %rax
	addl	%edx, %eax
	sarl	$2, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	sall	$3, %ecx
	subl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L4
.L3:
	movl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
.L4:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L5
	movl	-4(%rbp), %eax
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$16, %rsp
	movl	$7, -4(%rbp)
	movl	$10, -8(%rbp)
	movl	$9, -12(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	sumOfMultiples
	cmpl	$21, %eax
	jne	.L8
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	sumOfMultiples
	cmpl	$40, %eax
	jne	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	sumOfMultiples
	cmpl	$30, %eax
	jne	.L8
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L8:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdbool.h>
#include <string.h>
#include <stdio.h>

bool canConstruct(char* r, char* m) {
    int arr[26] = {};
    for(; *m; ){
        int idx = *(m) - 'a';
        arr[idx]++;
        *(m)++;
    }
    for(; *r; ){
        int idx = *(r) - 'a';
        arr[idx]--;
        if(arr[idx] == -1)
            return false;
        *(r)++;
    }
    return true;
}

int main() {
    char ransom1[] = "a";
    char magazine1[] = "b";
    if (canConstruct(ransom1, magazine1)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char ransom2[] = "aa";
    char magazine2[] = "ab";
    if (canConstruct(ransom2, magazine2)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    char ransom3[] = "aa";
    char magazine3[] = "aab";
    if (!canConstruct(ransom3, magazine3)) {
        printf("<<<FUNCTION FAILURE>>>\n");
        return 1;
    }

    printf("<<<FUNCTION SUCCESS>>>\n");
    return 0;
}

	.text
	.globl	canConstruct
canConstruct:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$8, %rsp
	movq	%rdi, -120(%rbp)
	movq	%rsi, -128(%rbp)
	leaq	-112(%rbp), %rdx
	movl	$0, %eax
	movl	$13, %ecx
	movq	%rdx, %rdi
	rep stosq
	jmp	.L2
.L3:
	movq	-128(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	movl	%edx, -112(%rbp,%rax,4)
	movq	-128(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -128(%rbp)
.L2:
	movq	-128(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	jmp	.L4
.L7:
	movq	-120(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$97, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	movl	%edx, -112(%rbp,%rax,4)
	movl	-4(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L5
	movl	$0, %eax
	jmp	.L8
.L5:
	movq	-120(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -120(%rbp)
.L4:
	movq	-120(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L7
	movl	$1, %eax
.L8:
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION FAILURE>>>"
.LC1:
	.string	"<<<FUNCTION SUCCESS>>>"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$32, %rsp
	movw	$97, -2(%rbp)
	movw	$98, -4(%rbp)
	leaq	-4(%rbp), %rdx
	leaq	-2(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	canConstruct
	testb	%al, %al
	je	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L14
.L10:
	movw	$24929, -7(%rbp)
	movb	$0, -5(%rbp)
	movw	$25185, -10(%rbp)
	movb	$0, -8(%rbp)
	leaq	-10(%rbp), %rdx
	leaq	-7(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	canConstruct
	testb	%al, %al
	je	.L12
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L14
.L12:
	movw	$24929, -13(%rbp)
	movb	$0, -11(%rbp)
	movl	$6447457, -17(%rbp)
	leaq	-17(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	canConstruct
	xorl	$1, %eax
	testb	%al, %al
	je	.L13
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %eax
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L14:
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int compar (const void * elem1, const void * elem2) {
    int f = *((int*)elem1);
    int s = *((int*)elem2);
    if (f > s) return 1;
    if (f < s) return -1;
    return 0;
}

int* numberGame(int* nums, int numsSize, int* returnSize) {
    int* result = malloc(numsSize * sizeof(int));
    *returnSize = numsSize;
    (void)memcpy(result, nums, numsSize * sizeof(int));
    qsort(result, numsSize, sizeof(int), compar);
    for (int i = 0; i < numsSize ; i += 2) {
        int tmp = result[i];
        result[i] = result[i + 1];
        result[i + 1] = tmp;
    }
    return result;
}

int main() {
    int nums0[] = {5, 4, 2, 3};
    int returnSize0;
    int* result0 = numberGame(nums0, 4, &returnSize0);
    int expected0[] = {3, 2, 5, 4};
    bool success0 = (returnSize0 == 4);
    for (int i = 0; i < returnSize0 && success0; i++) {
        if (result0[i] != expected0[i]) {
            success0 = false;
            break;
        }
    }
    free(result0);

    int nums1[] = {2, 5};
    int returnSize1;
    int* result1 = numberGame(nums1, 2, &returnSize1);
    int expected1[] = {5, 2};
    bool success1 = (returnSize1 == 2);
    for (int i = 0; i < returnSize1 && success1; i++) {
        if (result1[i] != expected1[i]) {
            success1 = false;
            break;
        }
    }
    free(result1);

    if (success0 == true && success1 == true) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	compar
compar:
	pushq	%rbp
	movq	%rsp, %rbp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	ret
	.globl	numberGame
numberGame:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	-56(%rbp), %rax
	movl	-44(%rbp), %edx
	movl	%edx, (%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rcx
	movq	-16(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-44(%rbp), %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	compar(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -4(%rbp)
	jmp	.L6
.L7:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$2, -4(%rbp)
.L6:
	movl	-4(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L7
	movq	-16(%rbp), %rax
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$112, %rsp
	movl	$5, -48(%rbp)
	movl	$4, -44(%rbp)
	movl	$2, -40(%rbp)
	movl	$3, -36(%rbp)
	leaq	-52(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	numberGame
	movq	%rax, -24(%rbp)
	movl	$3, -80(%rbp)
	movl	$2, -76(%rbp)
	movl	$5, -72(%rbp)
	movl	$4, -68(%rbp)
	movl	-52(%rbp), %eax
	cmpl	$4, %eax
	sete	%al
	movb	%al, -1(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L10
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L11
	movb	$0, -1(%rbp)
	jmp	.L12
.L11:
	addl	$1, -8(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L12
	cmpb	$0, -1(%rbp)
	jne	.L13
.L12:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$2, -88(%rbp)
	movl	$5, -84(%rbp)
	leaq	-92(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movl	$2, %esi
	movq	%rax, %rdi
	call	numberGame
	movq	%rax, -32(%rbp)
	movl	$5, -100(%rbp)
	movl	$2, -96(%rbp)
	movl	-92(%rbp), %eax
	cmpl	$2, %eax
	sete	%al
	movb	%al, -9(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L14
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	movl	-100(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L15
	movb	$0, -9(%rbp)
	jmp	.L16
.L15:
	addl	$1, -16(%rbp)
.L14:
	movl	-92(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L16
	cmpb	$0, -9(%rbp)
	jne	.L17
.L16:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	cmpb	$0, -1(%rbp)
	je	.L18
	cmpb	$0, -9(%rbp)
	je	.L18
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L18:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L19:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <string.h>

int strStr(char* a, char* b) {
    int len = strlen(b);
    for(int i = 0;i < strlen(a); i++) {
        char c[len + 1];
        strncpy(c, a + i, len);
        c[len] = '\0';
        if (strcmp(c, b) == 0)
            return i;
    }
    return -1;
}

int main() {
    char* a1 = "sadbutsad";
    char* b1 = "sad";
    char* a2 = "leetcode";
    char* b2 = "leeto";

    if (strStr(a1, b1) == 0 && strStr(a2, b2) == -1) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	strStr
strStr:
	pushq	%rbp
	movq	%rsp, %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -56(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	-56(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -64(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -72(%rbp)
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	movslq	%eax, %rcx
	movq	-88(%rbp), %rax
	addq	%rax, %rcx
	movq	-72(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strncpy@PLT
	movq	-72(%rbp), %rdx
	movl	-56(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	movq	-96(%rbp), %rdx
	movq	-72(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	-52(%rbp), %eax
	movq	%rbx, %rsp
	jmp	.L4
.L3:
	movq	%rbx, %rsp
	addl	$1, -52(%rbp)
.L2:
	movl	-52(%rbp), %eax
	movslq	%eax, %rbx
	movq	-88(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L5
	movl	$-1, %eax
.L4:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	ret
	.section	.rodata
.LC0:
	.string	"sadbutsad"
.LC1:
	.string	"sad"
.LC2:
	.string	"leetcode"
.LC3:
	.string	"leeto"
.LC4:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC5:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$32, %rsp
	leaq	.LC0(%rip), %rax
	movq	%rax, -8(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -16(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	.LC3(%rip), %rax
	movq	%rax, -32(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strStr
	testl	%eax, %eax
	jne	.L7
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strStr
	cmpl	$-1, %eax
	jne	.L7
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>
#include <stdlib.h>

int* plusOne(int* digits, int digitsSize, int* returnSize) {
    int* result = (int*) malloc((digitsSize + 1) * sizeof(int));

    for (int i = 0; i < digitsSize; i++) {
        result[i] = digits[i];
    }

    for (int i = digitsSize - 1; i >= 0; i--) {
        if (result[i] < 9) {
            result[i]++;
            *returnSize = digitsSize;
            return result;
        } else {
            result[i] = 0;
        }
    }

    result[0] = 1;
    for (int i = 1; i <= digitsSize; i++) {
        result[i] = 0;
    }
    *returnSize = digitsSize + 1;
    return result;
}

int main() {
    int digits1[] = {1, 2, 3};
    int size1;
    int* result1 = plusOne(digits1, 3, &size1);

    int digits2[] = {4, 3, 2, 1};
    int size2;
    int* result2 = plusOne(digits2, 4, &size2);

    int digits3[] = {9};
    int size3;
    int* result3 = plusOne(digits3, 1, &size3);

    int success = 1;

    int expected1[] = {1, 2, 4};
    if (size1 != 3) success = 0;
    for (int i = 0; i < size1; i++) {
        if (result1[i] != expected1[i]) {
            success = 0;
            break;
        }
    }

    int expected2[] = {4, 3, 2, 2};
    if (size2 != 4) success = 0;
    for (int i = 0; i < size2; i++) {
        if (result2[i] != expected2[i]) {
            success = 0;
            break;
        }
    }

    int expected3[] = {1, 0};
    if (size3 != 2) success = 0;
    for (int i = 0; i < size3; i++) {
        if (result3[i] != expected3[i]) {
            success = 0;
            break;
        }
    }

    if (success) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }

    free(result1);
    free(result2);
    free(result3);

    return 0;
}

	.text
	.globl	plusOne
plusOne:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L3
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$8, %eax
	jg	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movq	-56(%rbp), %rax
	movl	-44(%rbp), %edx
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	subl	$1, -8(%rbp)
.L4:
	cmpl	$0, -8(%rbp)
	jns	.L7
	movq	-24(%rbp), %rax
	movl	$1, (%rax)
	movl	$1, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L9
	movl	-44(%rbp), %eax
	leal	1(%rax), %edx
	movq	-56(%rbp), %rax
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
.L6:
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$144, %rsp
	movl	$1, -52(%rbp)
	movl	$2, -48(%rbp)
	movl	$3, -44(%rbp)
	leaq	-56(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movl	$3, %esi
	movq	%rax, %rdi
	call	plusOne
	movq	%rax, -24(%rbp)
	movl	$4, -80(%rbp)
	movl	$3, -76(%rbp)
	movl	$2, -72(%rbp)
	movl	$1, -68(%rbp)
	leaq	-84(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	plusOne
	movq	%rax, -32(%rbp)
	movl	$9, -88(%rbp)
	leaq	-92(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movl	$1, %esi
	movq	%rax, %rdi
	call	plusOne
	movq	%rax, -40(%rbp)
	movl	$1, -4(%rbp)
	movl	$1, -104(%rbp)
	movl	$2, -100(%rbp)
	movl	$4, -96(%rbp)
	movl	-56(%rbp), %eax
	cmpl	$3, %eax
	je	.L11
	movl	$0, -4(%rbp)
.L11:
	movl	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	movl	-104(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L13
	movl	$0, -4(%rbp)
	jmp	.L14
.L13:
	addl	$1, -8(%rbp)
.L12:
	movl	-56(%rbp), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L15
.L14:
	movl	$4, -128(%rbp)
	movl	$3, -124(%rbp)
	movl	$2, -120(%rbp)
	movl	$2, -116(%rbp)
	movl	-84(%rbp), %eax
	cmpl	$4, %eax
	je	.L16
	movl	$0, -4(%rbp)
.L16:
	movl	$0, -12(%rbp)
	jmp	.L17
.L20:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L18
	movl	$0, -4(%rbp)
	jmp	.L19
.L18:
	addl	$1, -12(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
.L19:
	movl	$1, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	-92(%rbp), %eax
	cmpl	$2, %eax
	je	.L21
	movl	$0, -4(%rbp)
.L21:
	movl	$0, -16(%rbp)
	jmp	.L22
.L25:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	movl	-136(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	je	.L23
	movl	$0, -4(%rbp)
	jmp	.L24
.L23:
	addl	$1, -16(%rbp)
.L22:
	movl	-92(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L25
.L24:
	cmpl	$0, -4(%rbp)
	je	.L26
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L27
.L26:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L27:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits


#include <stdio.h>

int sumRow(int i , int cols,int** accounts){
    int s = 0;
    for(int j = 0; j < cols; j++) {
        s = s + accounts[i][j];
    }
    return s;
}

int maximumWealth(int** accounts, int accountsSize, int* accountsColSize) {
    int max = sumRow(0, *accountsColSize, accounts);

    int i = 1;
    while (i < accountsSize) {
        if (max < sumRow(i, *accountsColSize, accounts)) {
            max = sumRow(i, *accountsColSize, accounts);
        }
        i++;
    }
    return max;
}

int main() {
    int* arr1_1 = (int[]) {1, 2 ,3};
    int* arr1_2 = (int[]) {3, 2, 1};
    int* accounts1[] = {arr1_1, arr1_2};
    int accountsColSize1 = 3;
    int result1 = maximumWealth(accounts1, 2, &accountsColSize1);

    int* arr2_1 = (int[]) {1, 5};
    int* arr2_2 = (int[]) {7, 3};
    int* arr2_3 = (int[]) {3, 5};
    int* accounts2[] = {arr2_1, arr2_2, arr2_3};
    int accountsColSize2 = 2;
    int result2 = maximumWealth(accounts2, 3, &accountsColSize2);

    int* arr3_1 = (int[]) {2, 8, 7};
    int* arr3_2 = (int[]) {7, 1, 3};
    int* arr3_3 = (int[]) {1, 9, 5};
    int* accounts3[] = {arr3_1, arr3_2, arr3_3};
    int accountsColSize3 = 3;
    int result3 = maximumWealth(accounts3, 3, &accountsColSize3);

    if (result1 == 6 && result2 == 10 && result3 == 17) {
        printf("<<<FUNCTION SUCCESS>>>\n");
    } else {
        printf(">>>FUNCTION FAILURE<<<\n");
    }
    return 0;
}

	.text
	.globl	sumRow
sumRow:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	ret
	.globl	maximumWealth
maximumWealth:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	movq	-24(%rbp), %rdx
	movl	%eax, %esi
	movl	$0, %edi
	call	sumRow
	movl	%eax, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L6
.L8:
	movq	-40(%rbp), %rax
	movl	(%rax), %ecx
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	sumRow
	cmpl	%eax, -4(%rbp)
	jge	.L7
	movq	-40(%rbp), %rax
	movl	(%rax), %ecx
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	sumRow
	movl	%eax, -4(%rbp)
.L7:
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L8
	movl	-4(%rbp), %eax
	leave
	ret
	.section	.rodata
.LC0:
	.string	"<<<FUNCTION SUCCESS>>>"
.LC1:
	.string	">>>FUNCTION FAILURE<<<"
	.text
	.globl	main
main:
	pushq	%rbp
	movq	%rsp, %rbp
	subq	$272, %rsp
	movl	$1, -96(%rbp)
	movl	$2, -92(%rbp)
	movl	$3, -88(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, -8(%rbp)
	movl	$3, -108(%rbp)
	movl	$2, -104(%rbp)
	movl	$1, -100(%rbp)
	leaq	-108(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -128(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, -120(%rbp)
	movl	$3, -132(%rbp)
	leaq	-132(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movl	$2, %esi
	movq	%rax, %rdi
	call	maximumWealth
	movl	%eax, -20(%rbp)
	movl	$1, -140(%rbp)
	movl	$5, -136(%rbp)
	leaq	-140(%rbp), %rax
	movq	%rax, -32(%rbp)
	movl	$7, -148(%rbp)
	movl	$3, -144(%rbp)
	leaq	-148(%rbp), %rax
	movq	%rax, -40(%rbp)
	movl	$3, -156(%rbp)
	movl	$5, -152(%rbp)
	leaq	-156(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -192(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -184(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -176(%rbp)
	movl	$2, -196(%rbp)
	leaq	-196(%rbp), %rdx
	leaq	-192(%rbp), %rax
	movl	$3, %esi
	movq	%rax, %rdi
	call	maximumWealth
	movl	%eax, -52(%rbp)
	movl	$2, -208(%rbp)
	movl	$8, -204(%rbp)
	movl	$7, -200(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, -64(%rbp)
	movl	$7, -220(%rbp)
	movl	$1, -216(%rbp)
	movl	$3, -212(%rbp)
	leaq	-220(%rbp), %rax
	movq	%rax, -72(%rbp)
	movl	$1, -232(%rbp)
	movl	$9, -228(%rbp)
	movl	$5, -224(%rbp)
	leaq	-232(%rbp), %rax
	movq	%rax, -80(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, -256(%rbp)
	movq	-72(%rbp), %rax
	movq	%rax, -248(%rbp)
	movq	-80(%rbp), %rax
	movq	%rax, -240(%rbp)
	movl	$3, -260(%rbp)
	leaq	-260(%rbp), %rdx
	leaq	-256(%rbp), %rax
	movl	$3, %esi
	movq	%rax, %rdi
	call	maximumWealth
	movl	%eax, -84(%rbp)
	cmpl	$6, -20(%rbp)
	jne	.L11
	cmpl	$10, -52(%rbp)
	jne	.L11
	cmpl	$17, -84(%rbp)
	jne	.L11
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L12
.L11:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	$0, %eax
	leave
	ret
	.section	.note.GNU-stack,"",@progbits