LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_put_in_grid
static void
ipc_window_put_in_grid(uint32_t *d)
{
	uint16_t grid_width, grid_height;
	uint16_t grid_x, grid_y;
	uint16_t occ_w, occ_h;
	const uint16_t m1 = 16U, m2 = 0xffffU;

	DMSG("data[4] = %d\n", d[4]);
	grid_width  = d[0] >> m1;
	grid_height = d[0] & m2;
	grid_x      = d[1] >> m1;
	grid_y      = d[1] & m2;
	occ_w       = d[2] >> m1;
	occ_h       = d[2] & m2;

	if (focused_win == NULL || grid_x >= grid_width || grid_y >= grid_height)
		return;

	grid_window(focused_win, grid_width, grid_height, grid_x, grid_y, occ_w, occ_h);
}

// Assembly:
movq %rdi, %rax
movl (%rdi), %ecx
movl 0x4(%rdi), %r8d
movl %ecx, %edx
shrl $0x10, %edx
movl %r8d, %r9d
shrl $0x10, %r9d
movq 0x5b10(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
setne %sil
cmpl %edx, %r9d
setb %r10b
andb %sil, %r10b
cmpb $0x1, %r10b
jne 0x6d22
movl $0xffff, %esi           # imm = 0xFFFF
movl %r8d, %r10d
andl %esi, %r10d
andl %ecx, %esi
cmpl %esi, %r10d
jae 0x6d22
pushq %rax
movl 0x8(%rax), %eax
movl %eax, %r10d
shrl $0x10, %r10d
movzwl %ax, %eax
movl %eax, (%rsp)
movzwl %dx, %esi
movzwl %cx, %edx
movzwl %r9w, %ecx
movzwl %r8w, %r8d
movzwl %r10w, %r9d
callq 0x78e8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5ab3(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x6de0
cmpb $0x1, 0x28(%rdi)
jne 0x6de0
movq 0x8(%rax), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movq (%rax), %xmm1
pcmpeqd 0x22ca(%rip), %xmm1     # 0x9020
packssdw %xmm1, %xmm1
pxor %xmm2, %xmm2
psubw %xmm0, %xmm2
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movd 0x1c(%rdi), %xmm0
paddw %xmm1, %xmm0
movswl 0x18(%rdi), %ecx
movd %xmm0, %eax
movswl %ax, %edx
movswl 0x20(%rdi), %r9d
addl %r9d, %edx
cmpl %ecx, %edx
jg 0x6de0
movswl 0x1a(%rdi), %edx
pextrw $0x1, %xmm0, %r8d
movswl %r8w, %r10d
movswl 0x22(%rdi), %esi
addl %esi, %r10d
cmpl %edx, %r10d
jg 0x6de0
pshuflw $0x60, %xmm0, %xmm0     # xmm0 = xmm0[0,0,2,1,4,5,6,7]
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movmskpd %xmm0, %r10d
testb $0x1, %r10b
jne 0x6de0
shrb %r10b
jne 0x6de0
pushq %rax
movzwl %si, %esi
movl %esi, (%rsp)
movzwl %cx, %esi
movzwl %dx, %edx
movzwl %ax, %ecx
movzwl %r8w, %r8d
movzwl %r9w, %r9d
callq 0x78e8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x59f5(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x6eab
cmpb $0x1, 0x28(%rdi)
jne 0x6eab
movq 0x8(%rax), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movq (%rax), %xmm1
pcmpeqd 0x220c(%rip), %xmm1     # 0x9020
packssdw %xmm1, %xmm1
pxor %xmm2, %xmm2
psubw %xmm0, %xmm2
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movq 0x20(%rdi), %xmm0
paddw %xmm1, %xmm0
movswl 0x18(%rdi), %ecx
movd %xmm0, %eax
movswl %ax, %edx
movswl 0x1c(%rdi), %r8d
addl %r8d, %edx
cmpl %ecx, %edx
jg 0x6eab
movswl 0x1a(%rdi), %edx
pextrw $0x1, %xmm0, %esi
movswl %si, %r10d
movswl 0x1e(%rdi), %r9d
addl %r9d, %r10d
cmpl %edx, %r10d
jg 0x6eab
pshuflw $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1,4,5,6,7]
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
pxor %xmm1, %xmm1
pcmpgtw %xmm1, %xmm0
movmskpd %xmm0, %r10d
xorl $0x3, %r10d
testb $0x1, %r10b
jne 0x6eab
shrb %r10b
jne 0x6eab
pushq %rax
movzwl %si, %esi
movl %esi, (%rsp)
movzwl %cx, %esi
movzwl %dx, %edx
movzwl %r8w, %ecx
movzwl %r9w, %r8d
movzwl %ax, %r9d
callq 0x78e8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x572e(%rip), %rax      # 0xc7e0
testq %rax, %rax
je 0x70fd
leaq 0x530a(%rip), %rcx      # 0xc3c8
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x70fd
cmpq %rax, (%rcx)
je 0x70d1
addq $0x10, %rcx
jmp 0x70be
movq 0x52f0(%rip), %rdx      # 0xc3c8
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
cmoveq %rdx, %rcx
movq (%rcx), %rdi
cmpb $0x1, 0x54(%rdi)
jne 0x70d8
movl 0x58(%rdi), %esi
cmpl 0x58(%rax), %esi
jne 0x70d8
cmpq %rax, %rdi
jne 0x5936
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x520c(%rip)      # 0xc7bc
jbe 0x75e6
leaq 0x4e0f(%rip), %r14      # 0xc3c8
movq (%r14), %r14
testq %r14, %r14
je 0x75d9
movq (%r14), %rdi
testq %rdi, %rdi
je 0x75d3
cmpl %ebx, 0x58(%rdi)
jne 0x75d3
callq 0x7c1f
addq $0x10, %r14
jmp 0x75b9
movq 0x5220(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x51b1(%rip)      # 0xc7bc
jbe 0x7625
movq 0x51ec(%rip), %rax      # 0xc800
movl %ebx, %ecx
cmpb $0x1, (%rax,%rcx)
jne 0x7627
movl %ebx, %edi
callq 0x7ca4
jmp 0x762e
popq %rbx
retq
movl %ebx, %edi
callq 0x7c42
movl %ebx, 0x51d4(%rip)      # 0xc808
popq %rbx
jmp 0x5804
// File: /workspace/github_c_makefile_star2_O2/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), %ebx
decl %ebx
movl 0x5175(%rip), %eax      # 0xc7bc
cmpl %ebx, %eax
jbe 0x767a
xorl %ebp, %ebp
cmpl %eax, %ebp
jae 0x766f
cmpl %ebp, %ebx
jne 0x765e
movl %ebx, %edi
callq 0x7c42
jmp 0x7665
movl %ebp, %edi
callq 0x7ca4
incl %ebp
movl 0x514f(%rip), %eax      # 0xc7bc
jmp 0x764d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5804
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7b95
movl %edi, %eax
leaq 0x1600(%rip), %rcx      # 0x9120
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movss 0x162b(%rip), %xmm2     # 0x915c
subss %xmm1, %xmm2
ucomiss %xmm2, %xmm0
movb $0x1, %al
jae 0x7b65
addss 0x161c(%rip), %xmm1     # 0x9160
jmp 0x7b90
movss 0x160a(%rip), %xmm2     # 0x9158
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
ucomiss %xmm0, %xmm3
jb 0x7b95
subss %xmm1, %xmm2
movb $0x1, %al
ucomiss %xmm2, %xmm0
jbe 0x7b95
retq
movss 0x15e6(%rip), %xmm2     # 0x9154
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
ucomiss %xmm0, %xmm3
jb 0x7b95
subss %xmm1, %xmm2
movb $0x1, %al
ucomiss %xmm2, %xmm0
jae 0x7b65
jmp 0x7b95
andps 0x14a2(%rip), %xmm0     # 0x9030
movb $0x1, %al
ucomiss %xmm0, %xmm1
jae 0x7b65
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7c0d
movzwl 0x8(%rsi), %esi
addl %esi, %edi
cmpw %di, %cx
setle %cl
cmpw %di, %dx
setge %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x7c18
andb %r9b, %r8b
andb %r10b, %al
orb %r8b, %al
jmp 0x7c1a
xorl %eax, %eax
andb $0x1, %al
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
orl $-0x1, 0x58(%rdi)
callq 0x5bd5
callq 0x5804
movq %rbx, %rdi
callq 0x5b20
movq %rbx, %rdi
popq %rbx
jmp 0x4fb8
// File: /workspace/github_c_makefile_star2_O2/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, 0x4b74(%rip)      # 0xc7bc
jbe 0x7c86
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x4770(%rip), %r15      # 0xc3c8
movq (%r15), %r15
testq %r15, %r15
je 0x7c87
movq (%r15), %r14
cmpl %ebx, 0x58(%r14)
jne 0x7c80
movq 0x4748(%rip), %rdi      # 0xc3b8
movl (%r14), %esi
callq 0x3270
movq %r14, %rdi
callq 0x5936
addq $0x10, %r15
jmp 0x7c58
retq
movq 0x4b72(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x1, (%rax,%rcx)
movl %ebx, 0x4b6e(%rip)      # 0xc808
popq %rbx
popq %r14
popq %r15
jmp 0x5804
// File: /workspace/github_c_makefile_star2_O2/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, 0x4b12(%rip)      # 0xc7bc
jbe 0x7cdd
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x470f(%rip), %r14      # 0xc3c8
movq (%r14), %r14
testq %r14, %r14
je 0x7cde
movq (%r14), %rax
cmpl %ebx, 0x58(%rax)
jne 0x7cd7
movq 0x46e8(%rip), %rdi      # 0xc3b8
movl (%rax), %esi
callq 0x35f0
addq $0x10, %r14
jmp 0x7cb9
retq
movq 0x4b1b(%rip), %rax      # 0xc800
movl %ebx, %ecx
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5804
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: grab_buttons
static void
grab_buttons(void)
{
	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		window_grab_buttons(client->window);
	}
}

// Assembly:
pushq %rbx
leaq 0x46c9(%rip), %rbx      # 0xc3c8
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7d17
movq (%rbx), %rax
movl (%rax), %edi
callq 0x53e3
addq $0x10, %rbx
jmp 0x7cff
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x468b(%rip), %rdi      # 0xc3b8
callq 0x3360
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x3030
movq %rax, %r14
testq %rax, %rax
je 0x7dfb
movq %rbx, (%rsp)
movq 0x4662(%rip), %r15      # 0xc3b8
movq %r15, %rdi
callq 0x36a0
xorl %r13d, %r13d
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3530
testq %rax, %rax
je 0x7e03
movq %rax, %r12
cmpb $0x0, 0x1(%rax)
je 0x7e08
movq %r12, %rdi
callq 0x34d0
xorl %r15d, %r15d
testq %rax, %rax
je 0x7e0b
movq %rax, %r13
movq %r12, %rdi
callq 0x3610
movzbl 0x1(%r12), %esi
cltd
idivl %esi
testl %eax, %eax
cmovlel %r15d, %eax
pushq $0x1
popq %rdx
xorl %ecx, %ecx
cmpq %rax, %rcx
je 0x7e0b
movl %edx, %edi
shll %cl, %edi
movq %rcx, %r8
imulq %rsi, %r8
addq %r13, %r8
xorl %r9d, %r9d
cmpq %rsi, %r9
je 0x7df6
movb (%r8,%r9), %r10b
testb %r10b, %r10b
je 0x7df1
movq %r14, %r11
movb (%r11), %bl
testb %bl, %bl
je 0x7df1
movl %edi, %ebp
cmpb %r10b, %bl
je 0x7de9
xorl %ebp, %ebp
orl %ebp, %r15d
incq %r11
jmp 0x7dd9
incq %r9
jmp 0x7dc8
incq %rcx
jmp 0x7db2
xorl %r13d, %r13d
xorl %r15d, %r15d
jmp 0x7e12
xorl %r15d, %r15d
jmp 0x7e0e
xorl %r15d, %r15d
movq %r12, %r13
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x3490
movq %r14, %rdi
callq 0x32c0
movq %r13, %rdi
callq 0x32c0
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_O2/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 0x3480
pushq $-0x1
popq %rbp
testl %eax, %eax
js 0x7f19
incl %eax
movq %rax, %rdi
callq 0x31a0
movq %rax, (%r15)
testq %rax, %rax
je 0x7f19
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x32e0
movl %eax, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7f70
movq (%rdi), %rax
testq %rax, %rax
je 0x7f70
cmpq %rsi, %rax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x7f70
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rcx
testq %rax, %rax
je 0x7f54
movq %rcx, 0x10(%rax)
testq %rcx, %rcx
je 0x7f5d
movq %rax, 0x8(%rcx)
andq $0x0, 0x8(%rsi)
movq (%rdi), %rax
movq %rax, 0x10(%rsi)
movq %rsi, 0x8(%rax)
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7fb4
movq (%rdi), %rcx
testq %rcx, %rcx
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
je 0x7fb5
retq
movq 0x10(%rsi), %rax
cmpq %rsi, %rcx
je 0x7fcd
movq 0x8(%rsi), %rcx
movq %rax, 0x10(%rcx)
testq %rax, %rax
jne 0x7fd7
jmp 0x7fdb
movq %rax, (%rdi)
testq %rax, %rax
je 0x7fdb
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rsi, %rdi
jmp 0x32c0
// File: /workspace/github_c_makefile_star2_O2/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
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %r15
movq 0x10(%r15), %r12
testq %r12, %r12
je 0x8018
testb %bl, %bl
je 0x8008
movq (%r15), %rdi
callq 0x32c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x7f9c
movq %r12, %r15
jmp 0x7ff3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x38, %rsp
movups 0xad6f(%rip), %xmm1     # 0xd1b8
movaps %xmm1, (%rsp)
cvttss2si %xmm0, %rax
movq %rax, %rcx
movaps %xmm0, 0x10(%rsp)
subss 0x5ba2(%rip), %xmm0     # 0x8004
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 0x2499
addq $-0x3b9aca00, %rax      # imm = 0xC4653600
movq %rax, 0x8(%rsp)
incq (%rsp)
pushq $0x1
popq %rbx
movq %rsp, %r14
movl %ebx, %edi
movl %ebx, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x22c0
testl %eax, %eax
jne 0x249f
pushq $0x1
popq %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x20a0
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm1
movsd 0x5b3c(%rip), %xmm2     # 0x8010
mulsd %xmm2, %xmm1
cvtsi2sdq 0xacd7(%rip), %xmm3 # 0xd1b8
addsd %xmm0, %xmm1
cvtsi2sdq 0xacd2(%rip), %xmm0 # 0xd1c0
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
subsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
mulss 0x5b02(%rip), %xmm0     # 0x8008
subss 0x10(%rsp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5add(%rip), %rsi      # 0x801c
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
pushq $0x2
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x258e
movl %eax, %ebp
movzbl 0x4(%rbx), %edx
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x25bd
leaq 0xaefb(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x25ec
movl %ebp, (%rbx)
xorl %eax, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
movq 0xaa63(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x5a7f(%rip), %rsi      # 0x802a
movq %rsp, %rdx
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x21c0
jmp 0x25e7
movq 0xaa34(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x5a66(%rip), %rsi      # 0x8040
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x2582
movq 0xaa05(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x5a50(%rip), %rsi      # 0x8051
movq %rsp, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x257e
// File: /workspace/github_c_makefile_star2_O2/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 %edx, %edx
xorl %eax, %eax
cmpl $0x10, %eax
je 0x266a
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
testb %sil, %sil
je 0x2666
leal (%rdx,%rdx), %r8d
movl %r8d, %r9d
xorl $0x3000, %r9d           # imm = 0x3000
testw %dx, %dx
cmovnsl %r8d, %r9d
incb %sil
movl %r9d, %edx
jmp 0x2644
incl %eax
jmp 0x2623
movzwl %dx, %eax
shrl $0xc, %eax
movw %cx, 0xe(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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:
subq $0x18, %rsp
leaq 0xe(%rsp), %rsi
andq $0x0, 0x1(%rsi)
movb $0x0, 0x9(%rsi)
movb $0x1e, (%rsi)
movl (%rdi), %edi
pushq $0x1
popq %rdx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x29ec
addq $0x18, %rsp
retq
movq 0xa605(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x57d8(%rip), %rsi      # 0x81d5
leaq 0x57f2(%rip), %rdx      # 0x81f6
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x29e7
// File: /workspace/github_c_makefile_star2_O2/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 0xe(%rsp), %rsi
andq $0x0, 0x1(%rsi)
movb $0x0, 0x9(%rsi)
movb $0x58, (%rsi)
movl (%rdi), %edi
pushq $0x1
popq %rdx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x2a3f
addq $0x18, %rsp
retq
movq 0xa5b2(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x5785(%rip), %rsi      # 0x81d5
leaq 0x57ac(%rip), %rdx      # 0x8203
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x2a3a
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x6(%rsp), %rsi
andq $0x0, 0x1(%rsi)
movq %rdi, %rbx
movb $0x0, 0x9(%rsi)
movb $0x48, (%rsi)
movl (%rdi), %edi
pushq $0x1
popq %rdx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x2a97
addq $0x10, %rsp
popq %rbx
retq
movq 0xa55a(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %edx
leaq 0x5769(%rip), %rsi      # 0x8215
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x2a91
// File: /workspace/github_c_makefile_star2_O2/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
andw $0x0, 0x8(%rsi)
andq $0x0, (%rsi)
movl (%rdi), %edi
pushq $0x1
popq %rdx
callq 0x20b0
cmpq $0x1, %rax
jne 0x2d54
movl (%rbx), %edi
movq %rsp, %rsi
pushq $0x3
popq %rdx
callq 0x2180
cmpq $0x3, %rax
jne 0x2d67
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
movq 0xa29d(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x556e(%rip), %rsi      # 0x82d3
jmp 0x2d78
movq 0xa28a(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x55a3(%rip), %rsi      # 0x831b
leaq 0x5587(%rip), %rdx      # 0x8306
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x2d4e
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
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
pushq $0x1
popq %rbp
cmpl $0x30d2, %ecx           # imm = 0x30D2
ja 0x2e0e
leal -0x3e81(%rax), %ecx
cmpl $0x1d0d7e, %ecx         # imm = 0x1D0D7E
ja 0x2e0e
movq %rdi, %rbx
cvtsi2ss %eax, %xmm0
addss 0x90(%rdi), %xmm0
mulss 0x8c(%rdi), %xmm0
mulss 0x522b(%rip), %xmm0     # 0x8018
movss %xmm0, 0x88(%rdi)
leaq 0xa678(%rip), %r14      # 0xd474
movl (%r14), %eax
cmpl $0x2, %eax
jge 0x2e1b
xorl %ebp, %ebp
testl %eax, %eax
jg 0x2e96
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xa1d6(%rip), %r15      # 0xcff8
movq (%r15), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x5517(%rip), %rsi      # 0x8347
leaq 0x5523(%rip), %rdx      # 0x835a
xorl %eax, %eax
callq 0x21c0
movl (%r14), %eax
cmpl $0x2, %eax
jl 0x2e04
movq (%r15), %rdi
movzbl 0x4(%rbx), %ecx
movq 0x40(%rbx), %r8
leaq 0x551c(%rip), %rsi      # 0x8374
leaq 0x54fb(%rip), %rdx      # 0x835a
xorl %eax, %eax
callq 0x21c0
movl (%r14), %eax
cmpl $0x2, %eax
jl 0x2e04
movq (%r15), %rdi
movzbl 0x4(%rbx), %ecx
movq 0x48(%rbx), %r8
leaq 0x5509(%rip), %rsi      # 0x8389
leaq 0x54d3(%rip), %rdx      # 0x835a
xorl %eax, %eax
callq 0x21c0
movl (%r14), %eax
jmp 0x2e04
movq 0xa15b(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movzbl 0x4(%rbx), %ecx
movslq 0x50(%rbx), %r8
cvtss2sd 0x88(%rbx), %xmm0
leaq 0x54e8(%rip), %rsi      # 0x839f
leaq 0x549c(%rip), %rdx      # 0x835a
movb $0x1, %al
callq 0x21c0
jmp 0x2e0e
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x54f9(%rip), %rdi      # 0x83d8
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x2f28
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 0x2f47
leaq 0xa565(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x2f76
movl %ebp, (%r14)
movb %bl, 0x4(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xa0c9(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x549e(%rip), %rsi      # 0x83e3
jmp 0x2f64
movq 0xa0aa(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x50dc(%rip), %rsi      # 0x8040
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rax
jmp 0x2f1d
movq 0xa07b(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x5474(%rip), %rsi      # 0x83fb
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x2f14
// File: /workspace/github_c_makefile_star2_O2/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 0xa4c6(%rip), %rax      # 0xd474
cmpl $0x2, (%rax)
jge 0x2fb6
xorl %eax, %eax
retq
pushq %rax
movq 0xa03a(%rip), %rax      # 0xcff8
movq (%rax), %rax
movzbl 0x4(%rdi), %ecx
leaq 0x5447(%rip), %rsi      # 0x8413
leaq 0x5455(%rip), %rdx      # 0x8428
movsd 0x53ed(%rip), %xmm0     # 0x83c8
movq %rax, %rdi
movb $0x1, %al
callq 0x21c0
addq $0x8, %rsp
jmp 0x2fb3
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
andw $0x0, 0x8(%rsi)
andq $0x0, (%rsi)
movl (%rdi), %edi
pushq $0x4
popq %rdx
callq 0x2180
cmpq $0x4, %rax
jne 0x305e
movzbl 0x8(%rsp), %eax
andl $0x3f, %eax
shll $0x8, %eax
movzbl 0x9(%rsp), %r8d
orl %eax, %r8d
movw %r8w, 0xa(%rbx)
movzwl 0xa(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
shrl $0x5, %eax
movw %ax, 0xc(%rbx)
leaq 0xa42b(%rip), %r14      # 0xd474
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jg 0x307f
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x9f93(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x53c6(%rip), %rdi      # 0x8435
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
pushq $0x1
popq %rbp
jmp 0x3051
movq 0x9f72(%rip), %r15      # 0xcff8
movq (%r15), %rdi
movzbl 0x4(%rbx), %ecx
leaq 0x53bc(%rip), %rsi      # 0x8450
leaq 0x53d1(%rip), %rdx      # 0x846c
xorl %ebp, %ebp
movl %r8d, %r9d
xorl %eax, %eax
callq 0x21c0
cmpl $0x0, (%r14)
jle 0x3051
movq (%r15), %rdi
movzbl 0x4(%rbx), %ecx
movzwl 0xc(%rbx), %r8d
leaq 0x53bc(%rip), %rsi      # 0x847c
leaq 0x53a5(%rip), %rdx      # 0x846c
xorl %ebp, %ebp
movl %r8d, %r9d
xorl %eax, %eax
callq 0x21c0
jmp 0x3051
// File: /workspace/github_c_makefile_star2_O2/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 0x52c7(%rip), %xmm1     # 0x83d0
addss %xmm2, %xmm0
addss 0x52bf(%rip), %xmm1     # 0x83d4
movss %xmm1, 0x14(%rdi)
mulss 0x1c(%rdi), %xmm0
addss 0x20(%rdi), %xmm0
movss %xmm0, 0x18(%rdi)
leaq 0xa344(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x3138
xorl %eax, %eax
retq
pushq %rax
movq 0x9eb8(%rip), %rax      # 0xcff8
movq (%rax), %rax
movzbl 0x4(%rdi), %ecx
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
leaq 0x5342(%rip), %rsi      # 0x8498
leaq 0x535d(%rip), %rdx      # 0x84ba
movq %rax, %rdi
movb $0x2, %al
callq 0x21c0
addq $0x8, %rsp
jmp 0x3135
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
andw $0x0, 0x10(%rsp)
movq %rdi, %rbx
andq $0x0, 0x8(%rsp)
leaq 0x5246(%rip), %rdi      # 0x83d8
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x31ee
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 0x321a
leaq 0x8(%rsp), %rsi
pushq $0x3
popq %rdx
movl %r14d, %edi
callq 0x2180
cmpq $0x3, %rax
jne 0x3244
leaq 0xa29b(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x3256
movl %r14d, 0x10(%rbx)
movb %bpl, 0x14(%rbx)
movb $0x1, 0x15(%rbx)
xorl %eax, %eax
jmp 0x324b
movq 0x9e03(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x51d8(%rip), %rsi      # 0x83e3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x3248
movq 0x9dd7(%rip), %rax      # 0xcff8
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x4e09(%rip), %rsi      # 0x8040
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
movb $0x0, 0x15(%rbx)
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x9d9b(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x5271(%rip), %rsi      # 0x84d8
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x31de
// File: /workspace/github_c_makefile_star2_O2/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
andw $0x0, 0x8(%rsi)
andq $0x0, (%rsi)
movl 0x10(%rdi), %edi
pushq $0x3
popq %rdx
callq 0x2180
cmpq $0x3, %rax
jne 0x3317
movzwl 0x8(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movl %r8d, 0x8(%rbx)
leaq 0xa16d(%rip), %rax      # 0xd474
xorl %ebp, %ebp
cmpl $0x2, (%rax)
jge 0x3338
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq 0x9cda(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x510d(%rip), %rdi      # 0x8435
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
pushq $0x1
popq %rbp
jmp 0x330e
movq 0x9cb9(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movzbl 0x14(%rbx), %ecx
leaq 0x51e3(%rip), %rsi      # 0x8530
leaq 0x51f7(%rip), %rdx      # 0x854b
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x21c0
jmp 0x330e
// File: /workspace/github_c_makefile_star2_O2/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        # 0x4082
pushq $0x2
popq %rdi
callq 0x21b0
leaq 0x9397(%rip), %rax      # 0xd430
movq (%rax), %rdi
testq %rdi, %rdi
je 0x40a6
callq 0x20d0
leaq 0x937b(%rip), %rax      # 0xd428
movq (%rax), %rdi
testq %rdi, %rdi
je 0x40ba
callq 0x20d0
movq 0x8f37(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x4dde(%rip), %rdi      # 0x8ea9
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
xorl %edi, %edi
callq 0x2290
// File: /workspace/github_c_makefile_star2_O2/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 0x8f09(%rip), %rbp      # 0xcff8
movq (%rbp), %rcx
leaq 0x4cbc(%rip), %rdi      # 0x8db6
pushq $0x4a
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rcx
leaq 0x4cee(%rip), %rdi      # 0x8e01
pushq $0x17
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rcx
leaq 0x4cec(%rip), %rdi      # 0x8e19
movq %r14, %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rcx
leaq 0x4cee(%rip), %rdi      # 0x8e31
pushq $0x7
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rdi
cvtss2sd 0x91e6(%rip), %xmm0     # 0xd340
leaq 0x4cd8(%rip), %rsi      # 0x8e39
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rcx
leaq 0x4cda(%rip), %rdi      # 0x8e4d
pushq $0xc
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rdi
cvtss2sd 0x919e(%rip), %xmm0     # 0xd328
leaq 0x4cc9(%rip), %r14      # 0x8e5a
movq %r14, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
cvtss2sd 0x917d(%rip), %xmm0     # 0xd324
leaq 0x4cbb(%rip), %r13      # 0x8e69
movq %r13, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
movzbl 0x90d9(%rip), %edx      # 0xd29c
leaq 0x4cb1(%rip), %r15      # 0x8e7b
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
movzbl 0x90be(%rip), %edx      # 0xd29d
leaq 0x4ca7(%rip), %r12      # 0x8e8d
movq %r12, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
cvtss2sd 0x9060(%rip), %xmm0     # 0xd25c
movq %r13, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rcx
leaq 0x4c89(%rip), %rdi      # 0x8e9a
pushq $0xe
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%rbp), %rdi
cvtss2sd 0x9068(%rip), %xmm0     # 0xd290
movq %r14, %rsi
movb $0x1, %al
callq 0x21c0
movq (%rbp), %rdi
movzbl 0x8f97(%rip), %edx      # 0xd1d4
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
movq (%rbp), %rdi
movzbl 0x8f83(%rip), %edx      # 0xd1d5
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_O2/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 0x3526(%rip), %xmm2     # 0x85a4
cmpltps %xmm0, %xmm2
xorps %xmm3, %xmm3
movaps %xmm0, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %ebp
movss 0x3f45(%rip), %xmm2     # 0x8fe0
cmpltps %xmm1, %xmm2
movss 0x3f3d(%rip), %xmm3     # 0x8fe4
movaps %xmm1, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %r15d
movsd 0x3f42(%rip), %xmm2     # 0x9000
movaps %xmm2, %xmm3
testb $0x1, %bpl
jne 0x50cb
cvtss2sd %xmm0, %xmm3
testb $0x1, %r15b
jne 0x50d5
cvtss2sd %xmm1, %xmm2
leaq 0x3f54(%rip), %rsi      # 0x9030
movq %rbx, %rdi
movaps %xmm3, %xmm0
movaps %xmm2, %xmm1
movb $0x2, %al
callq 0x2280
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x5158
movzbl %al, %edx
leaq 0x3f45(%rip), %rsi      # 0x9049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
leaq 0x835f(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x513b
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %ecx
incl %ecx
testb $0x1, %r15b
pushq $0x14
popq %rax
cmovel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7eb6(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3f05(%rip), %rsi      # 0x9051
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x511a
// File: /workspace/github_c_makefile_star2_O2/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
movslq %eax, %rcx
pushq $0x1
popq %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
jge 0x5176
xorb (%rbx,%rdx), %al
incq %rdx
jmp 0x5169
popq %rbx
retq