LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: demuxDatagrama
Datagrama *demuxDatagrama(char *buffer){
	int res;
	Datagrama *novo = (Datagrama *) malloc(sizeof(struct segmento));
	res = sscanf(buffer, "%d %d %d %d %d %d %[^ ]", &novo->seq, &novo->ack, &novo->len, &novo->win_size, &novo->flags, &novo->cksum,novo->data);
	if(res< 7){ 
		free(novo); 
		return NULL;
	}
	else {
		int i, diff = (strlen(buffer)) - novo->len;
		for(i = 0; i < novo->len && i< TAM; i++) novo->data[i] = buffer[diff + i];
		novo->data[i] = '\0';
		return novo;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0xe0, %edi
callq 0x1110
movq %rax, %rbx
leaq 0x4(%rax), %rcx
leaq 0x8(%rax), %r15
leaq 0xc(%rax), %r9
leaq 0x10(%rax), %r10
leaq 0x14(%rax), %r11
leaq 0x18(%rax), %r12
subq $0x8, %rsp
leaq 0x19fe(%rip), %rsi      # 0x3007
movq %r14, %rdi
movq %rax, %rdx
movq %r15, %r8
xorl %eax, %eax
pushq %r12
pushq %r11
pushq %r10
callq 0x1120
addq $0x20, %rsp
cmpl $0x6, %eax
jg 0x1634
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0x1669
movq %r14, %rdi
callq 0x1070
movslq (%r15), %rcx
subl %ecx, %eax
cltq
addq %r14, %rax
xorl %edx, %edx
cmpq %rcx, %rdx
jge 0x1664
cmpq $0xc7, %rdx
ja 0x1664
movb (%rax,%rdx), %sil
movb %sil, 0x18(%rbx,%rdx)
incq %rdx
jmp 0x1648
movb $0x0, 0x18(%rbx,%rdx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: muxDatagrama
char *muxDatagrama(Datagrama *novo){
	if(novo){
	char *buffer = (char *)malloc(sizeof(char)*(TAM+24));
	sprintf(buffer, "%d %d %d %d %d %d %s", novo->seq, novo->ack, novo->len, novo->win_size, novo->flags, novo->cksum, novo->data);
	return buffer;
	}
	else return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x16cd
movq %rdi, %r14
movl $0xe0, %edi
callq 0x1110
movq %rax, %rbx
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
movl 0x10(%r14), %r10d
movl 0x14(%r14), %r11d
addq $0x18, %r14
subq $0x8, %rsp
leaq 0x1968(%rip), %rsi      # 0x301f
movq %rax, %rdi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
callq 0x1190
addq $0x20, %rsp
jmp 0x16cf
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: mostraFlagsActivas
void mostraFlagsActivas(int flags){
	if(flags & FL_SYN) printf("FL_SYN\n");
	if(flags & FL_ACK) printf("FL_ACK\n");
	if(flags & FL_FIN) printf("FL_FIN\n");
	if(flags & FL_GET) printf("FL_GET\n");
	if(flags & FL_ERRO) printf("FL_ERRO\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
testb $0x1, %bl
je 0x16f0
leaq 0x1a20(%rip), %rdi      # 0x310b
callq 0x1060
testb $0x2, %bl
je 0x1701
leaq 0x1a16(%rip), %rdi      # 0x3112
callq 0x1060
testb $0x4, %bl
je 0x1712
leaq 0x1a0c(%rip), %rdi      # 0x3119
callq 0x1060
testb $0x8, %bl
je 0x1723
leaq 0x1a02(%rip), %rdi      # 0x3120
callq 0x1060
testb $0x10, %bl
jne 0x172f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x19f1(%rip), %rdi      # 0x3127
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: mostraDatagrama
void mostraDatagrama(Datagrama *data){
if(data){
	printf("Ack: %d\n", data->ack);
	printf("Seq: %d\n", data->seq);
	printf("Len: %d\n", data->len);
	printf("Win_size: %d\n", data->win_size);
	printf("checksum: %d\n", data->cksum);
	mostraFlagsActivas(data->flags);
	printf("Data:%s", data->data);
	}
	else printf("Formato desconhecido");
}

// Assembly:
testq %rdi, %rdi
je 0x17ca
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %esi
leaq 0x18d7(%rip), %rdi      # 0x3034
xorl %eax, %eax
callq 0x1080
movl (%rbx), %esi
leaq 0x18d0(%rip), %rdi      # 0x303d
xorl %eax, %eax
callq 0x1080
movl 0x8(%rbx), %esi
leaq 0x18c8(%rip), %rdi      # 0x3046
xorl %eax, %eax
callq 0x1080
movl 0xc(%rbx), %esi
leaq 0x18c0(%rip), %rdi      # 0x304f
xorl %eax, %eax
callq 0x1080
movl 0x14(%rbx), %esi
leaq 0x18bd(%rip), %rdi      # 0x305d
xorl %eax, %eax
callq 0x1080
movl 0x10(%rbx), %edi
callq 0x16d7
addq $0x18, %rbx
leaq 0x18b1(%rip), %rdi      # 0x306b
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1080
leaq 0x18a2(%rip), %rdi      # 0x3073
xorl %eax, %eax
jmp 0x1080
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: readFile
int readFile(int file, int nbytes, char *buffer){
	int n, i = 0;
	n = 1;
	while(i < nbytes && n > 0){
	n = read(file, &(buffer[i]), 1);
	i++;
	}
	buffer[i] = '\0';
	return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %edi, %r15d
movslq %esi, %r13
pushq $0x1
popq %rax
xorl %r14d, %r14d
pushq $0x1
popq %r12
testl %eax, %eax
jle 0x1816
cmpq %r13, %r14
jge 0x1816
leaq (%rbx,%r14), %rsi
movl %r15d, %edi
movq %r12, %rdx
callq 0x10c0
incq %r14
jmp 0x17f9
movb $0x0, (%rbx,%r14)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/./datagrama.h
// Function: parteFicheiro
Datagrama *parteFicheiro(int fich, int nbytes, int seq){
	int length, bytesRead = 0;
	Datagrama *novo = initDatagrama();
	
	if(nbytes < TAM){
		length = nbytes;
	}else length = TAM;
		
	bytesRead = readFile(fich, length, novo->data);
	
	if(bytesRead == length){
	//numero de bytes lidos
		novo->seq = seq + bytesRead;
		novo->ack = 0;
		novo->len = strlen(novo->data);
		novo->win_size = 1;
		return novo;
	}
	else {
		novo->seq = seq + bytesRead;
		if(strlen(novo->data)==1) strcpy(novo->data,"c");
		novo->len = strlen(novo->data);
		novo->flags = FL_FIN;
		return novo;
		}
			
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %r14d
movl %edi, %r13d
callq 0x15aa
movq %rax, %rbx
movl $0xc8, %r12d
cmpl %r12d, %r14d
cmovll %r14d, %r12d
movq %rax, %r14
addq $0x18, %r14
movl %r13d, %edi
movl %r12d, %esi
movq %r14, %rdx
callq 0x17d8
cmpl %r12d, %eax
jne 0x1887
addl %r15d, %r12d
movl %r12d, (%rbx)
andl $0x0, 0x4(%rbx)
pushq $0x1
popq %r15
pushq $0xc
popq %r12
jmp 0x18a8
addl %r15d, %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x1070
pushq $0x4
popq %r15
pushq $0x10
popq %r12
cmpq $0x1, %rax
jne 0x18a8
movw $0x63, (%r14)
movq %r14, %rdi
callq 0x1070
movl %eax, 0x8(%rbx)
movl %r15d, (%rbx,%r12)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/clientec2.c
// Function: transfereFich
int transfereFich(int te, int tp, int sock, char *file, int destBuffer, ConState *con ,struct sockaddr_in *from, int fromlen){
	int trans, f, fin,  seq = 0;
	char *buffer;
	Datagrama *enviar;
	if((f = open(file, O_RDONLY))< 0){ //Ocorreu um erro na abertura do ficheiro. Possivelmente não existe
		enviar = initDatagrama();
		enviar->flags = (FL_ERRO | FL_FIN);
		buffer = muxDatagrama(enviar);
		free(enviar);
		sendto(sock,buffer,strlen(buffer), 0, (struct sockaddr *)from, fromlen);
		free(buffer);
		perror("open");
		return -1;
	}
	else {
		fin  = 0;
		trans = 1;
		while(!fin && trans){
			enviar = parteFicheiro(f, destBuffer, seq); //Segmento com atenção ao buffer do cliente
			enviar->cksum = checksum(enviar->data);     //Calcula o cksum da informação e junta ao segmento
			seq = enviar->seq;
			
			fin = (enviar->flags & FL_FIN);
			buffer = muxDatagrama(enviar);
			
			trans = sendMsg(te, tp, sock, buffer, con, seq, from, &fromlen);
			free(enviar);
			free(buffer);
		}
	return fin;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, -0x48(%rbp)
movl %r8d, -0x3c(%rbp)
movl %edx, -0x2c(%rbp)
movl %esi, -0x38(%rbp)
movl %edi, -0x34(%rbp)
movl 0x18(%rbp), %r12d
xorl %r15d, %r15d
movq %rcx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x1140
movl %eax, -0x30(%rbp)
testl %eax, %eax
js 0x1b7d
pushq $0x1
popq %r14
xorl %r12d, %r12d
testl %r15d, %r15d
jne 0x1bd6
testl %r14d, %r14d
je 0x1bd6
movl -0x30(%rbp), %edi
movl -0x3c(%rbp), %esi
movl %r12d, %edx
callq 0x182d
movq %rax, %r13
leaq 0x18(%rax), %rdi
callq 0x1349
movl %eax, 0x14(%r13)
movl (%r13), %r12d
movl 0x10(%r13), %r15d
andl $0x4, %r15d
movq %r13, %rdi
callq 0x1675
movq %rax, %rbx
movl -0x34(%rbp), %edi
movl -0x38(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %rax, %rcx
movq -0x48(%rbp), %r8
movl %r12d, %r9d
leaq 0x18(%rbp), %rax
pushq %rax
pushq 0x10(%rbp)
callq 0x18c9
popq %rcx
popq %rdx
movl %eax, %r14d
movq %r13, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
jmp 0x1aff
callq 0x15aa
movq %rax, %rbx
movl $0x14, 0x10(%rax)
movq %rax, %rdi
callq 0x1675
movq %rax, %r14
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1070
movl -0x2c(%rbp), %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
movq 0x10(%rbp), %r8
movl %r12d, %r9d
callq 0x10a0
movq %r14, %rdi
callq 0x1030
leaq 0x14cb(%rip), %rdi      # 0x3098
callq 0x1160
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/clientec2.c
// Function: trataPedido
Datagrama* trataPedido(char *pedido){
	if(strstr(pedido, "dir") && strstr(pedido, "get")==NULL){
	Datagrama *novo = initDatagrama();
	novo->flags = (FL_DIR);
	//strcpy(novo->data, "dir.cmd");
	novo->len = strlen("dir.cmd");
	novo->win_size = 1;
	return novo;
	}
	if(strstr(pedido, "get")){
	Datagrama *novo = initDatagrama();
	char ptr[5];
	novo->flags = (FL_GET);
	sscanf(pedido, "%s %s", ptr, novo->data);
	novo->len = strlen(novo->data);
	novo->win_size = 1;
	return novo;
	}
	if(strstr(pedido, "wait")){
	Datagrama *novo = initDatagrama();
	novo->flags = (FL_GET);
	strcpy(novo->data, "wait");
	novo->len = strlen(novo->data);
	novo->win_size = 1;
	return novo;
	}
	if(strstr(pedido, "put")){
	Datagrama *novo = initDatagrama();
	char ptr[5];
	novo->flags = (FL_PUT);
	sscanf(pedido, "%s %s", ptr, novo->data);
	novo->len = strlen(novo->data);
	novo->win_size = 1;
	return novo;
	}
	
	else return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0xf68(%rip), %rsi       # 0x30c9
callq 0x11d0
testq %rax, %rax
je 0x2183
leaq 0xf5b(%rip), %rsi       # 0x30cd
movq %rbx, %rdi
callq 0x11d0
testq %rax, %rax
je 0x220c
leaq 0xf43(%rip), %rsi       # 0x30cd
movq %rbx, %rdi
callq 0x11d0
testq %rax, %rax
je 0x21c7
callq 0x15aa
movq %rax, %r14
movl $0x8, 0x10(%rax)
leaq 0x18(%rax), %r15
leaq 0xf20(%rip), %rsi       # 0x30d1
leaq -0x22(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x1120
movq %r15, %rdi
jmp 0x21f9
leaq 0xf09(%rip), %rsi       # 0x30d7
movq %rbx, %rdi
callq 0x11d0
testq %rax, %rax
je 0x2237
callq 0x15aa
movq %rax, %r14
movl $0x8, 0x10(%rax)
leaq 0x18(%rax), %rdi
movl $0x74696177, 0x18(%rax) # imm = 0x74696177
movb $0x0, 0x1c(%rax)
callq 0x1070
movl %eax, 0x8(%r14)
movl $0x1, 0xc(%r14)
jmp 0x2229
callq 0x15aa
movq %rax, %r14
movl $0x20, 0x10(%rax)
movabsq $0x100000007, %rax      # imm = 0x100000007
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe9e(%rip), %rsi       # 0x30dc
movq %rbx, %rdi
callq 0x11d0
testq %rax, %rax
je 0x226e
callq 0x15aa
movq %rax, %r14
movl $0x40, 0x10(%rax)
leaq 0x18(%rax), %r15
leaq 0xe6c(%rip), %rsi       # 0x30d1
leaq -0x1d(%rbp), %rdx
jmp 0x21b5
xorl %r14d, %r14d
jmp 0x2229
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/clientec2.c
// Function: enviaPedido
int enviaPedido(int sock, char *buffer, struct sockaddr_in *servidor,int te, int tp){
	if(!buffer){
		printf("erro no comando\n");
		return 0;
	}else {
		n = sendto(sock,buffer, strlen(buffer),0,(struct sockaddr *)servidor ,(socklen_t)length);
              	if (n < 0) { 
              		perror("Sendto");
              		exit(1);
              	}
            	return 1;	
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x22bc
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
movq %rsi, %rdi
callq 0x1070
movl 0x3366(%rip), %r9d      # 0x5600
movl %r15d, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x10a0
movl %eax, 0x3361(%rip)      # 0x5614
testl %eax, %eax
js 0x22d5
pushq $0x1
popq %rax
jmp 0x22ca
leaq 0xe8b(%rip), %rdi       # 0x314e
callq 0x1060
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdd6(%rip), %rdi       # 0x30b2
callq 0x1160
pushq $0x1
popq %rdi
callq 0x11a0
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/clientec2.c
// Function: contem
Flag *contem(char **argv, char *token) {
        Flag *flag = NULL;
        int i;

        for(i=0; argv[i]!=NULL; i++) {
                if(strcasecmp(argv[i], token) == 0) { /* encontrei */
                        flag = (Flag *) malloc(sizeof(Flag));
                        flag->bool = 1;
                        flag->pos = i;
                        return flag;
                }
        }
        return flag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
testq %rdi, %rdi
je 0x24e8
movq %r14, %rsi
callq 0x1040
testl %eax, %eax
je 0x24d3
incq %r12
jmp 0x24b9
pushq $0x8
popq %rdi
callq 0x1110
movq %rax, %rbx
movl $0x1, (%rax)
movl %r12d, 0x4(%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ulisses[P]ftp-client-server/clientec2.c
// Function: main
int main(int args, char **argv) {
        Flag *tp = NULL;
        Flag *te = NULL;

        if((tp = contem(argv,"-tp"))==NULL) {
                errorMsg();
                exit(2);
        }

        if((te = contem(argv,"-te"))==NULL) {
                errorMsg();
                exit(3);
        }

        if(tp->bool && te->bool && args >5) {//a alterar aquando da programação da camada da aplicação
                cliente(atoi(argv[te->pos+1]),atoi(argv[tp->pos+1]), argv[5], argv[4]);
                /*Datagrama *teste = trataPedido(pedido);
                if(teste) mostraDatagrama(teste);
                free(teste);*/
        }
        return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r15d
leaq 0xbf8(%rip), %rsi       # 0x3103
movq %rbx, %rdi
callq 0x24a3
testq %rax, %rax
je 0x257e
movq %rax, %r14
leaq 0xbe5(%rip), %rsi       # 0x3107
movq %rbx, %rdi
callq 0x24a3
testq %rax, %rax
je 0x2587
cmpl $0x0, (%r14)
je 0x2571
cmpl $0x6, %r15d
jl 0x2571
cmpl $0x0, (%rax)
je 0x2571
movslq 0x4(%rax), %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1170
movl %eax, %r15d
movslq 0x4(%r14), %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1170
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rdx
movl %r15d, %edi
movl %eax, %esi
callq 0x22e9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2492
pushq $0x2
jmp 0x258e
callq 0x2492
pushq $0x3
popq %rdi
callq 0x11a0
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/tst/uint256.c
// Function: test_bits
void test_bits() {
    uint256_t a;
    clear256(&a);
    assert(bits256(&a) == 0);

    LOWER(LOWER(a)) = 1;
    assert(bits256(&a) == 1);

    LOWER(UPPER(a)) = 1;
    assert(bits128(&UPPER(a)) == 1);
    assert(bits256(&a) == 129);

    UPPER(UPPER(a)) = 0xff00000000000000;
    assert(bits128(&UPPER(a)) == 128);
    assert(bits256(&a) == 256);

    UPPER(UPPER(a)) = 0x7f00000000000000;
    assert(bits128(&UPPER(a)) == 127);
    assert(bits256(&a) == 255);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x32c1
movq %rbx, %rdi
callq 0x395f
testl %eax, %eax
jne 0x1ac4
movq %rsp, %rdi
movq $0x1, 0x18(%rdi)
callq 0x395f
cmpl $0x1, %eax
jne 0x1ae0
movq %rsp, %rdi
movq $0x1, 0x8(%rdi)
callq 0x3935
cmpl $0x1, %eax
jne 0x1afc
movq %rsp, %rdi
callq 0x395f
cmpl $0x81, %eax
jne 0x1b15
movabsq $-0x100000000000000, %rax # imm = 0xFF00000000000000
movq %rsp, %rdi
movq %rax, (%rdi)
callq 0x3935
cmpl $0x80, %eax
jne 0x1b2e
movq %rsp, %rdi
callq 0x395f
cmpl $0x100, %eax            # imm = 0x100
jne 0x1b47
movabsq $0x7f00000000000000, %rax # imm = 0x7F00000000000000
movq %rsp, %rdi
movq %rax, (%rdi)
callq 0x3935
cmpl $0x7f, %eax
jne 0x1b60
movq %rsp, %rdi
callq 0x395f
cmpl $0xff, %eax
jne 0x1b79
addq $0x20, %rsp
popq %rbx
retq
leaq 0x3c37(%rip), %rdi      # 0x5702
leaq 0x35a5(%rip), %rsi      # 0x5077
leaq 0x3c3a(%rip), %rcx      # 0x5713
pushq $0x58
jmp 0x1b90
leaq 0x3c3d(%rip), %rdi      # 0x5724
leaq 0x3589(%rip), %rsi      # 0x5077
leaq 0x3c1e(%rip), %rcx      # 0x5713
pushq $0x5b
jmp 0x1b90
leaq 0x3c32(%rip), %rdi      # 0x5735
leaq 0x356d(%rip), %rsi      # 0x5077
leaq 0x3c02(%rip), %rcx      # 0x5713
pushq $0x5e
jmp 0x1b90
leaq 0x3c31(%rip), %rdi      # 0x574d
leaq 0x3554(%rip), %rsi      # 0x5077
leaq 0x3be9(%rip), %rcx      # 0x5713
pushq $0x5f
jmp 0x1b90
leaq 0x3c2b(%rip), %rdi      # 0x5760
leaq 0x353b(%rip), %rsi      # 0x5077
leaq 0x3bd0(%rip), %rcx      # 0x5713
pushq $0x62
jmp 0x1b90
leaq 0x3c2c(%rip), %rdi      # 0x577a
leaq 0x3522(%rip), %rsi      # 0x5077
leaq 0x3bb7(%rip), %rcx      # 0x5713
pushq $0x63
jmp 0x1b90
leaq 0x3c26(%rip), %rdi      # 0x578d
leaq 0x3509(%rip), %rsi      # 0x5077
leaq 0x3b9e(%rip), %rcx      # 0x5713
pushq $0x66
jmp 0x1b90
leaq 0x3c27(%rip), %rdi      # 0x57a7
leaq 0x34f0(%rip), %rsi      # 0x5077
leaq 0x3b85(%rip), %rcx      # 0x5713
pushq $0x67
popq %rdx
callq 0x1030
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/tst/uint256.c
// Function: main
int main() {
    test_bitwise();
    test_bits();
    test_math();
    test_shiftar();
    test_exp();
    test_signextend();
    test_mulmod();
    return 0;
}

// Assembly:
pushq %rax
callq 0x114c
callq 0x19f5
callq 0x1b96
callq 0x1efd
callq 0x26ff
callq 0x2a73
callq 0x2f04
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftl128
void shiftl128(const uint128_t *number, uint32_t value, uint128_t *target) {
    if (value >= 128) {
        clear128(target);
    } else if (value == 64) {
        UPPER_P(target) = LOWER_P(number);
        LOWER_P(target) = 0;
    } else if (value == 0) {
        copy128(target, number);
    } else if (value < 64) {
        UPPER_P(target) =
            (UPPER_P(number) << value) + (LOWER_P(number) >> (64 - value));
        LOWER_P(target) = (LOWER_P(number) << value);
    } else if ((128 > value) && (value > 64)) {
        UPPER_P(target) = LOWER_P(number) << (value - 64);
        LOWER_P(target) = 0;
    } else {
        clear128(target);
    }
}

// Assembly:
cmpl $0x80, %esi
jb 0x32ee
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
retq
testl %esi, %esi
je 0x32fd
cmpl $0x40, %esi
jne 0x3309
movq 0x8(%rdi), %rax
jmp 0x3339
movq (%rdi), %rax
movq %rax, (%rdx)
movq 0x8(%rdi), %rax
jmp 0x332b
jae 0x3330
movq (%rdi), %rax
movl %esi, %ecx
shlq %cl, %rax
movq 0x8(%rdi), %r8
negb %cl
shrq %cl, %r8
addq %rax, %r8
movq %r8, (%rdx)
movq 0x8(%rdi), %rax
movl %esi, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rdx)
retq
movq 0x8(%rdi), %rax
movl %esi, %ecx
shlq %cl, %rax
movq %rax, (%rdx)
andq $0x0, 0x8(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftl256
void shiftl256(const uint256_t *number, uint32_t value, uint256_t *target) {
    if (value >= 256) {
        clear256(target);
    } else if (value == 128) {
        copy128(&UPPER_P(target), &LOWER_P(number));
        clear128(&LOWER_P(target));
    } else if (value == 0) {
        copy256(target, number);
    } else if (value < 128) {
        uint128_t tmp1;
        uint128_t tmp2;
        uint256_t result;
        shiftl128(&UPPER_P(number), value, &tmp1);
        shiftr128(&LOWER_P(number), (128 - value), &tmp2);
        add128(&tmp1, &tmp2, &UPPER(result));
        shiftl128(&LOWER_P(number), value, &LOWER(result));
        copy256(target, &result);
    } else if ((256 > value) && (value > 128)) {
        shiftl128(&LOWER_P(number), (value - 128), &UPPER_P(target));
        clear128(&LOWER_P(target));
    } else {
        clear256(target);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
cmpl $0x100, %esi            # imm = 0x100
jb 0x3368
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x3437
movl %esi, %ebp
movq %rdi, %r14
testb %bpl, %bpl
je 0x3391
movzbl %bpl, %eax
cmpl $0x80, %eax
jne 0x33b4
movq 0x10(%r14), %rax
movq %rax, (%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x8(%rbx)
jmp 0x3430
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
jmp 0x3437
cmpl $0x7f, %ebp
ja 0x341c
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x32df
addq $0x10, %r14
movl $0x80, %esi
subl %ebp, %esi
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x3444
movq 0x8(%r15), %rax
addq 0x8(%r12), %rax
movq (%r12), %rcx
adcq (%r15), %rcx
leaq 0x30(%rsp), %r15
movq %rcx, -0x10(%r15)
movq %rax, -0x8(%r15)
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x32df
movaps -0x10(%r15), %xmm0
movups %xmm0, (%rbx)
movaps (%r15), %xmm0
jmp 0x3433
addq $0x10, %r14
addl $-0x80, %ebp
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32df
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftr128
void shiftr128(const uint128_t *number, uint32_t value, uint128_t *target) {
    if (value >= 128) {
        clear128(target);
    } else if (value == 64) {
        UPPER_P(target) = 0;
        LOWER_P(target) = UPPER_P(number);
    } else if (value == 0) {
        copy128(target, number);
    } else if (value < 64) {
        uint128_t result;
        UPPER(result) = UPPER_P(number) >> value;
        LOWER(result) =
            (UPPER_P(number) << (64 - value)) + (LOWER_P(number) >> value);
        copy128(target, &result);
    } else if ((128 > value) && (value > 64)) {
        LOWER_P(target) = UPPER_P(number) >> (value - 64);
        UPPER_P(target) = 0;
    } else {
        clear128(target);
    }
}

// Assembly:
cmpl $0x80, %esi
jb 0x3453
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
retq
testl %esi, %esi
je 0x3465
cmpl $0x40, %esi
jne 0x3474
andq $0x0, (%rdx)
movq (%rdi), %rax
jmp 0x346f
movq (%rdi), %rax
movq %rax, (%rdx)
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rdx)
retq
movq (%rdi), %rax
jae 0x349a
movq %rax, %r8
movl %esi, %ecx
shrq %cl, %r8
negb %cl
shlq %cl, %rax
movq 0x8(%rdi), %rdi
movl %esi, %ecx
shrq %cl, %rdi
addq %rax, %rdi
movq %r8, (%rdx)
movq %rdi, 0x8(%rdx)
retq
movl %esi, %ecx
shrq %cl, %rax
movq %rax, 0x8(%rdx)
andq $0x0, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: add128
void add128(const uint128_t *number1, const uint128_t *number2, uint128_t *target) {
    UPPER_P(target) =
        UPPER_P(number1) + UPPER_P(number2) +
        ((LOWER_P(number1) + LOWER_P(number2)) < LOWER_P(number1));
    LOWER_P(target) = LOWER_P(number1) + LOWER_P(number2);
}

// Assembly:
movq (%rsi), %rax
movq 0x8(%rdi), %rcx
addq 0x8(%rsi), %rcx
adcq (%rdi), %rax
movq %rax, (%rdx)
movq 0x8(%rsi), %rax
addq 0x8(%rdi), %rax
movq %rax, 0x8(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftl512
void shiftl512(const uint512_t *number, uint32_t value, uint512_t *target) {
    if (value >= 512) {
        clear512(target);
    } else if (value == 256) {
        copy256(&UPPER_P(target), &LOWER_P(number));
        clear256(&LOWER_P(target));
    } else if (value == 0) {
        copy512(target, number);
    } else if (value < 256) {
        uint256_t tmp1;
        uint256_t tmp2;
        uint512_t result;
        shiftl256(&UPPER_P(number), value, &tmp1);
        shiftr256(&LOWER_P(number), (256 - value), &tmp2);
        add256(&tmp1, &tmp2, &UPPER(result));
        shiftl256(&LOWER_P(number), value, &LOWER(result));
        copy512(target, &result);
    } else if ((512 > value) && (value > 256)) {
        shiftl256(&LOWER_P(number), (value - 256), &UPPER_P(target));
        clear256(&LOWER_P(target));
    } else {
        clear512(target);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
cmpl $0x200, %esi            # imm = 0x200
jb 0x34f7
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x35e2
movl %esi, %ebp
movq %rdi, %r14
testl %esi, %esi
je 0x3533
cmpl $0x100, %ebp            # imm = 0x100
jne 0x354d
movq 0x20(%r14), %rax
movq %rax, (%rbx)
movq 0x28(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
jmp 0x35ba
movq %rbx, %rdi
movq %r14, %rsi
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x327b
jae 0x35c0
leaq 0x60(%rsp), %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3342
addq $0x20, %r14
movl $0x100, %esi            # imm = 0x100
subl %ebp, %esi
leaq 0x40(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x35f2
movq %rsp, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x36e3
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3342
movaps -0x20(%r15), %xmm0
movups %xmm0, (%rbx)
movaps -0x10(%r15), %xmm0
movups %xmm0, 0x10(%rbx)
movaps (%r15), %xmm0
movups %xmm0, 0x20(%rbx)
movaps 0x10(%r15), %xmm0
movups %xmm0, 0x30(%rbx)
jmp 0x35e2
addq $0x20, %r14
addl $0xffffff00, %ebp       # imm = 0xFFFFFF00
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x3342
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftr256
void shiftr256(const uint256_t *number, uint32_t value, uint256_t *target) {
    if (value >= 256) {
        clear256(target);
    } else if (value == 128) {
        copy128(&LOWER_P(target), &UPPER_P(number));
        clear128(&UPPER_P(target));
    } else if (value == 0) {
        copy256(target, number);
    } else if (value < 128) {
        uint128_t tmp1;
        uint128_t tmp2;
        uint256_t result;
        shiftr128(&UPPER_P(number), value, &UPPER(result));
        shiftr128(&LOWER_P(number), value, &tmp1);
        shiftl128(&UPPER_P(number), (128 - value), &tmp2);
        add128(&tmp1, &tmp2, &LOWER(result));
        copy256(target, &result);
    } else if ((256 > value) && (value > 128)) {
        shiftr128(&UPPER_P(number), (value - 128), &LOWER_P(target));
        clear128(&UPPER_P(target));
    } else {
        clear256(target);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
cmpl $0x100, %esi            # imm = 0x100
jb 0x3617
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x36d1
movl %esi, %ebp
movq %rdi, %r14
testb %bpl, %bpl
je 0x3640
movzbl %bpl, %eax
cmpl $0x80, %eax
jne 0x365c
movq (%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x18(%rbx)
jmp 0x36ce
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %rax
jmp 0x36b7
cmpl $0x7f, %ebp
ja 0x36bd
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3444
leaq 0x10(%r14), %rdi
leaq 0x10(%rsp), %r12
movl %ebp, %esi
movq %r12, %rdx
callq 0x3444
movl $0x80, %esi
subl %ebp, %esi
movq %rsp, %r13
movq %r14, %rdi
movq %r13, %rdx
callq 0x32df
movq 0x8(%r12), %rax
addq 0x8(%r13), %rax
movq (%r13), %rcx
adcq (%r12), %rcx
movaps (%r15), %xmm0
movups %xmm0, (%rbx)
movq %rcx, 0x10(%rbx)
movq %rax, 0x18(%rbx)
jmp 0x36d4
addl $-0x80, %ebp
leaq 0x10(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x3444
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: add256
void add256(const uint256_t *number1, const uint256_t *number2, uint256_t *target) {
    uint128_t tmp;
    add128(&UPPER_P(number1), &UPPER_P(number2), &UPPER_P(target));
    add128(&LOWER_P(number1), &LOWER_P(number2), &tmp);
    if (gt128(&LOWER_P(number1), &tmp)) {
        uint128_t one;
        UPPER(one) = 0;
        LOWER(one) = 1;
        add128(&UPPER_P(target), &one, &UPPER_P(target));
    }
    add128(&LOWER_P(number1), &LOWER_P(number2), &LOWER_P(target));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
callq 0x34a8
leaq 0x10(%r12), %r15
addq $0x10, %r14
movq %rsp, %r13
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x34a8
movq (%r13), %rax
cmpq %rax, 0x10(%r12)
jne 0x372d
movq 0x18(%r12), %rax
cmpq 0x8(%rsp), %rax
jbe 0x374b
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
movq $0x1, 0x8(%rsi)
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x34a8
addq $0x10, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x34a8
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftr512
void shiftr512(const uint512_t *number, uint32_t value, uint512_t *target) {
    if (value >= 512) {
        clear512(target);
    } else if (value == 256) {
        copy256(&LOWER_P(target), &UPPER_P(number));
        clear256(&UPPER_P(target));
    } else if (value == 0) {
        copy512(target, number);
    } else if (value < 256) {
        uint256_t tmp1;
        uint256_t tmp2;
        uint512_t result;
        shiftr256(&UPPER_P(number), value, &UPPER(result));
        shiftr256(&LOWER_P(number), value, &tmp1);
        shiftl256(&UPPER_P(number), (256 - value), &tmp2);
        add256(&tmp1, &tmp2, &LOWER(result));
        copy512(target, &result);
    } else if ((512 > value) && (value > 256)) {
        shiftr256(&UPPER_P(number), (value - 256), &LOWER_P(target));
        clear256(&UPPER_P(target));
    } else {
        clear512(target);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
cmpl $0x200, %esi            # imm = 0x200
jb 0x379b
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x3862
movl %esi, %ebp
movq %rdi, %r14
testl %esi, %esi
je 0x37da
cmpl $0x100, %ebp            # imm = 0x100
jne 0x37f4
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x30(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
jmp 0x3862
movq %rbx, %rdi
movq %r14, %rsi
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x327b
jae 0x3872
movq %rsp, %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x35f2
leaq 0x20(%r14), %rdi
leaq 0x60(%rsp), %r15
movl %ebp, %esi
movq %r15, %rdx
callq 0x35f2
movl $0x100, %esi            # imm = 0x100
subl %ebp, %esi
leaq 0x40(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x3342
leaq 0x20(%rsp), %r14
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x36e3
movaps -0x20(%r14), %xmm0
movups %xmm0, (%rbx)
movaps -0x10(%r14), %xmm0
movups %xmm0, 0x10(%rbx)
movaps (%r14), %xmm0
movups %xmm0, 0x20(%rbx)
movaps 0x10(%r14), %xmm0
movups %xmm0, 0x30(%rbx)
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addl $0xffffff00, %ebp       # imm = 0xFFFFFF00
leaq 0x20(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x35f2
xorps %xmm0, %xmm0
jmp 0x378f
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: shiftar256
void shiftar256(const uint256_t *number, uint32_t value, uint256_t *target) {
    bool positive = (UPPER(UPPER_P(number)) < 0x8000000000000000);
    shiftr256(number, value, target);
    if (positive) return;
    if (!value) return;
    if (value >= 64) {
        UPPER(UPPER_P(target)) = 0xffffffffffffffffllu;
        if (value >= 128) {
            LOWER(UPPER_P(target)) = 0xffffffffffffffffllu;
            if (value >= 192) {
                UPPER(LOWER_P(target)) = 0xffffffffffffffffllu;
                if (value >= 256) {
                    LOWER(LOWER_P(target)) = 0xffffffffffffffffllu;
                } else if (value > 192) {
                    LOWER(LOWER_P(target)) |= 0xffffffffffffffffllu - ((1llu << (256 - value)) - 1llu);
                }
            } else if (value > 128) {
                UPPER(LOWER_P(target)) |= 0xffffffffffffffffllu - ((1llu << (192 - value)) - 1llu);
            }
        } else if (value > 64) {
            LOWER(UPPER_P(target)) |= 0xffffffffffffffffllu - ((1llu << (128 - value)) - 1llu);
        }
    } else {
        UPPER(UPPER_P(target)) |= 0xffffffffffffffffllu - ((1llu << (64 - value)) - 1llu);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq (%rdi), %r14
callq 0x35f2
testl %ebp, %ebp
je 0x38e8
testq %r14, %r14
jns 0x38e8
cmpl $0x40, %ebp
jb 0x38da
orq $-0x1, (%rbx)
cmpl $0x80, %ebp
jb 0x38ed
orq $-0x1, 0x8(%rbx)
cmpl $0xc0, %ebp
jb 0x3903
orq $-0x1, 0x10(%rbx)
cmpl $0x100, %ebp            # imm = 0x100
jb 0x391c
orq $-0x1, 0x18(%rbx)
jmp 0x38e8
negb %bpl
pushq $-0x1
popq %rax
movl %ebp, %ecx
shlq %cl, %rax
orq %rax, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x40, %ebp
je 0x38e8
negb %bpl
pushq $-0x1
popq %rax
movl %ebp, %ecx
shlq %cl, %rax
orq %rax, 0x8(%rbx)
jmp 0x38e8
cmpl $0x80, %ebp
je 0x38e8
negb %bpl
pushq $-0x1
popq %rax
movl %ebp, %ecx
shlq %cl, %rax
orq %rax, 0x10(%rbx)
jmp 0x38e8
cmpl $0xc0, %ebp
je 0x38e8
negb %bpl
pushq $-0x1
popq %rax
movl %ebp, %ecx
shlq %cl, %rax
orq %rax, 0x18(%rbx)
jmp 0x38e8
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: bits128
uint32_t bits128(const uint128_t *number) {
    uint32_t result = 0;
    if (UPPER_P(number)) {
        result = 64;
        uint64_t up = UPPER_P(number);
        while (up) {
            up >>= 1;
            result++;
        }
    } else {
        uint64_t low = LOWER_P(number);
        while (low) {
            low >>= 1;
            result++;
        }
    }
    return result;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x394c
pushq $0x40
popq %rax
testq %rcx, %rcx
je 0x395e
shrq %rcx
incl %eax
jmp 0x3940
movq 0x8(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x395e
shrq %rcx
incl %eax
jmp 0x3952
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: bits256
uint32_t bits256(const uint256_t *number) {
    if (!zero128(&UPPER_P(number))) {
        return 128 + bits128(&UPPER_P(number));
    } else {
        return bits128(&LOWER_P(number));
    }
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
jne 0x396c
cmpq $0x0, (%rdi)
je 0x3977
pushq %rax
callq 0x3935
subl $-0x80, %eax
popq %rcx
retq
addq $0x10, %rdi
jmp 0x3935
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: sgt256
bool sgt256(const uint256_t *number1, const uint256_t *number2) {
    return (
        UPPER(UPPER_P(number1)) >= 0x8000000000000000 == UPPER(UPPER_P(number2)) >= 0x8000000000000000
        ? gt256(number1, number2)
        : gt256(number2, number1)
    );
}

// Assembly:
movq %rdi, %rax
movq (%rsi), %rcx
xorq (%rdi), %rcx
js 0x3b14
movq %rax, %rdi
jmp 0x3a36
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x3a36
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: add512
void add512(const uint512_t *number1, const uint512_t *number2, uint512_t *target) {
    uint256_t tmp;
    add256(&UPPER_P(number1), &UPPER_P(number2), &UPPER_P(target));
    add256(&LOWER_P(number1), &LOWER_P(number2), &tmp);
    if (gt256(&LOWER_P(number1), &tmp)) {
        uint256_t one;
        clear128(&UPPER(one));
        UPPER(LOWER(one)) = 0;
        LOWER(LOWER(one)) = 1;
        add256(&UPPER_P(target), &one, &UPPER_P(target));
    }
    copy256(&LOWER_P(target), &tmp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x36e3
addq $0x20, %r15
addq $0x20, %r14
movq %rsp, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x36e3
movq %r15, %rdi
movq %r12, %rsi
callq 0x3a36
testb %al, %al
je 0x3b83
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq $0x1, 0x18(%rsi)
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x36e3
movaps (%rsp), %xmm0
movups %xmm0, 0x20(%rbx)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x30(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: minus256
void minus256(const uint256_t *number1, const uint256_t *number2, uint256_t *target) {
    uint128_t tmp;
    minus128(&UPPER_P(number1), &UPPER_P(number2), &UPPER_P(target));
    minus128(&LOWER_P(number1), &LOWER_P(number2), &tmp);
    if (gt128(&tmp, &LOWER_P(number1))) {
        uint128_t one;
        UPPER(one) = 0;
        LOWER(one) = 1;
        minus128(&UPPER_P(target), &one, &UPPER_P(target));
    }
    minus128(&LOWER_P(number1), &LOWER_P(number2), &LOWER_P(target));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
callq 0x3ba0
leaq 0x10(%r13), %r14
leaq 0x10(%r12), %r15
movq 0x10(%r13), %rdx
movq 0x18(%r13), %rax
movq 0x18(%r12), %rcx
cmpq %rcx, %rax
movq %rdx, %rsi
sbbq 0x10(%r12), %rsi
cmpq %rdx, %rsi
jne 0x3c02
cmpq %rax, %rcx
jbe 0x3c1e
movq %rsp, %rsi
andq $0x0, (%rsi)
movq $0x1, 0x8(%rsi)
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x3ba0
addq $0x10, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3ba0
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: minus512
void minus512(const uint512_t *number1, const uint512_t *number2, uint512_t *target) {
    uint256_t tmp;
    minus256(&UPPER_P(number1), &UPPER_P(number2), &UPPER_P(target));
    minus256(&LOWER_P(number1), &LOWER_P(number2), &tmp);
    if (gt256(&tmp, &LOWER_P(number1))) {
        uint256_t one;
        clear128(&UPPER(one));
        UPPER(LOWER(one)) = 0;
        LOWER(LOWER(one)) = 1;
        minus256(&UPPER_P(target), &one, &UPPER_P(target));
    }
    minus256(&LOWER_P(number1), &LOWER_P(number2), &LOWER_P(target));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x3bbe
addq $0x20, %r15
addq $0x20, %r14
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3bbe
movq %r12, %rdi
movq %r15, %rsi
callq 0x3a36
testb %al, %al
je 0x3ca1
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq $0x1, 0x18(%rsi)
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x3bbe
addq $0x20, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3bbe
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: mul128
void mul128(const uint128_t *number1, const uint128_t *number2, uint128_t *target) {
    uint64_t top[4] = {UPPER_P(number1) >> 32, UPPER_P(number1) & 0xffffffff,
                       LOWER_P(number1) >> 32, LOWER_P(number1) & 0xffffffff};
    uint64_t bottom[4] = {UPPER_P(number2) >> 32, UPPER_P(number2) & 0xffffffff,
                          LOWER_P(number2) >> 32,
                          LOWER_P(number2) & 0xffffffff};
    uint64_t products[4][4];
    uint128_t tmp, tmp2;

    for (uint8_t y = 4; y --> 0;) {
        for (uint8_t x = 4; x --> 0;) {
            products[3 - x][y] = top[x] * bottom[y];
        }
    }

    uint64_t fourth32 = products[0][3] & 0xffffffff;
    uint64_t third32 = (products[0][2] & 0xffffffff) + (products[0][3] >> 32);
    uint64_t second32 = (products[0][1] & 0xffffffff) + (products[0][2] >> 32);
    uint64_t first32 = (products[0][0] & 0xffffffff) + (products[0][1] >> 32);

    third32 += products[1][3] & 0xffffffff;
    second32 += (products[1][2] & 0xffffffff) + (products[1][3] >> 32);
    first32 += (products[1][1] & 0xffffffff) + (products[1][2] >> 32);

    second32 += products[2][3] & 0xffffffff;
    first32 += (products[2][2] & 0xffffffff) + (products[2][3] >> 32);

    first32 += products[3][3] & 0xffffffff;

    UPPER(tmp) = first32 << 32;
    LOWER(tmp) = 0;
    UPPER(tmp2) = third32 >> 32;
    LOWER(tmp2) = third32 << 32;
    add128(&tmp, &tmp2, target);
    UPPER(tmp) = second32;
    LOWER(tmp) = 0;
    add128(&tmp, target, &tmp2);
    UPPER(tmp) = 0;
    LOWER(tmp) = fourth32;
    add128(&tmp, &tmp2, target);
}

// Assembly:
subq $0x48, %rsp
movq (%rdi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x60(%rsp)
movq %rcx, -0x58(%rsp)
movq 0x8(%rdi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x50(%rsp)
movq %rcx, -0x48(%rsp)
movq (%rsi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x80(%rsp)
movq %rcx, -0x78(%rsp)
movq 0x8(%rsi), %rax
movl %eax, %ecx
shrq $0x20, %rax
movq %rax, -0x70(%rsp)
movq %rcx, -0x68(%rsp)
movabsq $0x4, %rax
movabsq $0x3, %rcx
subq $0x1, %rax
jb 0x3ea6
movzbl %al, %esi
movl %esi, %edi
movq -0x80(%rsp,%rdi,8), %rdi
movq %rcx, %r8
cmpq $-0x1, %r8
je 0x3e62
movzbl %r8b, %r9d
movl %r9d, %r10d
movq -0x60(%rsp,%r10,8), %r10
imulq %rdi, %r10
movq %rcx, %r11
subq %r9, %r11
shlq $0x5, %r11
leaq (%rsp,%r11), %r9
addq $-0x40, %r9
movq %r10, (%r9,%rsi,8)
decq %r8
jmp 0x3e75
movq -0x28(%rsp), %r9
movl %r9d, %eax
movq -0x38(%rsp), %rsi
movq -0x30(%rsp), %r8
movl %r8d, %ecx
shrq $0x20, %r9
addq %rcx, %r9
movl %esi, %ecx
shrq $0x20, %r8
addq %rcx, %r8
shrq $0x20, %rsi
movq -0x8(%rsp), %rdi
movl %edi, %ecx
addq %r9, %rcx
movq -0x10(%rsp), %r9
movl %r9d, %r10d
shrq $0x20, %rdi
addq %r10, %rdi
addq %r8, %rdi
shrq $0x20, %r9
movq 0x18(%rsp), %r8
movl %r8d, %r10d
shrq $0x20, %r8
addl -0x40(%rsp), %esi
addl %esi, %r9d
addl -0x18(%rsp), %r9d
addl %r9d, %r8d
addl 0x10(%rsp), %r8d
addl 0x38(%rsp), %r8d
addq %rdi, %r10
shldq $0x20, %rcx, %r8
shlq $0x20, %rcx
orq %rax, %rcx
addq %r10, %r8
movq %r8, (%rdx)
movq %rcx, 0x8(%rdx)
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: exp256
void exp256(const uint256_t *base, const uint256_t *power, uint256_t *target) {
    uint256_t remaining, result;
    copy256(&remaining, power);
    UPPER(UPPER(result)) = 0;
    LOWER(UPPER(result)) = 0;
    UPPER(LOWER(result)) = 0;
    LOWER(LOWER(result)) = 1;
    uint256_t multiplier;
    copy256(&multiplier, base);
    while (!zero256(&remaining)) {
        if (LOWER(LOWER(remaining)) & 1) {
            mul256(&result, &multiplier, &result);
        }
        mul256(&multiplier, &multiplier, &multiplier);
        shiftr256(&remaining, 1, &remaining);
    }
    copy256(target, &result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movups (%rsi), %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq 0x10(%rsi), %rax
movq %rax, 0x10(%r14)
movq 0x18(%rsi), %rax
movq %rax, 0x18(%r14)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%r15)
movq $0x1, 0x18(%r15)
movups (%rdi), %xmm0
leaq 0x40(%rsp), %r12
movaps %xmm0, (%r12)
movups 0x10(%rdi), %xmm0
movaps %xmm0, 0x10(%r12)
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x458f
testb $0x1, %al
je 0x45a6
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3f32
jmp 0x45a6
cmpq $0x0, 0x10(%rsp)
jne 0x45a6
cmpq $0x0, 0x8(%rsp)
jne 0x45a6
cmpq $0x0, (%rsp)
je 0x45c8
movq %r12, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x3f32
movq %r14, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x35f2
movq 0x18(%rsp), %rax
jmp 0x4576
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/uint256.c
// Function: divmod128
void divmod128(const uint128_t *l, const uint128_t *r, uint128_t *retDiv,
               uint128_t *retMod) {
    uint128_t copyd, adder, resDiv, resMod;
    uint128_t one;
    UPPER(one) = 0;
    LOWER(one) = 1;
    uint32_t diffBits = bits128(l) - bits128(r);
    clear128(&resDiv);
    copy128(&resMod, l);
    if (gt128(r, l)) {
        copy128(retMod, l);
        clear128(retDiv);
    } else {
        shiftl128(r, diffBits, &copyd);
        shiftl128(&one, diffBits, &adder);
        if (gt128(&copyd, &resMod)) {
            shiftr128(&copyd, 1, &copyd);
            shiftr128(&adder, 1, &adder);
        }
        while (gte128(&resMod, r)) {
            if (gte128(&resMod, &copyd)) {
                minus128(&resMod, &copyd, &resMod);
                or128(&resDiv, &adder, &resDiv);
            }
            shiftr128(&copyd, 1, &copyd);
            shiftr128(&adder, 1, &adder);
        }
        copy128(retDiv, &resDiv);
        copy128(retMod, &resMod);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r12
andq $0x0, 0x28(%rsp)
movq $0x1, 0x30(%rsp)
callq 0x3935
movl %eax, %ebp
movq %r15, %rdi
callq 0x3935
movq (%r12), %r14
movq 0x8(%r12), %r13
movq (%r15), %rbx
cmpq %r14, %rbx
jne 0x465e
cmpq %r13, 0x8(%r15)
jbe 0x4681
movq 0x20(%rsp), %rcx
movq %r14, (%rcx)
movq 0x8(%r12), %rax
movq %rax, 0x8(%rcx)
xorps %xmm0, %xmm0
movq 0x18(%rsp), %rax
movups %xmm0, (%rax)
jmp 0x4758
subl %eax, %ebp
leaq 0x38(%rsp), %r12
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x32df
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl %ebp, %esi
callq 0x32df
movq (%r12), %rdx
cmpq %r14, %rdx
jne 0x46be
movq 0x40(%rsp), %rax
movq %r14, %rcx
cmpq %r13, %rax
ja 0x46c5
jmp 0x46f1
movq 0x40(%rsp), %rax
jbe 0x46ee
movq %rdx, %rcx
shrq %rcx
shrdq $0x1, %rdx, %rax
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
shrdq $0x1, %rdx, %rsi
shrq %rdx
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
jmp 0x46f1
movq %rdx, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %rdi
xorl %edx, %edx
xorl %esi, %esi
cmpq %rbx, %r14
jne 0x470c
cmpq 0x8(%r15), %r13
jae 0x470e
jmp 0x473d
jbe 0x4740
cmpq %rcx, %r14
jne 0x471d
cmpq %rax, %r13
jae 0x471f
movq %rcx, %r14
jmp 0x472b
jbe 0x472b
subq %rax, %r13
sbbq %rcx, %r14
orq %r8, %rdx
orq %rdi, %rsi
shrdq $0x1, %rcx, %rax
shrq %rcx
shrdq $0x1, %r8, %rdi
shrq %r8
jmp 0x46ff
movq %rbx, %r14
movq 0x18(%rsp), %rax
movq %rdx, (%rax)
movq %rsi, 0x8(%rax)
movq 0x20(%rsp), %rax
movq %r14, (%rax)
movq %r13, 0x8(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq