#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 main() {
  unsigned int lhs, rhs;
  unsigned int lhs_dec, rhs_dec;
  printf("/* Automatically generated by libfpfd-dpd/divtable.c */\n"
         "\n"
         "        .section .rodata\n"
         ".globl fpfd_bcddiv\n"
         "        .align 32\n"
         "        .type fpfd_bcddiv, @object\n"
         "        .size fpfd_bcddiv, 39419\n"
         "fpfd_bcddiv:\n");
  lhs_dec = 0;
  rhs_dec = 0;
  for (lhs = 0; lhs <= 0x99; ++lhs) {
    for (rhs = 0; rhs < 0x100; ++rhs) {
      if ((lhs & 0xE) <= 0x8 && (lhs & 0xE0) <= 0x80 && (rhs & 0xE) <= 0x8 &&
          (rhs & 0xE0) <= 0x80) {
        if (rhs_dec != 0) {
          printf("        .byte 0x%u\n", lhs_dec / rhs_dec);
        } else {
          printf("        .byte 0x0\n");
        }
        ++rhs_dec;
      } else {
        printf("        .byte 0x0\n");
      }
    }
    if ((lhs & 0xE) <= 0x8 && (lhs & 0xE0) <= 0x80) {
      ++lhs_dec;
      rhs_dec = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x99,-0x8(%rbp)
ja     1250 <main+0x140>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jae    120b <main+0xfb>
mov    -0x8(%rbp),%eax
and    $0xe,%eax
cmp    $0x8,%eax
ja     11ea <main+0xda>
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     11ea <main+0xda>
mov    -0xc(%rbp),%eax
and    $0xe,%eax
cmp    $0x8,%eax
ja     11ea <main+0xda>
mov    -0xc(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     11ea <main+0xda>
cmpl   $0x0,-0x14(%rbp)
je     11ce <main+0xbe>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %eax,%esi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xcc>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f8 <main+0xe8>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fd <main+0xed>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x46>
mov    -0x8(%rbp),%eax
and    $0xe,%eax
cmp    $0x8,%eax
ja     123d <main+0x12d>
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     123d <main+0x12d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1242 <main+0x132>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9e(%rip),%r12
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    1171 <main+0x51>
nopw   0x0(%rax,%rax,1)
movzbl %r15b,%eax
add    %eax,%ebp
test   %al,%al
mov    $0x0,%eax
cmovne %eax,%ebx
add    $0x1,%r13d
cmp    $0x9a,%r13d
je     1203 <main+0xe3>
mov    %r13d,%eax
and    $0xe,%eax
cmp    $0x9,%eax
setb   %al
mov    %r13d,%ecx
and    $0xe0,%ecx
cmp    $0x81,%ecx
setb   %r15b
and    %al,%r15b
xor    %r14d,%r14d
jmp    11b5 <main+0x95>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0x1,%r14d
cmp    $0x100,%r14d
je     1150 <main+0x30>
mov    %r14d,%eax
and    $0xe,%eax
cmp    $0x9,%eax
setb   %al
and    %r15b,%al
cmp    $0x1,%al
jne    11a0 <main+0x80>
mov    %r14d,%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     11a0 <main+0x80>
test   %ebx,%ebx
je     11f6 <main+0xd6>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
lea    0xe18(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
jmp    11a8 <main+0x88>
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
jmp    11a8 <main+0x88>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/* Automatically generated by libfpfd-dpd/divtable.c */\0A\0A .section .rodata\0A.globl fpfd_bcddiv\0A .align 32\0A .type fpfd_bcddiv, @object\0A .size fpfd_bcddiv, 39419\0Afpfd_bcddiv:\0A\00"
@.str.1 = [20 x i8] c" .byte 0x%u\0A\00"
@.str.2 = [19 x i8] c" .byte 0x0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %2
br label %7
7: ; preds = %61, %0
%8 = load i32, i32* %2
%9 = icmp ule i32 %8, 153
br i1 %9, label %10, label %64
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %46, %10
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 256
br i1 %13, label %14, label %49
14: ; preds = %11
%15 = load i32, i32* %2
%16 = and i32 %15, 14
%17 = icmp ule i32 %16, 8
br i1 %17, label %18, label %43
18: ; preds = %14
%19 = load i32, i32* %2
%20 = and i32 %19, 224
%21 = icmp ule i32 %20, 128
br i1 %21, label %22, label %43
22: ; preds = %18
%23 = load i32, i32* %3
%24 = and i32 %23, 14
%25 = icmp ule i32 %24, 8
br i1 %25, label %26, label %43
26: ; preds = %22
%27 = load i32, i32* %3
%28 = and i32 %27, 224
%29 = icmp ule i32 %28, 128
br i1 %29, label %30, label %43
30: ; preds = %26
%31 = load i32, i32* %5
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = udiv i32 %34, %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %40
38: ; preds = %30
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %33
%41 = load i32, i32* %5
%42 = add i32 %41, 1
store i32 %42, i32* %5
br label %45
43: ; preds = %26, %22, %18, %14
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
br label %46
46: ; preds = %45
%47 = load i32, i32* %3
%48 = add i32 %47, 1
store i32 %48, i32* %3
br label %11
49: ; preds = %11
%50 = load i32, i32* %2
%51 = and i32 %50, 14
%52 = icmp ule i32 %51, 8
br i1 %52, label %53, label %60
53: ; preds = %49
%54 = load i32, i32* %2
%55 = and i32 %54, 224
%56 = icmp ule i32 %55, 128
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* %4
%59 = add i32 %58, 1
store i32 %59, i32* %4
store i32 0, i32* %5
br label %60
60: ; preds = %57, %53, %49
br label %61
61: ; preds = %60
%62 = load i32, i32* %2
%63 = add i32 %62, 1
store i32 %63, i32* %2
br label %7
64: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c" .byte 0x%u\0A\00"
@str = [200 x i8] c"/* Automatically generated by libfpfd-dpd/divtable.c */\0A\0A .section .rodata\0A.globl fpfd_bcddiv\0A .align 32\0A .type fpfd_bcddiv, @object\0A .size fpfd_bcddiv, 39419\0Afpfd_bcddiv:\00"
@str.4 = [18 x i8] c" .byte 0x0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %35
%3 = phi i32 [ 0, %0 ], [ %38, %35 ]
%4 = phi i32 [ 0, %0 ], [ %37, %35 ]
%5 = phi i32 [ 0, %0 ], [ %39, %35 ]
%6 = and i32 %5, 14
%7 = icmp ult i32 %6, 9
%8 = and i32 %5, 224
%9 = icmp ult i32 %8, 129
%10 = and i1 %7, %9
br label %11
11: ; preds = %2, %31
%12 = phi i32 [ %3, %2 ], [ %32, %31 ]
%13 = phi i32 [ 0, %2 ], [ %33, %31 ]
%14 = and i32 %13, 14
%15 = icmp ult i32 %14, 9
%16 = select i1 %10, i1 %15, i1 false
%17 = and i32 %13, 224
%18 = icmp ult i32 %17, 129
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %20, label %29
20: ; preds = %11
%21 = icmp eq i32 %12, 0
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = udiv i32 %4, %12
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %27
25: ; preds = %20
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = add i32 %12, 1
br label %31
29: ; preds = %11
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
br label %31
31: ; preds = %27, %29
%32 = phi i32 [ %28, %27 ], [ %12, %29 ]
%33 = add nuw nsw i32 %13, 1
%34 = icmp eq i32 %33, 256
br i1 %34, label %35, label %11
35: ; preds = %31
%36 = zext i1 %10 to i32
%37 = add i32 %4, %36
%38 = select i1 %10, i32 0, i32 %32
%39 = add nuw nsw i32 %5, 1
%40 = icmp eq i32 %39, 154
br i1 %40, label %41, label %2
41: ; preds = %35
ret i32 0
}