LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x3d80(%rip), %xmm2     # 0x9fb0
andps %xmm0, %xmm2
movss 0x3d3d(%rip), %xmm1     # 0x9f78
movaps %xmm2, (%rsp)
cmpltss %xmm2, %xmm1
movss 0x3364(%rip), %xmm2     # 0x95b0
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x3d9a(%rip), %rsi      # 0x9ffd
movb $0x1, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x6299
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x628b
movzbl %cl, %edx
leaq 0x3d39(%rip), %rsi      # 0x9fd9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x81c3(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x62d3
xorl %eax, %eax
movaps (%rsp), %xmm0
ucomiss 0x3cb5(%rip), %xmm0     # 0x9f78
seta %al
leal (%rax,%rax,8), %eax
incl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x7d1e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3d06(%rip), %rsi      # 0x9fea
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x62b6
// File: /workspace/github_c_makefile_star2_O1/Openvario[P]sensord/nmea.c
// Function: Compose_Voltage_POV
int Compose_Voltage_POV(char *sentence, float voltage)
{
	int length;
	int success = 1;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xa, %ebp
movss 0x3c78(%rip), %xmm1     # 0x9f7c
ucomiss %xmm0, %xmm1
jbe 0x630e
xorps %xmm0, %xmm0
jmp 0x6329
movl $0x1, %ebp
ucomiss 0x3c66(%rip), %xmm0     # 0x9f80
jbe 0x6329
movss 0x3c60(%rip), %xmm0     # 0x9f84
movl $0xa, %ebp
cvtss2sd %xmm0, %xmm0
leaq 0x3cd8(%rip), %rsi      # 0xa00c
movq %rbx, %rdi
movb $0x1, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x636d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x635f
movzbl %cl, %edx
leaq 0x3c65(%rip), %rsi      # 0x9fd9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x80ef(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x6391
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7c60(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3c48(%rip), %rsi      # 0x9fea
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x638a
// File: /workspace/github_c_makefile_star2_O1/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 0x3bcb(%rip), %xmm1     # 0x9f88
cmpltps %xmm0, %xmm1
movss 0x3bc3(%rip), %xmm2     # 0x9f8c
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x63e3
cvtss2sd %xmm0, %xmm0
jmp 0x63eb
movsd 0x3bad(%rip), %xmm0     # 0x9f98
leaq 0x3c29(%rip), %rsi      # 0xa01b
movq %rbx, %rdi
movb $0x1, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x642b
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x641d
movzbl %cl, %edx
leaq 0x3ba7(%rip), %rsi      # 0x9fd9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x8031(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x6459
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7b98(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3b80(%rip), %rsi      # 0x9fea
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x6448
// File: /workspace/github_c_makefile_star2_O1/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 0x3107(%rip), %xmm1     # 0x958c
cmpltps %xmm0, %xmm1
xorps %xmm2, %xmm2
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x64a6
cvtss2sd %xmm0, %xmm0
jmp 0x64ae
movsd 0x3af2(%rip), %xmm0     # 0x9fa0
leaq 0x3b75(%rip), %rsi      # 0xa02a
movq %rbx, %rdi
movb $0x1, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x64ee
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x64e0
movzbl %cl, %edx
leaq 0x3ae4(%rip), %rsi      # 0x9fd9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x7f6e(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x651c
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7ad5(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3abd(%rip), %rsi      # 0x9fea
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x650b
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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), %xmm3
movss 0xc(%rdi), %xmm7
movaps %xmm3, %xmm5
mulss %xmm2, %xmm5
addss (%rdi), %xmm5
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
movaps %xmm4, %xmm9
movaps %xmm4, %xmm6
mulss %xmm4, %xmm6
movaps %xmm7, %xmm10
mulss %xmm2, %xmm10
movss 0x10(%rdi), %xmm8
movaps %xmm4, %xmm11
mulss %xmm8, %xmm11
addss %xmm10, %xmm10
addss %xmm11, %xmm10
movss 0x14(%rdi), %xmm11
mulss %xmm11, %xmm6
cvtss2sd %xmm6, %xmm6
mulsd 0x3a9c(%rip), %xmm6     # 0xa038
cvtss2sd %xmm10, %xmm10
addsd %xmm10, %xmm6
xorps %xmm10, %xmm10
cvtss2sd 0x8(%rdi), %xmm10
mulss %xmm2, %xmm9
addsd %xmm6, %xmm10
xorps %xmm6, %xmm6
cvtsd2ss %xmm10, %xmm6
mulss %xmm11, %xmm9
mulss 0x3a70(%rip), %xmm9     # 0xa040
mulss %xmm8, %xmm2
addss %xmm9, %xmm2
addss %xmm7, %xmm2
mulss %xmm11, %xmm4
addss %xmm8, %xmm4
subss %xmm5, %xmm0
addss %xmm6, %xmm1
movss 0x3a4c(%rip), %xmm7     # 0xa044
divss %xmm1, %xmm7
movaps %xmm2, %xmm1
mulss %xmm7, %xmm1
mulss %xmm6, %xmm7
movaps %xmm7, %xmm8
mulss %xmm0, %xmm8
addss %xmm5, %xmm8
movss %xmm8, (%rdi)
mulss %xmm1, %xmm0
addss %xmm3, %xmm0
movss %xmm0, 0x4(%rdi)
mulss %xmm2, %xmm1
subss %xmm1, %xmm4
movss %xmm4, 0x10(%rdi)
movaps %xmm2, %xmm0
mulss %xmm7, %xmm0
subss %xmm0, %xmm2
movss %xmm2, 0xc(%rdi)
mulss %xmm6, %xmm7
subss %xmm7, %xmm6
movss %xmm6, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rsi, %rbx
xorl %edx, %edx
movl $0x14, %ecx
callq 0x723a
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
jne 0x722c
xorl %eax, %eax
xorl %ecx, %ecx
addb (%rbx,%rax), %cl
incq %rax
cmpq $0x14, %rax
jne 0x7219
xorl %eax, %eax
cmpb 0x10(%rbx), %cl
jne 0x722e
popq %rbx
retq
callq 0x37f3
movl $0x2, %eax
jmp 0x722c
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edx
callq 0x20b0
cmpq $0x1, %rax
jne 0x7285
movl (%r14), %edi
movsbq %bpl, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2180
cmpq %r14, %rax
jne 0x728c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3832
jmp 0x7291
callq 0x3851
movb $0x1, %al
jmp 0x727c
// File: /workspace/github_c_makefile_star2_O1/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
movb %dl, 0x6(%rsp)
testl %ecx, %ecx
je 0x7311
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6(%rsp), %r15
movb (%r15), %al
movzbl %cl, %r12d
incb %al
movzbl %al, %r13d
xorl %ebp, %ebp
movb (%rbx,%rbp), %al
movb %al, 0x7(%rsp)
movl (%r14), %edi
movl $0x2, %edx
movq %r15, %rsi
callq 0x20b0
cmpq $0x2, %rax
jne 0x7322
movl $0x2710, %edi           # imm = 0x2710
callq 0x2300
leal (%r13,%rbp), %eax
movb %al, 0x6(%rsp)
incq %rbp
cmpl %ebp, %r12d
jne 0x72d9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x386d
movb $0x1, %al
jmp 0x7313
nop
// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movq %rdi, %r14
leaq 0x2098(%rip), %rdi      # 0x93d8
xorl %r15d, %r15d
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x7396
movl %eax, %ebp
movzbl %bl, %r12d
xorl %r15d, %r15d
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x739d
leaq 0x70fc(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x73a4
movl %ebp, (%r14)
movb %bl, 0x4(%r14)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x38b8
jmp 0x738a
callq 0x388c
jmp 0x738a
movq 0x6c4d(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x346f(%rip), %rsi      # 0xa824
movl %r12d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x737d
// File: /workspace/github_c_makefile_star2_O1/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 0x3470(%rip), %rsi      # 0xa83e
movl $0x1, %edx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x7402
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movaps 0x33df(%rip), %xmm0     # 0xa7d0
movups %xmm0, 0x18(%rbx)
xorl %eax, %eax
movb %al, 0x2c(%rbx)
movb %al, 0x2e(%rbx)
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
movl (%rdi), %edi
leaq 0x341f(%rip), %rsi      # 0xa83b
movl $0x1, %edx
callq 0x20b0
xorl %ebx, %ebx
cmpq $0x1, %rax
jne 0x7489
xorl %ebx, %ebx
leaq 0xf(%rsp), %r15
leaq 0x10(%rsp), %r12
xorl %ebp, %ebp
movl (%r14), %edi
movl $0x1, %edx
movq %r15, %rsi
callq 0x2180
testq %rax, %rax
je 0x7489
movzbl 0xf(%rsp), %eax
testb $0x1, %al
je 0x747e
movups 0x337f(%rip), %xmm0     # 0xa7e0
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x7466
incl %ebp
cmpl $0x64, %ebp
jne 0x743c
jmp 0x7489
testb $0x4, %al
jne 0x7489
shrl %eax
andl $0x1, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3389(%rip), %rsi      # 0xa83d
movl $0x2, %edx
callq 0x20b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x2, %rax
jne 0x75a7
xorl %r13d, %r13d
leaq 0xe(%rsp), %r15
leaq 0x10(%rsp), %r12
movl (%r14), %edi
movl $0x1, %edx
movq %r15, %rsi
callq 0x2180
testq %rax, %rax
je 0x75a7
testb $0x1, 0xe(%rsp)
je 0x7524
movups 0x32df(%rip), %xmm0     # 0xa7e0
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x7506
incl %r13d
cmpl $0x64, %r13d
jne 0x74da
movl $0x64, %r13d
cmpl $0x64, %r13d
je 0x75a7
leaq 0xe(%rsp), %rsi
movb $-0x5b, (%rsi)
movb %bpl, 0x1(%rsi)
movl (%r14), %edi
movl $0x2, %edx
callq 0x20b0
cmpq $0x2, %rax
jne 0x75a7
xorl %ebp, %ebp
leaq 0xe(%rsp), %r15
leaq 0x10(%rsp), %r12
movl (%r14), %edi
movl $0x1, %edx
movq %r15, %rsi
callq 0x2180
testq %rax, %rax
je 0x75a7
testb $0x1, 0xe(%rsp)
je 0x7598
movups 0x3268(%rip), %xmm0     # 0xa7e0
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x757d
incl %ebp
cmpl $0x64, %ebp
jne 0x7555
movl $0x64, %ebp
xorl %eax, %eax
cmpl $0x64, %ebp
setne %al
leal -0x1(,%rax,2), %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_O1/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 %r12
pushq %rbx
subq $0x20, %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
movl $0x2, %edx
callq 0x20b0
xorl %ebp, %ebp
cmpq $0x2, %rax
jne 0x778f
xorl %ebp, %ebp
leaq 0xe(%rsp), %r14
leaq 0x10(%rsp), %r15
xorl %r12d, %r12d
movl (%rbx), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x2180
testq %rax, %rax
je 0x778f
movzbl 0xe(%rsp), %eax
testb $0x1, %al
je 0x7784
movups 0x307b(%rip), %xmm0     # 0xa7e0
movaps %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r15, %rsi
callq 0x2120
testl %eax, %eax
jne 0x776a
incl %r12d
cmpl $0x64, %r12d
jne 0x7741
jmp 0x778f
shrl $0x5, %eax
movl %eax, 0x18(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
xorl %eax, %eax
movq 0x8(%rdi,%rax,8), %rcx
xorl %esi, %esi
xorl %edx, %edx
movzbl %cl, %r8d
movl $0x8, %r9d
movl %r8d, %r10d
xorl %edx, %r10d
movl %edx, %r11d
shrl %r11d
movl %r11d, %edx
xorl $0x8c, %edx
testb $0x1, %r10b
cmovel %r11d, %edx
shrl %r8d
decl %r9d
jne 0x78fd
sarq $0x8, %rcx
incl %esi
cmpl $0x4, %esi
jne 0x78f3
leaq 0x1(%rax), %rsi
testq %rax, %rax
movq %rsi, %rax
je 0x78ea
movzbl %cl, %ecx
xorl %eax, %eax
cmpl %edx, %ecx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %ecx
movl %eax, %edx
xorl %edi, %edx
movl %eax, %esi
sarl %esi
movl %esi, %eax
xorl $0x8c, %eax
testb $0x1, %dl
cmovel %esi, %eax
sarl %edi
decl %ecx
jne 0x794b
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4c, %esi
callq 0x7498
cmpl $-0x1, %eax
je 0x79b4
xorl %r14d, %r14d
movq 0x8(%rbx,%r14,8), %r15
movl $0x4, %ebp
movzbl %r15b, %esi
movq %rbx, %rdi
callq 0x7498
sarq $0x8, %r15
decl %ebp
jne 0x798d
leaq 0x1(%r14), %rax
testq %r14, %r14
movq %rax, %r14
je 0x7983
movl $0x1, %eax
jmp 0x79b6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7404
xorl %ebp, %ebp
testl %eax, %eax
je 0x7a4b
movq %rbx, %rdi
movl $0xcc, %esi
callq 0x7498
cmpl $-0x1, %eax
je 0x7a4b
movl 0x3c(%rbx), %eax
addl $-0x9, %eax
movl $0x3a, %ecx
cmpl $0x2, %eax
ja 0x7a18
movl %eax, %edx
shlb $0x5, %dl
orb $0x1f, %dl
movl %eax, %eax
leaq 0x2e07(%rip), %rcx      # 0xa818
movl (%rcx,%rax,4), %ecx
movb %dl, 0x7(%rsp)
movl %ecx, 0x34(%rbx)
movl $0x5, 0x38(%rbx)
movl $0x1, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
movzbl 0x4(%rsp,%r15), %esi
movq %rbx, %rdi
callq 0x7498
cmpl $-0x1, %eax
cmovel %r14d, %ebp
incq %r15
cmpq $0x4, %r15
jne 0x7a2d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ebp
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x75b8
movl %eax, (%rsp,%r14,4)
testl %eax, %eax
cmovsl %ebp, %r15d
incq %r14
cmpq $0x5, %r14
jne 0x7a74
xorl %ebp, %ebp
testl %r15d, %r15d
jne 0x7b47
movl 0x4(%rsp), %eax
movl 0x10(%rsp), %ecx
shll $0x8, %eax
orl (%rsp), %eax
shrl $0x5, %ecx
andl $0x3, %ecx
leaq 0x2d53(%rip), %rdx      # 0xa808
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
sarl $0x3, %eax
movl $0x9, %ecx
movsd 0x2d2a(%rip), %xmm0     # 0xa7f8
jmp 0x7b00
sarl %eax
movl $0xb, %ecx
movsd 0x2d21(%rip), %xmm0     # 0xa800
jmp 0x7b00
movl $0xc, %ecx
movsd 0x2d02(%rip), %xmm0     # 0xa7f0
jmp 0x7b00
sarl $0x2, %eax
movl $0xa, %ecx
movsd 0x2538(%rip), %xmm0     # 0xa038
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x24(%rbx)
xorl %ebp, %ebp
movss 0x246a(%rip), %xmm1     # 0x9f88
ucomiss %xmm0, %xmm1
jbe 0x7b3b
ucomiss 0x2462(%rip), %xmm0     # 0x9f8c
jbe 0x7b3b
xorl %ebp, %ebp
cmpl %ecx, 0x3c(%rbx)
setne %bpl
incl %ebp
movb $0x1, 0x2e(%rbx)
leaq 0x6932(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x7b54
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x38e4
jmp 0x7b47
nop
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2, %eax
decl %ecx
cmpl $0x6, %ecx
ja 0x8462
leaq 0x244f(%rip), %rdx      # 0xa874
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $-0xb, 0xe(%rsp)
jmp 0x8443
movb 0x3c(%rdi), %al
movb %al, 0xe(%rsp)
jmp 0x8443
movb $-0x3, 0xe(%rsp)
movl $0x1, %ebx
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)
movl $0x2, %ebx
jmp 0x8448
// File: /workspace/github_c_makefile_star2_O1/Openvario[P]sensord/humidity.c
// Function: si7021_start_temp
int si7021_start_temp (t_ds2482 *sensor) {

	// This sends a temperature conversion for an HTU21D, a humidity conversion for SI7021 (does both), and a conversion for HTU31D
	char config[2],lngth=1;

	switch (sensor->sensor_type) {
		case SI7021 : config[0]=0xf5; break;
		case HTU21D : config[0]=0xf3; 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
movl $0x2, %eax
decl %ecx
cmpl $0x6, %ecx
ja 0x84d6
leaq 0x23fe(%rip), %rdx      # 0xa890
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $-0xd, 0xe(%rsp)
jmp 0x84b7
movb $-0xb, 0xe(%rsp)
jmp 0x84b7
movb 0x3c(%rdi), %al
movb %al, 0xe(%rsp)
jmp 0x84b7
movb $-0x3, 0xe(%rsp)
movl $0x1, %ebx
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)
movl $0x2, %ebx
jmp 0x84bc
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpb $0x1, 0x30(%rdi)
jne 0x859b
movb $0x0, 0x2e(%rbx)
movl (%rbx), %edi
leaq 0xd(%rsp), %rsi
movl $0x3, %edx
callq 0x2180
movq %rax, %rcx
movl $0x4, %eax
cmpq $0x3, %rcx
jne 0x85a5
movzwl 0xd(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
movzbl 0xf(%rsp), %edx
movl %ecx, %esi
shll $0x8, %esi
movl $0x988000, %eax         # imm = 0x988000
movl $0x800000, %edi         # imm = 0x800000
movl $0xff8000, %r8d         # imm = 0xFF8000
testl %esi, %edi
je 0x8556
movl %eax, %r9d
andl %r8d, %r9d
xorl %r9d, %esi
shrl %edi
shrl %r8d
shrl %eax
cmpl $0x80, %edi
jne 0x8549
movl $0x2, %eax
cmpl %edx, %esi
jne 0x85a5
cvtsi2sd %ecx, %xmm0
mulsd 0x235e(%rip), %xmm0     # 0xa8d8
mulsd 0x235e(%rip), %xmm0     # 0xa8e0
addsd 0x235e(%rip), %xmm0     # 0xa8e8
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rbx)
movb 0x2c(%rbx), %al
movb %al, 0x2e(%rbx)
jmp 0x85a3
movq %rbx, %rdi
callq 0x85ab
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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)
movl $0x1, %ebp
cmpb $0x3, 0x30(%rdi)
jne 0x89b7
movl %esi, %ebx
movq %rdi, %r14
andl $0xf, %ebx
leaq 0xc(%rsp), %rsi
movb %bl, 0x1(%rsi)
movl (%rdi), %edi
movl $0x2, %edx
callq 0x20b0
movl $0x2, %ebp
cmpq $0x2, %rax
jne 0x89b7
movl (%r14), %edi
leaq 0xe(%rsp), %rsi
movl $0x1, %edx
callq 0x20b0
cmpq $0x1, %rax
jne 0x89b7
movl (%r14), %edi
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
callq 0x2180
cmpq $0x1, %rax
jne 0x89b7
movzbl 0xd(%rsp), %eax
xorl %ebp, %ebp
cmpl %eax, %ebx
setne %bpl
addl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7d2(%rip), %rdi       # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
movl %eax, (%r14)
testl %eax, %eax
js 0x8c57
movzbl %bl, %ebp
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x8c5e
movq %r14, %rdi
callq 0x8c89
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jg 0x8c68
leaq 0x582a(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x8c6d
movb %bl, 0x4(%r14)
xorl %eax, %eax
jmp 0x8c68
callq 0x3b20
jmp 0x8c63
callq 0x3af4
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5384(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x1ea0(%rip), %rsi      # 0xab1e
movl %ebp, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x8c4f
// File: /workspace/github_c_makefile_star2_O1/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 0x8e40
movups 0x1d21(%rip), %xmm0     # 0xab48
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
jne 0x8e2d
xorl %eax, %eax
jmp 0x8e45
movl $0x3, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
imull $0xf0f0f0f1, %ebx, %eax # imm = 0xF0F0F0F1
addl $0x7878787, %eax        # imm = 0x7878787
cmpl $0xf0f0f0e, %eax        # imm = 0xF0F0F0E
jbe 0x121c
imull $0xc28f5c29, %ebx, %eax # imm = 0xC28F5C29
addl $0x51eb851, %eax        # imm = 0x51EB851
cmpl $0xa3d70a2, %eax        # imm = 0xA3D70A2
jbe 0x120a
popq %rbx
retq
callq 0x1040
movl %eax, %edi
movl $0x2, %esi
popq %rbx
jmp 0x1070
movl $0x1, %edi
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O1/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 0x1248
shrl $0x8, %edx
andl $0xff, %edx
jne 0x1282
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %ebx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
movq 0x2d9f(%rip), %rcx      # 0x3ff8
movq (%rcx), %r14
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x1295
movl %ebx, %edi
callq 0x1090
leaq 0xdc3(%rip), %rsi       # 0x2034
movq %r14, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1060
jmp 0x12a6
movq 0x2d6f(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd85(%rip), %rsi       # 0x2018
jmp 0x129f
leaq 0xdba(%rip), %rsi       # 0x2056
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movb $0x1, %al
jmp 0x1240
// File: /workspace/github_c_makefile_star2_O1/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
movl $0xf, %ebx
callq 0x10c0
testl %eax, %eax
je 0x131b
cmpl $-0x1, %eax
je 0x1329
leal 0x2(%rbx), %eax
cmpl $0x224, %ebx            # imm = 0x224
movl %eax, %ebx
jb 0x12b7
leaq 0xc(%rsp), %rdi
callq 0x10b0
xorl %ebx, %ebx
cmpl $-0x1, %eax
je 0x130a
xorl %ebx, %ebx
movl $0x1, %ebp
leaq 0xc(%rsp), %r14
movl 0xc(%rsp), %edi
callq 0x1226
testb %al, %al
cmovnel %ebp, %ebx
movq %r14, %rdi
callq 0x10b0
cmpl $-0x1, %eax
jne 0x12ef
callq 0x1030
cmpl $0xa, (%rax)
jne 0x1332
movl %ebx, %edi
callq 0x10a0
movl %ebx, %edi
callq 0x11cc
xorl %edi, %edi
callq 0x10a0
leaq 0xd44(%rip), %rsi       # 0x2074
jmp 0x1339
leaq 0xd40(%rip), %rsi       # 0x2079
movl $0x1, %edi
xorl %eax, %eax
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
leaq 0x18be(%rip), %rbx      # 0x4004
xorl %esi, %esi
leal 0x1(%rsi), %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
movl $0x1, %edi
callq 0x24c0
movl %ebp, %esi
jmp 0x2748
nop
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x2, %edi
setb %r12b
jb 0x1397
movq %rsi, %rbx
movl %edi, %ebp
movslq %edi, %r13
movl $0x1, %r15d
movq (%rbx,%r15,8), %r14
movzbl (%r14), %eax
cmpl $0x2d, %eax
je 0x1347
cmpl $0x2b, %eax
jne 0x135d
cmpl $0x3, %ebp
jg 0x1397
incq %r14
movq %r14, %rdi
callq 0x13ad
testl %eax, %eax
jne 0x138b
jmp 0x1397
movq %r14, %rdi
callq 0x13ad
testl %eax, %eax
je 0x1397
cmpq $0x2, %r15
jb 0x138b
movq -0x8(%rbx,%r15,8), %rdi
callq 0x1070
movl %eax, 0x4(%rsp)
movq %r14, %rdi
callq 0x1070
cmpl %eax, 0x4(%rsp)
jg 0x1397
incq %r15
cmpq %r13, %r15
setae %r12b
jne 0x1335
movzbl %r12b, %eax
andl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1050
testq %rax, %rax
sete %bpl
je 0x13fc
movq %rax, %r14
callq 0x1080
movq (%rax), %rax
movsbq (%rbx), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x13fc
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rdx, %r14
je 0x13f5
movsbq (%rbx,%rcx), %rsi
leaq 0x1(%rcx), %rdx
testb $0x8, 0x1(%rax,%rsi,2)
jne 0x13dd
cmpq %r14, %rcx
setae %bpl
movzbl %bpl, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1270
movl $0x10, %edi
callq 0x10d0
testq %rax, %rax
je 0x1244
movq %rax, %rbx
testq %r12, %r12
je 0x1252
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
testq %r14, %r14
je 0x1272
movl $0x0, (%r14)
jmp 0x1272
testq %r14, %r14
je 0x1270
movl $0x80000001, (%r14)     # imm = 0x80000001
jmp 0x1270
movq %r14, %rdi
callq 0x1050
movq %rax, %r12
testq %r14, %r14
je 0x1281
cmpl $0x0, (%r14)
je 0x122f
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 %r12, 0x8(%rbx)
jmp 0x1272
// File: /workspace/github_c_makefile_star2_O1/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
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x8(%rsp)
testq %rdx, %rdx
je 0x12ac
cmpl $0x0, (%rbx)
jne 0x1300
testb %sil, %sil
je 0x12ef
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 0x1300
movl 0xc(%rsp), %eax
testl %eax, %eax
jne 0x12fe
movl 0x8(%rsp), %eax
jmp 0x12fe
movq %r14, %rdi
callq 0x1040
xorl %eax, %eax
testq %rbx, %rbx
je 0x1300
movl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1376
testq %rbx, %rbx
je 0x136a
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
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/item.c
// Function: _SH_Item__to_s_param
void
__SH_Item__to_s_param(SH_Key* key, SH_Item* obj, void* ptr, int* err) {
	__sh_item__string* str;

	sh_char_t* k; /* key string */
	sh_char_t* o; /* obj string */

	int local_err = SH_E_NO_ERROR;

	__cascade(err,);

	str = (__sh_item__string*)ptr;

	k = SH_Key__to_s(key, &local_err);
	if (local_err) {
		__raise(err, local_err);
		return;
	}

	if (SH_BOOLEAN == SH_BareItem__type(obj->item, &local_err) && SH_Boolean__true(SH_BareItem__get_boolean(obj->item, &local_err), &local_err)) {
		str->a[str->n ++] = k; str->length += strlen((const char*)k);
		str->a[str->n ++] = (sh_char_t*)0;
	} else {
		local_err = SH_E_NO_ERROR; /* ignore any errors above */
		o = SH_Item__to_s(obj, &local_err);
		if (local_err) {
			free(k);
			__raise(err, local_err);
			return;
		}

		str->a[str->n ++] = k; str->length += strlen((const char*)k);
		str->a[str->n ++] = o; str->length += strlen((const char*)o);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movl $0x0, 0xc(%rsp)
testq %rcx, %rcx
je 0x13c1
cmpl $0x0, (%r14)
jne 0x147c
leaq 0xc(%rsp), %r13
movq %r13, %rsi
callq 0x10a0
movq %rax, %r15
movl (%r13), %eax
testl %eax, %eax
je 0x13e7
testq %r14, %r14
jne 0x1479
jmp 0x147c
movq (%r12), %rdi
leaq 0xc(%rsp), %rsi
callq 0x1090
cmpl $0x6, %eax
jne 0x1449
movq (%r12), %rdi
leaq 0xc(%rsp), %r13
movq %r13, %rsi
callq 0x1030
movq %rax, %rdi
movq %r13, %rsi
callq 0x1110
testb %al, %al
je 0x1449
movq 0x8(%rbx), %r14
leaq 0x1(%r14), %rax
movq %rax, 0x8(%rbx)
movq %r15, 0x10(%rbx,%r14,8)
movq %r15, %rdi
callq 0x1070
addq %rax, (%rbx)
leaq 0x2(%r14), %rax
movq %rax, 0x8(%rbx)
movq $0x0, 0x18(%rbx,%r14,8)
jmp 0x147c
leaq 0xc(%rsp), %r13
movl $0x0, (%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1120
cmpl $0x0, (%r13)
je 0x148a
movq %r15, %rdi
callq 0x1040
testq %r14, %r14
je 0x147c
movl 0xc(%rsp), %eax
movl %eax, (%r14)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r12
movq 0x8(%rbx), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x8(%rbx)
movq %r15, 0x10(%rbx,%r13,8)
movq %r15, %rdi
callq 0x1070
movq %rax, %r14
addq (%rbx), %r14
movq %r14, (%rbx)
leaq 0x2(%r13), %rax
movq %rax, 0x8(%rbx)
movq %r12, 0x18(%rbx,%r13,8)
movq %r12, %rdi
callq 0x1070
addq %r14, %rax
movq %rax, (%rbx)
jmp 0x147c