LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/error.c
// Function: malloc_chk
void malloc_chk(void* ret, const char* func, const char* file, int line) {
    if (ret != NULL)
        return;
    fprintf(
        stderr,
        "[%s::ERROR]\033[1;31m Failed to allocate memory : "
        "%s.\033[0m\n[%s::DEBUG]\033[1;35m Error occured at %s:%d.\033[0m\n\n",
        func, strerror(errno), func, file, line);
    exit(EXIT_FAILURE);
}

// Assembly:
testq %rdi, %rdi
je 0x2916
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x36cc(%rip), %rax      # 0x5ff8
movq (%rax), %r15
callq 0x1070
movl (%rax), %edi
callq 0x1240
movl %ebp, (%rsp)
leaq 0x122d(%rip), %rsi      # 0x3b72
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x1130
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/error.c
// Function: f_chk
void f_chk(void* ret, const char* func, const char* file, int line,
           const char* fopen_f) {
    if (ret != NULL)
        return;
    fprintf(
        stderr,
        "[%s::ERROR]\033[1;31m Failed to open %s : "
        "%s.\033[0m\n[%s::DEBUG]\033[1;35m Error occured at %s:%d.\033[0m\n\n",
        func, fopen_f, strerror(errno), func, file, line);
    exit(EXIT_FAILURE);
}

// Assembly:
testq %rdi, %rdi
je 0x2969
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r15
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r12
movq 0x3673(%rip), %rax      # 0x5ff8
movq (%rax), %r13
callq 0x1070
movl (%rax), %edi
callq 0x1240
leaq 0x123f(%rip), %rsi      # 0x3bda
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r14
pushq %rbx
callq 0x1130
popq %rcx
popq %rdx
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/error.c
// Function: null_chk
void null_chk(void* ret, const char* func, const char* file, int line) {
    if (ret != NULL)
        return;
    fprintf(stderr,
            "[%s::ERROR]\033[1;31m %s.\033[0m\n[%s::DEBUG]\033[1;35m Error "
            "occured at %s:%d.\033[0m\n\n",
            func, strerror(errno), func, file, line);
    exit(EXIT_FAILURE);
}

// Assembly:
testq %rdi, %rdi
je 0x29c4
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x361e(%rip), %rax      # 0x5ff8
movq (%rax), %r15
callq 0x1070
movl (%rax), %edi
callq 0x1240
movl %ebp, (%rsp)
leaq 0x1247(%rip), %rsi      # 0x3c3a
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x1130
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/hasindu2008[P]f5p/error.c
// Function: neg_chk
void neg_chk(int ret, const char* func, const char* file, int line) {
    if (ret >= 0)
        return;
    fprintf(stderr,
            "[%s::ERROR]\033[1;31m %s.\033[0m\n[%s::DEBUG]\033[1;35m Error "
            "occured at %s:%d.\033[0m\n\n",
            func, strerror(errno), func, file, line);
    exit(EXIT_FAILURE);
}

