#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);
scalar_t__ is_aux_carry_flag_set();
int /*<<< orphan*/ is_carry_flag_set();
int /*<<< orphan*/ is_parity_flag_set();
int /*<<< orphan*/ is_sign_flag_set();
int /*<<< orphan*/ is_zero_flag_set();
void generic_asserts_with_carry() {
  assert(!is_zero_flag_set() && "generic_asserts_with_carry failed!");
  assert(!is_sign_flag_set() && "generic_asserts_with_carry failed!");
  assert(!is_parity_flag_set() && "generic_asserts_with_carry failed!");
  assert(!is_carry_flag_set() && "generic_asserts_with_carry failed!");
  assert(is_aux_carry_flag_set() && "generic_asserts_with_carry failed!");
}


x86 assembly (clang, -O0):
<generic_asserts_with_carry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <is_zero_flag_set@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    1189 <generic_asserts_with_carry+0x29>
mov    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1189 <generic_asserts_with_carry+0x29>
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1070 <is_sign_flag_set@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    11b7 <generic_asserts_with_carry+0x57>
mov    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    11b7 <generic_asserts_with_carry+0x57>
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <is_parity_flag_set@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
jne    11e5 <generic_asserts_with_carry+0x85>
mov    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    11e5 <generic_asserts_with_carry+0x85>
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <is_carry_flag_set@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4(%rbp)
jne    1213 <generic_asserts_with_carry+0xb3>
mov    $0x1,%al
mov    %al,-0x4(%rbp)
jmp    1213 <generic_asserts_with_carry+0xb3>
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1080 <is_aux_carry_flag_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1243 <generic_asserts_with_carry+0xe3>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1243 <generic_asserts_with_carry+0xe3>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_asserts_with_carry>:
push   %rax
xor    %eax,%eax
call   1060 <is_zero_flag_set@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1070 <is_sign_flag_set@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <is_parity_flag_set@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <is_carry_flag_set@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1080 <is_aux_carry_flag_set@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"generic_asserts_with_carry failed!\00"
define void @generic_asserts_with_carry() {
%1 = call i32 (...) @is_zero_flag_set()
%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 (...) @is_sign_flag_set()
%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 i32 (...) @is_parity_flag_set()
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
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 (...) @is_carry_flag_set()
%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 i64 (...) @is_aux_carry_flag_set()
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %32
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_with_carry() {
%1 = tail call i32 (...) @is_zero_flag_set()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @is_sign_flag_set()
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (...) @is_parity_flag_set()
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 (...) @is_carry_flag_set()
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i64 (...) @is_aux_carry_flag_set()
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
ret void
}