#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, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void sounder(int onOrOff, int msec) {
  int i;
  int units = (8 * msec / 1200);
  fprintf(stderr, "sounder(%i, %i)\n", onOrOff, msec);
  if (onOrOff && (units == 1))
    printf(".");
  else if (onOrOff && (units == 3))
    printf("-");
  else
    for (i = 0; i < units - 1; ++i)
      printf(" ");
}


x86 assembly (clang, -O0):
<sounder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    $0x4b0,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
je     117f <sounder+0x5f>
cmpl   $0x1,-0x10(%rbp)
jne    117f <sounder+0x5f>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <sounder+0xc0>
cmpl   $0x0,-0x4(%rbp)
je     11a4 <sounder+0x84>
cmpl   $0x3,-0x10(%rbp)
jne    11a4 <sounder+0x84>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <sounder+0xbb>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11d6 <sounder+0xb6>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ab <sounder+0x8b>
jmp    11db <sounder+0xbb>
jmp    11e0 <sounder+0xc0>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sounder>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <fprintf@plt>
test   %ebp,%ebp
je     1156 <sounder+0x36>
lea    -0x96(%rbx),%eax
mov    $0x2e,%edi
cmp    $0x96,%eax
jb     116c <sounder+0x4c>
test   %ebp,%ebp
je     1177 <sounder+0x57>
lea    -0x1c2(%rbx),%eax
mov    $0x2d,%edi
cmp    $0x96,%eax
jae    1177 <sounder+0x57>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
cmp    $0x12c,%ebx
jl     11bf <sounder+0x9f>
movslq %ebx,%rax
imul   $0x1b4e81b5,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
cmp    $0x3,%eax
mov    $0x2,%ebx
cmovge %eax,%ebx
add    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11b0 <sounder+0x90>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"sounder(%i, %i)\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [2 x i8] c" \00"
define void @sounder(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 8, %7
%9 = sdiv i32 %8, 1200
store i32 %9, i32* %6
%10 = load i32, i32* @stderr
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %42
21: ; preds = %16, %2
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %41
29: ; preds = %24, %21
store i32 0, i32* %5
br label %30
30: ; preds = %37, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = sub nsw i32 %32, 1
%34 = icmp slt i32 %31, %33
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %30
40: ; preds = %30
br label %41
41: ; preds = %40, %27
br label %42
42: ; preds = %41, %19
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"sounder(%i, %i)\0A\00"
define void @sounder(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 150
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = icmp ne i32 %0, 0
%7 = add i32 %1, -150
%8 = icmp ult i32 %7, 150
%9 = and i1 %6, %8
br i1 %9, label %24, label %10
10: ; preds = %2
%11 = add i32 %1, -450
%12 = icmp ult i32 %11, 150
%13 = and i1 %6, %12
br i1 %13, label %24, label %14
14: ; preds = %10
%15 = icmp sgt i32 %1, 299
br i1 %15, label %16, label %27
16: ; preds = %14
%17 = call i32 @llvm.smax.i32(i32 %3, i32 2)
%18 = add nsw i32 %17, -1
br label %19
19: ; preds = %16, %19
%20 = phi i32 [ %22, %19 ], [ 0, %16 ]
%21 = tail call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, %18
br i1 %23, label %27, label %19
24: ; preds = %10, %2
%25 = phi i32 [ 46, %2 ], [ 45, %10 ]
%26 = tail call i32 @putchar(i32 %25)
br label %27
27: ; preds = %19, %24, %14
ret void
}