#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/multable.c */\n"
         "\n"
         "        .section .rodata\n"
         ".globl fpfd_bcdmul\n"
         "        .align 32\n"
         "        .type fpfd_bcdmul, @object\n"
         "        .size fpfd_bcdmul, 78848\n"
         "fpfd_bcdmul:\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) {
        printf("        .value 0x%u\n", lhs_dec * rhs_dec);
        ++rhs_dec;
      } else {
        printf("        .value 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     1230 <main+0x120>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jae    11eb <main+0xdb>
mov    -0x8(%rbp),%eax
and    $0xe,%eax
cmp    $0x8,%eax
ja     11ca <main+0xba>
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     11ca <main+0xba>
mov    -0xc(%rbp),%eax
and    $0xe,%eax
cmp    $0x8,%eax
ja     11ca <main+0xba>
mov    -0xc(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     11ca <main+0xba>
mov    -0x10(%rbp),%esi
imul   -0x14(%rbp),%esi
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d8 <main+0xc8>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <main+0xcd>
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     121d <main+0x10d>
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
ja     121d <main+0x10d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1222 <main+0x112>
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    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9f(%rip),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1171 <main+0x51>
nopw   0x0(%rax,%rax,1)
movzbl %r15b,%eax
add    %eax,%ebx
test   %al,%al
mov    $0x0,%eax
cmovne %eax,%ebp
add    $0x1,%r13d
cmp    $0x9a,%r13d
je     11ef <main+0xcf>
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>
mov    %ebp,%esi
imul   %ebx,%esi
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
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/multable.c */\0A\0A .section .rodata\0A.globl fpfd_bcdmul\0A .align 32\0A .type fpfd_bcdmul, @object\0A .size fpfd_bcdmul, 78848\0Afpfd_bcdmul:\0A\00"
@.str.1 = [21 x i8] c" .value 0x%u\0A\00"
@.str.2 = [20 x i8] c" .value 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 = %55, %0
%8 = load i32, i32* %2
%9 = icmp ule i32 %8, 153
br i1 %9, label %10, label %58
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %40, %10
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 256
br i1 %13, label %14, label %43
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 %37
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 %37
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 %37
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 %37
30: ; preds = %26
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = mul i32 %31, %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %5
%36 = add i32 %35, 1
store i32 %36, i32* %5
br label %39
37: ; preds = %26, %22, %18, %14
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %30
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add i32 %41, 1
store i32 %42, i32* %3
br label %11
43: ; preds = %11
%44 = load i32, i32* %2
%45 = and i32 %44, 14
%46 = icmp ule i32 %45, 8
br i1 %46, label %47, label %54
47: ; preds = %43
%48 = load i32, i32* %2
%49 = and i32 %48, 224
%50 = icmp ule i32 %49, 128
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = load i32, i32* %4
%53 = add i32 %52, 1
store i32 %53, i32* %4
store i32 0, i32* %5
br label %54
54: ; preds = %51, %47, %43
br label %55
55: ; preds = %54
%56 = load i32, i32* %2
%57 = add i32 %56, 1
store i32 %57, i32* %2
br label %7
58: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c" .value 0x%u\0A\00"
@str = [200 x i8] c"/* Automatically generated by libfpfd-dpd/multable.c */\0A\0A .section .rodata\0A.globl fpfd_bcdmul\0A .align 32\0A .type fpfd_bcdmul, @object\0A .size fpfd_bcdmul, 78848\0Afpfd_bcdmul:\00"
@str.3 = [19 x i8] c" .value 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, %30
%3 = phi i32 [ 0, %0 ], [ %33, %30 ]
%4 = phi i32 [ 0, %0 ], [ %32, %30 ]
%5 = phi i32 [ 0, %0 ], [ %34, %30 ]
%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, %26
%12 = phi i32 [ %3, %2 ], [ %27, %26 ]
%13 = phi i32 [ 0, %2 ], [ %28, %26 ]
%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 %24
20: ; preds = %11
%21 = mul i32 %12, %4
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = add i32 %12, 1
br label %26
24: ; preds = %11
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
br label %26
26: ; preds = %20, %24
%27 = phi i32 [ %23, %20 ], [ %12, %24 ]
%28 = add nuw nsw i32 %13, 1
%29 = icmp eq i32 %28, 256
br i1 %29, label %30, label %11
30: ; preds = %26
%31 = zext i1 %10 to i32
%32 = add i32 %4, %31
%33 = select i1 %10, i32 0, i32 %27
%34 = add nuw nsw i32 %5, 1
%35 = icmp eq i32 %34, 154
br i1 %35, label %36, label %2
36: ; preds = %30
ret i32 0
}