#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*/ printf(char *, int, int, int, int, ...);
int /*<<< orphan*/ puts(char *);
void DumpRegs_Real(int eip, int efl, int edi, int esi, int ebp, int esp,
                   int ebx, int edx, int ecx, int eax) {
  int cf, sf, zf, of, af, pf;
  cf = !!(efl & (1 << 0));
  sf = !!(efl & (1 << 7));
  zf = !!(efl & (1 << 6));
  of = !!(efl & (1 << 11));
  af = !!(efl & (1 << 4));
  pf = !!(efl & (1 << 2));
  puts("");
  printf("  EAX=%.8X  EBX=%.8X  ECX=%.8X  EDX=%.8X\n", eax, ebx, ecx, edx);
  printf("  ESI=%.8X  EDI=%.8X  EBP=%.8X  ESP=%.8X\n", esi, edi, ebp, esp);
  printf("  EIP=%.8X  EFL=%.8X  CF=%d  SF=%d  ZF=%d  OF=%d  AF=%d  PF=%d\n",
         eip, efl, cf, sf, zf, of, af, pf);
  puts("");
}


x86 assembly (clang, -O0):
<DumpRegs_Real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x30(%rbp)
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    0x28(%rbp),%esi
mov    0x10(%rbp),%edx
mov    0x20(%rbp),%ecx
mov    0x18(%rbp),%r8d
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%r11d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
lea    0xe13(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf7(%rip),%rdi
call   1030 <puts@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpRegs_Real>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,0x20(%rsp)
mov    %r8d,0x1c(%rsp)
mov    %ecx,0x10(%rsp)
mov    %edx,0x14(%rsp)
mov    %esi,%ebx
mov    %edi,0x24(%rsp)
mov    0x78(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x60(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x70(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %esi,%eax
and    $0x1,%eax
mov    %eax,0x18(%rsp)
mov    %esi,%ebp
shr    $0x7,%ebp
and    $0x1,%ebp
mov    %esi,%r12d
shr    $0x6,%r12d
and    $0x1,%r12d
mov    %esi,%r15d
shr    $0xb,%r15d
and    $0x1,%r15d
mov    %esi,%r13d
shr    $0x4,%r13d
and    $0x1,%r13d
mov    %esi,%r14d
shr    $0x2,%r14d
and    $0x1,%r14d
mov    0x68(%rsp),%eax
mov    %eax,(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe4d(%rip),%rdi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe59(%rip),%rdi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x20(%rsp),%r8d
xor    %eax,%eax
call   1040 <printf@plt>
sub    $0x8,%rsp
lea    0xe60(%rip),%rdi
mov    0x2c(%rsp),%esi
mov    %ebx,%edx
mov    0x20(%rsp),%ecx
mov    %ebp,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
push   %r14
push   %r13
push   %r15
call   1040 <printf@plt>
add    $0x20,%rsp
mov    $0xa,%edi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [42 x i8] c" EAX=%.8X EBX=%.8X ECX=%.8X EDX=%.8X\0A\00"
@.str.2 = [42 x i8] c" ESI=%.8X EDI=%.8X EBP=%.8X ESP=%.8X\0A\00"
@.str.3 = [64 x i8] c" EIP=%.8X EFL=%.8X CF=%d SF=%d ZF=%d OF=%d AF=%d PF=%d\0A\00"
define void @DumpRegs_Real(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%27 = load i32, i32* %12
%28 = and i32 %27, 1
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
%31 = xor i1 %30, true
%32 = zext i1 %31 to i32
store i32 %32, i32* %21
%33 = load i32, i32* %12
%34 = and i32 %33, 128
%35 = icmp ne i32 %34, 0
%36 = xor i1 %35, true
%37 = xor i1 %36, true
%38 = zext i1 %37 to i32
store i32 %38, i32* %22
%39 = load i32, i32* %12
%40 = and i32 %39, 64
%41 = icmp ne i32 %40, 0
%42 = xor i1 %41, true
%43 = xor i1 %42, true
%44 = zext i1 %43 to i32
store i32 %44, i32* %23
%45 = load i32, i32* %12
%46 = and i32 %45, 2048
%47 = icmp ne i32 %46, 0
%48 = xor i1 %47, true
%49 = xor i1 %48, true
%50 = zext i1 %49 to i32
store i32 %50, i32* %24
%51 = load i32, i32* %12
%52 = and i32 %51, 16
%53 = icmp ne i32 %52, 0
%54 = xor i1 %53, true
%55 = xor i1 %54, true
%56 = zext i1 %55 to i32
store i32 %56, i32* %25
%57 = load i32, i32* %12
%58 = and i32 %57, 4
%59 = icmp ne i32 %58, 0
%60 = xor i1 %59, true
%61 = xor i1 %60, true
%62 = zext i1 %61 to i32
store i32 %62, i32* %26
%63 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%64 = load i32, i32* %20
%65 = load i32, i32* %17
%66 = load i32, i32* %19
%67 = load i32, i32* %18
%68 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 %65, i32 %66, i32 %67)
%69 = load i32, i32* %14
%70 = load i32, i32* %13
%71 = load i32, i32* %15
%72 = load i32, i32* %16
%73 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %69, i32 %70, i32 %71, i32 %72)
%74 = load i32, i32* %11
%75 = load i32, i32* %12
%76 = load i32, i32* %21
%77 = load i32, i32* %22
%78 = load i32, i32* %23
%79 = load i32, i32* %24
%80 = load i32, i32* %25
%81 = load i32, i32* %26
%82 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i32 %74, i32 %75, i32 %76, i32 %77, i32 %78, i32 %79, i32 %80, i32 %81)
%83 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c" EAX=%.8X EBX=%.8X ECX=%.8X EDX=%.8X\0A\00"
@.str.2 = [42 x i8] c" ESI=%.8X EDI=%.8X EBP=%.8X ESP=%.8X\0A\00"
@.str.3 = [64 x i8] c" EIP=%.8X EFL=%.8X CF=%d SF=%d ZF=%d OF=%d AF=%d PF=%d\0A\00"
define void @DumpRegs_Real(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = and i32 %1, 1
%12 = lshr i32 %1, 7
%13 = and i32 %12, 1
%14 = lshr i32 %1, 6
%15 = and i32 %14, 1
%16 = lshr i32 %1, 11
%17 = and i32 %16, 1
%18 = lshr i32 %1, 4
%19 = and i32 %18, 1
%20 = lshr i32 %1, 2
%21 = and i32 %20, 1
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %6, i32 %8, i32 %7)
%24 = tail call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %3, i32 %2, i32 %4, i32 %5)
%25 = tail call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i32 %0, i32 %1, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21)
%26 = tail call i32 @putchar(i32 10)
ret void
}