#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 */
double pow(int, int);
int Check(long long int a, long long int b, int d, int f1, int f2) {
  if ((a - f1 * pow(10, d - 1)) == 0 &&
      (b - f2 * pow(10, d - 1)) == (int)(0.999999999999999 * pow(10, d - 1)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    122c <Check+0x11c>
jp     122c <Check+0x11c>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  0xdfc(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
cvtsi2sd %eax,%xmm1
ucomisd %xmm1,%xmm0
jne    122c <Check+0x11c>
jp     122c <Check+0x11c>
movl   $0x1,-0x4(%rbp)
jmp    1233 <Check+0x123>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %rdi,%xmm0
movsd  %xmm0,(%rsp)
mov    %r8d,%r14d
mov    %edx,%ebx
mov    %rsi,%rbp
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0xffffffff,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    11ca <Check+0xba>
jp     11ca <Check+0xba>
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mulsd  0xe50(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mov    $0x1,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11ca <Check+0xba>
jnp    11cc <Check+0xbc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Check(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i64 %0, i64* %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i64, i64* %7
%13 = sitofp i64 %12 to double
%14 = load i32, i32* %10
%15 = sitofp i32 %14 to double
%16 = load i32, i32* %9
%17 = sub nsw i32 %16, 1
%18 = call double @pow(i32 10, i32 %17)
%19 = fneg double %15
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double %13)
%21 = fcmp oeq double %20, 0.000000e+00
br i1 %21, label %22, label %40
22: ; preds = %5
%23 = load i64, i64* %8
%24 = sitofp i64 %23 to double
%25 = load i32, i32* %11
%26 = sitofp i32 %25 to double
%27 = load i32, i32* %9
%28 = sub nsw i32 %27, 1
%29 = call double @pow(i32 10, i32 %28)
%30 = fneg double %26
%31 = call double @llvm.fmuladd.f64(double %30, double %29, double %24)
%32 = load i32, i32* %9
%33 = sub nsw i32 %32, 1
%34 = call double @pow(i32 10, i32 %33)
%35 = fmul double 0x3FEFFFFFFFFFFFF7, %34
%36 = fptosi double %35 to i32
%37 = sitofp i32 %36 to double
%38 = fcmp oeq double %31, %37
br i1 %38, label %39, label %40
39: ; preds = %22
store i32 1, i32* %6
br label %41
40: ; preds = %22, %5
store i32 0, i32* %6
br label %41
41: ; preds = %40, %39
%42 = load i32, i32* %6
ret i32 %42
}

LLVM IR (-O2):
define i32 @Check(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4) {
%6 = sitofp i64 %0 to double
%7 = sitofp i32 %3 to double
%8 = add nsw i32 %2, -1
%9 = tail call double @pow(i32 10, i32 %8)
%10 = fneg double %7
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double %6)
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = sitofp i64 %1 to double
%15 = sitofp i32 %4 to double
%16 = tail call double @pow(i32 10, i32 %8)
%17 = fneg double %15
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %14)
%19 = tail call double @pow(i32 10, i32 %8)
%20 = fmul double %19, 0x3FEFFFFFFFFFFFF7
%21 = fptosi double %20 to i32
%22 = sitofp i32 %21 to double
%23 = fcmp oeq double %18, %22
br i1 %23, label %25, label %24
24: ; preds = %13, %5
br label %25
25: ; preds = %13, %24
%26 = phi i32 [ 0, %24 ], [ 1, %13 ]
ret i32 %26
}