#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);
int /*<<< orphan*/ system(char *);
int main() {
  int contador = 1;
  do {
    if ((contador % 3) == 0)
      printf("%d foo\n", contador);
    else if ((contador % 5) == 0)
      printf("%d bar\n", contador);
    else if ((contador % 7) == 0)
      printf("%d baz\n", contador);
    else
      printf("%d\n", contador);
    contador++;
  } while (contador <= 50);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115e <main+0x3e>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1186 <main+0x66>
mov    -0x8(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
jmp    11c2 <main+0xa2>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ae <main+0x8e>
mov    -0x8(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
jmp    11bd <main+0x9d>
mov    -0x8(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
jmp    11c2 <main+0xa2>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jle    1136 <main+0x16>
lea    0xe3b(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0xcccccccd,%r14d
lea    0xec3(%rip),%r15
lea    0xec4(%rip),%r12
lea    0xec5(%rip),%r13
lea    0xec6(%rip),%rbp
jmp    116f <main+0x4f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x33,%ebx
je     11d9 <main+0xb9>
movzbl %bl,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
mov    %r15,%rdi
add    %cl,%al
je     1160 <main+0x40>
mov    %ebx,%eax
mov    %rax,%rcx
imul   %r14,%rcx
shr    $0x22,%rcx
lea    (%rcx,%rcx,4),%ecx
mov    $0x1,%edx
sub    %ecx,%edx
add    %ebx,%edx
mov    %r12,%rdi
cmp    $0x1,%edx
je     1160 <main+0x40>
imul   $0x24924925,%rax,%rax
shr    $0x20,%rax
mov    %ebx,%ecx
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x2,%ecx
mov    %ecx,%eax
shl    $0x3,%eax
neg    %eax
add    %ecx,%eax
add    $0x1,%eax
add    %ebx,%eax
mov    %r13,%rdi
cmp    $0x1,%eax
je     1160 <main+0x40>
mov    %rbp,%rdi
jmp    1160 <main+0x40>
lea    0xe3c(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d foo\0A\00"
@.str.1 = [8 x i8] c"%d bar\0A\00"
@.str.2 = [8 x i8] c"%d baz\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %32, %0
%4 = load i32, i32* %2
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %29
10: ; preds = %3
%11 = load i32, i32* %2
%12 = srem i32 %11, 5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %28
17: ; preds = %10
%18 = load i32, i32* %2
%19 = srem i32 %18, 7
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %27
24: ; preds = %17
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %14
br label %29
29: ; preds = %28, %7
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %32
32: ; preds = %29
%33 = load i32, i32* %2
%34 = icmp sle i32 %33, 50
br i1 %34, label %3, label %35
35: ; preds = %32
%36 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d foo\0A\00"
@.str.1 = [8 x i8] c"%d bar\0A\00"
@.str.2 = [8 x i8] c"%d baz\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
br label %1
1: ; preds = %13, %0
%2 = phi i32 [ 1, %0 ], [ %16, %13 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 3
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = urem i32 %2, 5
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = urem i32 %2, 7
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
br label %13
13: ; preds = %9, %6, %1
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %6 ], [ %12, %9 ]
%15 = tail call i32 @printf(i8* %14, i32 %2)
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 51
br i1 %17, label %18, label %1
18: ; preds = %13
%19 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}