#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 euclid_pythagorean_triple(int, int, long *, long *, long *);
void euclid_pythagorean_triple_test(void) {
  long a = 0;
  long b = 0;
  long c = 0;
  assert(!euclid_pythagorean_triple(9, 6, &a, &b, &c));
  assert(!euclid_pythagorean_triple(9, 7, &a, &b, &c));
  assert(euclid_pythagorean_triple(2, 1, &a, &b, &c));
  assert(a == 3);
  assert(b == 4);
  assert(c == 5);
}


x86 assembly (clang, -O0):
<euclid_pythagorean_triple_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x9,%edi
mov    $0x6,%esi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <euclid_pythagorean_triple@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x9,%edi
mov    $0x7,%esi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <euclid_pythagorean_triple@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <euclid_pythagorean_triple@plt>
mov    %eax,%edi
call   1040 <assert@plt>
cmpq   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x4,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x5,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_pythagorean_triple_test>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x18(%rsp),%rbx
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%r15
mov    $0x9,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <euclid_pythagorean_triple@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x9,%edi
mov    $0x7,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <euclid_pythagorean_triple@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <euclid_pythagorean_triple@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x3,0x18(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x4,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x5,0x8(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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