#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 */
scalar_t__ is_palindrome(int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int find_biggest() {
  int loops = 0;
  int biggest = 0;
  int n1 = 0, n2 = 0;
  int a = 999;
  int b = 0;
  int db = 0;
  while (a >= 100) {
    if (a % 11 == 0) {
      b = 999;
      db = 1;
    } else {
      b = 990;
      db = 11;
    }
    while (b >= a) {
      loops++;
      int p = a * b;
      if (p < biggest) {
        break;
      }
      if (is_palindrome(p)) {
        biggest = p;
        n1 = a;
        n2 = b;
        break;
      }
      b -= db;
    }
    a--;
  }
  printf("find_biggest is %d=%d * %d, with loops %d\n", biggest, n1, n2, loops);
  return biggest;
}


x86 assembly (clang, -O0):
<find_biggest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3e7,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x14(%rbp)
jl     1214 <find_biggest+0xf4>
mov    -0x14(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118a <find_biggest+0x6a>
movl   $0x3e7,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1198 <find_biggest+0x78>
movl   $0x3de,-0x18(%rbp)
movl   $0xb,-0x1c(%rbp)
jmp    119d <find_biggest+0x7d>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1206 <find_biggest+0xe6>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cd <find_biggest+0xad>
jmp    1206 <find_biggest+0xe6>
mov    -0x20(%rbp),%edi
call   1030 <is_palindrome@plt>
cmp    $0x0,%rax
je     11f6 <find_biggest+0xd6>
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1206 <find_biggest+0xe6>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    119d <find_biggest+0x7d>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <find_biggest+0x39>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    0xdd8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_biggest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x3e7,%r14d
xor    %ebx,%ebx
mov    $0xffffffff,%edx
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
jmp    1178 <find_biggest+0x58>
mov    %ebp,0xc(%rsp)
mov    %r14d,%eax
mov    %r14d,0x10(%rsp)
mov    %r15d,0x14(%rsp)
mov    $0xffffffff,%edx
lea    -0x1(%r14),%eax
cmp    $0x64,%r14d
mov    %eax,%r14d
jbe    11e4 <find_biggest+0xc4>
imul   $0xba2e8ba3,%r14d,%eax
xor    %ecx,%ecx
cmp    $0x1745d175,%eax
setb   %cl
lea    0x3de(%rcx,%rcx,8),%r15d
mov    $0xfffffff5,%r13d
cmovb  %edx,%r13d
cmp    %r14d,%r15d
jb     116b <find_biggest+0x4b>
add    $0x1,%ebx
mov    %r15d,%ebp
imul   %r14d,%ebp
mov    %r13d,%r12d
imul   %r14d,%r12d
mov    %ebx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ebx
cmp    0xc(%rsp),%ebp
jl     1166 <find_biggest+0x46>
mov    %ebp,%edi
call   1030 <is_palindrome@plt>
test   %rax,%rax
jne    1155 <find_biggest+0x35>
add    %r13d,%r15d
lea    0x1(%rbx),%eax
add    %r12d,%ebp
cmp    %r14d,%r15d
jge    11c0 <find_biggest+0xa0>
jmp    1166 <find_biggest+0x46>
lea    0xe15(%rip),%rdi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    %ebx,%r8d
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"find_biggest is %d=%d * %d, with loops %d\0A\00"
define i32 @find_biggest() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 999, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %45, %0
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 100
br i1 %11, label %12, label %48
12: ; preds = %9
%13 = load i32, i32* %5
%14 = srem i32 %13, 11
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 999, i32* %6
store i32 1, i32* %7
br label %18
17: ; preds = %12
store i32 990, i32* %6
store i32 11, i32* %7
br label %18
18: ; preds = %17, %16
br label %19
19: ; preds = %41, %18
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = icmp sge i32 %20, %21
br i1 %22, label %23, label %45
23: ; preds = %19
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = mul nsw i32 %26, %27
store i32 %28, i32* %8
%29 = load i32, i32* %8
%30 = load i32, i32* %2
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %33
32: ; preds = %23
br label %45
33: ; preds = %23
%34 = load i32, i32* %8
%35 = call i64 @is_palindrome(i32 %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i32, i32* %8
store i32 %38, i32* %2
%39 = load i32, i32* %5
store i32 %39, i32* %3
%40 = load i32, i32* %6
store i32 %40, i32* %4
br label %45
41: ; preds = %33
%42 = load i32, i32* %7
%43 = load i32, i32* %6
%44 = sub nsw i32 %43, %42
store i32 %44, i32* %6
br label %19
45: ; preds = %37, %32, %19
%46 = load i32, i32* %5
%47 = add nsw i32 %46, -1
store i32 %47, i32* %5
br label %9
48: ; preds = %9
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = load i32, i32* %1
%53 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %50, i32 %51, i32 %52)
%54 = load i32, i32* %2
ret i32 %54
}

LLVM IR (-O2):
@.str = [43 x i8] c"find_biggest is %d=%d * %d, with loops %d\0A\00"
define i32 @find_biggest() {
br label %1
1: ; preds = %0, %24
%2 = phi i32 [ 0, %0 ], [ %28, %24 ]
%3 = phi i32 [ 999, %0 ], [ %29, %24 ]
%4 = phi i32 [ 0, %0 ], [ %27, %24 ]
%5 = phi i32 [ 0, %0 ], [ %26, %24 ]
%6 = phi i32 [ 0, %0 ], [ %25, %24 ]
%7 = urem i32 %3, 11
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 999, i32 990
%10 = select i1 %8, i32 -1, i32 -11
%11 = icmp ult i32 %9, %3
br i1 %11, label %24, label %12
12: ; preds = %1, %21
%13 = phi i32 [ %15, %21 ], [ %2, %1 ]
%14 = phi i32 [ %22, %21 ], [ %9, %1 ]
%15 = add nsw i32 %13, 1
%16 = mul nsw i32 %14, %3
%17 = icmp slt i32 %16, %6
br i1 %17, label %24, label %18
18: ; preds = %12
%19 = tail call i64 @is_palindrome(i32 %16)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = add nsw i32 %14, %10
%23 = icmp slt i32 %22, %3
br i1 %23, label %24, label %12
24: ; preds = %21, %12, %18, %1
%25 = phi i32 [ %6, %1 ], [ %16, %18 ], [ %6, %12 ], [ %6, %21 ]
%26 = phi i32 [ %5, %1 ], [ %3, %18 ], [ %5, %12 ], [ %5, %21 ]
%27 = phi i32 [ %4, %1 ], [ %14, %18 ], [ %4, %12 ], [ %4, %21 ]
%28 = phi i32 [ %2, %1 ], [ %15, %18 ], [ %15, %12 ], [ %15, %21 ]
%29 = add nsw i32 %3, -1
%30 = icmp ugt i32 %3, 100
br i1 %30, label %1, label %31
31: ; preds = %24
%32 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28)
ret i32 %25
}