#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__ log10(int);
scalar_t__ pow(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
void find1() {
  int number = 16;
  do {
    if ((number % 10) == 6) {
      int newNumber = (number / 10) + (int)pow(10, (int)log10(number)) * 6;
      printf("%d -> %d\n", number, newNumber);
      if ((number * 4) == newNumber) {
        printf("%d !!!\n", number);
        break;
      }
    }
    number++;
  } while (1);
}


x86 assembly (clang, -O0):
<find1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x6,%edx
jne    11c1 <find1+0x91>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <log10@plt>
mov    %eax,%esi
mov    $0xa,%edi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
imul   $0x6,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    11bc <find1+0x8c>
mov    -0x4(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d9 <find1+0xa9>
jmp    11c1 <find1+0x91>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    113f <find1+0xf>
jmp    11d9 <find1+0xa9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find1>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x10,%ebx
mov    $0x40,%r15d
mov    $0xcccccccd,%r12d
lea    0xeb0(%rip),%r14
jmp    1167 <find1+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0x4,%r15d
mov    %ebx,%ebp
imul   %r12,%rbp
shr    $0x23,%rbp
lea    0x0(%rbp,%rbp,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
cmp    $0x6,%ecx
jne    1160 <find1+0x30>
mov    %ebx,%edi
call   1050 <log10@plt>
mov    $0xa,%edi
mov    %eax,%esi
call   1040 <pow@plt>
lea    (%rax,%rax,2),%eax
lea    0x0(%rbp,%rax,2),%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    %ebp,%r15d
jne    1160 <find1+0x30>
lea    0xe55(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d -> %d\0A\00"
@.str.1 = [8 x i8] c"%d !!!\0A\00"
define void @find1() {
%1 = alloca i32
%2 = alloca i32
store i32 16, i32* %1
br label %3
3: ; preds = %31, %0
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %28
7: ; preds = %3
%8 = load i32, i32* %1
%9 = sdiv i32 %8, 10
%10 = load i32, i32* %1
%11 = call i64 @log10(i32 %10)
%12 = trunc i64 %11 to i32
%13 = call i64 @pow(i32 10, i32 %12)
%14 = trunc i64 %13 to i32
%15 = mul nsw i32 %14, 6
%16 = add nsw i32 %9, %15
store i32 %16, i32* %2
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %1
%21 = mul nsw i32 %20, 4
%22 = load i32, i32* %2
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %7
%25 = load i32, i32* %1
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %32
27: ; preds = %7
br label %28
28: ; preds = %27, %3
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %31
31: ; preds = %28
br i1 true, label %3, label %32
32: ; preds = %31, %24
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d -> %d\0A\00"
@.str.1 = [8 x i8] c"%d !!!\0A\00"
define void @find1() {
br label %1
1: ; preds = %16, %0
%2 = phi i32 [ 16, %0 ], [ %17, %16 ]
%3 = urem i32 %2, 10
%4 = udiv i32 %2, 10
%5 = icmp eq i32 %3, 6
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = tail call i64 @log10(i32 %2)
%8 = trunc i64 %7 to i32
%9 = tail call i64 @pow(i32 10, i32 %8)
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 6
%12 = add nsw i32 %11, %4
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %12)
%14 = shl nsw i32 %2, 2
%15 = icmp eq i32 %14, %12
br i1 %15, label %18, label %16
16: ; preds = %6, %1
%17 = add nuw nsw i32 %2, 1
br label %1
18: ; preds = %6
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}