#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*/ dump_bit_dynamic(int, int, int, int);
void bitdynamic(void) {
  int type, sreg, mode, dreg;
  for (sreg = 0; sreg < 8; sreg++)
    for (type = 0; type < 4; type++)
      for (mode = 0; mode < 8; mode++)
        for (dreg = 0; dreg < 8; dreg++)
          dump_bit_dynamic(sreg, type, mode, dreg);
}


x86 assembly (clang, -O0):
<bitdynamic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11b4 <bitdynamic+0xa4>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    11a1 <bitdynamic+0x91>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    118e <bitdynamic+0x7e>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    117b <bitdynamic+0x6b>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <dump_bit_dynamic@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <bitdynamic+0x42>
jmp    1180 <bitdynamic+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <bitdynamic+0x31>
jmp    1193 <bitdynamic+0x83>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <bitdynamic+0x20>
jmp    11a6 <bitdynamic+0x96>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <bitdynamic+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitdynamic>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x2,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x3,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x4,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x5,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x6,%ecx
call   1030 <dump_bit_dynamic@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x7,%ecx
call   1030 <dump_bit_dynamic@plt>
add    $0x1,%ebx
cmp    $0x8,%ebx
jne    1140 <bitdynamic+0x30>
add    $0x1,%ebp
cmp    $0x4,%ebp
jne    1130 <bitdynamic+0x20>
add    $0x1,%r14d
cmp    $0x8,%r14d
jne    1120 <bitdynamic+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @bitdynamic() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %41
8: ; preds = %5
store i32 0, i32* %1
br label %9
9: ; preds = %34, %8
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %37
12: ; preds = %9
store i32 0, i32* %3
br label %13
13: ; preds = %30, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %33
16: ; preds = %13
store i32 0, i32* %4
br label %17
17: ; preds = %26, %16
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 8
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @dump_bit_dynamic(i32 %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %17
29: ; preds = %17
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %13
33: ; preds = %13
br label %34
34: ; preds = %33
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %9
37: ; preds = %9
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %5
41: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @bitdynamic() {
br label %1
1: ; preds = %0, %20
%2 = phi i32 [ 0, %0 ], [ %21, %20 ]
br label %3
3: ; preds = %1, %17
%4 = phi i32 [ 0, %1 ], [ %18, %17 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %15, %5 ]
%7 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 0)
%8 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 1)
%9 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 2)
%10 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 3)
%11 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 4)
%12 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 5)
%13 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 6)
%14 = tail call i32 @dump_bit_dynamic(i32 %2, i32 %4, i32 %6, i32 7)
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, 8
br i1 %16, label %17, label %5
17: ; preds = %5
%18 = add nuw nsw i32 %4, 1
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %3
20: ; preds = %17
%21 = add nuw nsw i32 %2, 1
%22 = icmp eq i32 %21, 8
br i1 %22, label %23, label %1
23: ; preds = %20
ret void
}