#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 /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *);
void processLineWithScan(char line[]) {
  int x, y, count;
  sscanf(line, "%d %d %d", &x, &y, &count);
  for (int i = 1; i <= count; i++) {
    int printNum = 1;
    if ((i % x) == 0) {
      printNum = 0;
      printf("F");
    }
    if ((i % y) == 0) {
      printNum = 0;
      printf("B");
    }
    if (printNum) {
      printf("%d", i);
    }
    if (i != count) {
      printf(" ");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<processLineWithScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <sscanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f4 <processLineWithScan+0xd4>
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1187 <processLineWithScan+0x67>
movl   $0x0,-0x1c(%rbp)
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11ac <processLineWithScan+0x8c>
movl   $0x0,-0x1c(%rbp)
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11c7 <processLineWithScan+0xa7>
mov    -0x18(%rbp),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     11e1 <processLineWithScan+0xc1>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e6 <processLineWithScan+0xc6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114f <processLineWithScan+0x2f>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processLineWithScan>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1050 <sscanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11d7 <processLineWithScan+0xa7>
mov    $0x1,%ebx
lea    0xea1(%rip),%r14
jmp    1179 <processLineWithScan+0x49>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ecx
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    11d7 <processLineWithScan+0xa7>
mov    %ebx,%eax
cltd
idivl  0x14(%rsp)
test   %edx,%edx
je     11a0 <processLineWithScan+0x70>
mov    %ebx,%eax
cltd
idivl  0x10(%rsp)
test   %edx,%edx
je     11b5 <processLineWithScan+0x85>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11bf <processLineWithScan+0x8f>
nopl   (%rax)
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
cltd
idivl  0x10(%rsp)
test   %edx,%edx
jne    11bf <processLineWithScan+0x8f>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
cmp    0xc(%rsp),%ebx
je     1170 <processLineWithScan+0x40>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
jmp    1170 <processLineWithScan+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.3 = [3 x i8] c"%d\00"
define void @processLineWithScan(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %37, %1
%12 = call i32 @putchar(i32 10)
ret void
13: ; preds = %1, %37
%14 = phi i32 [ %39, %37 ], [ 1, %1 ]
%15 = load i32, i32* %2
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = call i32 @putchar(i32 70)
%20 = load i32, i32* %3
%21 = srem i32 %14, %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %27, label %31
23: ; preds = %13
%24 = load i32, i32* %3
%25 = srem i32 %14, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23, %18
%28 = call i32 @putchar(i32 66)
br label %31
29: ; preds = %23
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %31
31: ; preds = %18, %27, %29
%32 = load i32, i32* %4
%33 = icmp eq i32 %14, %32
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = call i32 @putchar(i32 32)
%36 = load i32, i32* %4
br label %37
37: ; preds = %34, %31
%38 = phi i32 [ %36, %34 ], [ %14, %31 ]
%39 = add nuw nsw i32 %14, 1
%40 = icmp slt i32 %14, %38
br i1 %40, label %13, label %11
}