LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_window_move_in_grid
static void
ipc_window_move_in_grid(uint32_t *d)
{
	uint16_t x, y;

	if (focused_win == NULL)
		return;

	x = d[2];
	y = d[3];

	if (d[0] == IPC_MUL_MINUS)
		x = -x;
	if (d[1] == IPC_MUL_MINUS)
		y = -y;

	move_grid_window(focused_win, x, y);
}

// Assembly:
movq %rdi, %rax
movq 0x561d(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x7245
movl 0x8(%rax), %edx
movl %edx, %ecx
negl %ecx
cmpl $0x1, (%rax)
cmovnel %edx, %ecx
movl 0xc(%rax), %edx
movl %edx, %r8d
negl %r8d
cmpl $0x1, 0x4(%rax)
cmovnel %edx, %r8d
cmpb $0x1, 0x28(%rdi)
jne 0x7245
addw 0x1c(%rdi), %cx
movswl 0x18(%rdi), %edx
movswl %cx, %esi
movswl 0x20(%rdi), %eax
addl %eax, %esi
cmpl %edx, %esi
jg 0x7245
addw 0x1e(%rdi), %r8w
movswl 0x1a(%rdi), %r9d
movswl %r8w, %r10d
movswl 0x22(%rdi), %esi
addl %esi, %r10d
cmpl %r9d, %r10d
jg 0x7245
testw %cx, %cx
js 0x7245
testw %r8w, %r8w
js 0x7245
pushq %rax
movzwl %si, %esi
movl %esi, (%rsp)
movzwl %dx, %esi
movzwl %r9w, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movzwl %ax, %r9d
callq 0x7f1a
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_window_resize_in_grid
static void
ipc_window_resize_in_grid(uint32_t *d)
{
	uint16_t x, y;

	if (focused_win == NULL)
		return;

	x = d[2];
	y = d[3];

	if (d[0] == IPC_MUL_MINUS)
		x = -x;
	if (d[1] == IPC_MUL_MINUS)
		y = -y;

	resize_grid_window(focused_win, x, y);
}

// Assembly:
movq %rdi, %rax
movq 0x5590(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x72d3
movl 0x8(%rax), %ecx
movl %ecx, %r9d
negl %r9d
cmpl $0x1, (%rax)
cmovnel %ecx, %r9d
movl 0xc(%rax), %edx
movl %edx, %ecx
negl %ecx
cmpl $0x1, 0x4(%rax)
cmovnel %edx, %ecx
cmpb $0x1, 0x28(%rdi)
jne 0x72d3
addw 0x20(%rdi), %r9w
movswl 0x18(%rdi), %eax
movswl %r9w, %edx
movswl 0x1c(%rdi), %r8d
addl %r8d, %edx
cmpl %eax, %edx
jg 0x72d3
addw 0x22(%rdi), %cx
movswl 0x1a(%rdi), %edx
movswl %cx, %esi
movswl 0x1e(%rdi), %r10d
addl %r10d, %esi
cmpl %edx, %esi
jg 0x72d3
testw %r9w, %r9w
jle 0x72d3
testw %cx, %cx
jle 0x72d3
pushq %rax
movzwl %cx, %ecx
movl %ecx, (%rsp)
movzwl %ax, %esi
movzwl %dx, %edx
movzwl %r8w, %ecx
movzwl %r10w, %r8d
movzwl %r9w, %r9d
callq 0x7f1a
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_window_rev_cycle
static void
rcycle_window(struct client *client)
{
	struct list_item *item = NULL;
	struct list_item *last_item;
	struct list_item *client_item;
	struct client *data;

	if (win_list == NULL)
		return;

	/* find last window */
	item = win_list;
	while (item != NULL) {
		last_item = item;
		item = item->next;
	}

	/* find item of client */
	item = win_list;
	while (item != NULL && item->data != client)
		item = item->next;

	if (item == NULL)
		item = last_item;

	client_item = item;

	item = client_item;
	do {
		item = item->prev;
		if (item == NULL)
			item = last_item;
		data = item->data;
	} while (!data->mapped);

	if (item != NULL && item->data != client)
		set_focused(item->data);
}

// Assembly:
movq 0x4ed7(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x756a
pushq %rbx
subq $0x10, %rsp
movq 0x52de(%rip), %rcx      # 0xc7e0
movq %rax, %rsi
movq %rsi, %rdx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0x7505
jmp 0x751c
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x7523
cmpq %rcx, (%rax)
jne 0x7513
jmp 0x7526
movq %rdx, %rax
movq 0x8(%rax), %rax
testq %rax, %rax
cmoveq %rdx, %rax
movq (%rax), %rbx
cmpb $0x1, 0x54(%rbx)
jne 0x7526
cmpq %rcx, %rbx
je 0x7565
movq %rbx, %rdi
callq 0x5045
movl (%rbx), %esi
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq 0x4e5d(%rip), %rdi      # 0xc3b8
movl $0x40, %edx
callq 0x3200
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_window_cycle_in_group
static void
ipc_window_cycle_in_group(uint32_t *d)
{
	(void)(d);

	if (focused_win == NULL)
		return;

	cycle_window_in_group(focused_win);
}

// Assembly:
movq 0x526e(%rip), %rax      # 0xc7e0
testq %rax, %rax
je 0x7605
pushq %rbx
subq $0x10, %rsp
movq 0x4e41(%rip), %rdx      # 0xc3c8
testq %rdx, %rdx
je 0x759d
movq %rdx, %rcx
cmpq %rax, (%rcx)
je 0x75a1
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0x758f
xorl %ecx, %ecx
jmp 0x75bd
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
cmoveq %rdx, %rcx
movq (%rcx), %rsi
cmpb $0x1, 0x54(%rsi)
jne 0x75a1
movl 0x58(%rsi), %edi
cmpl 0x58(%rax), %edi
jne 0x75a1
testq %rcx, %rcx
sete %dl
cmpq %rax, %rsi
sete %dil
orb %dl, %dil
jne 0x7600
movl 0x58(%rsi), %edx
cmpl 0x58(%rax), %edx
jne 0x7600
movq (%rcx), %rbx
movq %rbx, %rdi
callq 0x5045
movl (%rbx), %esi
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq 0x4dc2(%rip), %rdi      # 0xc3b8
movl $0x40, %edx
callq 0x3200
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_group_remove_all_windows
static void
group_remove_all_windows(uint32_t group)
{
	if (group >= conf.groups)
		return;

	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		if (client != NULL && client->group == group) {
			group_remove_window(client);
		}
	}

	group_in_use[group] = false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %ebx
decl %ebx
cmpl %ebx, 0x4c30(%rip)      # 0xc7bc
jbe 0x7bbf
movq 0x4833(%rip), %r14      # 0xc3c8
testq %r14, %r14
je 0x7bb2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x7bac
cmpl %ebx, 0x58(%rdi)
jne 0x7bac
callq 0x8232
movq 0x10(%r14), %r14
jmp 0x7b95
movq 0x4c47(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_group_toggle
static void
group_toggle(uint32_t group)
{
	if (group >= conf.groups)
		return;

	if (group_in_use[group])
		group_deactivate(group);
	else
		group_activate(group);
	last_group = group;
	update_group_list();
}

// Assembly:
pushq %rbx
movl (%rdi), %ebx
decl %ebx
cmpl %ebx, 0x4bd8(%rip)      # 0xc7bc
jbe 0x7bfe
movq 0x4c13(%rip), %rax      # 0xc800
movl %ebx, %ecx
cmpb $0x1, (%rax,%rcx)
jne 0x7c00
movl %ebx, %edi
callq 0x8309
jmp 0x7c07
popq %rbx
retq
movl %ebx, %edi
callq 0x8274
movl %ebx, 0x4bfb(%rip)      # 0xc808
popq %rbx
jmp 0x5a33
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ipc_group_activate_specific
static void
group_activate_specific(uint32_t group)
{
	if (group >= conf.groups)
		return;

	for (unsigned int i = 0; i < conf.groups; i++) {
		if (i == group)
			group_activate(i);
		else
			group_deactivate(i);
	}
	update_group_list();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl (%rdi), %ebp
decl %ebp
cmpl %ebp, 0x4b9c(%rip)      # 0xc7bc
jbe 0x7c4b
xorl %ebx, %ebx
movl %ebx, %edi
cmpl %ebx, %ebp
jne 0x7c31
callq 0x8274
jmp 0x7c36
callq 0x8309
incl %ebx
cmpl 0x4b7e(%rip), %ebx      # 0xc7bc
jb 0x7c24
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5a33
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: is_in_valid_direction
static bool
is_in_valid_direction(uint32_t direction, float window_direction, float delta)
{
	switch((uint32_t)direction) {
		case NORTH:
			if (window_direction >= (180 - delta) || window_direction <= (-180 + delta))
				return true;
			break;
		case SOUTH:
			if (fabs(window_direction) <= ( 0 + delta))
				return true;
			break;
		case EAST:
			if (window_direction <= (90 + delta) && window_direction > (90 - delta))
				return true;
			break;
		case WEST:
			if (window_direction <= (-90 + delta) && window_direction >= (-90 - delta))
				return true;
			break;
	}

	return false;
}

// Assembly:
cmpl $0x3, %edi
ja 0x81a8
movl %edi, %eax
leaq 0xf8d(%rip), %rcx       # 0x90c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movss 0xfb8(%rip), %xmm2      # 0x90fc
subss %xmm1, %xmm2
ucomiss %xmm2, %xmm0
movb $0x1, %al
jae 0x8178
addss 0xfa9(%rip), %xmm1      # 0x9100
jmp 0x81a3
movss 0xf97(%rip), %xmm2      # 0x90f8
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
ucomiss %xmm0, %xmm3
jb 0x81a8
subss %xmm1, %xmm2
movb $0x1, %al
ucomiss %xmm2, %xmm0
jbe 0x81a8
retq
movss 0xf73(%rip), %xmm2      # 0x90f4
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
ucomiss %xmm0, %xmm3
jb 0x81a8
subss %xmm1, %xmm2
movb $0x1, %al
ucomiss %xmm2, %xmm0
jae 0x8178
jmp 0x81a8
andps 0xf8f(%rip), %xmm0      # 0x9130
movb $0x1, %al
ucomiss %xmm0, %xmm1
jae 0x8178
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: is_overlapping
static bool
is_overlapping(struct client *a, struct client *b)
{
	struct win_position pos_a_top_left = get_window_position(TOP_LEFT, a);
	struct win_position pos_a_top_right = get_window_position(TOP_RIGHT, a);
	struct win_position pos_a_bot_left = get_window_position(BOTTOM_LEFT, a);

	struct win_position pos_b_top_left = get_window_position(TOP_LEFT, b);
	struct win_position pos_b_top_right = get_window_position(TOP_RIGHT, b);
	struct win_position pos_b_bot_left = get_window_position(BOTTOM_LEFT, b);

	bool is_x_top_overlapped = pos_a_top_left.x <= pos_b_top_left.x && pos_a_top_right.x >= pos_b_top_left.x;
	bool is_x_bot_overlapped = pos_a_top_left.x <= pos_b_top_right.x && pos_a_top_right.x >= pos_b_top_right.x;

	bool is_y_top_overlapped = pos_a_top_left.y <= pos_b_top_left.y && pos_a_bot_left.y >= pos_b_top_left.y;
	bool is_y_bot_overlapped = pos_a_top_left.y <= pos_b_bot_left.y && pos_a_bot_left.y >= pos_b_bot_left.y;

	return (is_x_top_overlapped || is_x_bot_overlapped) && (is_y_top_overlapped || is_y_bot_overlapped);
}

// Assembly:
pushq %rbp
pushq %rbx
movzwl 0x4(%rdi), %ecx
movzwl 0x6(%rdi), %eax
movzwl 0x8(%rdi), %edx
addw %cx, %dx
movzwl 0xa(%rdi), %r10d
addw %ax, %r10w
movzwl 0x4(%rsi), %edi
movzwl 0x6(%rsi), %r9d
movzwl 0xa(%rsi), %r11d
addl %r9d, %r11d
cmpw %di, %cx
setle %bl
cmpw %di, %dx
setge %bpl
cmpw %r9w, %ax
setle %r8b
cmpw %r9w, %r10w
setge %r9b
cmpw %r11w, %ax
setle %al
cmpw %r11w, %r10w
setge %r10b
testb %bpl, %bl
jne 0x8220
movzwl 0x8(%rsi), %esi
addl %esi, %edi
cmpw %di, %cx
setle %cl
cmpw %di, %dx
setge %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x822b
andb %r9b, %r8b
andb %r10b, %al
orb %r8b, %al
jmp 0x822d
xorl %eax, %eax
andb $0x1, %al
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: group_remove_window
static void
group_remove_window(struct client *client)
{
	if (client != NULL) {
		client->group = NULL_GROUP;
		update_wm_desktop(client);
		update_group_list();
		update_current_desktop(client);
		update_window_status(client);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xffffffff, 0x58(%rdi) # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x8255
movq 0x4177(%rip), %rdi      # 0xc3c0
movl (%rbx), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3450
callq 0x5a33
movq 0x415f(%rip), %rdi      # 0xc3c0
movl 0x58(%rbx), %edx
xorl %esi, %esi
callq 0x35c0
movq %rbx, %rdi
popq %rbx
jmp 0x51c7
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: group_activate
static void
group_activate(uint32_t group) {
	if (group >= conf.groups)
		return;

	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		if (client->group == group) {
			xcb_map_window(conn, client->window);
			set_focused(client);
		}
	}
	group_in_use[group] = true;
	last_group = group;
	update_group_list();
}

// Assembly:
cmpl %edi, 0x4542(%rip)      # 0xc7bc
jbe 0x8308
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x4137(%rip), %r12      # 0xc3c8
testq %r12, %r12
je 0x82e5
leaq 0x4(%rsp), %r14
movq (%r12), %r15
cmpl %ebx, 0x58(%r15)
jne 0x82db
movq 0x410c(%rip), %rdi      # 0xc3b8
movl (%r15), %esi
callq 0x3280
movq %r15, %rdi
callq 0x5045
movl (%r15), %esi
movl $0x0, 0x4(%rsp)
movq 0x40ea(%rip), %rdi      # 0xc3b8
movl $0x40, %edx
movq %r14, %rcx
callq 0x3200
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x829b
movq 0x4514(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x1, (%rax,%rcx)
movl %ebx, 0x4510(%rip)      # 0xc808
callq 0x5a33
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: group_deactivate
static void
group_deactivate(uint32_t group)
{
	if (group >= conf.groups)
		return;

	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		if (client->group == group)
			xcb_unmap_window(conn, client->window);
	}
	group_in_use[group] = false;
	update_group_list();
}

// Assembly:
cmpl %edi, 0x44ad(%rip)      # 0xc7bc
jbe 0x833f
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0x40aa(%rip), %r14      # 0xc3c8
testq %r14, %r14
je 0x8340
movq (%r14), %rax
cmpl %ebx, 0x58(%rax)
jne 0x8339
movq 0x4086(%rip), %rdi      # 0xc3b8
movl (%rax), %esi
callq 0x3600
movq 0x10(%r14), %r14
jmp 0x831e
retq
movq 0x44b9(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a33
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: pointer_modfield_from_keysym
static int16_t
pointer_modfield_from_keysym(xcb_keysym_t keysym)
{
	uint16_t modfield = 0;
	xcb_keycode_t *keycodes = NULL, *mod_keycodes = NULL;
	xcb_get_modifier_mapping_reply_t *reply = NULL;
	xcb_key_symbols_t *symbols = xcb_key_symbols_alloc(conn);

	/* wrapped all of them in an ugly if to prevent getting values when
	   we don't need them */
	if (!((keycodes = xcb_key_symbols_get_keycode(symbols, keysym)) == NULL ||
		  (reply = xcb_get_modifier_mapping_reply(conn, xcb_get_modifier_mapping(conn), NULL)) == NULL ||
		  reply->keycodes_per_modifier < 1 ||
		  (mod_keycodes = xcb_get_modifier_mapping_keycodes(reply)) == NULL)) {

		int num_mod =
			xcb_get_modifier_mapping_keycodes_length(reply) /
			reply->keycodes_per_modifier;

		for (int i = 0; i < num_mod; i++) {
			for (int j = 0; j < reply->keycodes_per_modifier; j++) {
				xcb_keycode_t mk = mod_keycodes[i * reply->keycodes_per_modifier + j];
				if (mk != XCB_NO_SYMBOL) {
					for (xcb_keycode_t *k = keycodes; *k != XCB_NO_SYMBOL; k++) {
						if (*k == mk)
							modfield |= (1 << i);
					}
				}
			}
		}
	}

	xcb_key_symbols_free(symbols);
	free(keycodes);
	free(reply);
	return modfield;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
movq 0x404b(%rip), %rdi      # 0xc3b8
callq 0x3370
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x3030
movq %rax, %r14
testq %rax, %rax
je 0x845c
movq 0x4026(%rip), %r15      # 0xc3b8
movq %r15, %rdi
callq 0x36b0
xorl %r13d, %r13d
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3540
testq %rax, %rax
je 0x845f
movq %rax, %r12
cmpb $0x0, 0x1(%rax)
je 0x8464
movq %r12, %rdi
callq 0x34e0
testq %rax, %rax
je 0x8464
movq %rax, %r13
movq %r12, %rdi
callq 0x3620
movzbl 0x1(%r12), %esi
cltd
idivl %esi
xorl %r15d, %r15d
testl %eax, %eax
jle 0x8467
movq %rbx, (%rsp)
cmpl $0x1, %esi
movl %esi, %edx
adcl $0x0, %esi
movl %eax, %eax
movq %r14, %rdi
incq %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
shll %cl, %r8d
movq %rcx, %r9
imulq %rdx, %r9
addq %r13, %r9
xorl %r10d, %r10d
movb (%r9,%r10), %r11b
testb %r11b, %r11b
je 0x8443
movb (%r14), %bl
testb %bl, %bl
je 0x8443
movq %rdi, %rbp
cmpb %r11b, %bl
movl $0x0, %ebx
cmovel %r8d, %ebx
orl %ebx, %r15d
movb (%rbp), %bl
incq %rbp
testb %bl, %bl
jne 0x842a
incq %r10
cmpq %rsi, %r10
jne 0x8417
incq %rcx
cmpq %rax, %rcx
jne 0x8401
movq %r12, %r13
movq (%rsp), %rbx
jmp 0x846a
xorl %r13d, %r13d
xorl %r15d, %r15d
jmp 0x846a
xorl %r15d, %r15d
movq %r12, %r13
movq %rbx, %rdi
callq 0x34a0
movq %r14, %rdi
callq 0x32d0
movq %r13, %rdi
callq 0x32d0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/helpers.c
// Function: vasprintf
int
vasprintf(char **buf, const char *fmt, va_list args)
{
	va_list tmp;
	va_copy(tmp, args);
	int size = vsnprintf(NULL, 0, fmt, tmp);
	va_end(tmp);

	if (size < 0) {
		return -1;
	}

	*buf = malloc(size + 1);

	if (*buf == NULL) {
		return -1;
	}

	size = vsprintf(*buf, fmt, args);
	return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdx), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
movups (%rdx), %xmm0
movaps %xmm0, (%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3490
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x8573
incl %eax
movq %rax, %rdi
callq 0x31b0
movq %rax, (%r15)
testq %rax, %rax
je 0x8573
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x32f0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
testq %rdi, %rdi
je 0x85d1
movq (%rdi), %rax
testq %rax, %rax
je 0x85d1
cmpq %rsi, %rax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x85d1
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x85ae
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rsi), %rcx
testq %rcx, %rcx
je 0x85bb
movq %rax, 0x8(%rcx)
movq $0x0, 0x8(%rsi)
movq (%rdi), %rax
movq %rax, 0x10(%rsi)
movq %rsi, 0x8(%rax)
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x31b0
testq %rax, %rax
je 0x85ff
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x8603
movq $0x0, 0x8(%rax)
movq %rcx, 0x10(%rax)
movq %rax, 0x8(%rcx)
jmp 0x8610
xorl %eax, %eax
jmp 0x8613
movq %rax, %rcx
addq $0x8, %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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:
testq %rdi, %rdi
je 0x862d
movq (%rdi), %rcx
testq %rcx, %rcx
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
je 0x862e
retq
movq 0x10(%rsi), %rax
cmpq %rsi, %rcx
je 0x864a
movq 0x8(%rsi), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%rsi), %rax
testq %rax, %rax
jne 0x8654
jmp 0x8658
movq %rax, (%rdi)
testq %rax, %rax
je 0x8658
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rsi, %rdi
jmp 0x32d0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x86a0
movl %esi, %ebx
movq %rdi, %r14
movq %rax, %r12
testb %bl, %bl
je 0x8688
movq (%r15), %rdi
callq 0x32d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x8615
movq 0x10(%r12), %rax
movq %r12, %r15
testq %rax, %rax
jne 0x8679
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Openvario[P]sensord/main.c
// Function: print_runtime_config
void print_runtime_config(void)
{
	// print actual used config
	fprintf(stderr, "=========================================================================\n");
	fprintf(stderr, "Runtime Configuration:\n");
	fprintf(stderr, "----------------------\n");
	fprintf(stderr, "Vario:\n");
	fprintf(stderr, "  Kalman Accel:\t%f\n",config.vario_x_accel);
	fprintf(stderr, "Sensor TEK:\n");
	fprintf(stderr, "  Offset: \t%f\n",tep_sensor.offset);
	fprintf(stderr, "  Linearity: \t%f\n", tep_sensor.linearity);
	fprintf(stderr, "  Address: \t0x%x\n", tep_sensor.address);
	fprintf(stderr, "  Bus: \t\t%u\n", tep_sensor.bus);
	fprintf(stderr, "  Linearity: \t%f\n", static_sensor.linearity);
	fprintf(stderr, "Sensor TOTAL:\n");
	fprintf(stderr, "  Offset: \t%f\n",dynamic_sensor.offset);
	fprintf(stderr, "  Address: \t0x%x\n", static_sensor.address);
	fprintf(stderr, "  Bus: \t\t%u\n", static_sensor.bus);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xb83b(%rip), %rbp      # 0xdff8
movq (%rbp), %rcx
leaq 0x757e(%rip), %rdi      # 0x9d46
pushq $0x4a
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rcx
leaq 0x75b0(%rip), %rdi      # 0x9d91
pushq $0x17
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rcx
leaq 0x75ae(%rip), %rdi      # 0x9da9
movq %r14, %rsi
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rcx
leaq 0x75b0(%rip), %rdi      # 0x9dc1
pushq $0x7
popq %rsi
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rdi
cvtss2sd 0xbb18(%rip), %xmm0     # 0xe340
leaq 0x759a(%rip), %rsi      # 0x9dc9
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rcx
leaq 0x759c(%rip), %rdi      # 0x9ddd
pushq $0xc
popq %rsi
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rdi
cvtss2sd 0xbad0(%rip), %xmm0     # 0xe328
leaq 0x758b(%rip), %r14      # 0x9dea
movq %r14, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
cvtss2sd 0xbaaf(%rip), %xmm0     # 0xe324
leaq 0x757d(%rip), %r13      # 0x9df9
movq %r13, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
movzbl 0xba0b(%rip), %edx      # 0xe29c
leaq 0x7573(%rip), %r15      # 0x9e0b
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
movzbl 0xb9f0(%rip), %edx      # 0xe29d
leaq 0x7569(%rip), %r12      # 0x9e1d
movq %r12, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
cvtss2sd 0xb992(%rip), %xmm0     # 0xe25c
movq %r13, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rcx
leaq 0x754b(%rip), %rdi      # 0x9e2a
pushq $0xe
popq %rsi
movq %rbx, %rdx
callq 0x22a0
movq (%rbp), %rdi
cvtss2sd 0xb99a(%rip), %xmm0     # 0xe290
movq %r14, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
movzbl 0xb8c9(%rip), %edx      # 0xe1d4
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
movzbl 0xb8b5(%rip), %edx      # 0xe1d5
movq %r12, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21c0
// File: /workspace/github_c_makefile_star2_O1/Openvario[P]sensord/24c16.c
// Function: eeprom_open
int eeprom_open(t_24c16 *eeprom, unsigned char i2c_address)
{
	// local variables
	int fd;
	char s;
	int ret_code = 0;
	char offset = 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));
		ret_code = 1;
	}

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

	// assign file handle to sensor object
	eeprom->fd = fd;
	eeprom->address = i2c_address;

	//write address offset to eeprom
	if ((write(eeprom->fd, (void*)&offset, 1)) != 1) {				// Send register we want to read from
		//fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
		ret_code = 1;
	}

	if (read(eeprom->fd, &s, 1) != 1) {		// Read back data into buf[]
		ret_code = 1;
	}

	if (ret_code == 0)
	{
		fprintf(stderr, "Opened 24C16 on 0x%x\n", i2c_address);

	}
	else
	{
		fprintf(stderr, "Opened 24C16 on 0x%x failed !!!\n", i2c_address);
	}
	return (ret_code);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movb $0x0, 0x6(%rsp)
leaq 0x5ce6(%rip), %rdi      # 0x93d8
xorl %r13d, %r13d
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2230
movl %eax, %r15d
testl %eax, %eax
jns 0x3734
movq 0xa8eb(%rip), %rax      # 0xdff8
movq (%rax), %r12
callq 0x2040
movl (%rax), %edi
callq 0x22d0
leaq 0x5cc0(%rip), %rsi      # 0x93e3
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %r13
pushq $0x1
popq %rbp
movzbl %r14b, %r14d
movl $0x703, %esi            # imm = 0x703
movl %r15d, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
jns 0x377e
movq 0xa8a0(%rip), %rax      # 0xdff8
movq (%rax), %r12
callq 0x2040
movl (%rax), %edi
callq 0x22d0
leaq 0x58d2(%rip), %rsi      # 0x9040
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
movl %ebp, %r13d
movl %r15d, (%rbx)
movb %r14b, 0x4(%rbx)
leaq 0x6(%rsp), %rsi
pushq $0x1
popq %r12
movl %r15d, %edi
movq %r12, %rdx
callq 0x20b0
movq %rax, %r15
xorq $0x1, %r15
movl (%rbx), %edi
leaq 0x7(%rsp), %rsi
movq %r12, %rdx
callq 0x2180
xorq $0x1, %rax
orq %r15, %rax
cmovel %r13d, %ebp
testl %ebp, %ebp
movq 0xa835(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x6fa7(%rip), %rax      # 0xa774
leaq 0x6fb6(%rip), %rsi      # 0xa78a
cmoveq %rax, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x21c0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x30, %rsp
movups 0xa55f(%rip), %xmm1     # 0xe1b8
movaps %xmm1, (%rsp)
cvttss2si %xmm0, %rax
movq %rax, %rcx
movaps %xmm0, 0x10(%rsp)
subss 0x5392(%rip), %xmm0     # 0x9004
cvttss2si %xmm0, %rdx
sarq $0x3f, %rcx
andq %rcx, %rdx
orq %rax, %rdx
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x3b9aca01, %rax       # imm = 0x3B9ACA01
jl 0x3ca9
addq $-0x3b9aca00, %rax      # imm = 0xC4653600
movq %rax, 0x8(%rsp)
incq (%rsp)
movq %rsp, %rbx
movl $0x1, %edi
movl $0x1, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x22b0
testl %eax, %eax
jne 0x3cac
leaq 0x20(%rsp), %rbx
movl $0x1, %edi
movq %rbx, %rsi
callq 0x20a0
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x8(%rbx), %xmm1
movsd 0x5321(%rip), %xmm2     # 0x9010
mulsd %xmm2, %xmm1
cvtsi2sdq 0xa4bc(%rip), %xmm3 # 0xe1b8
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0xa4b4(%rip), %xmm0 # 0xe1c0
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
mulss 0x52e1(%rip), %xmm0     # 0x9008
subss 0x10(%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
movq %rsp, %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x2130
movzbl 0x5(%rbx), %edx
leaq 0x52bd(%rip), %rsi      # 0x901c
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x3db0
movl %eax, %ebp
movzbl 0x4(%rbx), %edx
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x3dba
leaq 0xa6d9(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x3dc6
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
movq %rsp, %rdi
callq 0x235c
jmp 0x3dbf
callq 0x2330
movl $0x1, %eax
jmp 0x3da4
movq 0xa22b(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x5276(%rip), %rsi      # 0x9051
movq %rsp, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x3da0
// File: /workspace/github_c_makefile_star2_O1/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:
movzwl 0xe(%rdi), %ecx
movl %ecx, %eax
andl $0xff00, %eax           # imm = 0xFF00
movw %ax, 0xe(%rdi)
xorl %eax, %eax
xorl %edx, %edx
movl %eax, %esi
andl $-0x2, %esi
movzwl (%rdi,%rsi), %esi
movzbl %sil, %r8d
shrl $0x8, %esi
testb $0x1, %al
cmovel %esi, %r8d
xorl %r8d, %edx
movb $-0x8, %sil
leal (%rdx,%rdx), %r8d
movl %r8d, %r9d
xorl $0x3000, %r9d           # imm = 0x3000
testw %dx, %dx
cmovnsl %r8d, %r9d
movl %r9d, %edx
incb %sil
jne 0x3e16
incl %eax
cmpl $0x10, %eax
jne 0x3dfa
movzwl %dx, %eax
shrl $0xc, %eax
movw %cx, 0xe(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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:
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movw $0x0, 0x8(%rsi)
movb $0x58, (%rsi)
movl (%rdi), %edi
movl $0x1, %edx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x412c
addq $0x18, %rsp
retq
callq 0x253b
movl $0x1, %eax
jmp 0x4127
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
movq $0x0, (%rsi)
movw $0x0, 0x8(%rsi)
movb $0x48, (%rsi)
movl (%rdi), %edi
movl $0x1, %edx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x4170
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0x255a
movl $0x1, %eax
jmp 0x416a
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
movw $0x0, 0x8(%rsi)
movq $0x0, (%rsi)
movl (%rdi), %edi
movl $0x1, %edx
callq 0x20b0
cmpq $0x1, %rax
jne 0x43d1
movl (%rbx), %edi
movq %rsp, %rsi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
jne 0x43d8
movl 0x1c(%rbx), %eax
movl %eax, 0x24(%rbx)
movzbl (%rsp), %eax
shll $0x10, %eax
movzbl 0x1(%rsp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x2(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x1c(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0x260b
jmp 0x43dd
callq 0x262a
movl $0x1, %eax
jmp 0x43cb
// File: /workspace/github_c_makefile_star2_O1/Openvario[P]sensord/ms5611.c
// Function: ms5611_calculate_pressure
int ms5611_calculate_pressure(t_ms5611 *sensor)
{
	sensor->p_meas = (((sensor->D1 * sensor->sens) >> 21) - sensor->off) >> 11;

	// check for valid range
	if ((sensor->temp > -4000) && (sensor->temp < 8500) && (sensor->p_meas > 16000) && (sensor->p_meas < 1920000))
	{
		// correct measured pressure
		sensor->p = (sensor->linearity * (float)(sensor->p_meas + sensor->offset))*.0625;

		// some debugging output
		ddebug_print("%s @ 0x%x: D1: %u\n", __func__, sensor->address, sensor->D1);
		ddebug_print("%s @ 0x%x: OFF: %" PRId64 "\n", __func__, sensor->address, sensor->off);
		ddebug_print("%s @ 0x%x: SENS: %" PRId64 "\n", __func__, sensor->address, sensor->sens);
		debug_print("%s @ 0x%x: Pressure measured: %ld, %f\n", __func__, sensor->address, (unsigned long)sensor->p_meas, sensor->p);
		return(0);
	}
	else
	{
		// TODO add error handling here !!
		return(1);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x1c(%rdi), %r8d
movq 0x48(%rdi), %rax
imulq %r8, %rax
shrq $0x15, %rax
subq 0x40(%rdi), %rax
shrq $0xb, %rax
movl %eax, 0x50(%rdi)
movl $0xf9f, %ecx            # imm = 0xF9F
addl 0x38(%rdi), %ecx
movl $0x1, %ebp
cmpl $0x30d2, %ecx           # imm = 0x30D2
ja 0x4472
leal -0x3e81(%rax), %ecx
cmpl $0x1d0d7e, %ecx         # imm = 0x1D0D7E
ja 0x4472
movq %rdi, %rbx
cvtsi2ss %eax, %xmm0
addss 0x90(%rdi), %xmm0
mulss 0x8c(%rdi), %xmm0
mulss 0x4bd3(%rip), %xmm0     # 0x9018
movss %xmm0, 0x88(%rdi)
leaq 0xa020(%rip), %r14      # 0xe474
cmpl $0x2, (%r14)
jge 0x4479
cmpl $0x2, (%r14)
jge 0x449e
cmpl $0x2, (%r14)
jge 0x44c7
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jg 0x44f3
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x9b78(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x4eb9(%rip), %rsi      # 0x9347
leaq 0x4ec5(%rip), %rdx      # 0x935a
xorl %eax, %eax
callq 0x21c0
jmp 0x445a
movq 0x9b53(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
movq 0x40(%rbx), %r8
leaq 0x4ebd(%rip), %rsi      # 0x9374
leaq 0x4e9c(%rip), %rdx      # 0x935a
xorl %eax, %eax
callq 0x21c0
jmp 0x4460
movq 0x9b2a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
movq 0x48(%rbx), %r8
leaq 0x4ea9(%rip), %rsi      # 0x9389
leaq 0x4e73(%rip), %rdx      # 0x935a
xorl %eax, %eax
callq 0x21c0
jmp 0x4466
movq 0x9afe(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
movslq 0x50(%rbx), %r8
xorps %xmm0, %xmm0
cvtss2sd 0x88(%rbx), %xmm0
leaq 0x4e88(%rip), %rsi      # 0x939f
leaq 0x4e3c(%rip), %rdx      # 0x935a
movb $0x1, %al
callq 0x21c0
jmp 0x4472
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4e99(%rip), %rdi      # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x458a
movl %eax, %ebp
movzbl %bl, %r15d
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x4591
leaq 0x9f03(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x459d
movl %ebp, (%r14)
movb %bl, 0x4(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2675
jmp 0x4596
callq 0x2649
movl $0x1, %eax
jmp 0x457f
movq 0x9a54(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x4e4d(%rip), %rsi      # 0x93fb
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x4576
// File: /workspace/github_c_makefile_star2_O1/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:
movl $0x39990666, 0x6(%rdi)  # imm = 0x39990666
movw $0x3200, 0xe(%rdi)      # imm = 0x3200
movl $0x438311ec, 0x10(%rdi) # imm = 0x438311EC
leaq 0x9e9f(%rip), %rax      # 0xe474
cmpl $0x2, (%rax)
jge 0x45dd
xorl %eax, %eax
retq
pushq %rax
callq 0x26a1
addq $0x8, %rsp
jmp 0x45da
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
movw $0x0, 0x8(%rsi)
movq $0x0, (%rsi)
movl (%rdi), %edi
movl $0x4, %edx
callq 0x2180
cmpq $0x4, %rax
jne 0x4661
movzbl (%rsp), %eax
andl $0x3f, %eax
shll $0x8, %eax
movzbl 0x1(%rsp), %r8d
orl %eax, %r8d
movw %r8w, 0xa(%rbx)
movzwl 0x2(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
shrl $0x5, %eax
movw %ax, 0xc(%rbx)
leaq 0x9e2c(%rip), %r14      # 0xe474
cmpl $0x0, (%r14)
jg 0x466d
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jg 0x4695
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x26cf
movl $0x1, %ebp
jmp 0x4656
movq 0x9984(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x4dce(%rip), %rsi      # 0x9450
leaq 0x4de3(%rip), %rdx      # 0x946c
movl %r8d, %r9d
xorl %eax, %eax
callq 0x21c0
jmp 0x464e
movq 0x995c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
movzwl 0xc(%rbx), %r8d
leaq 0x4dcd(%rip), %rsi      # 0x947c
leaq 0x4db6(%rip), %rdx      # 0x946c
xorl %ebp, %ebp
movl %r8d, %r9d
xorl %eax, %eax
callq 0x21c0
jmp 0x4656
// File: /workspace/github_c_makefile_star2_O1/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:
movzwl 0xa(%rdi), %eax
movzwl 0x6(%rdi), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm2
movzbl 0xe(%rdi), %eax
cvtsi2ss %eax, %xmm0
movzwl 0xc(%rdi), %eax
imull $0xc8, %eax, %eax
cvtsi2ss %eax, %xmm1
divss 0x10(%rdi), %xmm2
mulss 0x4cd3(%rip), %xmm1     # 0x93c8
addss %xmm2, %xmm0
addss 0x4ccb(%rip), %xmm1     # 0x93cc
movss %xmm1, 0x14(%rdi)
mulss 0x1c(%rdi), %xmm0
addss 0x20(%rdi), %xmm0
movss %xmm0, 0x18(%rdi)
leaq 0x9d58(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x4724
xorl %eax, %eax
retq
pushq %rax
movq 0x98cc(%rip), %rax      # 0xdff8
movq (%rax), %rax
movzbl 0x4(%rdi), %ecx
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
leaq 0x4d56(%rip), %rsi      # 0x9498
leaq 0x4d71(%rip), %rdx      # 0x94ba
movq %rax, %rdi
movb $0x2, %al
callq 0x21c0
addq $0x8, %rsp
jmp 0x4721
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movw $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
leaq 0x4c56(%rip), %rdi      # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x47f6
movl %eax, %r14d
movzbl %bpl, %r15d
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x47fd
leaq 0x8(%rsp), %rsi
movl $0x3, %edx
movl %r14d, %edi
callq 0x2180
cmpq $0x3, %rax
jne 0x47e2
leaq 0x9ca7(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x4807
movl %r14d, 0x10(%rbx)
movb %bpl, 0x14(%rbx)
movb $0x1, 0x15(%rbx)
xorl %eax, %eax
jmp 0x47eb
movb $0x0, 0x15(%rbx)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2728
jmp 0x47e6
movq %rbx, %rdi
callq 0x26eb
jmp 0x47e6
movq 0x97ea(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x4cc0(%rip), %rsi      # 0x94d8
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x47d2
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movw $0x0, 0x8(%rsi)
movq $0x0, (%rsi)
movl 0x10(%rdi), %edi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
jne 0x4895
movzwl 0x8(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movl %r8d, 0x8(%rbx)
leaq 0x9bef(%rip), %rax      # 0xe474
xorl %ebp, %ebp
cmpl $0x2, (%rax)
jge 0x48a1
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
callq 0x278f
movl $0x1, %ebp
jmp 0x488c
movq 0x9750(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x14(%rbx), %ecx
leaq 0x4c7a(%rip), %rsi      # 0x9530
leaq 0x4c8e(%rip), %rdx      # 0x954b
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x21c0
jmp 0x488c
// File: /workspace/github_c_makefile_star2_O1/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 %rax
leaq -0x8(%rip), %rsi        # 0x52cc
movl $0x2, %edi
callq 0x21b0
leaq 0x914b(%rip), %rax      # 0xe430
movq (%rax), %rdi
testq %rdi, %rdi
je 0x52f2
callq 0x20d0
leaq 0x912f(%rip), %rax      # 0xe428
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5306
callq 0x20d0
movq 0x8ceb(%rip), %rax      # 0xdff8
movq (%rax), %rcx
leaq 0x4b22(%rip), %rdi      # 0x9e39
movl $0xc, %esi
movl $0x1, %edx
callq 0x22a0
xorl %edi, %edi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x34ae(%rip), %xmm2     # 0x95a0
cmpltps %xmm0, %xmm2
xorps %xmm3, %xmm3
movaps %xmm0, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %ebp
movss 0x3e61(%rip), %xmm2     # 0x9f70
cmpltps %xmm1, %xmm2
movss 0x3e59(%rip), %xmm3     # 0x9f74
movaps %xmm1, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %r15d
movsd 0x3e5e(%rip), %xmm2     # 0x9f90
movaps %xmm2, %xmm3
testb $0x1, %bpl
jne 0x6142
xorps %xmm3, %xmm3
cvtss2sd %xmm0, %xmm3
testb $0x1, %r15b
jne 0x614f
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
leaq 0x3e6a(%rip), %rsi      # 0x9fc0
movq %rbx, %rdi
movaps %xmm3, %xmm0
movaps %xmm2, %xmm1
movb $0x2, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x6195
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x6187
movzbl %cl, %edx
leaq 0x3e3d(%rip), %rsi      # 0x9fd9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x82c7(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x61d5
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %ecx
incl %ecx
testb $0x1, %r15b
movl $0x14, %eax
cmovel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7e1c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3dfb(%rip), %rsi      # 0x9fe1
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x61b2
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
callq 0x20e0
cmpl $0x2, %eax
jl 0x6219
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x620c
jmp 0x621b
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq