#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 sscanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  int i;
  if (argc != 2)
    return 1;
  if (sscanf(argv[1], "%d", &i) != 1)
    return 1;
  if (i % 3 == 0) {
    printf("fizz");
  }
  if (i % 2 == 0) {
    printf("buzz");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11cc <main+0xac>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea5(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1179 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11cc <main+0xac>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1199 <main+0x79>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b9 <main+0x99>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%ebx
cmp    $0x2,%edi
jne    118d <main+0x5d>
mov    0x8(%rsi),%rdi
lea    0xeb6(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    118d <main+0x5d>
mov    0xc(%rsp),%eax
imul   $0xaaaaaaab,%eax,%ecx
add    $0x2aaaaaaa,%ecx
cmp    $0x55555554,%ecx
jbe    1195 <main+0x65>
test   $0x1,%al
jne    1181 <main+0x51>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
test   $0x1,%al
je     1175 <main+0x45>
jmp    1181 <main+0x51>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"fizz\00"
@.str.2 = [5 x i8] c"buzz\00"
@.str.3 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %31
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %31
17: ; preds = %10
%18 = load i32, i32* %6
%19 = srem i32 %18, 3
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %6
%25 = srem i32 %24, 2
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27, %23
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %31
31: ; preds = %29, %16, %9
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"fizz\00"
@.str.2 = [5 x i8] c"buzz\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %26
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %26
11: ; preds = %6
%12 = load i32, i32* %3
%13 = srem i32 %12, 3
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %3
br label %18
18: ; preds = %15, %11
%19 = phi i32 [ %17, %15 ], [ %12, %11 ]
%20 = and i32 %19, 1
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %18
%25 = call i32 @putchar(i32 10)
br label %26
26: ; preds = %6, %2, %24
%27 = phi i32 [ 0, %24 ], [ 1, %2 ], [ 1, %6 ]
ret i32 %27
}