// Assembly:
testl %edi, %edi
js 0x2a16
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x35cc(%rip), %rax      # 0x5ff8
movq (%rax), %r15
callq 0x1070
movl (%rax), %edi
callq 0x1240
movl %ebp, (%rsp)
leaq 0x11f5(%rip), %rsi      # 0x3c3a
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x1130
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stack.c
// Function: inits
void inits(istack *s){
    
    s->p = calloc(1,sizeof(node));
    s->p->next = NULL;
    s->p->prev = NULL;
    s->width = 0;
    s->store = s->p;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2180
movq %rax, 0x10(%rbx)
andl $0x0, 0x8(%rbx)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stack.c
// Function: ipushs
void ipushs(istack *s, int a){
	s->p->val = a;
    pntr temp;
    temp = s->p;
    s->p = calloc(1,sizeof(node));
    s->p->prev = temp;
    s->p->next = NULL;
    temp->next = s->p;
    s->width++;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movb %sil, 0x8(%r14)
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x2180
movq %rax, 0x10(%rbx)
movq %r14, (%rax)
movq %rax, 0x10(%r14)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stack.c
// Function: inserts
void inserts(istack *s, int a,int loc){
	node* newnode = (node *)malloc(sizeof(node));
	newnode->val = a;
	node *temp = s->store;
	if( loc > s->width + 1)
		return;
	else if(loc == 0){

		newnode->next = s->store;
        s->store->prev = newnode;
        newnode->prev = NULL;
		s->store = newnode;
		s->width++;
		return;
	}
	else if(loc == s->width + 1){
        newnode->next = NULL;
        s->p->next = newnode;
        newnode->prev = s->p;
		s->p = newnode;
		s->width++;
		return;
	}
	else if(loc > 0){
		while(loc > 1){
			temp = temp->next;
			loc--;
		}
		newnode->next = temp->next;
        newnode->next->prev = newnode;
        newnode->prev = temp;
		temp->next = newnode;
		s->width++;
		return;
	}
   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x21f0
movb %r15b, 0x8(%rax)
movl 0x8(%rbx), %ecx
incl %ecx
cmpl %r14d, %ecx
jl 0x24b4
movq (%rbx), %rdx
testl %r14d, %r14d
je 0x247e
cmpl %r14d, %ecx
jne 0x2489
andq $0x0, 0x10(%rax)
leaq 0x10(%rbx), %rdi
movq 0x10(%rbx), %rsi
leaq 0x10(%rsi), %rdx
movl %r14d, %ecx
jmp 0x24a8
movq %rdx, 0x10(%rax)
xorl %esi, %esi
movq %rbx, %rdi
jmp 0x24a8
testl %r14d, %r14d
jg 0x2493
jmp 0x24b4
decl %r14d
movq %rdx, %rsi
movq 0x10(%rdx), %rdx
cmpl $0x2, %r14d
jge 0x2490
leaq 0x10(%rsi), %rdi
movq %rdx, 0x10(%rax)
movq %rax, (%rdx)
movq %rsi, (%rax)
movq %rax, (%rdi)
movl %ecx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stack.c
// Function: ipops
int ipops(istack *s){
      //head pointer is ahead of the last element in the stack
    //printw("%d\t",s->width);
    pntr temp;
    temp = s->p;
    s->width--;
    s->p = s->p->prev;
    //printw("%d\t",s->width);
    s->p->next = NULL;
    int num = s->p->val;
    free(temp);
    return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
decl 0x8(%rdi)
movq (%rax), %rcx
movq %rcx, 0x10(%rdi)
andq $0x0, 0x10(%rcx)
movsbl 0x8(%rcx), %ebx
movq %rax, %rdi
callq 0x2030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stack.c
// Function: ipoploc
int ipoploc(istack *s,int x){
      //head pointer is ahead of the last element in the stack
    //printw("%d\t",s->width);
    pntr temp = s->store;
    int num;
    int i;
    if(x == 0){
        s->store = s->store->next;
        s->store->prev = NULL;
        num = temp->val;
        free(temp);
        s->width--;
        return num;
    }
    for(i = 0; i < x; i++)
        temp = temp->next;
    
    temp->prev->next = temp->next;
    temp->next->prev = temp->prev;
    s->width--;
    num = temp->val;
    free(temp);
    return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testl %esi, %esi
je 0x252c
xorl %ecx, %ecx
testl %esi, %esi
cmovgl %esi, %ecx
movq %rdi, %rax
movq 0x10(%rdi), %rdi
subl $0x1, %ecx
jae 0x2505
movq (%rax), %rcx
movq %rdi, 0x10(%rcx)
movq %rcx, (%rdi)
decl 0x8(%rbx)
movb 0x8(%rax), %r14b
movq %rax, %rdi
callq 0x2030
jmp 0x2543
movq 0x10(%rdi), %rax
movq %rax, (%rbx)
andq $0x0, (%rax)
movb 0x8(%rdi), %r14b
callq 0x2030
decl 0x8(%rbx)
movsbl %r14b, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/line.c
// Function: initq
void initq(line *s){
    s->link = (point *)calloc(1,sizeof(point));
    //s->link->element = (istack *)calloc(1,sizeof(istack));
    inits(&(s->link->element));
    s->link->head = NULL;
    s->link->tail = NULL;
    //printw("%p\n",s->link->tail);
    //refresh();
    s->front = s->link;
    s->lines = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2180
movq %rax, 0x10(%rbx)
leaq 0x8(%rax), %rdi
callq 0x23dc
movq 0x10(%rbx), %rax
andq $0x0, 0x20(%rax)
andq $0x0, (%rax)
movq %rax, (%rbx)
andl $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/line.c
// Function: enqueue
void enqueue(line *s){
    point *temp =  (point *)calloc(1,sizeof(point));
    temp->head = s->link;
    temp->tail = NULL;
    //printw("1\n");
    //refresh();
    inits(&(temp->element));
    s->link->tail = temp;
    s->link = temp;
    s->lines++;


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2180
movq %rax, %r14
movq 0x10(%rbx), %rax
movq %rax, 0x20(%r14)
leaq 0x8(%r14), %rdi
callq 0x23dc
movq 0x10(%rbx), %rax
movq %r14, (%rax)
movq %r14, 0x10(%rbx)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/line.c
// Function: enqueue_pos
void enqueue_pos(line *l, int a){
    point *newnode =  (point *)calloc(1,sizeof(point));
    inits(&(newnode->element));
    point* temp = l->front;
    int i = 0;
    for(; i < a; i++)
        temp = temp->tail;
    temp->head->tail = newnode;
    newnode->tail = temp;
    newnode->head = temp->head;
    temp->head = newnode;
    l->lines++;
    return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2180
movq %rax, %r14
leaq 0x8(%rax), %rdi
callq 0x23dc
xorl %eax, %eax
testl %r15d, %r15d
cmovgl %r15d, %eax
incl %eax
movq %rbx, %rcx
movq (%rcx), %rcx
decl %eax
jne 0x262d
movq 0x20(%rcx), %rax
movq %r14, (%rax)
movq %rcx, (%r14)
movq %rax, 0x20(%r14)
movq %r14, 0x20(%rcx)
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/line.c
// Function: dequeue
void dequeue(line *s){
    s->link->head->tail = NULL;
    point *temp = s->link;
    s->link = s->link->head;
    free(temp);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movq 0x20(%rax), %rcx
andq $0x0, (%rcx)
movq %rcx, 0x10(%rdi)
movq %rax, %rdi
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/line.c
// Function: dequeueloc
void dequeueloc(line *s,int x){
    point* temp = s->front;
    int num;
    int i;
    for(i = 0; i < x; i++)
        temp = temp->tail;
    
    if(temp->tail == NULL){
        dequeue(s);
        return;
    }
    temp->head->tail = temp->tail;
    temp->tail->head = temp->head;

    s->lines--;
    free(temp);
    return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
testl %esi, %esi
cmovgl %esi, %ecx
incl %ecx
movq %rdi, %rax
movq (%rax), %rax
decl %ecx
jne 0x2681
movq (%rax), %rcx
testq %rcx, %rcx
je 0x26aa
movq 0x20(%rax), %rdx
movq %rcx, (%rdx)
movq (%rax), %rcx
movq %rdx, 0x20(%rcx)
decl 0x8(%rdi)
movq %rax, %rdi
popq %rbp
jmp 0x2030
popq %rbp
jmp 0x2654
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: create_newwin
WINDOW *create_newwin(int height, int width, int starty, int startx){       
    WINDOW *local_win;
    local_win = newwin(height, width, starty, startx);
    box(local_win, 0 , 0);
    wrefresh(local_win);
    keypad(local_win, TRUE);
    return local_win; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
callq 0x2040
movq %rax, %rbx
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2070
movq %rbx, %rdi
callq 0x2100
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2150
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: line_num
void line_num(){
    int i,j;
    for(i = stline,j = 0; j < (by - 4) ;i++,j++){
        move(j,bx-1);
        printw("%d",(i+1)%10);
    }
    refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7a2f(%rip), %rax      # 0xa19c
movl (%rax), %r15d
incl %r15d
movq 0x7866(%rip), %r13      # 0x9fe0
pushq $0xa
popq %r12
leaq 0x4ca8(%rip), %rbx      # 0x742d
xorl %r14d, %r14d
leaq 0x79fd(%rip), %rax      # 0xa18c
movl (%rax), %eax
addl $-0x4, %eax
movq (%r13), %rdi
cmpl %eax, %r14d
jge 0x27c9
leaq 0x79f0(%rip), %rax      # 0xa194
movl (%rax), %edx
decl %edx
movl %r14d, %esi
callq 0x2230
leal (%r15,%r14), %eax
cltd
idivl %r12d
movq %rbx, %rdi
movl %edx, %esi
xorl %eax, %eax
callq 0x2270
incl %r14d
jmp 0x2788
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: display
void display(int stline){
    //clear();
    move(0,0);
    int a,y,x;
    point *temp = data.front;
    for(a = 0; (a < stline) && (stline >=0); a++){
        temp = temp->tail;
    }
    int count = 1;
    while(temp){
        if(count >= (by - 3))
            break;
        clrtoeol();
        node *row = temp->element.store;
        while(row->next){
                printw("%c",row->val);
            row = row->next;    
        }
        count++;
        temp = temp->tail;
    }
    getyx(stdscr,y,x);
    refresh();
    line_num();
    move(y,x);
    refresh();
    return;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x77ed(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2230
testl %ebx, %ebx
cmovgl %ebx, %r12d
incl %r12d
leaq 0x79c6(%rip), %r14      # 0xa1d8
movq (%r14), %r14
decl %r12d
jne 0x2812
pushq $0x1
popq %r12
leaq 0x7967(%rip), %r13      # 0xa18c
leaq 0x47e8(%rip), %rbx      # 0x7014
testq %r14, %r14
je 0x2877
movl (%r13), %eax
addl $-0x3, %eax
cmpl %eax, %r12d
jge 0x2877
movq 0x779c(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x2240
leaq 0x8(%r14), %r15
movq (%r15), %r15
cmpq $0x0, 0x10(%r15)
je 0x286f
movsbl 0x8(%r15), %esi
addq $0x10, %r15
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2270
jmp 0x2850
incl %r12d
movq (%r14), %r14
jmp 0x282c
movq 0x7762(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2890
movswl (%rdi), %ebx
movswl 0x2(%rdi), %r14d
jmp 0x2896
pushq $-0x1
popq %rbx
movl %ebx, %r14d
callq 0x2100
callq 0x2758
movq 0x7739(%rip), %r15      # 0x9fe0
movq (%r15), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x2230
movq (%r15), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: initialise
void initialise(int line){
        initq(&data);
        inite(&states);
        inite(&redo);
        getmaxyx(stdscr,by,bx);
        return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7903(%rip), %rdi      # 0xa1d8
callq 0x2580
leaq 0x78d7(%rip), %rdi      # 0xa1b8
callq 0x5410
leaq 0x78db(%rip), %rdi      # 0xa1c8
callq 0x5410
movq 0x76e7(%rip), %rax      # 0x9fe0
movq (%rax), %rcx
testq %rcx, %rcx
je 0x290f
movswl 0x4(%rcx), %eax
incl %eax
movswl 0x6(%rcx), %ecx
incl %ecx
jmp 0x2914
pushq $-0x1
popq %rax
movl %eax, %ecx
leaq 0x7871(%rip), %rdx      # 0xa18c
movl %eax, (%rdx)
leaq 0x7870(%rip), %rax      # 0xa194
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: add_line
int add_line(int line){
    int i = 0;
    point *temp = data.front;
    if(line < lines){
        enqueue_pos(&data,line);
    }
    else if( lines == line){
        enqueue(&data);
    }
    for(i = 0; i < line - 1; i++){
        temp = temp->tail;
    }
    char *str = (char *)calloc(2,1);
    str[0] = '\0';
    int x,y;
    char ch[2] = {'\0'};
    i = 0;
    ch[0] = ipops(&(temp->element));

    getyx(stdscr,y,x);
    
    while(ch[0] != '\n'){
       
        i++;
        strcat(str,ch);
         str = realloc(str,strlen(str) +2);
        ch[0] = ipops(&(temp->element));
    }
    ipushs(&(temp->element),'\n');
    if(strlen(str)){
        while(i--){
            ipushs(&(temp->tail->element),str[i]);
        }
    }
    if(line < lines)
        ipushs(&(temp->tail->element),'\n');
    return temp->tail->element.width;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x7899(%rip), %rax      # 0xa1d8
movq (%rax), %r13
leaq 0x783f(%rip), %rax      # 0xa188
cmpl %edi, (%rax)
jle 0x295d
leaq 0x7884(%rip), %rdi      # 0xa1d8
movl %ebx, %esi
callq 0x25f8
jmp 0x296b
jne 0x296b
leaq 0x7872(%rip), %rdi      # 0xa1d8
callq 0x25bc
cmpl $0x2, %ebx
pushq $0x1
popq %rax
cmovgel %ebx, %eax
decl %eax
subl $0x1, %eax
jb 0x2981
movq (%r13), %r13
jmp 0x2976
movl %ebx, -0x30(%rbp)
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
callq 0x2180
movq %rax, %r14
leaq -0x2a(%rbp), %r12
andw $0x0, (%r12)
leaq 0x8(%r13), %r15
movq %r15, %rdi
callq 0x24bf
xorl %ebx, %ebx
movb %al, -0x2a(%rbp)
cmpb $0xa, %al
je 0x29e0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2260
movq %r14, %rdi
callq 0x20c0
leaq 0x2(%rax), %rsi
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
movq %r15, %rdi
callq 0x24bf
incq %rbx
jmp 0x29aa
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x2402
cmpb $0x0, (%r14)
je 0x2a12
movq %rbx, %r15
subq $0x1, %r15
jb 0x2a12
movq (%r13), %rdi
addq $0x8, %rdi
movsbl -0x1(%r14,%rbx), %esi
callq 0x2402
movq %r15, %rbx
jmp 0x29f4
movl -0x30(%rbp), %eax
leaq 0x776c(%rip), %rcx      # 0xa188
cmpl %eax, (%rcx)
jle 0x2a30
movq (%r13), %rdi
addq $0x8, %rdi
pushq $0xa
popq %rsi
callq 0x2402
movq (%r13), %rax
movl 0x10(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: search_char
int search_char(char ch,int param,istack t){
    if(param == 0){
        node *temp = t.store;
        while(temp->next){
            if(ch == temp->val)
                return 1;
            temp = temp->next;
        }
        return 0;
    }
    else{
        point *temp = data.front;
        int i = 0;
        for(; i < param; i++)
            temp = temp->tail;
        node *trav = temp->element.store;
        while(trav->next){
            if(ch == trav->val)
                return 1;
            trav = trav->next;
        }
    }

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
je 0x2a85
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
incl %eax
leaq 0x777a(%rip), %rcx      # 0xa1d8
movq (%rcx), %rcx
decl %eax
jne 0x2a5e
movq 0x8(%rcx), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x2a7b
cmpb %dil, 0x8(%rax)
movq %rcx, %rax
jne 0x2a69
xorl %eax, %eax
testq %rcx, %rcx
setne %al
jmp 0x2aa7
leaq 0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x1, %eax
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0x2aa5
cmpb %dil, 0x8(%rcx)
movq %rdx, %rcx
jne 0x2a91
jmp 0x2aa7
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: getwidth
int getwidth(int y){
    point *temp = data.front;
    int i = 0;
    for(; i < y; i++){
        if(temp->tail == NULL)
            break;
        else
            temp = temp->tail;
    }
    if(ipeeps(&temp->element) == '\n')
        return (temp->element.width - 1);    
    else
        return (temp->element.width);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7215(%rip), %rax      # 0xa1d8
movq (%rax), %rcx
xorl %eax, %eax
testl %edi, %edi
cmovgl %edi, %eax
incl %eax
movq %rcx, %rbx
decl %eax
je 0x2fde
movq (%rbx), %rcx
testq %rcx, %rcx
jne 0x2fcf
leaq 0x8(%rbx), %rdi
callq 0x2567
xorl %ecx, %ecx
cmpl $0xa, %eax
sete %cl
movl 0x10(%rbx), %eax
subl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: save
void save(char *fname){
    int fd = open(fname,O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
    //int i = 0, fd = open("random.txt", O_WRONLY | O_CREAT ,S_IRUSR | S_IWUSR);
    point *temp = data.front;
    while(temp){
        char *str = (char *)calloc(1,1);
        node *row = temp->element.store;
        char ch[2] = {'\0'};
        str = realloc(str,strlen(str)+1);
        while(row->next){
            write(fd,&row->val,1);
            row = row->next;
        }
        temp = temp->tail;
    }

    close(fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2210
movl %eax, %ebx
leaq 0x6f83(%rip), %r12      # 0xa1d8
pushq $0x1
popq %r14
movq (%r12), %r12
testq %r12, %r12
je 0x32a4
movq %r14, %rdi
movq %r14, %rsi
callq 0x2180
movq %rax, %r15
movq 0x8(%r12), %r13
movq %rax, %rdi
callq 0x20c0
leaq 0x1(%rax), %rsi
movq %r15, %rdi
callq 0x2200
cmpq $0x0, 0x10(%r13)
je 0x3259
leaq 0x8(%r13), %rsi
movl %ebx, %edi
movq %r14, %rdx
callq 0x2080
movq 0x10(%r13), %r13
jmp 0x3289
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2140
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: read_chunck
int read_chunck(){
    char buffer[2] = {'\0'};
    int x,y,mk;
    point *temp = data.front;
    int count = 0;
    int t = ftrack;
    int k = 0;
    while(k = read(fdr,buffer,1)){
        if(k == 0)  
            return 0;
        if(buffer[0] == '\t' || buffer[0] == '\r')
            continue;
        if(buffer[0] == '\n'){
            x = getwidth(t);
            add_char(buffer[0],t,x);
            t++;
            lines++;
            add_line(t);
            count++;
            move(t,0);
        }
        else{
            x = getwidth(t);
            mk = add_char(buffer[0],t,x);
                if( (x >= (bx - 3))){
                    count++;
                    t++;
                    move(t,0);
                }
                else{
                    move(t,++x);
                }
        }
        if(count >= thresh){
                break;
        }
    }
    clear();
    display(stline);
    refresh();
    ftrack += thresh;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq -0x32(%rbp), %rbx
andw $0x0, (%rbx)
leaq 0x6d1f(%rip), %r13      # 0xa1a4
movl (%r13), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
leaq 0x6cfe(%rip), %r12      # 0xa198
pushq $0x1
popq %r15
movl (%r12), %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2170
testl %eax, %eax
je 0x357b
movb -0x32(%rbp), %r14b
movl %r14d, %eax
andb $-0x5, %al
cmpb $0x9, %al
je 0x349e
movl -0x30(%rbp), %r13d
movl %r13d, %edi
callq 0x2fb6
cmpb $0xa, %r14b
jne 0x34fe
pushq $0xa
popq %rdi
movl %r13d, %esi
movl %eax, %edx
callq 0x2aa9
incl %r13d
leaq 0x6c9d(%rip), %rax      # 0xa188
incl (%rax)
movl %r13d, %edi
callq 0x2928
movl -0x2c(%rbp), %r14d
incl %r14d
jmp 0x3548
movsbl %r14b, %edi
movl %r13d, %esi
movl %eax, %r14d
movl %eax, %edx
callq 0x2aa9
leaq 0x6c7e(%rip), %rax      # 0xa194
movl (%rax), %eax
addl $-0x3, %eax
cmpl %eax, %r14d
jge 0x353e
movq 0x6ab9(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
incl %r14d
movl %r13d, %esi
movl %r14d, %edx
callq 0x2230
movl -0x2c(%rbp), %r14d
jmp 0x3560
movl -0x2c(%rbp), %r14d
incl %r14d
incl %r13d
movq 0x6a91(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl %r13d, -0x30(%rbp)
movl %r13d, %esi
xorl %edx, %edx
callq 0x2230
leaq 0x6c29(%rip), %rax      # 0xa190
movl %r14d, -0x2c(%rbp)
cmpl (%rax), %r14d
leaq 0x6c2f(%rip), %r13      # 0xa1a4
jl 0x349e
movq 0x6a5e(%rip), %rbx      # 0x9fe0
movq (%rbx), %rdi
callq 0x20a0
leaq 0x6c0b(%rip), %rax      # 0xa19c
movl (%rax), %edi
callq 0x27dc
movq (%rbx), %rdi
callq 0x2100
leaq 0x6be9(%rip), %rax      # 0xa190
movl (%rax), %eax
addl %eax, (%r13)
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: get_word
char* get_word(FILE *fp){
    char ch='\0';
    int i = 0;
    char *temp  = (char *)calloc(50,sizeof(char));
    ch = '\0';
    while(ch != EOF){
        ch= fgetc(fp);
        if(ch == 10 || ch == 13 || ch == ' ' || ch == EOF){
            temp[i] = '\0';
            if(ch == EOF)
                return NULL;
            i=0;
            return temp;
        }
        else{
        temp[i] = ch;
        i++;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x32
popq %rdi
pushq $0x1
popq %rsi
callq 0x2180
movq %rax, %rbx
xorl %r15d, %r15d
xorl %eax, %eax
cmpb $-0x1, %al
je 0x362c
movq %r14, %rdi
callq 0x2130
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xff000000, %ecx       # imm = 0xFF000000
je 0x3619
cmpl $0xa000000, %ecx        # imm = 0xA000000
je 0x3619
cmpl $0x20000000, %ecx       # imm = 0x20000000
je 0x3619
cmpl $0xd000000, %ecx        # imm = 0xD000000
je 0x3619
movb %al, (%rbx,%r15)
incq %r15
jmp 0x35df
xorl %eax, %eax
cmpl $0xff000000, %ecx       # imm = 0xFF000000
movl %r15d, %ecx
movb $0x0, (%rbx,%rcx)
cmoveq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: printopt
void printopt(WINDOW *win, char** dict,int mark,int count){
    int x,y,i;
    x = 1; 
    y = 1;
    box(win,0,0);
    for(i = 0; i < 4 && i < count; i++ ){                        //show 4 or less most relevant words;
        if(mark == i+1){
            wattron(win,A_REVERSE);
            mvwprintw(win,y,x,"%s",dict[i]);
            wattroff(win,A_REVERSE);
        }
        else{
            mvwprintw(win, y, x, "%s", dict[i]);
        }
        y++;
    }
    wrefresh(win);
    return; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2070
movslq %r15d, %r15
movl %r12d, %r12d
decq %r12
xorl %r13d, %r13d
cmpq $0x3, %r13
ja 0x36fa
cmpq %r15, %r13
jge 0x36fa
leaq 0x1(%r13), %r14
cmpq %r13, %r12
jne 0x36d6
movq %rbx, %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x2160
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %r8
movq %rbx, %rdi
movl %r14d, %esi
pushq $0x1
popq %rdx
leaq 0x3a50(%rip), %rcx      # 0x710e
xorl %eax, %eax
callq 0x2110
movq %rbx, %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x22c0
jmp 0x36f5
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %r8
movq %rbx, %rdi
movl %r14d, %esi
pushq $0x1
popq %rdx
leaq 0x3a20(%rip), %rcx      # 0x710e
xorl %eax, %eax
callq 0x2110
movq %r14, %r13
jmp 0x3683
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: master_menu
void master_menu(){
    int y,x;
    getyx(stdscr,y,x);
    WINDOW *menu = create_newwin(3,bx,by-3,0);
    //wborder(menu, ' ', ' ', ' ',' ',' ',' ',' ',' ');
    wattron(menu,A_REVERSE);
    mvwprintw(menu,1,1," OPTIONS:F1 | SAVE:F5 | EXIT:F2 | ^X:CUT | ^C:COPY | SUGGESTIONS:TAB | VASU'S TEXT EDITOR | LINE NO.: %d | COORDINATES:(%d,%d)| #LINE:%d",y+stline+1,x,y,(y+stline)/10);
    wattroff(menu,A_REVERSE);
    wrefresh(menu);
    move(y,x);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x645d(%rip), %r12      # 0x9fe0
movq (%r12), %rax
testq %rax, %rax
je 0x3b96
movswl (%rax), %ebx
movswl 0x2(%rax), %r14d
jmp 0x3b9c
pushq $-0x1
popq %rbx
movl %ebx, %r14d
leaq 0x65f1(%rip), %rax      # 0xa194
movl (%rax), %esi
leaq 0x65e0(%rip), %rax      # 0xa18c
movl (%rax), %edx
addl $-0x3, %edx
pushq $0x3
popq %rdi
xorl %ecx, %ecx
callq 0x26cc
movq %rax, %r15
movq %rax, %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x2160
leaq 0x65c8(%rip), %rax      # 0xa19c
movl (%rax), %eax
leal (%rax,%rbx), %r8d
incl %r8d
addl %ebx, %eax
pushq $0xa
popq %rcx
cltd
idivl %ecx
movl %eax, %r10d
leaq 0x3445(%rip), %rcx      # 0x7034
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %edx, %esi
movl %r14d, %r9d
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0x2110
popq %rcx
popq %rdx
movq %r15, %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x22c0
movq %r15, %rdi
callq 0x2100
movq (%r12), %rdi
movl %ebx, %esi
movl %r14d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: line_copy
char* line_copy(int y){
    point *temp = data.front;
    while(y--){
        temp = temp->tail;
    }
    int i;
    node * traverse = temp->element.store;
    char *str = (char *)calloc(temp->element.width  + 1,1);
    for(i = 0; i < temp->element.width; i++){
        if(traverse->val == '\n')
            break;
        str[i] = traverse->val;
        traverse = traverse->next;
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
incl %edi
leaq 0x6595(%rip), %rbx      # 0xa1d8
movq (%rbx), %rbx
decl %edi
jne 0x3c43
movslq 0x10(%rbx), %r14
addq $0x8, %rbx
movq %r14, %rdi
incq %rdi
pushq $0x1
popq %rsi
callq 0x2180
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %edx
cmovgl %r14d, %edx
cmpq %rcx, %rdx
je 0x3c8d
movq (%rbx), %rbx
movb 0x8(%rbx), %sil
cmpb $0xa, %sil
je 0x3c8d
movb %sil, (%rax,%rcx)
addq $0x10, %rbx
incq %rcx
jmp 0x3c6e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: line_cut
char* line_cut(int y){
    point *temp = data.front;
    while(y--){
        temp = temp->tail;
    }
    int i = 0;
    char ch;
    char *str = (char *)calloc(temp->element.width  + 2,1);
    while(1){
        if(!isEmptys(&(temp->element))){
            ch = ipoploc(&(temp->element),0);
        }
        else
            break;
        if(ch == '\n'){
            inserts(&(temp->element),ch,0);
            break;
        }
        str[i++] = ch;
        str = realloc(str,strlen(str) + 2);
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
incl %edi
leaq 0x6533(%rip), %rbx      # 0xa1d8
movq (%rbx), %rbx
decl %edi
jne 0x3ca5
movslq 0x10(%rbx), %rdi
addq $0x8, %rbx
addq $0x2, %rdi
pushq $0x1
popq %rsi
callq 0x2180
movq %rax, %r14
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x254c
testl %eax, %eax
jne 0x3d0d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24ed
cmpb $0xa, %al
je 0x3d00
movb %al, (%r14,%r15)
incq %r15
movq %r14, %rdi
callq 0x20c0
leaq 0x2(%rax), %rsi
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
jmp 0x3cc6
pushq $0xa
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2432
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: word_cut
char* word_cut(int p,int q){
    point *temp = data.front;
    while(q--){
        temp = temp->tail;
    }
    int i = 0;
    char ch;
    char *str = (char *)calloc(2,1); 
    while(1){
        if(!isEmptys(&(temp->element)))
            ch = ipoploc(&(temp->element),p);
        else
            break;
        
        if(ch == '\n' || ch == ' '){
            inserts(&(temp->element),ch,p);
            break;
        }
        str[i++] = ch;    
        str = realloc(str,strlen(str) + 2);
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
incl %esi
leaq 0x64a7(%rip), %r14      # 0xa1d8
movq (%r14), %r14
decl %esi
jne 0x3d31
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
callq 0x2180
movq %rax, %r15
addq $0x8, %r14
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x254c
testl %eax, %eax
jne 0x3d9c
movq %r14, %rdi
movl %ebx, %esi
callq 0x24ed
cmpb $0x20, %al
je 0x3d8f
movzbl %al, %ecx
cmpl $0xa, %ecx
je 0x3d8f
movb %al, (%r15,%r12)
incq %r12
movq %r15, %rdi
callq 0x20c0
leaq 0x2(%rax), %rsi
movq %r15, %rdi
callq 0x2200
movq %rax, %r15
jmp 0x3d4d
movzbl %al, %esi
movq %r14, %rdi
movl %ebx, %edx
callq 0x2432
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: word_copy
char* word_copy(int p,int q){
    point *temp = data.front;
    while(q--){
        temp = temp->tail;
    }
    int i = 0;
    node * traverse = temp->element.store;
    while(p--){
        traverse = traverse->next;
    }
    char *str = (char *)calloc(2,1);
    while(1){
        if(!traverse->next || traverse->val == '\n' || traverse->val == ' ')
            break;
        str[i++] = traverse->val;
        str = realloc(str,strlen(str) + 2);
        traverse = traverse->next;
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
incl %esi
leaq 0x641d(%rip), %r14      # 0xa1d8
movq (%r14), %r14
decl %esi
jne 0x3dbb
addq $0x8, %r14
movq (%r14), %r14
subl $0x1, %edi
jb 0x3dd4
addq $0x10, %r14
jmp 0x3dc6
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
callq 0x2180
movq %rax, %rbx
xorl %r15d, %r15d
cmpq $0x0, 0x10(%r14)
je 0x3e1f
movzbl 0x8(%r14), %eax
cmpl $0xa, %eax
je 0x3e1f
cmpl $0x20, %eax
je 0x3e1f
movb %al, (%rbx,%r15)
incq %r15
movq %rbx, %rdi
callq 0x20c0
leaq 0x2(%rax), %rsi
movq %rbx, %rdi
callq 0x2200
movq %rax, %rbx
movq 0x10(%r14), %r14
jmp 0x3de5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: display_high
void display_high(int stline, int hx, int hy,int len){
    clear();
    move(0,0);
    int a,y,x;
    point *temp = data.front;
    for(a = 0; (a < stline) && (stline >=0); a++){
        temp = temp->tail;
    }
    int count = 1;
    while(temp){
        if(count >= (by - 3))
            break;
        node *row = temp->element.store;
        int check = 0;
        while(row->next){
            getyx(stdscr,y,x);
            if(((y+stline) == hy) && (x == hx)){
                wattron(stdscr,A_REVERSE);
                check = 1;
            }
            if(check == 1)
                len--;
            if(len  <= 0)
                wattroff(stdscr,A_REVERSE);    
            printw("%c",row->val);
            row = row->next;
        }
        count++;
        temp = temp->tail;
    }
    attroff(A_REVERSE);
    getyx(stdscr,y,x);
    refresh();
    line_num();
    move(y,x);
    return;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movl %edx, -0x34(%rbp)
movl %esi, -0x30(%rbp)
movl %edi, %r12d
movq 0x5f4f(%rip), %r14      # 0x9fe0
movq (%r14), %rdi
callq 0x20a0
movq (%r14), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2230
testl %r12d, %r12d
cmovgl %r12d, %r14d
incl %r14d
leaq 0x611f(%rip), %rcx      # 0xa1d8
movq (%rcx), %rcx
decl %r14d
jne 0x40b9
pushq $0x1
popq %rdx
pushq $-0x1
popq %r13
testq %rcx, %rcx
je 0x418d
leaq 0x60b4(%rip), %rax      # 0xa18c
movl (%rax), %eax
addl $-0x3, %eax
cmpl %eax, %edx
jge 0x418d
movl %edx, -0x2c(%rbp)
movq %rcx, -0x40(%rbp)
leaq 0x8(%rcx), %r15
xorl %r14d, %r14d
movq (%r15), %r15
cmpq $0x0, 0x10(%r15)
je 0x417c
movq 0x5edc(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl %r13d, %ecx
movl %r13d, %eax
testq %rdi, %rdi
je 0x4119
movswl (%rdi), %ecx
movswl 0x2(%rdi), %eax
addl %r12d, %ecx
cmpl -0x34(%rbp), %ecx
jne 0x413b
cmpl -0x30(%rbp), %eax
jne 0x413b
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x2160
movl %r13d, %eax
pushq $0x1
popq %r14
jmp 0x4146
xorl %eax, %eax
cmpl $0x1, %r14d
sete %al
negl %eax
addl %eax, %ebx
jg 0x4160
movq 0x5e8f(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x22c0
movsbl 0x8(%r15), %esi
addq $0x10, %r15
leaq 0x2ea4(%rip), %rdi      # 0x7014
xorl %eax, %eax
callq 0x2270
jmp 0x40f3
movl -0x2c(%rbp), %edx
incl %edx
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
jmp 0x40c8
movq 0x5e4c(%rip), %rbx      # 0x9fe0
movq (%rbx), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x22c0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x41b5
movswl (%rdi), %ebx
movswl 0x2(%rdi), %r14d
jmp 0x41bb
pushq $-0x1
popq %rbx
movl %ebx, %r14d
callq 0x2100
callq 0x2758
movq 0x5e14(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movl %ebx, %esi
movl %r14d, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/stdedit.c
// Function: self_destruct
void self_destruct(){
    while(!isEmptyq(&data)){
        while(!isEmptys(&(data.front->element)))
                ipops(&(data.front->element));
        dequeue(&data);
    }
    printf("\nThe Program terminated Successfully :)\nThanks For Using Vasu's Text Editor\n\n");
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x5525(%rip), %rbx      # 0xa1d8
movq %rbx, %rdi
callq 0x26b0
testl %eax, %eax
je 0x4ccd
jmp 0x4ce7
movq (%rbx), %rdi
addq $0x8, %rdi
callq 0x24bf
movq (%rbx), %rdi
addq $0x8, %rdi
callq 0x254c
testl %eax, %eax
je 0x4cc1
movq %rbx, %rdi
callq 0x2654
jmp 0x4cb3
leaq 0x278f(%rip), %rdi      # 0x747d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2060
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: add_event
void add_event(undo *s,char *state,int a,int b,char *c, char *d){
    event e;
    e.state = state;
    e.p1 = a;
    e.p2 = b;
    e.p3 = (char *)calloc(sizeof(c)+1,1);
    strcpy(e.p3,c);
    e.p4 = (char *)calloc(sizeof(d)+1,1);
    strcpy(e.p4,d);
    epush(s,e);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq %rsi, -0x50(%rbp)
movl %edx, -0x48(%rbp)
movl %ecx, -0x44(%rbp)
pushq $0x9
popq %r12
pushq $0x1
popq %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2050
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq %rax, -0x38(%rbp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
movq -0x30(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x541e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: backtrack
void backtrack(undo *s){
    if(isEmptye(s) || (s->num == 0)){
       return; 
    }
    event e = epop(s);
    
    if(strstr(e.state,"replace")){
        undo_replace(e);        
        char *temp = e.p3;
        e.p3 = e.p4;
        e.p4 = temp;
        epush(&redo,e);
    }
    else if(strstr(e.state,"add")){
        undo_insert(e);
        
    }
    else if(strstr(e.state,"back")){
        undo_back(e);
    }
    else if(strstr(e.state,"next")){
        undo_next(e);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
callq 0x54b1
testl %eax, %eax
je 0x4dad
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x0, 0x8(%rbx)
je 0x4da4
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5462
movq (%r14), %rbx
leaq 0x262b(%rip), %rsi      # 0x73f7
movq %rbx, %rdi
callq 0x22d0
testq %rax, %rax
je 0x4e33
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4edf
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x539f(%rip), %rdi      # 0xa1c8
callq 0x541e
jmp 0x4da4
leaq 0x21e2(%rip), %rsi      # 0x701c
movq %rbx, %rdi
callq 0x22d0
testq %rax, %rax
je 0x4e6b
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x5112
jmp 0x4da4
leaq 0x21ae(%rip), %rsi      # 0x7020
movq %rbx, %rdi
callq 0x22d0
testq %rax, %rax
je 0x4ea3
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x51f4
jmp 0x4da4
leaq 0x216d(%rip), %rsi      # 0x7017
movq %rbx, %rdi
callq 0x22d0
testq %rax, %rax
je 0x4da4
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x52b6
jmp 0x4da4
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: undo_insert
void undo_insert(event e){
    int x,y;
    getyx(stdscr,y,x);
    if(strstr(e.p3,"\n")){
        backspace(e.p2,1);
        epop(&states);
        display(stline);
        refresh();
        move(y,x);
    }
    else{
        backspace(e.p2,e.p1+1);
        epop(&states);
        display(stline);
        refresh();
    }
    if(x == e.p1)
        move(y,++x);

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
leaq 0x10(%rbp), %r12
movq 0x4eb4(%rip), %r15      # 0x9fe0
movq (%r15), %rax
testq %rax, %rax
je 0x513e
movswl (%rax), %ebx
movswl 0x2(%rax), %r14d
jmp 0x5144
pushq $-0x1
popq %rbx
movl %ebx, %r14d
movq 0x10(%r12), %rdi
pushq $0xa
popq %rsi
callq 0x20e0
movl 0xc(%r12), %edi
testq %rax, %rax
je 0x519d
pushq $0x1
popq %rsi
callq 0x2ffb
leaq 0x504e(%rip), %rsi      # 0xa1b8
leaq -0x48(%rbp), %rdi
callq 0x5462
leaq 0x5022(%rip), %rax      # 0xa19c
movl (%rax), %edi
callq 0x27dc
movq (%r15), %rdi
callq 0x2100
movq (%r15), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x2230
movl 0x8(%r12), %r12d
jmp 0x51d2
movl 0x8(%r12), %r12d
leal 0x1(%r12), %esi
callq 0x2ffb
leaq 0x5005(%rip), %rsi      # 0xa1b8
leaq -0x48(%rbp), %rdi
callq 0x5462
leaq 0x4fd9(%rip), %rax      # 0xa19c
movl (%rax), %edi
callq 0x27dc
movq (%r15), %rdi
callq 0x2100
cmpl %r12d, %r14d
jne 0x51e7
movq (%r15), %rdi
incl %r14d
movl %ebx, %esi
movl %r14d, %edx
callq 0x2230
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: undo_back
void undo_back(event e){
    int y,x;
    getyx(stdscr,y,x);
    if(strstr(e.p3,"\n")){
        add_char('\n',e.p2,e.p1);
        add_line(e.p2);
        display(stline);
        move(y,x+1);
    }
    else{
        add_char(e.p3[0],e.p2,e.p1-1);
        display(stline);
        move(y,x+1);
    }   
    display(stline);
    move(y,x+1);
    refresh();
    return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x10(%rbp), %r13
movq 0x4dd3(%rip), %r12      # 0x9fe0
movq (%r12), %rax
testq %rax, %rax
je 0x5222
movswl (%rax), %r14d
movswl 0x2(%rax), %ebx
incl %ebx
jmp 0x5228
xorl %ebx, %ebx
pushq $-0x1
popq %r14
movq 0x10(%r13), %r15
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x20e0
testq %rax, %rax
je 0x5259
movl 0x8(%r13), %edx
movl 0xc(%r13), %r15d
pushq $0xa
popq %rdi
movl %r15d, %esi
callq 0x2aa9
movl %r15d, %edi
callq 0x2928
jmp 0x526c
movsbl (%r15), %edi
movl 0x8(%r13), %edx
movl 0xc(%r13), %esi
decl %edx
callq 0x2aa9
leaq 0x4f29(%rip), %r15      # 0xa19c
movl (%r15), %edi
callq 0x27dc
movq (%r12), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x2230
movl (%r15), %edi
callq 0x27dc
movq (%r12), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x2230
movq (%r12), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: undo_next
void undo_next(event e){
    int x = 0,y = 0;
    getyx(stdscr,y,x);
    backspace(e.p2,0);
    epop(&states);
    clear();
    if((y == 0 ) && (stline != 0)){
        stline--;
    }
    display(stline);
    if(stline >  0){
        move(e.p2 - stline,getwidth(e.p2));
    }
    else{
        x += 2;
        move(e.p2,getwidth(e.p2 -stline));
    }
    refresh();
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq 0x4d10(%rip), %r12      # 0x9fe0
movq (%r12), %rcx
testq %rcx, %rcx
je 0x52e3
cmpw $0x0, (%rcx)
sete %r14b
jmp 0x52e6
xorl %r14d, %r14d
movl 0xc(%rax), %ebx
movl %ebx, %edi
xorl %esi, %esi
callq 0x2ffb
leaq 0x4ebf(%rip), %rsi      # 0xa1b8
leaq -0x48(%rbp), %rdi
callq 0x5462
movq (%r12), %rdi
callq 0x20a0
leaq 0x4e8a(%rip), %r15      # 0xa19c
movl (%r15), %edi
testl %edi, %edi
setne %al
andb %r14b, %al
cmpb $0x1, %al
jne 0x5326
decl %edi
movl %edi, (%r15)
callq 0x27dc
movl (%r15), %eax
movl %ebx, %r14d
subl %eax, %r14d
testl %eax, %eax
movq (%r12), %r15
movl %r14d, %edi
cmovgl %ebx, %edi
cmovlel %ebx, %r14d
callq 0x2fb6
movq %r15, %rdi
movl %r14d, %esi
movl %eax, %edx
callq 0x2230
movq (%r12), %rdi
callq 0x2100
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/undo.c
// Function: retrack
void retrack(undo *s){
     if(isEmptye(s) || s->num == 0){
       return; 
    }
    event e = epop(s);
    if(strstr(e.state,"replace")){
        undo_replace(e);        
        char *temp = e.p3;
        e.p3 = e.p4;
        e.p4 = temp;
        epush(&states,e);       
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
callq 0x54b1
testl %eax, %eax
je 0x538c
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x0, 0x8(%rbx)
je 0x5383
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5462
movq (%r14), %rdi
leaq 0x204c(%rip), %rsi      # 0x73f7
callq 0x22d0
testq %rax, %rax
je 0x5383
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4edf
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x4db3(%rip), %rdi      # 0xa1b8
callq 0x541e
jmp 0x5383
nop
// File: /workspace/github_c_makefile_star2_O2/vasusharma7[P]Text-Editor/events.c
// Function: epush
void epush(undo *s, event a){
    event *new = (event *)calloc(1,sizeof(event));
    *new  = a;
    if(!(s->e)){
        s->e = new;
        s->num++;
        return;
    }
    else
    {
        event *temp = s->e;
        s->e = new;
        s->e->ptr = temp;
        s->num++;
        return;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2180
movaps 0x10(%rbp), %xmm0
movaps 0x20(%rbp), %xmm1
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
movq 0x30(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq (%rbx), %rcx
movq %rax, (%rbx)
testq %rcx, %rcx
je 0x5458
movq %rcx, 0x20(%rax)
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq