LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_set
bool cache_set(struct cache *c, const char *key, void *value)
{
	pthread_rwlock_wrlock(&c->lock);
	struct entry *e = entry_for_key(c, key);

	if (e->in_use == IN_USE)
		free(e->key);

	e->in_use = IN_USE;

	e->key = strdup(key);
	e->value = value;

	pthread_rwlock_unlock(&c->lock);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x3070
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3170
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x15778
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x20(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x31d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x31b0
movb $0x1, %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_del
bool cache_del(struct cache *c, const char *key)
{
	pthread_rwlock_wrlock(&c->lock);
	struct entry *e = entry_for_key(c, key);

	if (e->in_use == IN_USE && strcmp(e->key, key) == 0) {
		free(e->key);
		e->key = NULL;
		e->value = NULL;
		e->in_use = NEVER;
		pthread_rwlock_unlock(&c->lock);
		return true;
	}

	pthread_rwlock_unlock(&c->lock);
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x3070
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3170
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x1584e
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3130
cmpl $0x0, %eax
jne 0x1584e
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x3030
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x31b0
movb $0x1, -0x1(%rbp)
jmp 0x1585f
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x31b0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doReload
static int doReload(int argc, char *argv[])
{
	int dev = 0;
	u8 bType = 0;
	UNUSED(argv);

	if (argc != 2)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	return writeReg8(dev, I2C_WDT_RELOAD_ADD, WDT_RELOAD_KEY);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x1dc7
leaq 0x36d3(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1df9
movl $0x30, %edi
leaq -0x15(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x1de7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1df9
movl -0x14(%rbp), %edi
xorl %esi, %esi
movl $0xca, %edx
callq 0x33f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doDefault
static int doDefault(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (WDT_DEFAULT_PERIOD_MIN <= val) && (val <= WDT_DEFAULT_PERIOD_MAX))
	{
		return writeReg16(dev, I2C_WDT_INIT_INTERVAL_SET_ADD, val);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x1e4e
leaq 0x364c(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ead
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x1e6e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ead
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
movl $0xb, %eax
cmpl -0x18(%rbp), %eax
jg 0x1ea6
cmpl $0xfde7, -0x18(%rbp)    # imm = 0xFDE7
jg 0x1ea6
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
movl $0x5, %esi
callq 0x3460
movl %eax, -0x4(%rbp)
jmp 0x1ead
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doPeriod
static int doPeriod(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (0 < val) && (val <= WDT_PERIOD_MAX))
	{
		return writeReg16(dev, I2C_WDT_INTERVAL_SET_ADD, val);
	}
	else if (val == 0)
	{
		return writeReg16(dev, I2C_WDT_INTERVAL_SET_ADD, WDT_DISABLE_PERIOD);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x1efe
leaq 0x359c(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f79
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x1f1e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f79
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jge 0x1f53
cmpl $0xffff, -0x18(%rbp)    # imm = 0xFFFF
jg 0x1f53
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
movl $0x1, %esi
callq 0x3460
movl %eax, -0x4(%rbp)
jmp 0x1f79
cmpl $0x0, -0x18(%rbp)
jne 0x1f70
movl -0x14(%rbp), %edi
movl $0x1, %esi
movl $0xfde9, %edx           # imm = 0xFDE9
callq 0x3460
movl %eax, -0x4(%rbp)
jmp 0x1f79
jmp 0x1f72
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetOffTime
static int doSetOffTime(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (WDT_MIN_POWER_OFF_INTERVAL < val)
		&& (val < WDT_MAX_POWER_OFF_INTERVAL))
	{
		return writeReg32(dev, I2C_POWER_OFF_INTERVAL_SET_ADD, val);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x1fce
leaq 0x34cc(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x202d
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x1fee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x202d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
movl $0x2, %eax
cmpl -0x18(%rbp), %eax
jge 0x2026
cmpl $0x28de80, -0x18(%rbp)  # imm = 0x28DE80
jge 0x2026
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
movl $0xe, %esi
callq 0x34d0
movl %eax, -0x4(%rbp)
jmp 0x202d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doClear
static int doClear(int argc, char *argv[])
{
	int dev = 0;
	u8 bType = 0;

	UNUSED(argv);

	if (argc != 2)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}

	return writeReg16(dev, I2C_WDT_CLEAR_RESET_COUNT_ADD, WDT_RESET_COUNT_KEY);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x2077
leaq 0x3423(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x20ac
movl $0x30, %edi
leaq -0x15(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2097
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x20ac
movl -0x14(%rbp), %edi
movl $0xb, %esi
movl $0xbe, %edx
callq 0x3460
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetRepowerOnBattery
static int doSetRepowerOnBattery(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 out = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) == 0)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = atoi(argv[2]);

	if (val == 0)
	{
		out = 1;
	}

	return writeReg8(dev, I2C_POWER_OFF_ON_BATTERY_ADD, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x29f5
leaq 0x2aa8(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2a77
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2a15
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2a77
movl -0x14(%rbp), %edi
movl $0x1b, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0xf0, %eax
cmpl $0x0, %eax
jne 0x2a49
leaq 0x2aba(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2a77
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x2a63
movb $0x1, -0x1a(%rbp)
movl -0x14(%rbp), %edi
movzbl -0x1a(%rbp), %edx
movl $0x1c, %esi
callq 0x33f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetPowerButtonEnable
static int doSetPowerButtonEnable(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 out = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = atoi(argv[2]);

	if (val > 0)
	{
		out = 1;
	}

	return writeReg8(dev, I2C_POWER_SW_USAGE_ADD, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x2ac5
leaq 0x29d8(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b47
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2ae5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b47
movl -0x14(%rbp), %edi
movl $0x1b, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0xf0, %eax
cmpl $0x10, %eax
jg 0x2b19
leaq 0x29ea(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b47
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x2b33
movb $0x1, -0x1a(%rbp)
movl -0x14(%rbp), %edi
movzbl -0x1a(%rbp), %edx
movl $0x1d, %esi
callq 0x33f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetButtonInt
static int doSetButtonInt(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	uint8_t buff[8];

	if (argc != 3)
	{
		printf("Invalid number of arguments usage: wdt -bint <0/1>\n");
		return FAIL;
	}
	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = readReg8(dev, I2C_MEM_REVISION_MAJOR_ADD);
	{
		if (val < 3)
		{
			printf("Not available on this firmware version!\n");
			return FAIL;
		}
	}
	val = atoi(argv[2]);
	if (val < 0 || val > 1)
	{
		printf("Invalid argument value usage: wdt -bint <0/1>\n");
		return FAIL;
	}
	buff[0] = (uint8_t)val;
	return writeBuff(dev, I2C_POWER_SW_INT_OUT, buff, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x2d61
leaq 0x2927(%rip), %rdi      # 0x5675
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e37
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2d84
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e37
movl -0x14(%rbp), %edi
movl $0x1b, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0xf0, %eax
cmpl $0x10, %eax
jg 0x2db8
leaq 0x274b(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e37
movl -0x14(%rbp), %edi
movl $0x2e, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x2de5
leaq 0x271e(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e37
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x2e01
cmpl $0x1, -0x18(%rbp)
jle 0x2e18
leaq 0x28a1(%rip), %rdi      # 0x56a9
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e37
movl -0x18(%rbp), %eax
movb %al, -0x21(%rbp)
movl -0x14(%rbp), %edi
leaq -0x21(%rbp), %rdx
movl $0x30, %esi
movl $0x1, %ecx
callq 0x36f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doBlockCharge
static int doBlockCharge(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	uint8_t buff[8];

	if (argc != 3)
	{
		printf("Invalid number of arguments usage: wdt -bc <0/1>\n");
		return FAIL;
	}
	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = readReg8(dev, I2C_MEM_REVISION_MAJOR_ADD);
	{
		if (val < 3)
		{
			printf("Not available on this firmware version!\n");
			return FAIL;
		}
	}
	val = atoi(argv[2]);
	if (val < 0 || val > 1)
	{
		printf("Invalid argument value usage: wdt -bc <0/1>\n");
		return FAIL;
	}
	buff[0] = (uint8_t)val;
	return writeBuff(dev, I2C_STOP_CHARGE, buff, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x2e81
leaq 0x286a(%rip), %rdi      # 0x56d8
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f57
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2ea4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f57
movl -0x14(%rbp), %edi
movl $0x1b, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0xf0, %eax
cmpl $0x10, %eax
jg 0x2ed8
leaq 0x262b(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f57
movl -0x14(%rbp), %edi
movl $0x2e, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x2f05
leaq 0x25fe(%rip), %rdi      # 0x54f3
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f57
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x2f21
cmpl $0x1, -0x18(%rbp)
jle 0x2f38
leaq 0x27e2(%rip), %rdi      # 0x570a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f57
movl -0x18(%rbp), %eax
movb %al, -0x21(%rbp)
movl -0x14(%rbp), %edi
leaq -0x21(%rbp), %rdx
movl $0x31, %esi
movl $0x1, %ecx
callq 0x36f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doUndervoltage
static int doUndervoltage(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (500 < val) && (val <= 4000))
	{
		return writeReg16(dev, I2C_BATTERY_UVLO, val);
	}
	printf("Battery under voltage threshold must be from 500mV to 4V\n"); 
	
	return FAIL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x2f9e
leaq 0x24fc(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x300b
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x2fbe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x300b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
movl $0x1f4, %eax            # imm = 0x1F4
cmpl -0x18(%rbp), %eax
jge 0x2ff6
cmpl $0xfa0, -0x18(%rbp)     # imm = 0xFA0
jg 0x2ff6
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
movl $0x36, %esi
callq 0x3460
movl %eax, -0x4(%rbp)
jmp 0x300b
leaq 0x273a(%rip), %rdi      # 0x5737
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doChemSel
static int doChemSel(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 buff[2];

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	
	val = readBuff(dev, I2C_MULTI_CHEM_CARD, buff, 1);
	if (OK == val)
	{
		if (buff[0] < 1)
		{
			printf("Available for Multichemestry card only!\n");
			return FAIL;
		}
			
		val = atoi(argv[2]);
		if ( (val >= 0) && (val < 8))
		{
			return writeReg8(dev, I2C_SEL_CHEMESTRY, val);
		}
		printf("Chemestry type available from 0 to 7 including\n");
	}
	
	return FAIL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x3061
leaq 0x243c(%rip), %rdi      # 0x548a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x310a
movl $0x30, %edi
leaq -0x19(%rbp), %rsi
callq 0x31b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x3084
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x310a
movl -0x14(%rbp), %edi
leaq -0x1b(%rbp), %rdx
movl $0x32, %esi
movl $0x1, %ecx
callq 0x3640
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jne 0x3103
movzbl -0x1b(%rbp), %eax
cmpl $0x1, %eax
jge 0x30c4
leaq 0x26bd(%rip), %rdi      # 0x5771
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x310a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x30f5
cmpl $0x8, -0x18(%rbp)
jge 0x30f5
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
movl $0x33, %esi
callq 0x33f0
movl %eax, -0x4(%rbp)
jmp 0x310a
leaq 0x269e(%rip), %rdi      # 0x579a
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: i2cSetup
int i2cSetup(int addr)
{
	int file;
	char filename[40];

	sprintf(filename, "/dev/i2c-1");

	if ( (file = open(filename, O_RDWR)) < 0)
	{
		printf("Failed to open the bus.");
		return FAIL;
	}
	if (ioctl(file, I2C_SLAVE, addr) < 0)
	{
		printf("Failed to acquire bus access and/or talk to slave.\n");
		return FAIL;
	}

	return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
leaq -0x40(%rbp), %rdi
leaq 0x2694(%rip), %rsi      # 0x57ca
movb $0x0, %al
callq 0x10b0
leaq -0x40(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x1090
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jge 0x316c
leaq 0x2679(%rip), %rdi      # 0x57d5
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31a0
movl -0xc(%rbp), %edi
movl -0x8(%rbp), %edx
movl $0x703, %esi            # imm = 0x703
movb $0x0, %al
callq 0x1060
cmpl $0x0, %eax
jge 0x319a
leaq 0x2663(%rip), %rdi      # 0x57ed
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31a0
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: doBoardInit
int doBoardInit(int hwAdd, u8 *bType)
{
	int dev, bV = -1;

	dev = i2cSetup(hwAdd);
	if (dev == FAIL)
	{
		return dev;
	}
	bV = readReg8(dev, I2C_WDT_RELOAD_ADD);
	if (bV == FAIL)
	{
		return bV;
	}
	*bType = bV;
	return dev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %edi
callq 0x3120
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x31df
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x320b
movl -0x14(%rbp), %edi
xorl %esi, %esi
callq 0x3220
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
jne 0x31fa
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x320b
movl -0x18(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg8
int readReg8(int dev, int add)
{

	int ret;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 1) != 1)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	ret = 0xff & buf[0];
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x1040
cmpq $0x1, %rax
je 0x3267
leaq 0x25ca(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x32a7
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x1070
cmpq $0x1, %rax
je 0x3295
leaq 0x25b4(%rip), %rdi      # 0x5839
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x32a7
movsbl -0x1a(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg16
int readReg16(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 2) != 2)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 2);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x1040
cmpq $0x1, %rax
je 0x32fe
leaq 0x2533(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x333a
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x2, %edx
callq 0x1070
cmpq $0x2, %rax
je 0x332c
leaq 0x251d(%rip), %rdi      # 0x5839
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x333a
movw -0x1a(%rbp), %ax
movw %ax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg32
int readReg32(int dev, int add)
{
	uint32_t ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 4) != 4)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 4);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x1040
cmpq $0x1, %rax
je 0x339e
leaq 0x2493(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33d8
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x4, %edx
callq 0x1070
cmpq $0x4, %rax
je 0x33cc
leaq 0x247d(%rip), %rdi      # 0x5839
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33d8
movl -0x1a(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg8
int writeReg8(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	buf[1] = 0xff & val;

	if (write(dev, buf, 2) < 0)
	{
		printf("Fail to w8\n");
		return -1;
	}
	return OK;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x10(%rbp), %eax
andl $0xff, %eax
movb %al, -0x19(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x2, %edx
callq 0x1040
cmpq $0x0, %rax
jge 0x3445
leaq 0x2416(%rip), %rdi      # 0x584b
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x344c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg16
int writeReg16(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 2);

	if (write(dev, buf, 3) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movw -0x10(%rbp), %ax
movw %ax, -0x19(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x3, %edx
callq 0x1040
cmpq $0x0, %rax
jge 0x34b2
leaq 0x23b5(%rip), %rdi      # 0x5857
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x34b9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg32
int writeReg32(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 4);

	if (write(dev, buf, 5) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x19(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x5, %edx
callq 0x1040
cmpq $0x0, %rax
jge 0x3520
leaq 0x2347(%rip), %rdi      # 0x5857
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3527
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg24
int readReg24(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, buf, 3) != 2)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	memcpy(&ret, buf, 3);

#ifdef DEBUG_I	
	printbits(ret);
	printf("\n");
	printf("%#08x\n", ret);
#endif
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x1, %edx
callq 0x1040
cmpq $0x1, %rax
je 0x357e
leaq 0x22b3(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x35c0
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x3, %edx
callq 0x1070
cmpq $0x2, %rax
je 0x35ac
leaq 0x229d(%rip), %rdi      # 0x5839
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x35c0
movw -0x1a(%rbp), %ax
movw %ax, -0x10(%rbp)
movb -0x18(%rbp), %al
movb %al, -0xe(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg24
int writeReg24(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 3);

	if (write(dev, buf, 4) < 0)
	{
		printf("Fail to w24\n");
		return FAIL;
	}
	return OK;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1a(%rbp)
movw -0x10(%rbp), %ax
movw %ax, -0x19(%rbp)
movb -0xe(%rbp), %al
movb %al, -0x17(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1a(%rbp), %rsi
movl $0x4, %edx
callq 0x1040
cmpq $0x0, %rax
jge 0x3628
leaq 0x224c(%rip), %rdi      # 0x5864
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x362f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readBuff
int readBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[2];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, data, len) < 1)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x3663
cmpl $0x20, -0x1c(%rbp)
jle 0x366c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x36d9
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x1e(%rbp)
movl -0x8(%rbp), %edi
leaq -0x1e(%rbp), %rsi
movl $0x1, %edx
callq 0x1040
cmpq $0x1, %rax
je 0x36a5
leaq 0x218c(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x36d9
movl -0x8(%rbp), %edi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x1070
cmpq $0x1, %rax
jge 0x36d2
leaq 0x2177(%rip), %rdi      # 0x5839
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x36d9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeBuff
int writeBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[I2C_MAX_BUFFER_SIZE];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE -1)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;
	memcpy( buf + 1, data, len);

	if (write(dev, buf, len + 1) < 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x3713
cmpl $0x1f, -0x1c(%rbp)
jle 0x371c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3775
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x1080
movl -0x8(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x1040
cmpq $0x1, %rax
jge 0x376e
leaq 0x20c3(%rip), %rdi      # 0x5821
movb $0x0, %al
callq 0x1050
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3775
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/fm4dd[P]learn-ssl/certsignature.c
// Function: X509_signature_dump
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) {
  const unsigned char *s;
  int i, n;

  n=sig->length;
  s=sig->data;
  for (i=0; i<n; i++) {
    if ((i%18) == 0) {
      if (BIO_write(bp,"\n",1) <= 0) return 0;
      if (BIO_indent(bp, indent, indent) <= 0) return 0;
    }
    if (BIO_printf(bp,"%02x%s",s[i],
      ((i+1) == n)?"":":") <= 0) return 0;
  }

  if (BIO_write(bp,"\n",1) != 1) return 0;

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x14be
movl -0x2c(%rbp), %eax
movl $0x12, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1463
movq -0x10(%rbp), %rdi
leaq 0xc7d(%rip), %rsi       # 0x20a3
movl $0x1, %edx
callq 0x1090
cmpl $0x0, %eax
jg 0x1441
movl $0x0, -0x4(%rbp)
jmp 0x14e8
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x10f0
cmpl $0x0, %eax
jg 0x1461
movl $0x0, -0x4(%rbp)
jmp 0x14e8
jmp 0x1463
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movl -0x2c(%rbp), %esi
addl $0x1, %esi
movl -0x30(%rbp), %r8d
leaq 0xc2f(%rip), %rcx       # 0x20b3
leaq 0xc19(%rip), %rax       # 0x20a4
cmpl %r8d, %esi
cmoveq %rax, %rcx
leaq 0xc3f(%rip), %rsi       # 0x20d8
movb $0x0, %al
callq 0x1100
cmpl $0x0, %eax
jg 0x14ae
movl $0x0, -0x4(%rbp)
jmp 0x14e8
jmp 0x14b0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13ff
movq -0x10(%rbp), %rdi
leaq 0xbda(%rip), %rsi       # 0x20a3
movl $0x1, %edx
callq 0x1090
cmpl $0x1, %eax
je 0x14e1
movl $0x0, -0x4(%rbp)
jmp 0x14e8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: push_document
static int push_document(lua_State *L)
{
    const GumboDocument *document = lua_touserdata(L, 1);
    lua_createtable(L, 0, 4);
    if (document->has_doctype) {
        set_integer(L, "quirksModeEnum", document->doc_type_quirks_mode);
        set_children(L, &document->children, 2);
        lua_getfield(L, -1, "childNodes");
        lua_createtable(L, 0, 3); // doctype
        set_string(L, "name", document->name);
        set_string(L, "publicId", document->public_identifier);
        set_string(L, "systemId", document->system_identifier);
        setmetatable(L, DocumentType);
        lua_rawseti(L, -2, 1); // childNodes[1] = doctype
        lua_pop(L, 1);
    } else {
        set_children(L, &document->children, 1);
    }
    setmetatable(L, Document);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4060
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x40a0
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x46e1
movq -0x8(%rbp), %rdi
leaq 0x2aa9f(%rip), %rsi     # 0x2f066
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, %esi
callq 0x4130
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x4710
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x2aa67(%rip), %rdx     # 0x2f075
callq 0x4270
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x40a0
movq -0x8(%rbp), %rdi
leaq 0x2aeaf(%rip), %rsi     # 0x2f4dd
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x2aa23(%rip), %rsi     # 0x2f080
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x2a9fd(%rip), %rsi     # 0x2f089
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0x47e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x4190
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4040
jmp 0x46f3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x4710
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x47e0
movl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_children
static void
set_children(lua_State *L, const GumboVector *vec, unsigned int start)
{
    const unsigned int length = vec->length;
    lua_createtable(L, length, 0);
    setmetatable(L, NodeList);
    for (unsigned int i = 0; i < length; i++) {
        push_node(L, (const GumboNode *)vec->data[i]);
        set_value(L, "parentNode", -3); // child.parentNode = parent
        lua_rawseti(L, -2, i + start); // parent.childNodes[i+start] = child
    }
    lua_setfield(L, -2, "childNodes");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
xorl %edx, %edx
callq 0x40a0
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x47e0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x47be
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x4820
movq -0x8(%rbp), %rdi
leaq 0x2a918(%rip), %rsi     # 0x2f092
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x4160
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4190
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4750
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x2a8a7(%rip), %rdx     # 0x2f075
callq 0x4110
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_tag
static void set_tag(lua_State *L, const GumboElement *element)
{
    if (element->tag_namespace == GUMBO_NAMESPACE_SVG) {
        set_literal(L, "namespace", "svg");
        GumboStringPiece original_tag = element->original_tag;
        gumbo_tag_from_original_text(&original_tag);
        const char *normalized = gumbo_normalize_svg_tagname(&original_tag);
        if (normalized) {
            set_string(L, "localName", normalized);
            return;
        }
    } else if (element->tag_namespace == GUMBO_NAMESPACE_MATHML) {
        set_literal(L, "namespace", "math");
    }
    if (element->tag == GUMBO_TAG_UNKNOWN) {
        GumboStringPiece original_tag = element->original_tag;
        gumbo_tag_from_original_text(&original_tag);
        pushstring_lower(L, original_tag.data, original_tag.length);
    } else {
        lua_pushstring(L, gumbo_normalized_tagname(element->tag));
    }
    lua_setfield(L, -2, "localName");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x14(%rax)
jne 0x4bcf
movq -0x8(%rbp), %rdi
leaq 0x2a5cc(%rip), %rsi     # 0x2f115
callq 0x4260
movq -0x8(%rbp), %rdi
leaq 0x302f9(%rip), %rsi     # 0x34e52
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x6000
leaq -0x20(%rbp), %rdi
callq 0x6df0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4bcd
movq -0x8(%rbp), %rdi
leaq 0x2a523(%rip), %rsi     # 0x2f0cb
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
jmp 0x4c7b
jmp 0x4c09
movq -0x10(%rbp), %rax
cmpl $0x2, 0x14(%rax)
jne 0x4c07
movq -0x8(%rbp), %rdi
leaq 0x2a531(%rip), %rsi     # 0x2f115
callq 0x4260
movq -0x8(%rbp), %rdi
leaq 0x2a444(%rip), %rsi     # 0x2f038
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
jmp 0x4c09
movq -0x10(%rbp), %rax
cmpl $0x96, 0x10(%rax)
jne 0x4c46
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6000
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4fa0
jmp 0x4c66
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x5f80
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x2a455(%rip), %rdx     # 0x2f0cb
callq 0x4110
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_sourcepos
static void set_sourcepos(lua_State *L, const GumboSourcePosition pos)
{
    if (pos.line != 0) {
        set_integer(L, "line", pos.line);
        set_integer(L, "column", pos.column);
        set_integer(L, "offset", pos.offset);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq %rdi, -0x8(%rbp)
cmpq $0x0, (%rax)
je 0x4d3a
movq -0x8(%rbp), %rdi
leaq 0x2a466(%rip), %rsi     # 0x2f11f
callq 0x4260
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movq (%rax), %rsi
callq 0x4130
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x2a43d(%rip), %rsi     # 0x2f124
callq 0x4260
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x4130
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
leaq 0x6926b(%rip), %rsi     # 0x6df81
callq 0x4260
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x10(%rax), %rsi
callq 0x4130
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: create_text_node
static void create_text_node(lua_State *L, const GumboText *t, Upvalue i)
{
    lua_createtable(L, 0, 5);
    set_string(L, "data", t->text);
    set_sourcepos(L, t->start_pos);
    setmetatable(L, i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x40a0
movq -0x8(%rbp), %rdi
leaq 0x31831(%rip), %rsi     # 0x3676f
callq 0x4260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x4260
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4c90
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x47e0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: pushstring_lower
static void pushstring_lower(lua_State *L, const char *s, size_t len)
{
    luaL_Buffer b;
#if LUA_VERSION_NUM >= 502
    char *lower = luaL_buffinitsize(L, &b, len);
    for (size_t i = 0; i < len; i++) {
        const char c = s[i];
        lower[i] = ascii_tolower(c);
    }
    luaL_addsize(&b, len);
    luaL_pushresult(&b);
#else
    luaL_buffinit(L, &b);
    for (size_t i = 0; i < len; i++) {
        const char c = s[i];
        luaL_addchar(&b, ascii_tolower(c));
    }
    luaL_pushresult(&b);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2050, %rsp           # imm = 0x2050
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x2038(%rbp), %rsi
callq 0x41e0
movq %rax, -0x2040(%rbp)
movq $0x0, -0x2048(%rbp)
movq -0x2048(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x5031
movq -0x10(%rbp), %rax
movq -0x2048(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x2049(%rbp)
movzbl -0x2049(%rbp), %edi
callq 0x5060
movb %al, %dl
movq -0x2040(%rbp), %rax
movq -0x2048(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x2048(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2048(%rbp)
jmp 0x4fdd
movq -0x18(%rbp), %rax
addq -0x2028(%rbp), %rax
movq %rax, -0x2028(%rbp)
leaq -0x2038(%rbp), %rdi
callq 0x40e0
addq $0x2050, %rsp           # imm = 0x2050
popq %rbp
retq
nopl (%rax,%rax)