#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);
int main(void) {
  int num1, num2, inv1, inv2;
  for (num1 = 10; num1 < 100; num1++) {
    inv1 = (num1 % 10) * 10 + num1 / 10;
    for (num2 = 10; num2 < 100; num2++) {
      inv2 = (num2 % 10) * 10 + num2 / 10;
      if (num1 * num2 == inv1 * inv2)
        printf("\n%d x %d = %d x %d = %d\n", num1, num2, inv1, inv2,
               num1 * num2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11eb <main+0xdb>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,%edx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    11d8 <main+0xc8>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,%edx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jne    11c5 <main+0xb5>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x8(%rbp),%r9d
imul   -0xc(%rbp),%r9d
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xba>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x4d>
jmp    11dd <main+0xcd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
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
mov    $0xa,%r15d
mov    $0x64,%ebx
lea    0xed3(%rip),%r14
jmp    1145 <main+0x35>
nop
add    $0x1,%r15d
mov    0x4(%rsp),%ebx
add    $0xa,%ebx
cmp    $0x64,%r15d
je     11c8 <main+0xb8>
movzbl %r15b,%eax
imul   $0xcd,%eax,%ecx
shr    $0xb,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    %al,%cl
movzbl %cl,%r12d
mov    $0x64,%r13b
mov    %ebx,0x4(%rsp)
mov    $0xa,%ebp
jmp    118f <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
add    %r15d,%ebx
add    $0xa,%r13b
cmp    $0x64,%ebp
je     1130 <main+0x20>
movzbl %bpl,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
imul   $0x63,%eax,%eax
mov    %r13d,%ecx
sub    %al,%cl
movzbl %cl,%r8d
mov    %r8d,%eax
imul   %r12d,%eax
cmp    %eax,%ebx
jne    1180 <main+0x70>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %ebx,%r9d
call   1030 <printf@plt>
jmp    1180 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A%d x %d = %d x %d = %d\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
store i32 10, i32* %2
br label %6
6: ; preds = %47, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %50
9: ; preds = %6
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = mul nsw i32 %11, 10
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
%15 = add nsw i32 %12, %14
store i32 %15, i32* %4
store i32 10, i32* %3
br label %16
16: ; preds = %43, %9
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %46
19: ; preds = %16
%20 = load i32, i32* %3
%21 = srem i32 %20, 10
%22 = mul nsw i32 %21, 10
%23 = load i32, i32* %3
%24 = sdiv i32 %23, 10
%25 = add nsw i32 %22, %24
store i32 %25, i32* %5
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = mul nsw i32 %29, %30
%32 = icmp eq i32 %28, %31
br i1 %32, label %33, label %42
33: ; preds = %19
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = mul nsw i32 %38, %39
%41 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35, i32 %36, i32 %37, i32 %40)
br label %42
42: ; preds = %33, %19
br label %43
43: ; preds = %42
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %16
46: ; preds = %16
br label %47
47: ; preds = %46
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %6
50: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A%d x %d = %d x %d = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %25
%2 = phi i32 [ 10, %0 ], [ %26, %25 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 10
%5 = mul nuw nsw i8 %4, 10
%6 = udiv i8 %3, 10
%7 = add nuw i8 %5, %6
%8 = zext i8 %7 to i32
br label %9
9: ; preds = %1, %22
%10 = phi i32 [ 10, %1 ], [ %23, %22 ]
%11 = trunc i32 %10 to i8
%12 = urem i8 %11, 10
%13 = mul nuw nsw i8 %12, 10
%14 = udiv i8 %11, 10
%15 = add nuw i8 %13, %14
%16 = zext i8 %15 to i32
%17 = mul nuw nsw i32 %10, %2
%18 = mul nuw nsw i32 %16, %8
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %9
%21 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %10, i32 %8, i32 %16, i32 %17)
br label %22
22: ; preds = %9, %20
%23 = add nuw nsw i32 %10, 1
%24 = icmp eq i32 %23, 100
br i1 %24, label %25, label %9
25: ; preds = %22
%26 = add nuw nsw i32 %2, 1
%27 = icmp eq i32 %26, 100
br i1 %27, label %28, label %1
28: ; preds = %25
ret i32 0
}