// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_rnd_1
subtilis_exp_t *subtilis_builtins_ir_rnd_1(subtilis_parser_t *p,
					   subtilis_error_t *err)
{
	subtilis_exp_t *e;
	subtilis_exp_t *e_dup = NULL;
	subtilis_exp_t *top_bit = NULL;

	e = subtilis_builtins_ir_basic_rnd(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e_dup = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_var_assign_hidden(p, subtilis_rnd_hidden_var,
				   &subtilis_type_integer, e_dup, err);
	e_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_and(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_divr(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_exp_handle_errors(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return e;

cleanup:

	subtilis_exp_delete(top_bit);
	subtilis_exp_delete(e_dup);
	subtilis_exp_delete(e);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x40390
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4061f
jmp 0x4072d
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x47d20
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4063e
jmp 0x4072d
movq -0x10(%rbp), %rdi
leaq 0x941e7(%rip), %rax     # 0xd4830
movq (%rax), %rsi
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %r8
leaq 0x6b275(%rip), %rdx     # 0xab8d0
callq 0x47150
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x40676
jmp 0x4072d
movq -0x18(%rbp), %rsi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
callq 0x37800
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x40696
jmp 0x4072d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x49090
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x406c2
jmp 0x4072d
movq -0x18(%rbp), %rsi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
callq 0x37800
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x406df
jmp 0x4072d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x494b0
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4070b
jmp 0x4072d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x36ce0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x40723
jmp 0x4072d
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x40750
movq -0x30(%rbp), %rdi
callq 0x36ee0
movq -0x28(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)