LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/nmea.c
// Function: Compose_Pressure_POV_fast
int Compose_Pressure_POV_fast(char *sentence, float te_vario)
{
	int length;
	int success = 1;

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

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

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

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movaps 0x3e97(%rip), %xmm2     # 0x9020
andps %xmm0, %xmm2
movss 0x3e54(%rip), %xmm1     # 0x8fe8
movaps %xmm2, (%rsp)
cmpltss %xmm2, %xmm1
movss 0x340f(%rip), %xmm2     # 0x85b4
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
cvtss2sd %xmm1, %xmm0
leaq 0x3eb4(%rip), %rsi      # 0x906d
movb $0x1, %al
callq 0x2280
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x5158
movzbl %al, %edx
leaq 0x3e71(%rip), %rsi      # 0x9049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
leaq 0x828b(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x520b
xorl %eax, %eax
movaps (%rsp), %xmm0
ucomiss 0x3ded(%rip), %xmm0     # 0x8fe8
seta %al
leal (%rax,%rax,8), %eax
incl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x7de6(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3e3e(%rip), %rsi      # 0x905a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x51ee
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/nmea.c
// Function: Compose_Voltage_POV
int Compose_Voltage_POV(char *sentence, float voltage)
{
	int length;
	int success = 1;

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
pushq $0xa
popq %rbx
movss 0x3db1(%rip), %xmm1     # 0x8fec
ucomiss %xmm0, %xmm1
jbe 0x5245
xorps %xmm0, %xmm0
jmp 0x525b
ucomiss 0x3da4(%rip), %xmm0     # 0x8ff0
jbe 0x5258
movss 0x3d9e(%rip), %xmm0     # 0x8ff4
jmp 0x525b
pushq $0x1
popq %rbx
cvtss2sd %xmm0, %xmm0
leaq 0x3e16(%rip), %rsi      # 0x907c
movq %r14, %rdi
movb $0x1, %al
callq 0x2280
movslq %eax, %r15
addq %r14, %r15
movq %r14, %rdi
callq 0x5158
movzbl %al, %edx
leaq 0x3dc1(%rip), %rsi      # 0x9049
movq %r15, %rdi
xorl %eax, %eax
callq 0x2280
leaq 0x81db(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x52a6
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x7d4b(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3da3(%rip), %rsi      # 0x905a
movq %r14, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x529e
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/nmea.c
// Function: Compose_Temperature_POV
int Compose_Temperature_POV(char *sentence, float temperature)
{
	int length;
	int success = 1;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movss 0x3d26(%rip), %xmm1     # 0x8ff8
cmpltps %xmm0, %xmm1
movss 0x3d1e(%rip), %xmm2     # 0x8ffc
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x52f8
cvtss2sd %xmm0, %xmm0
jmp 0x5300
movsd 0x3d08(%rip), %xmm0     # 0x9008
leaq 0x3d84(%rip), %rsi      # 0x908b
movq %rbx, %rdi
movb $0x1, %al
callq 0x2280
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x5158
movzbl %al, %edx
leaq 0x3d20(%rip), %rsi      # 0x9049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
leaq 0x813a(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x5350
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7ca1(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3cf9(%rip), %rsi      # 0x905a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x533f
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/nmea.c
// Function: Compose_Humidity_POV
int Compose_Humidity_POV(char *sentence, float humidity)
{
	int length;
	int success = 1;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movss 0x3214(%rip), %xmm1     # 0x8590
cmpltps %xmm0, %xmm1
xorps %xmm2, %xmm2
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x539d
cvtss2sd %xmm0, %xmm0
jmp 0x53a5
movsd 0x3c6b(%rip), %xmm0     # 0x9010
leaq 0x3cee(%rip), %rsi      # 0x909a
movq %rbx, %rdi
movb $0x1, %al
callq 0x2280
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x5158
movzbl %al, %edx
leaq 0x3c7b(%rip), %rsi      # 0x9049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
leaq 0x8095(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x53f5
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7bfc(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3c54(%rip), %rsi      # 0x905a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x53e4
nop
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/KalmanFilter1d.c
// Function: KalmanFiler1d_update
void KalmanFiler1d_update(t_kalmanfilter1d* filter, float z_abs, float var_z_abs, float dt)
{
	float F1=1.0;
	float dt2, dt3, dt4;
	float y;
	float s_inv;
	float k_abs;
	float k_vel;

	// check if dt is positive

	//Predict step
	//update state estimate
	filter->x_abs_ += filter->x_vel_ * dt;

	// update state covariance
	dt2 = dt * dt;
	dt3 = dt * dt2;
	dt4 = dt2 * dt2;

	filter->p_abs_abs_ += 2*(dt*filter->p_abs_vel_) + dt2 * filter->p_vel_vel_ + 0.25*(filter->var_x_accel_ * dt4);
  filter->p_abs_vel_ += dt * filter->p_vel_vel_ + (filter->var_x_accel_ * dt3)/2;
  filter->p_vel_vel_ += filter->var_x_accel_ * dt2;

	// Update step
	y = z_abs - filter->x_abs_;		// Innovation
	s_inv = F1 / (filter->p_abs_abs_ + var_z_abs);		// Innovation precision
	k_abs = filter->p_abs_abs_*s_inv; // Kalman gain
	k_vel = filter->p_abs_vel_*s_inv;

	// Update state estimate.
	filter->x_abs_ += k_abs * y;
	filter->x_vel_ += k_vel * y;

  // Update state covariance.
  filter->p_vel_vel_ -= filter->p_abs_vel_ * k_vel;
  filter->p_abs_vel_ -= filter->p_abs_vel_ * k_abs;
  filter->p_abs_abs_ -= filter->p_abs_abs_ * k_abs;

}

// Assembly:
movss 0x4(%rdi), %xmm4
movss 0xc(%rdi), %xmm7
movaps %xmm4, %xmm3
mulss %xmm2, %xmm3
addss (%rdi), %xmm3
movaps %xmm2, %xmm5
mulss %xmm2, %xmm5
movaps %xmm5, %xmm9
mulss %xmm2, %xmm9
movaps %xmm5, %xmm6
mulss %xmm5, %xmm6
movaps %xmm7, %xmm10
mulss %xmm2, %xmm10
movss 0x10(%rdi), %xmm8
movaps %xmm5, %xmm11
mulss %xmm8, %xmm11
addss %xmm10, %xmm10
addss %xmm11, %xmm10
movss 0x14(%rdi), %xmm11
mulss %xmm11, %xmm6
cvtss2sd %xmm6, %xmm6
mulsd 0x3c2f(%rip), %xmm6     # 0x90a8
cvtss2sd %xmm10, %xmm10
addsd %xmm10, %xmm6
cvtss2sd 0x8(%rdi), %xmm10
addsd %xmm6, %xmm10
cvtsd2ss %xmm10, %xmm6
mulss %xmm11, %xmm9
mulss 0x3c0f(%rip), %xmm9     # 0x90b0
mulss %xmm8, %xmm2
addss %xmm9, %xmm2
addss %xmm7, %xmm2
mulss %xmm11, %xmm5
addss %xmm8, %xmm5
subss %xmm3, %xmm0
addss %xmm6, %xmm1
movss 0x30bf(%rip), %xmm7     # 0x8588
divss %xmm1, %xmm7
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
unpcklps %xmm2, %xmm6            # xmm6 = xmm6[0],xmm2[0],xmm6[1],xmm2[1]
mulps %xmm6, %xmm7
movaps %xmm7, %xmm1
shufps $0x4, %xmm7, %xmm1      # xmm1 = xmm1[0,1],xmm7[0,0]
shufps $0x55, %xmm7, %xmm7     # xmm7 = xmm7[1,1,1,1]
mulss %xmm2, %xmm7
subss %xmm7, %xmm5
movss %xmm5, 0x10(%rdi)
movaps 0x3bca(%rip), %xmm2     # 0x90c0
xorps %xmm6, %xmm2
shufps $0x40, %xmm2, %xmm0     # xmm0 = xmm0[0,0],xmm2[0,1]
mulps %xmm1, %xmm0
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movlhps %xmm6, %xmm3            # xmm3 = xmm3[0],xmm6[0]
addps %xmm0, %xmm3
movups %xmm3, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/24c16.c
// Function: eeprom_read_data
int eeprom_read_data(t_24c16 *eeprom, t_eeprom_data *data)
{
	// read eeprom data to struct
	if (eeprom_read(eeprom, (char*)data, 0x00, sizeof(*data))==1)
		return 1;						// Failed to read the EEPROM

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
xorl %ebx, %ebx
pushq $0x14
popq %rcx
xorl %edx, %edx
callq 0x61e6
testb %al, %al
je 0x6198
pushq $0x1
popq %rbx
jmp 0x61a4
movq %r14, %rdi
callq 0x6270
testb %al, %al
je 0x61ae
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x6e43(%rip), %r14      # 0xcff8
movq (%r14), %rcx
leaq 0x35f9(%rip), %rdi      # 0x97b8
pushq $0x1c
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0x35fe(%rip), %rdi      # 0x97d5
pushq $0x26
popq %rsi
movq %rbx, %rdx
callq 0x22b0
pushq $0x2
jmp 0x6195
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/24c16.c
// Function: eeprom_read
char eeprom_read(t_24c16 *eeprom, char *s, char offset, char count)
{
	//write address offset to eeprom
	if ((write(eeprom->fd, &offset, 1)) != 1) {				// Send register we want to read from
		fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
		return(1);
	}

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

	return(0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %rsi
movb %dl, (%rsi)
movl (%rdi), %edi
pushq $0x1
popq %rdx
callq 0x20b0
cmpq $0x1, %rax
jne 0x622f
movl (%r14), %edi
movsbq %bpl, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2180
cmpq %r14, %rax
jne 0x6250
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x6dc2(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x1f95(%rip), %rsi      # 0x81d5
leaq 0x35f9(%rip), %rdx      # 0x9840
xorl %eax, %eax
callq 0x21c0
jmp 0x626c
movq 0x6da1(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x21d4(%rip), %rdi      # 0x8435
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
movb $0x1, %al
jmp 0x6226
// File: /workspace/github_c_makefile_star2_O2/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 0x2132(%rip), %rdi      # 0x83d8
xorl %r13d, %r13d
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2240
movl %eax, %r15d
testl %eax, %eax
jns 0x62e8
movq 0x6d37(%rip), %rax      # 0xcff8
movq (%rax), %r12
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x210c(%rip), %rsi      # 0x83e3
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 0x6332
movq 0x6cec(%rip), %rax      # 0xcff8
movq (%rax), %r12
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x1d1e(%rip), %rsi      # 0x8040
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 0x6c81(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x347b(%rip), %rax      # 0x97fc
leaq 0x348a(%rip), %rsi      # 0x9812
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_O2/Openvario[P]sensord/24c16.c
// Function: eeprom_write
char eeprom_write(t_24c16 *eeprom, char *s, unsigned char offset, unsigned char count)
{
	unsigned char buf[2];
	int i;

	//memcpy(&buf[1], s, count);

	//write data at offset to eeprom
	buf[0] = offset;														// This is the register we want to read from

	// write byte by byte to EEPROM
	for (i=0; i<count;i++)
	{
		// copy data to write buffer
		buf[1]=*(s);
		//fprintf(stderr, "buf[1]: '%c'\n",buf[1]);
		// Write data to EEPROM
		if ((write(eeprom->fd, &buf[0], 2)) != 2) {				// Send register we want to read from
			fprintf(stderr, "Error writing to i2c slave (%s)\n", __func__);
			return(1);
		}

		// give EEPROM time for write ...
		usleep(10000);
		buf[0]++;
		s++;
	}
	return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6(%rsp), %rax
movb %dl, (%rax)
incb %dl
movzbl %dl, %r13d
movl %ecx, %ebp
xorl %r15d, %r15d
pushq $0x2
popq %r12
cmpl %r15d, %ebp
je 0x6408
movb (%rbx,%r15), %al
movb %al, 0x7(%rsp)
movl (%r14), %edi
leaq 0x6(%rsp), %rsi
movq %r12, %rdx
callq 0x20b0
cmpq $0x2, %rax
jne 0x6419
movl $0x2710, %edi           # imm = 0x2710
callq 0x2310
leal (%r15,%r13), %eax
movb %al, 0x6(%rsp)
incq %r15
jmp 0x63ce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6bd8(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x1dab(%rip), %rsi      # 0x81d5
leaq 0x3402(%rip), %rdx      # 0x9833
xorl %eax, %eax
callq 0x21c0
movb $0x1, %al
jmp 0x640a
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: ds2482_open
int ds2482_open(t_ds2482 *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 0;
	}
	if (ioctl(fd, I2C_SLAVE, i2c_address) < 0) {
		fprintf(stderr, "ioctl error: %s\n", strerror(errno));
		return 0;
	}

	if (g_debug > 0) fprintf(stderr, "Opened DS2482 on 0x%x\n", i2c_address);
	//assign file handle to sensor object
	sensor->fd = fd;
	sensor->address = i2c_address;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x1f88(%rip), %rdi      # 0x83d8
xorl %ebx, %ebx
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x649f
movl %eax, %r15d
movzbl %bpl, %r12d
xorl %ebx, %ebx
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x64be
leaq 0x6fef(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x64ea
movl %r15d, (%r14)
movb %bpl, 0x4(%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x6b52(%rip), %rax      # 0xcff8
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x1f27(%rip), %rsi      # 0x83e3
jmp 0x64db
movq 0x6b33(%rip), %rax      # 0xcff8
movq (%rax), %r14
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x1b65(%rip), %rsi      # 0x8040
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x6494
movq 0x6b07(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x33a9(%rip), %rsi      # 0x98a4
movl %r12d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x648a
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: ds2482_reset
int ds2482_reset(t_ds2482 *sensor) {
	//server.log(format("Function: Resetting DS2482 at %i (%#x)", I2CAddr, I2CAddr));

	if (write(sensor->fd, "\xf0", 1)!=1) return 0; //reset DS2482
	sensor->owDeviceAddress[0]=0;
	sensor->owDeviceAddress[1]=0;
	sensor->owTriplet=4;
	sensor->owLastDevice=0;
	sensor->owLastDiscrepancy=0;
	sensor->temp_present=0;
	sensor->temp_valid=0;
	sensor->temperature=23;
	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
leaq 0x33aa(%rip), %rsi      # 0x98be
pushq $0x1
popq %rdx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x6544
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movaps 0x331b(%rip), %xmm0     # 0x9850
movups %xmm0, 0x18(%rbx)
xorl %eax, %eax
movb %al, 0x2c(%rbx)
movb %al, 0x2e(%rbx)
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWReset
int OWReset(t_ds2482 *sensor) {
	int i;
	unsigned char data;

	// server.log("Function: I2C Reset");
	if (write(sensor->fd, "\xb4",1)!=1) { // 1-wire reset
		// Device failed to acknowledge reset
		// server.log("I2C Reset Failed");
		return 0;
	}
	for (i=0;i<100;++i) {
		if (read(sensor->fd,&data,1)==0) { // Read the status register
			// server.log("I2C Read Status Failed");
			return 0;
		} else {
			// server.log(format("Read Status Byte = %d", data[0]));
			if (data & 1) { // 1-Wire Busy bit
				struct timespec nstime = {0,1e6};
				while (nanosleep(&nstime,&nstime)) ; // Wait, try again
			} else {
				// server.log("One-Wire bus is idle");
				if (data & 4) { // Short Detected bit
					// server.log("One-Wire Short Detected");
					return 0;
				}
				if (data & 2) { // Presense-Pulse Detect bit
					// server.log("One-Wire Devices Found");
					return 1;
				} else {
					// server.log("No One-Wire Devices Found");
					return 0;
				}
			}
		}
	}
	// server.log("One-Wire busy too long");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl (%rdi), %edi
leaq 0x335b(%rip), %rsi      # 0x98bb
pushq $0x1
popq %rdx
callq 0x20b0
xorl %ebx, %ebx
cmpq $0x1, %rax
jne 0x65cd
xorl %ebx, %ebx
leaq 0xf(%rsp), %r15
pushq $0x1
popq %r12
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
cmpl $0x64, %ebp
je 0x65cd
movl (%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2180
testq %rax, %rax
je 0x65cd
movzbl 0xf(%rsp), %eax
testb $0x1, %al
je 0x65c2
movups 0x32b6(%rip), %xmm0     # 0x9860
movaps %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %r13, %rsi
callq 0x2120
testl %eax, %eax
jne 0x65af
incl %ebp
jmp 0x6582
testb $0x4, %al
jne 0x65cd
shrl %eax
andl $0x1, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWWriteByte
int OWWriteByte(t_ds2482 *sensor, unsigned char writeval) {
	int i;
	unsigned char data[2];

	// server.log("Function: Write Byte to One-Wire");
	if (write(sensor->fd,"\xe1\xf0",2)!=2) { // Device failed to acknowledge
		// server.log("I2C Write Failed");
		return -1;
	}
	for (i=0;i<100;++i) {
		if (read(sensor->fd,data,1)==0) { // Read the status register
			// server.log("I2C Read Status Failed");
			return -1;
		} else {
			// server.log(format("Read Status Byte = %d", data[0]));
			if (data[0] & 0x01) { // 1-Wire Busy bit
				// server.log("One-Wire bus is busy");
				struct timespec nstime = {0,1e6};
				while (nanosleep(&nstime,&nstime)) ; // Wait, try again

			} else {
				// server.log("One-Wire bus is idle");
				break;
			}
		}
	}
	if (i == 100) {
		// server.log("One-Wire busy for too long");
		return -1;
	}
	data[0]=0xa5;
	data[1]=writeval;
	if (write(sensor->fd,data,2)!=2) { // set write byte command (A5) and send data (byte)
		// Device failed to acknowledge
		// server.log(format("I2C Write Byte Failed. Data: %#.2X", byte));
		return -1;
	}
	for (i=0;i<100;++i) {
		if (read(sensor->fd,data,1)==0) { // Read the status register
			// server.log("I2C Read Status Failed");
			return -1;
		} else {
			// server.log(format("Read Status Byte = %d", data[0]));
			if (data[0] & 1) { // 1-Wire Busy bit
				// server.log("One-Wire bus is busy");
				struct timespec nstime = {0,1e6};
				while (nanosleep(&nstime,&nstime)) ; // Wait, try again

			} else {
				// server.log("One-Wire bus is idle");
				break;
			}
		}
	}
	if (i == 100) {
		// server.log("One-Wire busy for too long");
		return -1;
	}

	// server.log("One-Wire Write Byte complete");
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl (%rdi), %edi
leaq 0x32c3(%rip), %rsi      # 0x98bd
pushq $0x2
popq %rdx
callq 0x20b0
pushq $-0x1
popq %rcx
cmpq $0x2, %rax
jne 0x66d6
xorl %ebx, %ebx
leaq 0xe(%rsp), %r15
pushq $0x1
popq %r12
leaq 0x10(%rsp), %r13
cmpl $0x64, %ebx
je 0x66d3
movl (%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2180
testq %rax, %rax
je 0x66d3
testb $0x1, 0xe(%rsp)
je 0x6665
movups 0x3213(%rip), %xmm0     # 0x9860
movaps %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %r13, %rsi
callq 0x2120
testl %eax, %eax
jne 0x6652
incl %ebx
jmp 0x661f
leaq 0xe(%rsp), %rsi
movb $-0x5b, (%rsi)
movb %bpl, 0x1(%rsi)
movl (%r14), %edi
pushq $0x2
popq %rdx
callq 0x20b0
cmpq $0x2, %rax
jne 0x66d3
xorl %ebx, %ebx
leaq 0xe(%rsp), %r15
pushq $0x1
popq %r12
pushq $0x1
popq %rbp
leaq 0x10(%rsp), %r13
cmpl $0x64, %ebx
je 0x66d3
movl (%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2180
testq %rax, %rax
je 0x66d3
testb $0x1, 0xe(%rsp)
je 0x66e7
movups 0x31a5(%rip), %xmm0     # 0x9860
movaps %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %r13, %rsi
callq 0x2120
testl %eax, %eax
jne 0x66c0
incl %ebx
jmp 0x6695
pushq $-0x1
popq %rcx
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %ecx
jmp 0x66d6
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWTriplet
int OWTriplet(t_ds2482 *sensor) {
	unsigned char data[2]={0x78,0};
	int i;

	// server.log("Function: OneWire Triplet");
	data[1]=sensor->owTriplet<<5;
	if (write(sensor->fd,data,2)!=2) { // Device failed to acknowledge
		// server.log("OneWire Triplet  Failed");
		return 0;
	}
	for (i=0;i<100;++i) {
		if (read(sensor->fd,&data,1)==0) { // Read the status register
			// server.log("I2C Read Status Failed");
			return 0;
		} else {
			// server.log(format("Read Status Byte = %d", data[0]));
			if (data[0] & 1) { // 1-Wire Busy bit
				// server.log("One-Wire bus is busy");
				struct timespec nstime = {0,1e6};
				while (nanosleep(&nstime,&nstime)) ; // Wait, try again
			} else {
				// server.log("One-Wire bus is idle");
				sensor->owTriplet=(data[0]>>5)&7;
				return 1;
			}
		}
	}
	if (i == 100) {
		// server.log("One-Wire busy for too long");
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0xe(%rsp), %rsi
movw $0x78, (%rsi)
movb 0x18(%rdi), %al
shlb $0x5, %al
movb %al, 0x1(%rsi)
movl (%rdi), %edi
pushq $0x2
popq %rdx
callq 0x20b0
xorl %ebp, %ebp
cmpq $0x2, %rax
jne 0x68b0
xorl %ebp, %ebp
leaq 0xe(%rsp), %r14
pushq $0x1
popq %r15
leaq 0x10(%rsp), %r12
xorl %r13d, %r13d
cmpl $0x64, %r13d
je 0x68b0
movl (%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2180
testq %rax, %rax
je 0x68b0
movzbl 0xe(%rsp), %eax
testb $0x1, %al
je 0x68a7
movups 0x2fd2(%rip), %xmm0     # 0x9860
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x6893
incl %r13d
jmp 0x6866
shrl $0x5, %eax
movl %eax, 0x18(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWCheckCRC
int OWCheckCRC(t_ds2482 *sensor) {
	int crc, j,i;
	long int da32bit;

	for (i=0;i<2;i++) {
		for (j=0,crc=0,da32bit=sensor->owDeviceAddress[i]; j<4; j++) { // All four bytes
			crc = AddCRC(da32bit & 0xFF, crc);
			// server.log(format("CRC = %.2X", crc));
			da32bit >>= 8; // Shift right 8 bits
		}
	}
	// server.log(format("CRC = %#.2X", crc));
	// server.log(format("DA  = %#.2X", da32bit));
	if ((da32bit & 0xFF) == crc) { // last byte of address should match CRC of other 7 bytes
		// server.log("CRC Passed");
		return 1; // match
	}
	return 0; // bad CRC
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $0x4
popq %rbp
cmpq $0x2, %r14
je 0x6a42
movq 0x8(%rbx,%r14,8), %r15
xorl %eax, %eax
movl %ebp, %r12d
subl $0x1, %r12d
jb 0x6a3d
movzbl %r15b, %edi
movl %eax, %esi
callq 0x6a5a
sarq $0x8, %r15
jmp 0x6a26
incq %r14
jmp 0x6a16
movzbl %r15b, %ecx
movslq %eax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
sete %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: AddCRC
int  AddCRC(int inbyte, int crc) {
	int i;

	for(i=0; i<8; i++) {
		if ((crc ^ inbyte) & 0x01) crc=(crc>>1)^0x8c; else crc>>=1;
		inbyte >>= 1;
	}
	return crc;
}

// Assembly:
movl %esi, %eax
pushq $0x8
popq %rcx
subl $0x1, %ecx
jb 0x6a7c
movl %eax, %edx
xorl %edi, %edx
sarl %eax
movl %eax, %esi
xorl $0x8c, %esi
testb $0x1, %dl
cmovnel %esi, %eax
sarl %edi
jmp 0x6a5f
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWSelect
int OWSelect(t_ds2482 *sensor) {
	// server.log("Selecting device");
	int i,j;

	if (OWWriteByte(sensor, 0x4C)==-1) return 0; // Issue the Match ROM command
	for(i=0; i<2; i++) {
		long int da32bit = sensor->owDeviceAddress[i];
		for(j=0; j<4; j++) {
			// server.log(format("Writing byte: %.2X", da32bit & 0xFF));
			OWWriteByte(sensor, da32bit & 0xff); // Send lowest byte
			da32bit >>=  8; // Shift right 8 bits
		}
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x4c
popq %rsi
callq 0x65de
cmpl $-0x1, %eax
je 0x6acd
xorl %r14d, %r14d
pushq $0x1
popq %rbp
pushq $0x4
popq %r15
cmpq $0x2, %r14
je 0x6acf
movq 0x8(%rbx,%r14,8), %r12
movl %r15d, %r13d
subl $0x1, %r13d
jb 0x6ac8
movzbl %r12b, %esi
movq %rbx, %rdi
callq 0x65de
sarq $0x8, %r12
jmp 0x6ab0
incq %r14
jmp 0x6aa2
xorl %ebp, %ebp
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_O2/Openvario[P]sensord/ds2482.c
// Function: OWConfigureBits
int OWConfigureBits (t_ds2482 *sensor) {
	unsigned char data[4] = {0x4e,0x00,0x00,0x7f};
	int i,j;

	if (OWReset(sensor)==0) return 0;
	if (OWWriteByte(sensor,0xCC)==-1) return 0;
	switch (sensor->databits) {
		case 9  : data[3]=0x1f; sensor->conversion_time = 6; sensor->delta_conversion_time = 5; break;
		case 10 : data[3]=0x3f; sensor->conversion_time = 13; sensor->delta_conversion_time = 5;  break;
		case 11 : data[3]=0x5f; sensor->conversion_time = 28; sensor->delta_conversion_time = 5; break;
		default : sensor->conversion_time = 58; sensor->delta_conversion_time = 5; break;
	}
	for (i=0,j=1;i<4;++i)
		if (OWWriteByte(sensor,data[i])==-1) j=0;
	return j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x7f00004e, 0x4(%rsp)  # imm = 0x7F00004E
callq 0x6546
xorl %ebp, %ebp
testl %eax, %eax
je 0x6b6a
movq %rbx, %rdi
movl $0xcc, %esi
callq 0x65de
cmpl $-0x1, %eax
je 0x6b6a
movl 0x3c(%rbx), %eax
addl $-0x9, %eax
cmpl $0x2, %eax
ja 0x6b34
movl %eax, %ecx
shlb $0x5, %cl
orb $0x1f, %cl
movl %eax, %eax
leaq 0x2d6d(%rip), %rdx      # 0x9898
movl (%rdx,%rax,4), %eax
movb %cl, 0x7(%rsp)
jmp 0x6b37
pushq $0x3a
popq %rax
movl %eax, 0x34(%rbx)
movl $0x5, 0x38(%rbx)
pushq $0x1
popq %rbp
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x6b6a
movzbl 0x4(%rsp,%r15), %esi
movq %rbx, %rdi
callq 0x65de
cmpl $-0x1, %eax
cmovel %r14d, %ebp
incq %r15
jmp 0x6b4a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/ds2482.c
// Function: OWReadTemperature
int OWReadTemperature(t_ds2482 *sensor) {
	int data[5];
	int i,j;

	sensor->temp_valid=0;
	for(i=0,j=0; i<5; i++) { // we only need 5 of the bytes
		// Technically we only need two, but grabbing 5 lets us double check the configuration
		data[i] = OWReadByte(sensor);
		if (data[i]<0) j=1;
		// server.log(format("read byte: %.2X", data[i]));
	}
	if (j) return 0;
	j=1;
	i = (data[1] << 8) | data[0];
	switch (data[4]&0x60) {
		case 0x60 : // server.log("12 bit resolution"); // 750 ms conversion time
			sensor->temperature=i/16.0;
			if (sensor->databits!=12) j=2;
			break;
		case 0x40 : // server.log("11 bit resolution"); // 375 ms
			sensor->temperature=(i>>1)/8.0;
			if (sensor->databits!=11) j=2;
			break;
		case 0x20 : // server.log("10 bit resolution"); // 187.5 ms
			sensor->temperature=(i>>2)/4.0;
			if (sensor->databits!=10) j=2;
			break;
		default : // server.log("9 bit resolution"); // 93.75 ms
			sensor->temperature=(i>>3)/2.0;
			if (sensor->databits!=9) j=2;
	}
	if ((sensor->temperature<125) && (sensor->temperature>-55)) sensor->temp_valid=1; else j=0;
	// server.log(format("Temperature = %.1f °C", celsius));
	debug_print("%s @ 0x18: temperature %f\n",__func__,sensor->temperature);
	return j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movb $0x0, 0x2e(%rdi)
xorl %r14d, %r14d
pushq $0x1
popq %rbp
xorl %r15d, %r15d
cmpq $0x5, %r14
je 0x6bae
movq %rbx, %rdi
callq 0x66eb
movl %eax, (%rsp,%r14,4)
testl %eax, %eax
cmovsl %ebp, %r15d
incq %r14
jmp 0x6b91
xorl %ebp, %ebp
testl %r15d, %r15d
jne 0x6c5b
movl 0x4(%rsp), %eax
movl 0x10(%rsp), %ecx
shll $0x8, %eax
orl (%rsp), %eax
shrl $0x5, %ecx
andl $0x3, %ecx
leaq 0x2cb4(%rip), %rdx      # 0x9888
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
sarl $0x3, %eax
pushq $0x9
popq %rcx
movsd 0x2c8d(%rip), %xmm0     # 0x9878
jmp 0x6c17
sarl %eax
pushq $0xb
popq %rcx
movsd 0x2c86(%rip), %xmm0     # 0x9880
jmp 0x6c17
pushq $0xc
popq %rcx
movsd 0x2c69(%rip), %xmm0     # 0x9870
jmp 0x6c17
sarl $0x2, %eax
pushq $0xa
popq %rcx
movsd 0x2491(%rip), %xmm0     # 0x90a8
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x24(%rbx)
xorl %ebp, %ebp
movss 0x23c6(%rip), %xmm1     # 0x8ff8
ucomiss %xmm0, %xmm1
jbe 0x6c4f
ucomiss 0x23be(%rip), %xmm0     # 0x8ffc
jbe 0x6c4f
xorl %ebp, %ebp
cmpl %ecx, 0x3c(%rbx)
setne %bpl
incl %ebp
movb $0x1, 0x2e(%rbx)
leaq 0x681e(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x6c68
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6389(%rip), %rax      # 0xcff8
movq (%rax), %rdi
cvtss2sd %xmm0, %xmm0
leaq 0x2c48(%rip), %rsi      # 0x98c5
leaq 0x2c5c(%rip), %rdx      # 0x98e0
movb $0x1, %al
callq 0x21c0
jmp 0x6c5b
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: si7021_crc_check
int si7021_crc_check(unsigned int value, uint8_t crc)
{
	uint32_t polynom = 0x988000; // x^8 + x^5 + x^4 + 1
	uint32_t msb     = 0x800000;
	uint32_t mask    = 0xFF8000;
	uint32_t result  = (uint32_t)value<<8; // Pad with zeros as specified in spec

	while( msb != 0x80 ) {

		// Check if msb of current value is 1 and apply XOR mask
		if( result & msb )
			result = ((result ^ polynom) & mask) | ( result & ~mask);

		// Shift by one
		msb >>= 1;
		mask >>= 1;
		polynom >>=1;
	}
	if( result == crc ) return 0;
	return 1 ;
}

// Assembly:
shll $0x8, %edi
movl $0xff8000, %eax         # imm = 0xFF8000
movl $0x800000, %ecx         # imm = 0x800000
movl $0x988000, %edx         # imm = 0x988000
cmpl $0x80, %ecx
je 0x6cbf
testl %ecx, %edi
je 0x6cb7
movl %edx, %r8d
andl %eax, %r8d
xorl %r8d, %edi
shrl %ecx
shrl %eax
shrl %edx
jmp 0x6ca2
movzbl %sil, %ecx
xorl %eax, %eax
cmpl %ecx, %edi
setne %al
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: si7021_start_humidity
int si7021_start_humidity (t_ds2482 *sensor) {
	char config[2],lngth=1;

	switch (sensor->sensor_type) {
		case SI7021 :
		case HTU21D : config[0]=0xf5; break;
		case HTU31D : config[0]=sensor->databits; break;
		case SHT4X  : config[0]=0xfd; break;
		case SHT85  : config[0] = 0x24; config[1] = 0x00; lngth=2; break;
		default     : return 2;
	}
	if (write(sensor->fd, &config, lngth)!=lngth) return 1;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movzbl 0x30(%rdi), %ecx
pushq $0x2
popq %rax
decl %ecx
cmpl $0x6, %ecx
ja 0x75e3
leaq 0x234c(%rip), %rdx      # 0x98f4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $-0xb, 0xe(%rsp)
jmp 0x75c6
movb 0x3c(%rdi), %al
movb %al, 0xe(%rsp)
jmp 0x75c6
movb $-0x3, 0xe(%rsp)
pushq $0x1
popq %rbx
movl (%rdi), %edi
leaq 0xe(%rsp), %rsi
movq %rbx, %rdx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rbx, %rcx
setne %al
addq $0x10, %rsp
popq %rbx
retq
movw $0x24, 0xe(%rsp)
pushq $0x2
jmp 0x75c8
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: si7021_read_temp
int si7021_read_temp (t_ds2482 *sensor) {

	uint8_t data[3];
	double temp;

	switch (sensor->sensor_type) {
		case HTU21D :
			sensor->temp_valid=0;
			if (read(sensor->fd, data, 3) != 3) return 4;
			if (si7021_crc_check((data[0]<<8)|data[1],data[2])>0) return 2;
			temp = (double) ((data[0]<<8)|data[1]) * 175.72/65536.0 - 46.85;
			sensor->temperature = temp;
			sensor->temp_valid = sensor->temp_present;
			break;
		default : si7021_read_humidity (sensor);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x30(%rdi)
jne 0x76a6
movb $0x0, 0x2e(%rbx)
movl (%rbx), %edi
leaq 0x5(%rsp), %rsi
pushq $0x3
popq %rdx
callq 0x2180
cmpq $0x3, %rax
jne 0x76b2
movzwl 0x5(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ebp
movzbl 0x7(%rsp), %esi
movl %ebp, %edi
callq 0x6c90
testl %eax, %eax
je 0x76bc
pushq $0x2
jmp 0x76b4
movq %rbx, %rdi
callq 0x76e9
xorl %eax, %eax
jmp 0x76b5
pushq $0x4
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cvtsi2sd %ebp, %xmm0
mulsd 0x2290(%rip), %xmm0     # 0x9958
mulsd 0x2290(%rip), %xmm0     # 0x9960
addsd 0x2290(%rip), %xmm0     # 0x9968
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rbx)
movb 0x2c(%rbx), %al
movb %al, 0x2e(%rbx)
jmp 0x76ae
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: si7021_configure_heater_value
int si7021_configure_heater_value (t_ds2482 *sensor, int value)
{
	uint8_t data[3] = {0x51,0x00,0x11};

	if (sensor->sensor_type==SI7021) {
		data[1]=value&0xf;				// If SI7021 initialize the heat control register
		if (write(sensor->fd,data,2)!=2) return 2;	// Program it
		if (write(sensor->fd,data+2,1)!=1) return 2;    // Start readback
		if (read(sensor->fd,data,1)!=1) return 2;	// Readback
		if (data[1]!=(value&0xf)) return 2;		// Verify readback matches written value
	} else return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x11, 0xe(%rsp)
movw $0x51, 0xc(%rsp)
cmpb $0x3, 0x30(%rdi)
jne 0x7a09
movl %esi, %ebx
movq %rdi, %r14
andl $0xf, %ebx
leaq 0xc(%rsp), %rsi
movb %bl, 0x1(%rsi)
movl (%rdi), %edi
pushq $0x2
popq %rdx
callq 0x20b0
pushq $0x2
popq %rbp
cmpq $0x2, %rax
jne 0x7a0c
movl (%r14), %edi
leaq 0xe(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x20b0
cmpq $0x1, %rax
jne 0x7a0c
movl (%r14), %edi
leaq 0xc(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2180
cmpq $0x1, %rax
jne 0x7a0c
movzbl 0xd(%rsp), %eax
xorl %ebp, %ebp
cmpl %eax, %ebx
setne %bpl
addl %ebp, %ebp
jmp 0x7a0c
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: am2321_open
int am2321_open (t_ds2482 *sensor, unsigned char i2c_address) {

	sensor->fd = open(I2C_DEVICE, O_RDWR);
	if (sensor->fd < 0) {
		fprintf(stderr, "Error opening file: %s\n", strerror(errno));
		return 1;
	}
	if (ioctl(sensor->fd, I2C_SLAVE, i2c_address) < 0) {
		fprintf(stderr, "ioctl error: %s\n", strerror(errno));
		return 1;
	}

	if (am2321_read(sensor)>0) return 1;
	if (g_debug > 0) fprintf(stderr, "Opened AM2321 on 0x%x\n", i2c_address);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7c8(%rip), %rdi       # 0x83d8
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2240
movl %eax, (%r14)
testl %eax, %eax
js 0x7c60
movzbl %bl, %ebp
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x7c7f
movq %r14, %rdi
callq 0x7cc7
testl %eax, %eax
jle 0x7c49
pushq $0x1
popq %rax
jmp 0x7c5b
leaq 0x5824(%rip), %rax      # 0xd474
cmpl $0x0, (%rax)
jg 0x7cab
movb %bl, 0x4(%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5391(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x766(%rip), %rsi       # 0x83e3
jmp 0x7c9c
movq 0x5372(%rip), %rax      # 0xcff8
movq (%rax), %rbx
callq 0x2040
movl (%rax), %edi
callq 0x22e0
leaq 0x3a4(%rip), %rsi       # 0x8040
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x7c44
movq 0x5346(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x1ee2(%rip), %rsi      # 0x9b9e
movl %ebp, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x7c55
// File: /workspace/github_c_makefile_star2_O2/Openvario[P]sensord/humidity.c
// Function: am2321_wakeup
int am2321_wakeup (t_ds2482 *sensor) {

	//  wake AM2320 up, goes to sleep to not warm up and affect the humidity sensor

	if (write(sensor->fd, NULL, 0)<0) return 3;
	struct timespec nstime = {0,1.0e6};
	while (nanosleep (&nstime,&nstime)) ; /* Wait atleast 1.5ms */
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl (%rdi), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x20b0
testq %rax, %rax
js 0x7e6b
movups 0x1d76(%rip), %xmm0     # 0x9bc8
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
jne 0x7e58
xorl %eax, %eax
jmp 0x7e6e
pushq $0x3
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/marcespie[P]unix-samples/chapter1/fork3bad.c
// Function: perform_computation
void
perform_computation(int i)
{
	printf("Square of %d is %d\n", i, i * i);
	if (i % 17 == 0)
		exit(1);
	if (i % 25 == 0)
		kill(getpid(), SIGINT);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl %edi, %edx
imull %edi, %edx
leaq 0xe29(%rip), %rdi       # 0x2004
movl %ebx, %esi
xorl %eax, %eax
callq 0x1050
pushq $0x11
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
testl %edx, %edx
je 0x120e
pushq $0x19
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
testl %edx, %edx
je 0x11fe
popq %rbx
retq
callq 0x1040
pushq $0x2
popq %rsi
movl %eax, %edi
popq %rbx
jmp 0x1070
pushq $0x1
popq %rdi
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/marcespie[P]unix-samples/chapter1/fork3bad.c
// Function: bad_status
bool 
bad_status(int status)
{
	if (WIFEXITED(status)) {
		int rc = WEXITSTATUS(status);
		if (rc == 0)
			return false;
		else
			fprintf(stderr, "Child exited with exit(%d)\n", rc);
	} else if (WIFSIGNALED(status)) {
		int sig = WTERMSIG(status);
		fprintf(stderr, "Child exited with signal %d (%s)\n", 
		    sig, strsignal(sig));
	} else
		fprintf(stderr, "This should never happen: %d\n", status);
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %edx
movl %edi, %ebx
andl $0x7f, %ebx
jne 0x1238
shrl $0x8, %edx
andl $0xff, %edx
jne 0x1272
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %ebx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
movq 0x2daf(%rip), %rcx      # 0x3ff8
movq (%rcx), %r14
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x1285
movl %ebx, %edi
callq 0x1090
leaq 0xdd3(%rip), %rsi       # 0x2034
movq %r14, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1060
jmp 0x1296
movq 0x2d7f(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd95(%rip), %rsi       # 0x2018
jmp 0x128f
leaq 0xdca(%rip), %rsi       # 0x2056
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movb $0x1, %al
jmp 0x1230
// File: /workspace/github_c_makefile_star2_O2/marcespie[P]unix-samples/chapter1/fork3bad.c
// Function: main
int
main()
{

	for (int i = 15; i < 550; i += 2) {
		int pid = fork();
		switch(pid) {
		case -1: 
			err(1, "fork");
		case 0:
			perform_computation(i);
			exit(0);
		}
	}

	// parent
	int rc = 0; // by default we succeed

	int status, r;
	while ((r = wait(&status)) != -1)
		if (bad_status(status))
			rc = 1;
	// this normally exits with ECHILD, when we reaped every child
	if (errno != ECHILD)
		err(1, "wait");

	exit(rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0xf
popq %rbx
cmpl $0x226, %ebx            # imm = 0x226
jae 0x12c0
callq 0x10c0
testl %eax, %eax
je 0x12f8
cmpl $-0x1, %eax
je 0x1306
addl $0x2, %ebx
jmp 0x12a5
xorl %ebx, %ebx
leaq 0xc(%rsp), %r14
pushq $0x1
popq %rbp
movq %r14, %rdi
callq 0x10b0
cmpl $-0x1, %eax
je 0x12e7
movl 0xc(%rsp), %edi
callq 0x1216
testb %al, %al
cmovnel %ebp, %ebx
jmp 0x12ca
callq 0x1030
cmpl $0xa, (%rax)
jne 0x130f
movl %ebx, %edi
callq 0x10a0
movl %ebx, %edi
callq 0x11cc
xorl %edi, %edi
callq 0x10a0
leaq 0xd67(%rip), %rsi       # 0x2074
jmp 0x1316
leaq 0xd63(%rip), %rsi       # 0x2079
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/johanDa9u[P]MiniShell/src/boucle.c
// Function: main
int main(){
    int x = 0;
   while(1){
       printf("%d\n",x++);
       sleep(1);
   }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x19cd(%rip), %rbx      # 0x4004
pushq $0x1
popq %rbp
xorl %esi, %esi
leal 0x1(%rsi), %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
movl %ebp, %edi
callq 0x24b0
movl %r14d, %esi
jmp 0x263c
nop
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_12/detab.c
// Function: is_arg_list_valid
int is_arg_list_valid(int argc, char *argv[])
{
  for (size_t i = 1; i < argc; ++i)
  {
    if (argv[i][0] == '-' || argv[i][0] == '+')
    {
      if (argc > 3 || !is_str_uint(argv[i] + 1))
      {
        return 0;
      }
      continue;
    }

    if (!is_str_uint(argv[i]) || (i > 1 && atoi(argv[i - 1]) > atoi(argv[i])))
    {
      return 0;
    }
  }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movslq %edi, %r12
pushq $0x1
popq %r13
cmpq %r12, %r13
jae 0x1371
movq (%rbx,%r13,8), %r14
movzbl (%r14), %eax
cmpl $0x2d, %eax
je 0x132a
cmpl $0x2b, %eax
jne 0x1340
cmpl $0x3, %ebp
jg 0x1371
incq %r14
movq %r14, %rdi
callq 0x1388
testl %eax, %eax
jne 0x136c
jmp 0x1371
movq %r14, %rdi
callq 0x1388
testl %eax, %eax
je 0x1371
cmpq $0x2, %r13
jb 0x136c
movq -0x8(%rbx,%r13,8), %rdi
callq 0x1070
movl %eax, %r15d
movq %r14, %rdi
callq 0x1070
cmpl %eax, %r15d
jg 0x1371
incq %r13
jmp 0x1313
xorl %eax, %eax
cmpq %r12, %r13
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_12/detab.c
// Function: is_str_uint
int is_str_uint(char *str)
{
  for (size_t i = 0; i < strlen(str); ++i)
  {
    if (!isdigit(str[i]))
    {
      return 0;
    }
  }
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1050
movq %rax, %r14
xorl %eax, %eax
movq %rax, %r15
cmpq %rax, %r14
je 0x13ba
callq 0x1080
movq (%rax), %rcx
movsbq (%rbx,%r15), %rdx
leaq 0x1(%r15), %rax
testb $0x8, 0x1(%rcx,%rdx,2)
jne 0x139a
xorl %eax, %eax
cmpq %r14, %r15
setae %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/item.c
// Function: SH_Item__init
SH_Item*
SH_Item__init(SH_BareItem* item, SH_dict* params, int* err) {
	SH_Item* obj;

	__cascade(err, (SH_Item*)0);

	obj = (SH_Item*)malloc(sizeof(SH_Item));
	if ((SH_Item*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_Item*)0;
	}

	if ((SH_dict*)0 == params) {
		params = SH_dict__init(err);
		if (__catch(err)) {
			free(obj);
			return (SH_Item*)0;
		}
	}

	obj->item = item;
	obj->params = params;

	__clear(err);
	return obj;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
testq %rdx, %rdx
je 0x1218
cmpl $0x0, (%r14)
jne 0x1268
pushq $0x10
popq %rdi
callq 0x10d0
testq %rax, %rax
je 0x123f
movq %rax, %rbx
testq %r12, %r12
je 0x124d
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
testq %r14, %r14
je 0x126a
andl $0x0, (%r14)
jmp 0x126a
testq %r14, %r14
je 0x1268
movl $0x80000001, (%r14)     # imm = 0x80000001
jmp 0x1268
movq %r14, %rdi
callq 0x1050
testq %r14, %r14
je 0x1279
cmpl $0x0, (%r14)
je 0x1282
movq %rbx, %rdi
callq 0x1040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, (%rbx)
movq %rax, 0x8(%rbx)
jmp 0x126a
movq %r15, (%rbx)
movq %rax, 0x8(%rbx)
jmp 0x1239
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/item.c
// Function: SH_Item__destroy
void
SH_Item__destroy(SH_Item *obj, sh_bool_t recursive, int* err) {
	int local_err1 = SH_E_NO_ERROR;
	int local_err2 = SH_E_NO_ERROR;
	__cascade(err,);
	if (recursive) {
		SH_BareItem__destroy(obj->item, recursive, &local_err1);
		SH_dict__destroy(obj->params, recursive, &local_err2);
		free(obj);
		__raise(err, (SH_E_NO_ERROR == local_err1) ? local_err2 : local_err1);
	} else {
		free(obj);
		__clear(err);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
andl $0x0, 0xc(%rsp)
andl $0x0, 0x8(%rsp)
testq %rdx, %rdx
je 0x12ad
cmpl $0x0, (%rbx)
jne 0x1301
testb %sil, %sil
je 0x12f0
movq (%r14), %rdi
movzbl %sil, %ebp
leaq 0xc(%rsp), %rdx
movl %ebp, %esi
callq 0x1100
movq 0x8(%r14), %rdi
leaq 0x8(%rsp), %rdx
movl %ebp, %esi
callq 0x10e0
movq %r14, %rdi
callq 0x1040
testq %rbx, %rbx
je 0x1301
movl 0xc(%rsp), %eax
testl %eax, %eax
jne 0x12ff
movl 0x8(%rsp), %eax
jmp 0x12ff
movq %r14, %rdi
callq 0x1040
xorl %eax, %eax
testq %rbx, %rbx
je 0x1301
movl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/phluid61[P]hsf/src/item.c
// Function: SH_Item__add_param
void
SH_Item__add_param(SH_Item* obj, SH_Key* key, SH_Item* item, int* err) {
	if (SH_dict__count(obj->params, 0) >= 256) { /* FIXME: magic numer, RFC 8941, 3.1.2 */
		__raise(err, SH_E_PARAMETERS_OVERFLOW);
		return;
	}
	SH_dict__add(obj->params, key, item, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x1060
cmpq $0x100, %rax            # imm = 0x100
jb 0x136b
testq %rbx, %rbx
je 0x135f
movl $0x100002, (%rbx)       # imm = 0x100002
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10b0