LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]windowchef/helpers.c
// Function: list_move_to_head
void
list_move_to_head(struct list_item **list, struct list_item *item)
{
	if (list == NULL || *list == NULL || *list == item || item == NULL)
		return;

	/* fill the hole */
	if (item->prev != NULL)
	    item->prev->next = item->next;
	if (item->next != NULL)
	    item->next->prev = item->prev;

	/* we are at the head, nothing is behind us now */
	item->prev = NULL;
	item->next = *list;
	item->next->prev = item;
	*list = item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xb6d1
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb6d1
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
je 0xb6d1
cmpq $0x0, -0x10(%rbp)
jne 0xb6d3
jmp 0xb747
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xb6f2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xb711
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]windowchef/helpers.c
// Function: list_add_item
struct list_item*
list_add_item(struct list_item **list)
{
	struct list_item *item;

	item = malloc(sizeof(struct list_item));
	if (item == NULL)
		return NULL;

	if (*list == NULL) {
		item->prev = item->next = NULL;
	} else {
		item->prev = NULL;
		item->next = *list;
		item->next->prev = item;
	}

	*list = item;

	return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x18, %edi
callq 0x31b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xb77b
movq $0x0, -0x8(%rbp)
jmp 0xb7dd
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xb79f
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0xb7ca
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]windowchef/helpers.c
// Function: list_delete_item
void
list_delete_item(struct list_item **list, struct list_item *item)
{
	if (list == NULL || *list == NULL || item == NULL)
		return;

	if (*list == item) {
		*list = item->next;
		if (*list != NULL) {
			(*list)->prev = NULL;
		}
	} else {
		item->prev->next = item->next;
		if (item->next != NULL)
			item->next->prev = item->prev;
	}

	free(item);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xb818
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb818
cmpq $0x0, -0x10(%rbp)
jne 0xb81a
jmp 0xb88f
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0xb851
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb84f
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq $0x0, 0x8(%rax)
jmp 0xb886
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xb884
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xb886
movq -0x10(%rbp), %rdi
callq 0x32d0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]windowchef/helpers.c
// Function: list_delete_all_items
void
list_delete_all_items(struct list_item **list, bool can_free_data)
{
	struct list_item *item, *next;

	for (item = *list; item->next != NULL; item = next) {
		next = item->next;
		if (can_free_data)
			free(item->data);
		list_delete_item(list, item);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xb8ff
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
testb $0x1, -0x9(%rbp)
je 0xb8e8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x32d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb7f0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xb8bf
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/wait.c
// Function: sensor_wait
float sensor_wait (float time)
{
	struct timespec until = sensor_prev;
	timespec_add_us(&until, time);
	while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &until, NULL)) {}

	struct timespec curtime;
	clock_gettime(CLOCK_MONOTONIC, &curtime);
	return timespec_delta_us(&curtime, &sensor_prev) - time;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movss %xmm0, -0x4(%rbp)
movups 0xcd64(%rip), %xmm0     # 0xf1b8
movaps %xmm0, -0x20(%rbp)
movss -0x4(%rbp), %xmm0
movss 0x8b9f(%rip), %xmm2     # 0xb004
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
cvttss2si %xmm1, %rax
cvttss2si %xmm0, %rsi
movq %rsi, %rcx
sarq $0x3f, %rcx
andq %rcx, %rax
orq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x24d0
movl $0x1, %esi
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl %esi, %edi
callq 0x22b0
cmpl $0x0, %eax
je 0x24a7
jmp 0x248c
movl $0x1, %edi
leaq -0x30(%rbp), %rsi
callq 0x2090
leaq -0x30(%rbp), %rdi
leaq 0xccf8(%rip), %rsi      # 0xf1b8
callq 0x2500
subss -0x4(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/./clock.h
// Function: timespec_add_ns
static inline void timespec_add_ns(struct timespec *t, unsigned long ns)
{
	t->tv_nsec += ns;

	if (t->tv_nsec > 1000000000) {
		t->tv_nsec -= 1000000000;
		++t->tv_sec;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x3b9aca00, 0x8(%rax)  # imm = 0x3B9ACA00
jle 0x257b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
subq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: ms5611_open
int ms5611_open(t_ms5611 *sensor)
{
	// local variables
	int fd;
	char i2c_dev[PATH_MAX] = {0};
	sprintf(i2c_dev, "/dev/i2c-%hhu", sensor->bus);

	// try to open I2C Bus
	fd = open(i2c_dev, O_RDWR);

	if (fd < 0) {
		fprintf(stderr, "Error opening %s: %s\n", i2c_dev, strerror(errno));
		return 1;
	}

	if (ioctl(fd, I2C_SLAVE, sensor->address) < 0) {
		fprintf(stderr, "ioctl error: %s\n", strerror(errno));
		return 1;
	}

	if (g_debug > 0) fprintf(stderr, "Opened MS5611 on bus %s with address 0x%x\n", i2c_dev, sensor->address);

	// assign file handle to sensor object
	sensor->fd = fd;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1040, %rsp           # imm = 0x1040
movq %rdi, -0x10(%rbp)
leaq -0x1020(%rbp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2130
leaq -0x1020(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x5(%rax), %edx
leaq 0x8a10(%rip), %rsi      # 0xb028
movb $0x0, %al
callq 0x2280
leaq -0x1020(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x2240
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x2691
movq 0xc9b6(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x1030(%rbp)
leaq -0x1020(%rbp), %rax
movq %rax, -0x1028(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x1030(%rbp), %rdi
movq -0x1028(%rbp), %rdx
movq %rax, %rcx
leaq 0x89b8(%rip), %rsi      # 0xb036
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x272e
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %edx
movl $0x703, %esi            # imm = 0x703
movb $0x0, %al
callq 0x2140
cmpl $0x0, %eax
jge 0x26eb
movq 0xc944(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x1038(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x1038(%rbp), %rdi
movq %rax, %rdx
leaq 0x8971(%rip), %rsi      # 0xb04c
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x272e
leaq 0xcd82(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x271e
movq 0xc8fa(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq -0x1020(%rbp), %rdx
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %ecx
leaq 0x8946(%rip), %rsi      # 0xb05d
movb $0x0, %al
callq 0x21d0
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1040, %rsp           # imm = 0x1040
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: crc4
uint8_t crc4(uint16_t n_prom[])
{
	int cnt; // simple counter
	uint16_t n_rem; // crc reminder
	uint16_t crc_read; // original value of the crc
	uint8_t n_bit;
	n_rem = 0x00;
	crc_read=n_prom[7]; //save read CRC
	n_prom[7]=(0xFF00 & (n_prom[7])); //CRC byte is replaced by 0
	for (cnt = 0; cnt < 16; cnt++) // operation is performed on bytes
	{// choose LSB or MSB
		if (cnt%2==1) n_rem ^= (unsigned short) ((n_prom[cnt>>1]) & 0x00FF);
		else n_rem ^= (unsigned short) (n_prom[cnt>>1]>>8);
		for (n_bit = 8; n_bit > 0; n_bit--)
		{
			if (n_rem & (0x8000))
			{
				n_rem = (n_rem << 1) ^ 0x3000;
			}
			else
			{
				n_rem = (n_rem << 1);
			}
		}
	}
	n_rem= (0x000F & (n_rem >> 12)); // final 4-bit reminder is CRC code
	n_prom[7]=crc_read; // restore the crc_read to its original place
	return (n_rem ^ 0x0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movw $0x0, -0xe(%rbp)
movq -0x8(%rbp), %rax
movw 0xe(%rax), %ax
movw %ax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xe(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xe(%rax)
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jge 0x2829
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x27b7
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0xff, %eax
movzwl %ax, %ecx
movzwl -0xe(%rbp), %eax
xorl %ecx, %eax
movw %ax, -0xe(%rbp)
jmp 0x27d7
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
sarl $0x8, %eax
movzwl %ax, %ecx
movzwl -0xe(%rbp), %eax
xorl %ecx, %eax
movw %ax, -0xe(%rbp)
movb $0x8, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jle 0x2819
movzwl -0xe(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x2803
movzwl -0xe(%rbp), %eax
shll %eax
xorl $0x3000, %eax           # imm = 0x3000
movw %ax, -0xe(%rbp)
jmp 0x280d
movzwl -0xe(%rbp), %eax
shll %eax
movw %ax, -0xe(%rbp)
jmp 0x280f
movb -0x11(%rbp), %al
addb $-0x1, %al
movb %al, -0x11(%rbp)
jmp 0x27db
jmp 0x281b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2779
movzwl -0xe(%rbp), %eax
sarl $0xc, %eax
andl $0xf, %eax
movw %ax, -0xe(%rbp)
movw -0x10(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xe(%rax)
movzwl -0xe(%rbp), %eax
xorl $0x0, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: ms5611_reset
int ms5611_reset(t_ms5611 *sensor)
{
	//variables
	unsigned char buf[10]={0x00};

	// clock out sensor
	//buf[0] = 0x00;										// This is the register we want to read from
	//if ((write(sensor->fd, buf, 1)) != 1) {				// Send register we want to read from
//		fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
	//	return(1);
	//}

	// reset sensor
	buf[0] = 0x1E;										// This is the register we want to read from
	if ((write(sensor->fd, buf, 1)) != 1) {				// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
		return(1);
	}

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movb $0x1e, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
cmpq $0x1, %rax
je 0x2c82
movq 0xc397(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x8576(%rip), %rsi      # 0xb1e1
leaq 0x8590(%rip), %rdx      # 0xb202
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x2c89
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: ms5611_start_temp
int ms5611_start_temp(t_ms5611 *sensor)
{
	//variables
	unsigned char buf[10]={0x00};

	// start conversion for D2
	buf[0] = 0x58;										// This is the register we want to read from
	if ((write(sensor->fd, buf, 1)) != 1) {				// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
		return(1);
	}

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movb $0x58, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
cmpq $0x1, %rax
je 0x2d02
movq 0xc317(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x84f6(%rip), %rsi      # 0xb1e1
leaq 0x851d(%rip), %rdx      # 0xb20f
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x2d09
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: ms5611_start_pressure
int ms5611_start_pressure(t_ms5611 *sensor)
{
	//variables
	//struct timespec sample_time;
	uint8_t buf[10]={0x00};

	// start conversion for D1
	buf[0] = 0x48;													// This is the register we want to read from
	if ((write(sensor->fd, buf, 1)) != 1) {								// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave: start conv: adr %x\n",sensor->address);
		return(1);
	}

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movb $0x48, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
cmpq $0x1, %rax
je 0x2d83
movq 0xc297(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %edx
leaq 0x84ae(%rip), %rsi      # 0xb221
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x2d8a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ms5611.c
// Function: ms5611_read_pressure
int ms5611_read_pressure(t_ms5611 *sensor)
{
	//variables
	//long d2;
	uint8_t buf[10]={0x00};

	// read result
	buf[0] = 0x00;
	if ((write(sensor->fd, buf, 1)) != 1) {								// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave: write Read result(%s)\n", __func__);
		return(1);
	}

	if (read(sensor->fd, buf, 3) != 3) {								// Read back data into buf[]
		fprintf(stderr, "Unable to read from slave: read result(%s)\n", __func__);
		return(1);
	}

	// put pressure reading together
	sensor->D1l = sensor->D1;
	sensor->D1 = (buf[0] << 16) + (buf[1] << 8) + buf[2];

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movb $0x0, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
cmpq $0x1, %rax
je 0x3212
movq 0xbe07(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x80e4(%rip), %rsi      # 0xb2df
leaq 0x8110(%rip), %rdx      # 0xb312
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x3286
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
je 0x3254
movq 0xbdc5(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x80ea(%rip), %rsi      # 0xb327
leaq 0x80ce(%rip), %rdx      # 0xb312
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x3286
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movzbl -0x1a(%rbp), %ecx
shll $0x10, %ecx
movzbl -0x19(%rbp), %eax
shll $0x8, %eax
addl %eax, %ecx
movzbl -0x18(%rbp), %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ams5915.c
// Function: ams5915_open
int ams5915_open(t_ams5915 *sensor, unsigned char i2c_address)
{
	// local variables
	int fd;

	// try to open I2C Bus
	fd = open("/dev/i2c-1", O_RDWR);

	if (fd < 0) {
		fprintf(stderr, "Error opening file: %s\n", strerror(errno));
		return 1;
	}

	if (ioctl(fd, I2C_SLAVE, i2c_address) < 0) {
		fprintf(stderr, "ioctl error: %s\n", strerror(errno));
		return 1;
	}

	if (g_debug > 0) fprintf(stderr, "Opened AMS5915 on 0x%x\n", i2c_address);

	// assign file handle to sensor object
	sensor->fd = fd;
	sensor->address = i2c_address;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
leaq 0x7f53(%rip), %rdi      # 0xb3dc
movl $0x2, %esi
movb $0x0, %al
callq 0x2240
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x34d9
movq 0xbb53(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x20(%rbp), %rdi
movq %rax, %rdx
leaq 0x7f21(%rip), %rsi      # 0xb3e7
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x356b
movl -0x18(%rbp), %edi
movzbl -0x11(%rbp), %edx
movl $0x703, %esi            # imm = 0x703
movb $0x0, %al
callq 0x2140
cmpl $0x0, %eax
jge 0x3529
movq 0xbb00(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x7b33(%rip), %rsi      # 0xb04c
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x356b
leaq 0xbf44(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x3551
movq 0xbabc(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movzbl -0x11(%rbp), %edx
leaq 0x7eb5(%rip), %rsi      # 0xb3ff
movb $0x0, %al
callq 0x21d0
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ams5915.c
// Function: ams5915_init
int ams5915_init(t_ams5915 *sensor)
{
	// set calibration data
	sensor->digoutpmin = 1638;    // from datasheet
	sensor->digoutpmax = 14745;   // from datasheet
	sensor->pmin = 0;             // from datasheet
	sensor->pmax = 50;            // from datasheet

	sensor->sensp = (float)(sensor->digoutpmax - sensor->digoutpmin)/(sensor->pmax - sensor->pmin);
	ddebug_print("%s @ 0x%x: sensp=%f\n", __func__, sensor->address, sensor->sensp);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw $0x666, 0x6(%rax)       # imm = 0x666
movq -0x8(%rbp), %rax
movw $0x3999, 0x8(%rax)      # imm = 0x3999
movq -0x8(%rbp), %rax
movb $0x0, 0xe(%rax)
movq -0x8(%rbp), %rax
movb $0x32, 0xf(%rax)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x6(%rcx), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movzbl 0xf(%rax), %eax
movq -0x8(%rbp), %rcx
movzbl 0xe(%rcx), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x10(%rax)
leaq 0xbe84(%rip), %rax      # 0xf474
cmpl $0x1, (%rax)
jle 0x3629
movq 0xb9fc(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x7dfc(%rip), %rsi      # 0xb417
leaq 0x7e0a(%rip), %rdx      # 0xb42c
movb $0x1, %al
callq 0x21d0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ams5915.c
// Function: ams5915_measure
int ams5915_measure(t_ams5915 *sensor)
{
	//variables
	uint8_t buf[10]={0x00};

	if (read(sensor->fd, buf, 4) != 4) {								// Read back data into buf[]
		fprintf(stderr, "Unable to read from slave\n");
		return(1);
	}

	sensor->digoutp = ((buf[0] & (0x3F)) << 8) + buf[1];
	sensor->digoutT = ((buf[2] << 8) + (buf[3] & 0xE0)) >> 5;
	debug_print("%s @ 0x%x: digoutp=0x%x %d\n", __func__, sensor->address, sensor->digoutp, sensor->digoutp);
	debug_print("%s @ 0x%x: digoutT=0x%x %d\n", __func__, sensor->address,sensor->digoutT, sensor->digoutT);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x4, %edx
callq 0x2180
cmpq $0x4, %rax
je 0x369a
movq 0xb97b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x7db2(%rip), %rsi      # 0xb439
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x3767
movzbl -0x1a(%rbp), %eax
andl $0x3f, %eax
shll $0x8, %eax
movzbl -0x19(%rbp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
movzbl -0x18(%rbp), %eax
shll $0x8, %eax
movzbl -0x17(%rbp), %ecx
andl $0xe0, %ecx
addl %ecx, %eax
sarl $0x5, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
leaq 0xbd97(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x371b
movq 0xb90f(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %r8d
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %r9d
leaq 0x7d47(%rip), %rsi      # 0xb454
leaq 0x7d5c(%rip), %rdx      # 0xb470
movb $0x0, %al
callq 0x21d0
leaq 0xbd52(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x3760
movq 0xb8ca(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %r8d
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %r9d
leaq 0x7d2e(%rip), %rsi      # 0xb480
leaq 0x7d17(%rip), %rdx      # 0xb470
movb $0x0, %al
callq 0x21d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ams5915.c
// Function: ams5915_calculate
int ams5915_calculate(t_ams5915 *sensor)
{
	// calculate differential pressure
	sensor->p = (((sensor->digoutp - sensor->digoutpmin)/sensor->sensp) + sensor->pmin);

	// calculate temperature
	sensor->T = ((sensor->digoutT * 200)/ (float)2048)-50;

	// correct measured pressure
	sensor->p = sensor->linearity * sensor->p + sensor->offset;

	debug_print("%s @ 0x%x: Pressure: %f Temp: %f\n", __func__, sensor->address, sensor->p, sensor->T);

	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x6(%rcx), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
divss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
movzbl 0xe(%rax), %eax
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
imull $0xc8, %eax, %eax
cvtsi2ss %eax, %xmm0
movss 0x7c0a(%rip), %xmm1     # 0xb3d8
divss %xmm1, %xmm0
movss 0x7bfa(%rip), %xmm1     # 0xb3d4
subss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x14(%rax)
movq -0x8(%rbp), %rax
movss 0x1c(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm2
movq -0x8(%rbp), %rax
movss 0x20(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x18(%rax)
leaq 0xbc5a(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x3860
movq 0xb7d2(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x8(%rbp), %rax
movss 0x14(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x7c4a(%rip), %rsi      # 0xb49c
leaq 0x7c65(%rip), %rdx      # 0xb4be
movb $0x2, %al
callq 0x21d0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ads1110.c
// Function: ads1110_open
int ads1110_open(t_ads1110 *sensor, unsigned char i2c_address)
{
	// local variables
	int fd;
	unsigned char buf[10]={0x00};

	// try to open I2C Bus
	fd = open("/dev/i2c-1", O_RDWR);

	if (fd < 0) {
		fprintf(stderr, "Error opening file: %s\n", strerror(errno));
		return 1;
	}

	if (ioctl(fd, I2C_SLAVE, i2c_address) < 0) {

		fprintf(stderr, "ioctl error: %s\n", strerror(errno));
		sensor->present = 0;
		return 1;
	}

	// Try to read from sensor to check if it present
	if (read(fd, buf, 3) != 3)
	{
		sensor->present = 0;
		return (1);
	}

	if (g_debug > 0) fprintf(stderr, "Opened ADS1110 on 0x%x\n", i2c_address);

	// assign file handle to sensor object
	sensor->fd = fd;
	sensor->address = i2c_address;
	sensor->present = 1;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
leaq -0x22(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
leaq 0x7b43(%rip), %rdi      # 0xb3dc
movl $0x2, %esi
movb $0x0, %al
callq 0x2240
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x38e9
movq 0xb743(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x7b11(%rip), %rsi      # 0xb3e7
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x39b4
movl -0x18(%rbp), %edi
movzbl -0x11(%rbp), %edx
movl $0x703, %esi            # imm = 0x703
movb $0x0, %al
callq 0x2140
cmpl $0x0, %eax
jge 0x3941
movq 0xb6f0(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x22d0
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x7723(%rip), %rsi      # 0xb04c
movb $0x0, %al
callq 0x21d0
movq -0x10(%rbp), %rax
movb $0x0, 0x15(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x39b4
movl -0x18(%rbp), %edi
leaq -0x22(%rbp), %rsi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
je 0x3969
movq -0x10(%rbp), %rax
movb $0x0, 0x15(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x39b4
leaq 0xbb04(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x3991
movq 0xb67c(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movzbl -0x11(%rbp), %edx
leaq 0x7b4e(%rip), %rsi      # 0xb4d8
movb $0x0, %al
callq 0x21d0
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x15(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/ads1110.c
// Function: ads1110_measure
int ads1110_measure(t_ads1110 *sensor)
{
	//variables
	//struct timespec sample_time;
	unsigned char buf[10]={0x00};
  //int digoutp;


	if (read(sensor->fd, buf, 3) != 3) {								// Read back data into buf[]
		fprintf(stderr, "Unable to read from slave\n");
		return(1);
	}

	sensor->voltage_raw = (buf[0] << 8) + buf[1];

	ddebug_print("%s @ 0x%x: voltage_raw=%d\n", __func__, sensor->address, sensor->voltage_raw);


	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x1a(%rbp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2130
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
leaq -0x1a(%rbp), %rsi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
je 0x3a88
movq 0xb58a(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x79c1(%rip), %rsi      # 0xb439
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x3ade
movzbl -0x1a(%rbp), %ecx
shll $0x8, %ecx
movzbl -0x19(%rbp), %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
leaq 0xb9d1(%rip), %rax      # 0xf474
cmpl $0x1, (%rax)
jle 0x3ad7
movq 0xb549(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r8d
leaq 0x7a67(%rip), %rsi      # 0xb530
leaq 0x7a7b(%rip), %rdx      # 0xb54b
movb $0x0, %al
callq 0x21d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/main.c
// Function: sigintHandler
static void sigintHandler(int sig_num)
{
	(void)sig_num;

	signal(SIGINT, sigintHandler);

	// if meas_mode = record -> close fp now
	if (fp_datalog != NULL)
		fclose(fp_datalog);

	// if sensordata from file
	if (fp_sensordata != NULL)
		fclose(fp_sensordata);

	fprintf(stderr, "Exiting ...\n");

	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x2, %edi
leaq -0x17(%rip), %rsi       # 0x4dd0
callq 0x21c0
leaq 0xa63d(%rip), %rax      # 0xf430
cmpq $0x0, (%rax)
je 0x4e08
leaq 0xa630(%rip), %rax      # 0xf430
movq (%rax), %rdi
callq 0x20c0
leaq 0xa619(%rip), %rax      # 0xf428
cmpq $0x0, (%rax)
je 0x4e24
leaq 0xa60c(%rip), %rax      # 0xf428
movq (%rax), %rdi
callq 0x20c0
movq 0xa1cd(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x7070(%rip), %rsi      # 0xbea5
movb $0x0, %al
callq 0x21d0
xorl %edi, %edi
callq 0x2290
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/main.c
// Function: handle_connection
static void handle_connection(int sock)
{
	int sock_err = 0;
	int j = 0;

	tep_sensor.D2f=tep_sensor.D2;
	static_sensor.D2f=static_sensor.D2;

	// main data acquisition loop
	while(sock_err >= 0)
	{
		if (tj)
			if ((++j)%1023==100) sensor_wait(250e3);
		pressure_measurement_handler();
		temperature_measurement_handler();
		sock_err = NMEA_message_handler(sock);
		//debug_print("Sock_err: %d\n",sock_err);

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl 0xa281(%rip), %eax      # 0xf2c0
movl %eax, 0xa283(%rip)      # 0xf2c8
movl 0xa1ad(%rip), %eax      # 0xf1f8
movl %eax, 0xa1af(%rip)      # 0xf200
cmpl $0x0, -0x8(%rbp)
jl 0x509f
leaq 0xa3c5(%rip), %rax      # 0xf423
testb $0x1, (%rax)
je 0x5088
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl $0x3ff, %ecx            # imm = 0x3FF
cltd
idivl %ecx
cmpl $0x64, %edx
jne 0x5086
movss 0x658f(%rip), %xmm0     # 0xb610
callq 0x2440
jmp 0x5088
callq 0x50b0
callq 0x59f0
movl -0x4(%rbp), %edi
callq 0x5d60
movl %eax, -0x8(%rbp)
jmp 0x5051
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: Compose_Pressure_POV_slow
int Compose_Pressure_POV_slow(char *sentence, float static_pressure, float dynamic_pressure)
{
	int length;
	int success = 1;

	// check static_pressure input value for validity
	if ((static_pressure < 0) || (static_pressure > 2000))
	{
		static_pressure = 9999;
		success = 10;
	}

	// check dynamic_pressure input value for validity
	/// @todo add useful range for dynamic_pressure vales !!
	if ((dynamic_pressure < -999.0) || (dynamic_pressure > 9998.0))
	{
		dynamic_pressure = 9999;
		success = 20;
	}

	// compose NMEA String
	length = sprintf(sentence, "$POV,P,%+07.4f,Q,%+05.2f", static_pressure, (dynamic_pressure));

	// Calculate NMEA checksum and add to string
	sprintf(sentence + length, "*%02X\r\n", NMEA_checksum(sentence));

	//print sentence for debug
	debug_print("POV slow NMEA sentence: %s\n", sentence);
	return (success);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movl $0x1, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomiss -0xc(%rbp), %xmm0
ja 0x6208
movss -0xc(%rbp), %xmm0
movss 0x5411(%rip), %xmm1     # 0xb614
ucomiss %xmm1, %xmm0
jbe 0x621c
movss 0x5dcc(%rip), %xmm0     # 0xbfdc
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x18(%rbp)
movss -0x10(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x5dcb(%rip), %xmm0     # 0xbff8
ucomisd %xmm1, %xmm0
ja 0x624a
movss -0x10(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x5dbc(%rip), %xmm1     # 0xc000
ucomisd %xmm1, %xmm0
jbe 0x625e
movss 0x5d8a(%rip), %xmm0     # 0xbfdc
movss %xmm0, -0x10(%rbp)
movl $0x14, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x10(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x5d9d(%rip), %rsi      # 0xc018
movb $0x2, %al
callq 0x2280
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62f0
movq -0x20(%rbp), %rdi
movzbl %al, %edx
leaq 0x5d86(%rip), %rsi      # 0xc031
movb $0x0, %al
callq 0x2280
leaq 0x91bb(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x62da
movq 0x8d33(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x5d66(%rip), %rsi      # 0xc039
movb $0x0, %al
callq 0x21d0
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: NMEA_checksum
unsigned char NMEA_checksum(char *string)
{
  unsigned char value=0;
	int i=1;
	int l;

	l = strlen(string);

	for (; i < l; i++)
	{
    value ^= string[i];
  }
  return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movl $0x1, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20d0
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x633b
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movzbl -0x9(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x9(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x6313
movb -0x9(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: Compose_Pressure_POV_fast
int Compose_Pressure_POV_fast(char *sentence, float te_vario)
{
	int length;
	int success = 1;

	// check te_vario input value for validity
	if ((te_vario < -50) || (te_vario > 50))
	{
		te_vario = 99;
		success = 10;
	}

	// compose NMEA String
	length = sprintf(sentence, "$POV,E,%+05.4f", te_vario);

	// Calculate NMEA checksum and add to string
	sprintf(sentence + length, "*%02X\r\n", NMEA_checksum(sentence));

	//print sentence for debug
	debug_print("NMEA sentence: %s\n", sentence);
	return (success);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movl $0x1, -0x14(%rbp)
movss 0x5c70(%rip), %xmm0     # 0xbfe0
ucomiss -0xc(%rbp), %xmm0
ja 0x6388
movss -0xc(%rbp), %xmm0
movss 0x5051(%rip), %xmm1     # 0xb3d4
ucomiss %xmm1, %xmm0
jbe 0x639c
movss 0x529c(%rip), %xmm0     # 0xb62c
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5ca5(%rip), %rsi      # 0xc055
movb $0x1, %al
callq 0x2280
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62f0
movq -0x20(%rbp), %rdi
movzbl %al, %edx
leaq 0x5c51(%rip), %rsi      # 0xc031
movb $0x0, %al
callq 0x2280
leaq 0x9086(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x640f
movq 0x8bfe(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x5c3a(%rip), %rsi      # 0xc042
movb $0x0, %al
callq 0x21d0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: Compose_Voltage_POV
int Compose_Voltage_POV(char *sentence, float voltage)
{
	int length;
	int success = 1;

	// check voltage input value for validity
	if (voltage < 2.)
	{
		voltage = 0.;
		success = 10;
	}
    else if (voltage > 20.)
	{
		voltage = 99.9;
		success = 10;
	}

	// compose NMEA String
	length = sprintf(sentence, "$POV,V,%+05.2f", voltage);

	// Calculate NMEA checksum and add to string
	sprintf(sentence + length, "*%02X\r\n", NMEA_checksum(sentence));

	//print sentence for debug
	debug_print("NMEA sentence: %s\n", sentence);
	return (success);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movl $0x1, -0x14(%rbp)
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x5bbf(%rip), %xmm0     # 0xc008
ucomisd %xmm1, %xmm0
jbe 0x6460
xorps %xmm0, %xmm0
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x14(%rbp)
jmp 0x648d
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x5b9f(%rip), %xmm1     # 0xc010
ucomisd %xmm1, %xmm0
jbe 0x648b
movss 0x5b65(%rip), %xmm0     # 0xbfe4
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x14(%rbp)
jmp 0x648d
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5bc3(%rip), %rsi      # 0xc064
movb $0x1, %al
callq 0x2280
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62f0
movq -0x20(%rbp), %rdi
movzbl %al, %edx
leaq 0x5b60(%rip), %rsi      # 0xc031
movb $0x0, %al
callq 0x2280
leaq 0x8f95(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x6500
movq 0x8b0d(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x5b49(%rip), %rsi      # 0xc042
movb $0x0, %al
callq 0x21d0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: Compose_Temperature_POV
int Compose_Temperature_POV(char *sentence, float temperature)
{
	int length;
	int success = 1;

 	// check voltage input value for validity
 	if ((temperature < -55) || (temperature > 125)) {
 		temperature = 23;
 		success = 10;
	}

	// compose NMEA String
	length = sprintf(sentence, "$POV,T,%+05.4f", temperature);

	// Calculate NMEA checksum and add to string
	sprintf(sentence + length, "*%02X\r\n", NMEA_checksum(sentence));

	//print sentence for debug
	debug_print("NMEA sentence: %s\n", sentence);
	return (success);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movl $0x1, -0x14(%rbp)
movss 0x5ab8(%rip), %xmm0     # 0xbfe8
ucomiss -0xc(%rbp), %xmm0
ja 0x6548
movss -0xc(%rbp), %xmm0
movss 0x5aa9(%rip), %xmm1     # 0xbfec
ucomiss %xmm1, %xmm0
jbe 0x655c
movss 0x5aa0(%rip), %xmm0     # 0xbff0
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5b03(%rip), %rsi      # 0xc073
movb $0x1, %al
callq 0x2280
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62f0
movq -0x20(%rbp), %rdi
movzbl %al, %edx
leaq 0x5a91(%rip), %rsi      # 0xc031
movb $0x0, %al
callq 0x2280
leaq 0x8ec6(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x65cf
movq 0x8a3e(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x5a7a(%rip), %rsi      # 0xc042
movb $0x0, %al
callq 0x21d0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/nmea.c
// Function: Compose_Humidity_POV
int Compose_Humidity_POV(char *sentence, float humidity)
{
	int length;
	int success = 1;

	// check voltage input value for validity
	if ((humidity < 0) || (humidity > 100)) {
		humidity = 50;
		success = 10;
	}

	// compose NMEA String
	length = sprintf(sentence, "$POV,H,%05.4f", humidity);

	// Calculate NMEA checksum and add to string
	sprintf(sentence + length, "*%02X\r\n", NMEA_checksum(sentence));

	//print sentence for debug
	debug_print("NMEA sentence: %s\n", sentence);
	return (success);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movl $0x1, -0x14(%rbp)
xorps %xmm0, %xmm0
ucomiss -0xc(%rbp), %xmm0
ja 0x6613
movss -0xc(%rbp), %xmm0
movss 0x4ffe(%rip), %xmm1     # 0xb60c
ucomiss %xmm1, %xmm0
jbe 0x6627
movss 0x4db9(%rip), %xmm0     # 0xb3d4
movss %xmm0, -0xc(%rbp)
movl $0xa, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5a47(%rip), %rsi      # 0xc082
movb $0x1, %al
callq 0x2280
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x62f0
movq -0x20(%rbp), %rdi
movzbl %al, %edx
leaq 0x59c6(%rip), %rsi      # 0xc031
movb $0x0, %al
callq 0x2280
leaq 0x8dfb(%rip), %rax      # 0xf474
cmpl $0x0, (%rax)
jle 0x669a
movq 0x8973(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x59af(%rip), %rsi      # 0xc042
movb $0x0, %al
callq 0x21d0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/KalmanFilter1d.c
// Function: KalmanFilter1d_reset
void KalmanFilter1d_reset(t_kalmanfilter1d* filter)
{
	filter->x_abs_ = 0.0;
	filter->x_vel_ = 0.0;

	filter->p_abs_abs_ = 0.0;
	filter->p_abs_vel_ = 0.0;
	filter->p_vel_vel_ = 0.0;

	filter->var_x_accel_ = 0.0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/24c16.c
// Function: update_checksum
int update_checksum(t_eeprom_data* data)
{
	char* p_data;
	char checksum=0x00;

	p_data = (char*)data;

	for (size_t i=0; i<sizeof(*data); i++)
	{
		checksum += *p_data;
		p_data++;
	}

	//fprintf(stderr, "Checksum: %x\n", checksum);
	data->checksum = checksum;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x14, -0x20(%rbp)
jae 0x766d
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movsbl -0x11(%rbp), %eax
addl %ecx, %eax
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x763c
movb -0x11(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x10(%rax)
xorl %eax, %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/24c16.c
// Function: eeprom_read_data
int eeprom_read_data(t_24c16 *eeprom, t_eeprom_data *data)
{
	// read eeprom data to struct
	if (eeprom_read(eeprom, (char*)data, 0x00, sizeof(*data))==1)
		return 1;						// Failed to read the EEPROM

	// verify checksum
	if (!verify_checksum(data))
	{
		fprintf(stderr, "EEPROM content not valid !!\n");
		fprintf(stderr, "Please use -i to initialize EEPROM !!\n");
		return 2;
	}
	else
	{
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
movl $0x14, %ecx
callq 0x7710
movsbl %al, %eax
cmpl $0x1, %eax
jne 0x76b5
movl $0x1, -0x4(%rbp)
jmp 0x7702
movq -0x18(%rbp), %rdi
callq 0x77c0
cmpb $0x0, %al
jne 0x76fb
movq 0x792f(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x5155(%rip), %rsi      # 0xc828
movb $0x0, %al
callq 0x21d0
movq 0x7917(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x515a(%rip), %rsi      # 0xc845
movb $0x0, %al
callq 0x21d0
movl $0x2, -0x4(%rbp)
jmp 0x7702
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/24c16.c
// Function: eeprom_read
char eeprom_read(t_24c16 *eeprom, char *s, char offset, char count)
{
	//write address offset to eeprom
	if ((write(eeprom->fd, &offset, 1)) != 1) {				// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
		return(1);
	}

	if (read(eeprom->fd, s, count) != count) {		// Read back data into buf[]
		fprintf(stderr, "Unable to read from slave\n");
		return(1);
	}

	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %cl, -0x19(%rbp)
movb %al, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x19(%rbp), %rsi
movl $0x1, %edx
callq 0x20a0
cmpq $0x1, %rax
je 0x7769
movq 0x78ad(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3a8c(%rip), %rsi      # 0xb1e1
leaq 0x5154(%rip), %rdx      # 0xc8b0
movb $0x0, %al
callq 0x21d0
movb $0x1, -0x1(%rbp)
jmp 0x77a9
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movsbq -0x1a(%rbp), %rdx
callq 0x2180
movsbq -0x1a(%rbp), %rcx
cmpq %rcx, %rax
je 0x77a5
movq 0x786a(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3ca1(%rip), %rsi      # 0xb439
movb $0x0, %al
callq 0x21d0
movb $0x1, -0x1(%rbp)
jmp 0x77a9
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Openvario[P]sensord/24c16.c
// Function: verify_checksum
char verify_checksum(t_eeprom_data* data)
{
	char* p_data;
	char checksum=0x00;

	p_data = (char*)data;

	for (size_t i=0; i<sizeof(*data); i++)
	{
		checksum += *p_data;
		p_data++;
	}
	//fprintf(stderr, "Checksum read: %x\n", data->checksum);
	//fprintf(stderr, "Checksum calc: %x\n", checksum);
	if (checksum == data->checksum)
	{
		return (1);
	}
	else
	{
		return(0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x14, -0x28(%rbp)
jae 0x780d
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movsbl -0x19(%rbp), %eax
addl %ecx, %eax
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x77dc
movsbl -0x19(%rbp), %eax
movq -0x10(%rbp), %rcx
movsbl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jne 0x7823
movb $0x1, -0x1(%rbp)
jmp 0x7827
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopl (%rax)