#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int integer_solve_quadratic(int, int, int, long *, long *);
void integer_solve_quadratic_test(void) {
  long x1 = 0;
  long x2 = 0;
  assert(!integer_solve_quadratic(2, 0, 7, &x1, &x2));
  assert(!integer_solve_quadratic(2, 0, 8, &x1, &x2));
  assert(integer_solve_quadratic(2, 0, -8, &x1, &x2));
  assert(x1 == -2);
  assert(x2 == 2);
  assert(!integer_solve_quadratic(2, 5, -2, &x1, &x2));
  assert(integer_solve_quadratic(1, -6, 5, &x1, &x2));
  assert(x1 == 1);
  assert(x2 == 5);
}


x86 assembly (clang, -O0):
<integer_solve_quadratic_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x7,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <integer_solve_quadratic@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x8,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <integer_solve_quadratic@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xfffffff8,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <integer_solve_quadratic@plt>
mov    %eax,%edi
call   1030 <assert@plt>
cmpq   $0xfffffffffffffffe,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x2,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
mov    $0x5,%esi
mov    $0xfffffffe,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <integer_solve_quadratic@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0xfffffffa,%esi
mov    $0x5,%edx
lea    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <integer_solve_quadratic@plt>
mov    %eax,%edi
call   1030 <assert@plt>
cmpq   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x5,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_solve_quadratic_test>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x7,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <integer_solve_quadratic@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <integer_solve_quadratic@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xfffffff8,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <integer_solve_quadratic@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffffe,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x2,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
mov    $0x5,%esi
mov    $0xfffffffe,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <integer_solve_quadratic@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0xfffffffa,%esi
mov    $0x5,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <integer_solve_quadratic@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x1,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x5,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @integer_solve_quadratic_test() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
%3 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 7, i64* %1, i64* %2)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 8, i64* %1, i64* %2)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 -8, i64* %1, i64* %2)
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %1
%16 = icmp eq i64 %15, -2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i64, i64* %2
%20 = icmp eq i64 %19, 2
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @integer_solve_quadratic(i32 2, i32 5, i32 -2, i64* %1, i64* %2)
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i32 @integer_solve_quadratic(i32 1, i32 -6, i32 5, i64* %1, i64* %2)
%29 = call i32 @assert(i32 %28)
%30 = load i64, i64* %1
%31 = icmp eq i64 %30, 1
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i64, i64* %2
%35 = icmp eq i64 %34, 5
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
ret void
}

LLVM IR (-O2):
define void @integer_solve_quadratic_test() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 7, i64* %1, i64* %2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 8, i64* %1, i64* %2)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @integer_solve_quadratic(i32 2, i32 0, i32 -8, i64* %1, i64* %2)
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %1
%16 = icmp eq i64 %15, -2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i64, i64* %2
%20 = icmp eq i64 %19, 2
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @integer_solve_quadratic(i32 2, i32 5, i32 -2, i64* %1, i64* %2)
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i32 @integer_solve_quadratic(i32 1, i32 -6, i32 5, i64* %1, i64* %2)
%28 = call i32 @assert(i32 %27)
%29 = load i64, i64* %1
%30 = icmp eq i64 %29, 1
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load i64, i64* %2
%34 = icmp eq i64 %33, 5
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
ret void
}