#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 /*<<< orphan*/ get_aux_carry_flag();
int /*<<< orphan*/ get_carry_flag();
scalar_t__ get_parity_flag();
int /*<<< orphan*/ get_sign_flag();
int /*<<< orphan*/ get_zero_flag();
void generic_asserts_cmp() {
  assert(!get_zero_flag() && "generic_asserts_cmp failed");
  assert(!get_sign_flag() && "generic_asserts_cmp failed");
  assert(get_parity_flag() && "generic_asserts_cmp failed");
  assert(!get_carry_flag() && "generic_asserts_cmp failed");
  assert(!get_aux_carry_flag() && "generic_asserts_cmp failed");
}


x86 assembly (clang, -O0):
<generic_asserts_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_zero_flag@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    1189 <generic_asserts_cmp+0x29>
mov    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1189 <generic_asserts_cmp+0x29>
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1060 <get_sign_flag@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    11b7 <generic_asserts_cmp+0x57>
mov    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    11b7 <generic_asserts_cmp+0x57>
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1080 <get_parity_flag@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x3(%rbp)
je     11e7 <generic_asserts_cmp+0x87>
mov    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    11e7 <generic_asserts_cmp+0x87>
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1070 <get_carry_flag@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4(%rbp)
jne    1215 <generic_asserts_cmp+0xb5>
mov    $0x1,%al
mov    %al,-0x4(%rbp)
jmp    1215 <generic_asserts_cmp+0xb5>
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1040 <get_aux_carry_flag@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1243 <generic_asserts_cmp+0xe3>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1243 <generic_asserts_cmp+0xe3>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_asserts_cmp>:
push   %rax
xor    %eax,%eax
call   1030 <get_zero_flag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1060 <get_sign_flag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1080 <get_parity_flag@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1070 <get_carry_flag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1040 <get_aux_carry_flag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"generic_asserts_cmp failed\00"
define void @generic_asserts_cmp() {
%1 = call i32 (...) @get_zero_flag()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %4
4: ; preds = %3, %0
%5 = phi i1 [ false, %0 ], [ true, %3 ]
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 (...) @get_sign_flag()
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %4
br label %11
11: ; preds = %10, %4
%12 = phi i1 [ false, %4 ], [ true, %10 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i64 (...) @get_parity_flag()
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
br label %18
18: ; preds = %17, %11
%19 = phi i1 [ false, %11 ], [ true, %17 ]
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 (...) @get_carry_flag()
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %18
br label %25
25: ; preds = %24, %18
%26 = phi i1 [ false, %18 ], [ true, %24 ]
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 (...) @get_aux_carry_flag()
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %25
br label %32
32: ; preds = %31, %25
%33 = phi i1 [ false, %25 ], [ true, %31 ]
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret void
}

LLVM IR (-O2):
define void @generic_asserts_cmp() {
%1 = tail call i32 (...) @get_zero_flag()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @get_sign_flag()
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 (...) @get_parity_flag()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 (...) @get_carry_flag()
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 (...) @get_aux_carry_flag()
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
ret void
}