#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dot(int y, long int period) {
  static long int xx;
  static char dott = 0;
  if (!y)
    dott = 0;
  if (++xx % period == 0) {
    fprintf(stderr, ".");
    dott++;
  }
  if (dott == 50) {
    fprintf(stderr, "\n");
    dott = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1130 <dot+0x20>
movb   $0x0,0x2f08(%rip)
mov    0x2ef9(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2eee(%rip)
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rdx
jne    1175 <dot+0x65>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ecb(%rip),%al
add    $0x1,%al
mov    %al,0x2ec3(%rip)
movsbl 0x2ebc(%rip),%eax
cmp    $0x32,%eax
jne    11a1 <dot+0x91>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x0,0x2e97(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
push   %rax
test   %edi,%edi
jne    111c <dot+0xc>
movb   $0x0,0x2f1c(%rip)
mov    0x2f0d(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f02(%rip)
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     116c <dot+0x5c>
cqto
idiv   %rsi
test   %rdx,%rdx
je     1175 <dot+0x65>
mov    0x2eee(%rip),%al
cmp    $0x32,%al
jne    116a <dot+0x5a>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x0,0x2ece(%rip)
pop    %rax
ret
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1144 <dot+0x34>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%al
add    $0x1,%al
mov    %al,0x2ea0(%rip)
cmp    $0x32,%al
je     114e <dot+0x3e>
jmp    116a <dot+0x5a>

LLVM IR (-O0):
@dot.xx = internal global i64 0
@dot.dott = internal global i8 0
@stderr = global i32 0
@.str = [2 x i8] c".\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dot(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
store i8 0, i8* @dot.dott
br label %8
8: ; preds = %7, %2
%9 = load i64, i64* @dot.xx
%10 = add nsw i64 %9, 1
store i64 %10, i64* @dot.xx
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = load i8, i8* @dot.dott
%18 = add i8 %17, 1
store i8 %18, i8* @dot.dott
br label %19
19: ; preds = %14, %8
%20 = load i8, i8* @dot.dott
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 50
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8 0, i8* @dot.dott
br label %26
26: ; preds = %23, %19
ret void
}

LLVM IR (-O2):
@dot.xx = internal unnamed_addr global i64 0
@dot.dott = internal unnamed_addr global i8 0
@stderr = global i32 0
@.str = [2 x i8] c".\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dot(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
store i8 0, i8* @dot.dott
br label %5
5: ; preds = %4, %2
%6 = load i64, i64* @dot.xx
%7 = add nsw i64 %6, 1
store i64 %7, i64* @dot.xx
%8 = srem i64 %7, %1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i8, i8* @dot.dott
%14 = add i8 %13, 1
store i8 %14, i8* @dot.dott
br label %17
15: ; preds = %5
%16 = load i8, i8* @dot.dott
br label %17
17: ; preds = %15, %10
%18 = phi i8 [ %16, %15 ], [ %14, %10 ]
%19 = icmp eq i8 %18, 50
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8 0, i8* @dot.dott
br label %23
23: ; preds = %20, %17
ret void
}