#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  int fizz, buzz, n;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%d %d %d", &fizz, &buzz, &n) != EOF) {
    int i;
    for (i = 1; i <= n; i++) {
      if (i > 1)
        printf(" ");
      if (i % fizz && i % buzz) {
        printf("%d", i);
      } else {
        if (i % fizz == 0)
          printf("F");
        if (i % buzz == 0)
          printf("B");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    128f <main+0x15f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe87(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe75(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1040 <fscanf@plt>
mov    0x2e31(%rip),%rcx
cmp    (%rcx),%rax
je     1288 <main+0x158>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1275 <main+0x145>
cmpl   $0x1,-0x28(%rbp)
jle    11eb <main+0xbb>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
je     1221 <main+0xf1>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x20(%rbp)
cmp    $0x0,%edx
je     1221 <main+0xf1>
mov    -0x28(%rbp),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1262 <main+0x132>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
jne    123f <main+0x10f>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x20(%rbp)
cmp    $0x0,%edx
jne    125d <main+0x12d>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1262 <main+0x132>
jmp    1267 <main+0x137>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11c7 <main+0x97>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <main+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    12ee <main+0x1ae>
mov    0x8(%rsi),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea3(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    %rax,%rdi
call   1050 <fscanf@plt>
mov    %rax,%rcx
mov    0x2e56(%rip),%r15
xor    %eax,%eax
cmp    (%r15),%rcx
je     1308 <main+0x1c8>
lea    0xc(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xe6c(%rip),%rbp
jmp    11dd <main+0x9d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
lea    0xe50(%rip),%rsi
lea    0x14(%rsp),%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1050 <fscanf@plt>
cmp    (%r15),%rax
je     1306 <main+0x1c6>
cmpl   $0x0,0x10(%rsp)
jle    11b0 <main+0x70>
mov    $0x1,%eax
xor    %edx,%edx
idivl  0x14(%rsp)
test   %edx,%edx
je     1220 <main+0xe0>
mov    0xc(%rsp),%ecx
mov    $0x1,%eax
xor    %edx,%edx
idiv   %ecx
test   %edx,%edx
je     122e <main+0xee>
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,0x10(%rsp)
jl     11b0 <main+0x70>
jmp    124a <main+0x10a>
nopl   0x0(%rax)
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
mov    $0x1,%eax
xor    %edx,%edx
idiv   %ecx
test   %edx,%edx
je     12d4 <main+0x194>
cmpl   $0x2,0x10(%rsp)
jl     11b0 <main+0x70>
mov    $0x1,%r14d
jmp    1278 <main+0x138>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    0x10(%rsp),%r14d
jge    11b0 <main+0x70>
add    $0x1,%r14d
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r14d,%eax
cltd
idivl  0x14(%rsp)
test   %edx,%edx
je     12b0 <main+0x170>
mov    0xc(%rsp),%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1260 <main+0x120>
jmp    12be <main+0x17e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    126d <main+0x12d>
mov    $0x42,%edi
call   1030 <putchar@plt>
jmp    126d <main+0x12d>
mov    $0x42,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0x10(%rsp)
jl     11b0 <main+0x70>
jmp    124a <main+0x10a>
mov    (%rsi),%rsi
lea    0xd08(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    1308 <main+0x1c8>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.3 = [2 x i8] c" \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [2 x i8] c"F\00"
@.str.6 = [2 x i8] c"B\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 1, i32* %3
br label %73
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %6
br label %23
23: ; preds = %70, %18
%24 = load i32*, i32** %6
%25 = call i64 @fscanf(i32* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%26 = load i64, i64* @EOF
%27 = icmp ne i64 %25, %26
br i1 %27, label %28, label %72
28: ; preds = %23
store i32 1, i32* %10
br label %29
29: ; preds = %67, %28
%30 = load i32, i32* %10
%31 = load i32, i32* %9
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %70
33: ; preds = %29
%34 = load i32, i32* %10
%35 = icmp sgt i32 %34, 1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
%39 = load i32, i32* %10
%40 = load i32, i32* %7
%41 = srem i32 %39, %40
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %38
%44 = load i32, i32* %10
%45 = load i32, i32* %8
%46 = srem i32 %44, %45
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = load i32, i32* %10
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %49)
br label %66
51: ; preds = %43, %38
%52 = load i32, i32* %10
%53 = load i32, i32* %7
%54 = srem i32 %52, %53
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %58
58: ; preds = %56, %51
%59 = load i32, i32* %10
%60 = load i32, i32* %8
%61 = srem i32 %59, %60
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %65
65: ; preds = %63, %58
br label %66
66: ; preds = %65, %48
br label %67
67: ; preds = %66
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
br label %29
70: ; preds = %29
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %23
72: ; preds = %23
store i32 0, i32* %3
br label %73
73: ; preds = %72, %13
%74 = load i32, i32* %3
ret i32 %74
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.4 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %75
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i64 @fscanf(i32* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %75, label %20
20: ; preds = %13, %70
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 1
br i1 %22, label %70, label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = srem i32 1, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %33, label %27
27: ; preds = %23
%28 = load i32, i32* %4
%29 = srem i32 1, %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 1)
br label %42
33: ; preds = %23
%34 = call i32 @putchar(i32 70)
%35 = load i32, i32* %4
br label %36
36: ; preds = %33, %27
%37 = phi i32 [ %35, %33 ], [ %28, %27 ]
%38 = srem i32 1, %37
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @putchar(i32 66)
br label %42
42: ; preds = %40, %36, %31
%43 = load i32, i32* %5
%44 = icmp sgt i32 %43, 1
br i1 %44, label %45, label %70
45: ; preds = %42, %66
%46 = phi i32 [ %67, %66 ], [ 2, %42 ]
%47 = call i32 @putchar(i32 32)
%48 = load i32, i32* %3
%49 = srem i32 %46, %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %57, label %51
51: ; preds = %45
%52 = load i32, i32* %4
%53 = srem i32 %46, %52
%54 = icmp eq i32 %53, 0
br i1 %54, label %60, label %55
55: ; preds = %51
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %46)
br label %66
57: ; preds = %45
%58 = call i32 @putchar(i32 70)
%59 = load i32, i32* %4
br label %60
60: ; preds = %51, %57
%61 = phi i32 [ %52, %51 ], [ %59, %57 ]
%62 = srem i32 %46, %61
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = call i32 @putchar(i32 66)
br label %66
66: ; preds = %55, %64, %60
%67 = add nuw nsw i32 %46, 1
%68 = load i32, i32* %5
%69 = icmp slt i32 %46, %68
br i1 %69, label %45, label %70
70: ; preds = %66, %42, %20
%71 = call i32 @putchar(i32 10)
%72 = call i64 @fscanf(i32* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%73 = load i64, i64* @EOF
%74 = icmp eq i64 %72, %73
br i1 %74, label %75, label %20
75: ; preds = %70, %13, %10
%76 = phi i32 [ 1, %10 ], [ 0, %13 ], [ 0, %70 ]
ret i32 %76
}