LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ams5915.c
// Function: ams5915_open
int ams5915_open(t_ams5915 *sensor, unsigned char i2c_address)
{
	// local variables
	int fd;

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4e7d(%rip), %rdi      # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x45a6
movl %eax, %ebp
movzbl %bl, %r15d
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x45ad
leaq 0x9ee7(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x45b9
movl %ebp, (%r14)
movb %bl, 0x4(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2607
jmp 0x45b2
callq 0x25db
movl $0x1, %eax
jmp 0x459b
movq 0x9a38(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x4e31(%rip), %rsi      # 0x93fb
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x4592
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ams5915.c
// Function: ams5915_init
int ams5915_init(t_ams5915 *sensor)
{
	// set calibration data
	sensor->digoutpmin = 1638;    // from datasheet
	sensor->digoutpmax = 14745;   // from datasheet
	sensor->pmin = 0;             // from datasheet
	sensor->pmax = 50;            // from datasheet

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

// Assembly:
movl $0x39990666, 0x6(%rdi)  # imm = 0x39990666
movw $0x3200, 0xe(%rdi)      # imm = 0x3200
movl $0x438311ec, 0x10(%rdi) # imm = 0x438311EC
leaq 0x9e83(%rip), %rax      # 0xe474
cmpl $0x2, (%rax)
jge 0x45f9
xorl %eax, %eax
retq
pushq %rax
callq 0x2633
addq $0x8, %rsp
jmp 0x45f6
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ams5915.c
// Function: ams5915_measure
int ams5915_measure(t_ams5915 *sensor)
{
	//variables
	uint8_t buf[10]={0x00};

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

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movw $0x0, 0x8(%rsi)
movq $0x0, (%rsi)
movl (%rdi), %edi
movl $0x4, %edx
callq 0x2180
cmpq $0x4, %rax
jne 0x4672
movzbl 0x8(%rsp), %eax
andl $0x3f, %eax
shll $0x8, %eax
movzbl 0x9(%rsp), %esi
orl %eax, %esi
movw %si, 0xa(%rbx)
movzwl 0xa(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
shrl $0x5, %eax
movw %ax, 0xc(%rbx)
leaq 0x9e11(%rip), %rcx      # 0xe474
xorl %eax, %eax
cmpl $0x0, (%rcx)
jg 0x467e
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x2661
movl $0x1, %eax
jmp 0x466a
leaq 0xc(%rbx), %rdx
leaq 0x14(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rcx
callq 0x267d
movl (%r14), %eax
jmp 0x466a
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ams5915.c
// Function: ams5915_calculate
int ams5915_calculate(t_ams5915 *sensor)
{
	// calculate differential pressure
	sensor->p = (((sensor->digoutp - sensor->digoutpmin)/sensor->sensp) + sensor->pmin);

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

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

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

	return (0);
}

// Assembly:
movzwl 0xa(%rdi), %eax
movzwl 0x6(%rdi), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm2
movzbl 0xe(%rdi), %eax
cvtsi2ss %eax, %xmm0
movzwl 0xc(%rdi), %eax
imull $0xc8, %eax, %eax
cvtsi2ss %eax, %xmm1
divss 0x10(%rdi), %xmm2
mulss 0x4d00(%rip), %xmm1     # 0x93c8
addss %xmm2, %xmm0
addss 0x4cf8(%rip), %xmm1     # 0x93cc
movss %xmm1, 0x14(%rdi)
mulss 0x1c(%rdi), %xmm0
addss 0x20(%rdi), %xmm0
movss %xmm0, 0x18(%rdi)
leaq 0x9d85(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x46f7
xorl %eax, %eax
retq
pushq %rax
movq 0x98f9(%rip), %rax      # 0xdff8
movq (%rax), %rax
movzbl 0x4(%rdi), %ecx
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
leaq 0x4d83(%rip), %rsi      # 0x9498
leaq 0x4d9e(%rip), %rdx      # 0x94ba
movq %rax, %rdi
movb $0x2, %al
callq 0x21c0
addq $0x8, %rsp
jmp 0x46f4
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ads1110.c
// Function: ads1110_open
int ads1110_open(t_ads1110 *sensor, unsigned char i2c_address)
{
	// local variables
	int fd;
	unsigned char buf[10]={0x00};

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

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

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movw $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
leaq 0x4c86(%rip), %rdi      # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x47c6
movl %eax, %r14d
movzbl %bpl, %r15d
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x47cd
leaq 0x8(%rsp), %rsi
movl $0x3, %edx
movl %r14d, %edi
callq 0x2180
cmpq $0x3, %rax
jne 0x47b2
leaq 0x9cd7(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x47d7
movl %r14d, 0x10(%rbx)
movb %bpl, 0x14(%rbx)
movb $0x1, 0x15(%rbx)
xorl %eax, %eax
jmp 0x47bb
movb $0x0, 0x15(%rbx)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2739
jmp 0x47b6
movq %rbx, %rdi
callq 0x26fc
jmp 0x47b6
movq 0x981a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x4cf0(%rip), %rsi      # 0x94d8
movl %r15d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x47a2
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/ads1110.c
// Function: ads1110_measure
int ads1110_measure(t_ads1110 *sensor)
{
	//variables
	//struct timespec sample_time;
	unsigned char buf[10]={0x00};
  //int digoutp;


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

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

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


	return(0);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movw $0x0, 0x8(%rsi)
movq $0x0, (%rsi)
movl 0x10(%rdi), %edi
movl $0x3, %edx
callq 0x2180
cmpq $0x3, %rax
jne 0x4865
movzwl 0x8(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movl %r8d, 0x8(%rbx)
leaq 0x9c1f(%rip), %rax      # 0xe474
xorl %ebp, %ebp
cmpl $0x2, (%rax)
jge 0x4871
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
callq 0x27a0
movl $0x1, %ebp
jmp 0x485c
movq 0x9780(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl 0x14(%rbx), %ecx
leaq 0x4caa(%rip), %rsi      # 0x9530
leaq 0x4cbe(%rip), %rdx      # 0x954b
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x21c0
jmp 0x485c
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/main.c
// Function: sigintHandler
static void sigintHandler(int sig_num)
{
	(void)sig_num;

	signal(SIGINT, sigintHandler);

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

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

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

	exit(0);
}

// Assembly:
pushq %rax
leaq -0x8(%rip), %rsi        # 0x5144
movl $0x2, %edi
callq 0x21b0
leaq 0x92d3(%rip), %rax      # 0xe430
movq (%rax), %rdi
testq %rdi, %rdi
je 0x516a
callq 0x20d0
leaq 0x92b7(%rip), %rax      # 0xe428
movq (%rax), %rdi
testq %rdi, %rdi
je 0x517e
callq 0x20d0
movq 0x8e73(%rip), %rax      # 0xdff8
movq (%rax), %rcx
leaq 0x4d1a(%rip), %rdi      # 0x9ea9
movl $0xc, %esi
movl $0x1, %edx
callq 0x22a0
xorl %edi, %edi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/nmea.c
// Function: Compose_Pressure_POV_slow
int Compose_Pressure_POV_slow(char *sentence, float static_pressure, float dynamic_pressure)
{
	int length;
	int success = 1;

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x35da(%rip), %xmm2     # 0x95a4
cmpltps %xmm0, %xmm2
xorps %xmm3, %xmm3
movaps %xmm0, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %ebp
movss 0x3ff9(%rip), %xmm2     # 0x9fe0
cmpltps %xmm1, %xmm2
movss 0x3ff1(%rip), %xmm3     # 0x9fe4
movaps %xmm1, %xmm4
cmpltps %xmm3, %xmm4
orps %xmm2, %xmm4
movd %xmm4, %r15d
movsd 0x3ff6(%rip), %xmm2     # 0xa000
movaps %xmm2, %xmm3
testb $0x1, %bpl
jne 0x601a
xorps %xmm3, %xmm3
cvtss2sd %xmm0, %xmm3
testb $0x1, %r15b
jne 0x6027
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
leaq 0x4002(%rip), %rsi      # 0xa030
movq %rbx, %rdi
movaps %xmm3, %xmm0
movaps %xmm2, %xmm1
movb $0x2, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x606d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x605f
movzbl %cl, %edx
leaq 0x3fd5(%rip), %rsi      # 0xa049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x83ef(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x60ad
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %ecx
incl %ecx
testb $0x1, %r15b
movl $0x14, %eax
cmovel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7f44(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3f93(%rip), %rsi      # 0xa051
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x608a
// File: /workspace/github_c_makefile_star2_O3/Openvario[P]sensord/nmea.c
// Function: NMEA_checksum
unsigned char NMEA_checksum(char *string)
{
  unsigned char value=0;
	int i=1;
	int l;

	l = strlen(string);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x20e0
cmpl $0x2, %eax
jl 0x60f1
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x60e4
jmp 0x60f3
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3f18(%rip), %xmm2     # 0xa020
andps %xmm0, %xmm2
movss 0x3ed5(%rip), %xmm1     # 0x9fe8
movaps %xmm2, (%rsp)
cmpltss %xmm2, %xmm1
movss 0x3490(%rip), %xmm2     # 0x95b4
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x3f32(%rip), %rsi      # 0xa06d
movb $0x1, %al
callq 0x2270
movslq %eax, %r14
addq %rbx, %r14
movq %rbx, %rdi
callq 0x20e0
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x6171
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x6163
movzbl %cl, %edx
leaq 0x3ed1(%rip), %rsi      # 0xa049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x82eb(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x61ab
xorl %eax, %eax
movaps (%rsp), %xmm0
ucomiss 0x3e4d(%rip), %xmm0     # 0x9fe8
seta %al
leal (%rax,%rax,8), %eax
incl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x7e46(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3e9e(%rip), %rsi      # 0xa05a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x618e
// File: /workspace/github_c_makefile_star2_O3/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 0x3e10(%rip), %xmm1     # 0x9fec
ucomiss %xmm0, %xmm1
jbe 0x61e6
xorps %xmm0, %xmm0
jmp 0x6201
movl $0x1, %ebp
ucomiss 0x3dfe(%rip), %xmm0     # 0x9ff0
jbe 0x6201
movss 0x3df8(%rip), %xmm0     # 0x9ff4
movl $0xa, %ebp
cvtss2sd %xmm0, %xmm0
leaq 0x3e70(%rip), %rsi      # 0xa07c
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 0x6245
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x6237
movzbl %cl, %edx
leaq 0x3dfd(%rip), %rsi      # 0xa049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x8217(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x6269
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7d88(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3de0(%rip), %rsi      # 0xa05a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x6262
// File: /workspace/github_c_makefile_star2_O3/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 0x3d63(%rip), %xmm1     # 0x9ff8
cmpltps %xmm0, %xmm1
movss 0x3d5b(%rip), %xmm2     # 0x9ffc
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x62bb
cvtss2sd %xmm0, %xmm0
jmp 0x62c3
movsd 0x3d45(%rip), %xmm0     # 0xa008
leaq 0x3dc1(%rip), %rsi      # 0xa08b
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 0x6303
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x62f5
movzbl %cl, %edx
leaq 0x3d3f(%rip), %rsi      # 0xa049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x8159(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x6331
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7cc0(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3d18(%rip), %rsi      # 0xa05a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x6320
// File: /workspace/github_c_makefile_star2_O3/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 0x3233(%rip), %xmm1     # 0x9590
cmpltps %xmm0, %xmm1
xorps %xmm2, %xmm2
movaps %xmm0, %xmm3
cmpltps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x637e
cvtss2sd %xmm0, %xmm0
jmp 0x6386
movsd 0x3c8a(%rip), %xmm0     # 0xa010
leaq 0x3d0d(%rip), %rsi      # 0xa09a
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 0x63c6
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
xorb (%rbx,%rdx), %cl
incq %rdx
cmpq %rdx, %rax
jne 0x63b8
movzbl %cl, %edx
leaq 0x3c7c(%rip), %rsi      # 0xa049
movq %r14, %rdi
xorl %eax, %eax
callq 0x2270
leaq 0x8096(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x63f4
movzbl %bpl, %eax
andl $0x1, %eax
leal (%rax,%rax,8), %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7bfd(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3c55(%rip), %rsi      # 0xa05a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x63e3
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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     # 0xa0a8
cvtss2sd %xmm10, %xmm10
addsd %xmm10, %xmm6
xorps %xmm10, %xmm10
cvtss2sd 0x8(%rdi), %xmm10
addsd %xmm6, %xmm10
xorps %xmm6, %xmm6
cvtsd2ss %xmm10, %xmm6
mulss %xmm11, %xmm9
mulss 0x3c08(%rip), %xmm9     # 0xa0b0
mulss %xmm8, %xmm2
addss %xmm9, %xmm2
addss %xmm7, %xmm2
mulss %xmm11, %xmm5
addss %xmm8, %xmm5
subss %xmm3, %xmm0
addss %xmm6, %xmm1
movss 0x30b8(%rip), %xmm7     # 0x9588
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 0x3bc3(%rip), %xmm2     # 0xa0c0
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_O3/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 0x70fa
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
jne 0x70ec
xorl %eax, %eax
xorl %ecx, %ecx
addb (%rbx,%rax), %cl
incq %rax
cmpq $0x14, %rax
jne 0x70d9
xorl %eax, %eax
cmpb 0x10(%rbx), %cl
jne 0x70ee
popq %rbx
retq
callq 0x37cf
movl $0x2, %eax
jmp 0x70ec
// File: /workspace/github_c_makefile_star2_O3/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 0x7145
movl (%r14), %edi
movsbq %bpl, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2180
cmpq %r14, %rax
jne 0x714c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x380e
jmp 0x7151
callq 0x382d
movb $0x1, %al
jmp 0x713c
// File: /workspace/github_c_makefile_star2_O3/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 0x71ce
movq %rsi, %rbx
movq %rdi, %r14
movzbl %cl, %r12d
incb %dl
movzbl %dl, %r13d
xorl %ebp, %ebp
leaq 0x6(%rsp), %r15
movb (%rbx,%rbp), %al
movb %al, 0x7(%rsp)
movl (%r14), %edi
movl $0x2, %edx
movq %r15, %rsi
callq 0x20b0
cmpq $0x2, %rax
jne 0x71df
movl $0x2710, %edi           # imm = 0x2710
callq 0x2300
leal (%r13,%rbp), %eax
movb %al, 0x6(%rsp)
incq %rbp
cmpl %ebp, %r12d
jne 0x7196
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3849
movb $0x1, %al
jmp 0x71d0
// File: /workspace/github_c_makefile_star2_O3/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 0x21dc(%rip), %rdi      # 0x93d8
xorl %r15d, %r15d
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x7252
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 0x7259
leaq 0x7240(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x7260
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 0x3894
jmp 0x7246
callq 0x3868
jmp 0x7246
movq 0x6d91(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x3633(%rip), %rsi      # 0xa8a4
movl %r12d, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x7239
// File: /workspace/github_c_makefile_star2_O3/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 0x3634(%rip), %rsi      # 0xa8be
movl $0x1, %edx
callq 0x20b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
jne 0x72be
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movaps 0x35a3(%rip), %xmm0     # 0xa850
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_O3/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 0x35e3(%rip), %rsi      # 0xa8bb
movl $0x1, %edx
callq 0x20b0
xorl %ebx, %ebx
cmpq $0x1, %rax
jne 0x7345
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 0x7345
movzbl 0xf(%rsp), %eax
testb $0x1, %al
je 0x733a
movups 0x3543(%rip), %xmm0     # 0xa860
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x7322
incl %ebp
cmpl $0x64, %ebp
jne 0x72f8
jmp 0x7345
testb $0x4, %al
jne 0x7345
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_O3/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 0x354d(%rip), %rsi      # 0xa8bd
movl $0x2, %edx
callq 0x20b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x2, %rax
jne 0x7456
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 0x7456
testb $0x1, 0xe(%rsp)
je 0x73dc
movups 0x34a3(%rip), %xmm0     # 0xa860
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x73c2
incl %r13d
cmpl $0x64, %r13d
jne 0x7396
jmp 0x7456
leaq 0xe(%rsp), %rsi
movb $-0x5b, (%rsi)
movb %bpl, 0x1(%rsi)
movl (%r14), %edi
movl $0x2, %edx
callq 0x20b0
cmpq $0x2, %rax
jne 0x7456
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 0x7456
testb $0x1, 0xe(%rsp)
je 0x7447
movups 0x3436(%rip), %xmm0     # 0xa860
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x2120
testl %eax, %eax
jne 0x742f
incl %ebp
cmpl $0x64, %ebp
jne 0x7407
jmp 0x7451
movl $0x1, %ebx
cmpl $0x64, %ebp
jne 0x7456
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
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_O3/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 0x762d
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 0x762d
movzbl 0xe(%rsp), %eax
testb $0x1, %al
je 0x7622
movups 0x325d(%rip), %xmm0     # 0xa860
movaps %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r15, %rsi
callq 0x2120
testl %eax, %eax
jne 0x7608
incl %r12d
cmpl $0x64, %r12d
jne 0x75df
jmp 0x762d
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_O3/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:
movb $0x1, %al
xorl %esi, %esi
movq 0x8(%rdi,%rsi,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 0x779a
sarq $0x8, %rcx
incl %esi
cmpl $0x4, %esi
jne 0x7790
movl $0x1, %esi
testb $0x1, %al
movl $0x0, %eax
jne 0x7787
movzbl %cl, %ecx
xorl %eax, %eax
cmpl %edx, %ecx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7354
cmpl $-0x1, %eax
je 0x785b
movb $0x1, %bpl
xorl %eax, %eax
movq 0x8(%rbx,%rax,8), %r14
movl $0x4, %r15d
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0x7354
sarq $0x8, %r14
decl %r15d
jne 0x782f
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x7824
movl $0x1, %eax
jmp 0x785d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x72c0
xorl %ebp, %ebp
testl %eax, %eax
je 0x78f2
movq %rbx, %rdi
movl $0xcc, %esi
callq 0x7354
cmpl $-0x1, %eax
je 0x78f2
movl 0x3c(%rbx), %eax
addl $-0x9, %eax
movl $0x3a, %ecx
cmpl $0x2, %eax
ja 0x78bf
movl %eax, %edx
shlb $0x5, %dl
orb $0x1f, %dl
movl %eax, %eax
leaq 0x2fe0(%rip), %rcx      # 0xa898
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 0x7354
cmpl $-0x1, %eax
cmovel %r14d, %ebp
incq %r15
cmpq $0x4, %r15
jne 0x78d4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7467
movl %eax, (%rsp,%r14,4)
testl %eax, %eax
cmovsl %ebp, %r15d
incq %r14
cmpq $0x5, %r14
jne 0x791b
xorl %ebp, %ebp
testl %r15d, %r15d
jne 0x79ee
movl 0x4(%rsp), %eax
movl 0x10(%rsp), %ecx
shll $0x8, %eax
orl (%rsp), %eax
shrl $0x5, %ecx
andl $0x3, %ecx
leaq 0x2f2c(%rip), %rdx      # 0xa888
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
sarl $0x3, %eax
movl $0x9, %ecx
movsd 0x2f03(%rip), %xmm0     # 0xa878
jmp 0x79a7
sarl %eax
movl $0xb, %ecx
movsd 0x2efa(%rip), %xmm0     # 0xa880
jmp 0x79a7
movl $0xc, %ecx
movsd 0x2edb(%rip), %xmm0     # 0xa870
jmp 0x79a7
sarl $0x2, %eax
movl $0xa, %ecx
movsd 0x2701(%rip), %xmm0     # 0xa0a8
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x24(%rbx)
xorl %ebp, %ebp
movss 0x2633(%rip), %xmm1     # 0x9ff8
ucomiss %xmm0, %xmm1
jbe 0x79e2
ucomiss 0x262b(%rip), %xmm0     # 0x9ffc
jbe 0x79e2
xorl %ebp, %ebp
cmpl %ecx, 0x3c(%rbx)
setne %bpl
incl %ebp
movb $0x1, 0x2e(%rbx)
leaq 0x6a8b(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x79fb
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x38c0
jmp 0x79ee
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x82dd
leaq 0x2654(%rip), %rdx      # 0xa8f4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $-0xb, 0xe(%rsp)
jmp 0x82be
movb 0x3c(%rdi), %al
movb %al, 0xe(%rsp)
jmp 0x82be
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 0x82c3
// File: /workspace/github_c_makefile_star2_O3/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 0x8351
leaq 0x2603(%rip), %rdx      # 0xa910
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $-0xd, 0xe(%rsp)
jmp 0x8332
movb $-0xb, 0xe(%rsp)
jmp 0x8332
movb 0x3c(%rdi), %al
movb %al, 0xe(%rsp)
jmp 0x8332
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 0x8337
// File: /workspace/github_c_makefile_star2_O3/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 0x8416
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 0x8420
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 0x83d1
movl %eax, %r9d
andl %r8d, %r9d
xorl %r9d, %esi
shrl %edi
shrl %r8d
shrl %eax
cmpl $0x80, %edi
jne 0x83c4
movl $0x2, %eax
cmpl %edx, %esi
jne 0x8420
cvtsi2sd %ecx, %xmm0
mulsd 0x2563(%rip), %xmm0     # 0xa958
mulsd 0x2563(%rip), %xmm0     # 0xa960
addsd 0x2563(%rip), %xmm0     # 0xa968
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rbx)
movb 0x2c(%rbx), %al
movb %al, 0x2e(%rbx)
jmp 0x841e
movq %rbx, %rdi
callq 0x8426
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8832
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 0x8832
movl (%r14), %edi
leaq 0xe(%rsp), %rsi
movl $0x1, %edx
callq 0x20b0
cmpq $0x1, %rax
jne 0x8832
movl (%r14), %edi
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
callq 0x2180
cmpq $0x1, %rax
jne 0x8832
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_O3/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 0x957(%rip), %rdi       # 0x93d8
movl $0x2, %esi
xorl %eax, %eax
callq 0x2230
movl %eax, (%r14)
testl %eax, %eax
js 0x8ad2
movzbl %bl, %ebp
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x8ad9
movq %r14, %rdi
callq 0x8b04
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jg 0x8ae3
leaq 0x59af(%rip), %rax      # 0xe474
cmpl $0x0, (%rax)
jg 0x8ae8
movb %bl, 0x4(%r14)
xorl %eax, %eax
jmp 0x8ae3
callq 0x3afc
jmp 0x8ade
callq 0x3ad0
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5509(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x20a5(%rip), %rsi      # 0xab9e
movl %ebp, %edx
xorl %eax, %eax
callq 0x21c0
jmp 0x8aca
// File: /workspace/github_c_makefile_star2_O3/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 0x8cb6
movups 0x1f2b(%rip), %xmm0     # 0xabc8
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
jne 0x8ca3
xorl %eax, %eax
jmp 0x8cbb
movl $0x3, %eax
addq $0x10, %rsp
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x18ce(%rip), %rbx      # 0x4004
xorl %esi, %esi
leal 0x1(%rsi), %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2140
movl $0x1, %edi
callq 0x24b0
movl %ebp, %esi
jmp 0x2738
nop