#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 check(int i, int first, int second) {
  if (i % first == 0 && i % second == 0)
    printf("FB");
  else if (i % first == 0)
    printf("F");
  else if (i % second == 0)
    printf("B");
  else
    printf("%d", i);
  return (0);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1154 <check+0x44>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1154 <check+0x44>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b5 <check+0xa5>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1177 <check+0x67>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b0 <check+0xa0>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    119a <check+0x8a>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <check+0x9b>
mov    -0x4(%rbp),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b0 <check+0xa0>
jmp    11b5 <check+0xa5>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
mov    %edx,%r8d
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%esi
mov    %edi,%eax
cltd
idiv   %r8d
test   %esi,%esi
je     114d <check+0x2d>
test   %edx,%edx
je     115d <check+0x3d>
mov    %edi,%ecx
lea    0xec1(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1177 <check+0x57>
test   %edx,%edx
je     1169 <check+0x49>
mov    $0x46,%edi
call   1030 <putchar@plt>
jmp    1177 <check+0x57>
mov    $0x42,%edi
call   1030 <putchar@plt>
jmp    1177 <check+0x57>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"FB\00"
@.str.1 = [2 x i8] c"F\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @check(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %37
18: ; preds = %11, %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = srem i32 %19, %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %36
25: ; preds = %18
%26 = load i32, i32* %4
%27 = load i32, i32* %6
%28 = srem i32 %26, %27
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %35
32: ; preds = %25
%33 = load i32, i32* %4
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %30
br label %36
36: ; preds = %35, %23
br label %37
37: ; preds = %36, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"FB\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @check(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, %1
%5 = icmp eq i32 %4, 0
%6 = srem i32 %0, %2
%7 = icmp eq i32 %6, 0
br i1 %5, label %8, label %13
8: ; preds = %3
br i1 %7, label %9, label %11
9: ; preds = %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %18
11: ; preds = %8
%12 = tail call i32 @putchar(i32 70)
br label %18
13: ; preds = %3
br i1 %7, label %14, label %16
14: ; preds = %13
%15 = tail call i32 @putchar(i32 66)
br label %18
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %0)
br label %18
18: ; preds = %11, %16, %14, %9
ret i32 0
}