#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;
  while (contador <= 50) {
    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++;
  }
  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)
cmpl   $0x32,-0x8(%rbp)
jg     11df <main+0xbf>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1168 <main+0x48>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    11d1 <main+0xb1>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1190 <main+0x70>
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
jmp    11cc <main+0xac>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b8 <main+0x98>
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%esi
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    11cc <main+0xac>
jmp    11d1 <main+0xb1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe36(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xecb(%rip),%r14
lea    0xecc(%rip),%r15
lea    0xecd(%rip),%r12
lea    0xece(%rip),%r13
jmp    115f <main+0x3f>
nopl   0x0(%rax)
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x33,%ebx
je     11b6 <main+0x96>
movzbl %bl,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
mov    %r14,%rdi
add    %al,%cl
je     1150 <main+0x30>
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
mov    %r15,%rdi
add    %bl,%cl
je     1150 <main+0x30>
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%ecx
shr    $0x8,%ecx
sub    %cl,%al
shr    %al
add    %cl,%al
shr    $0x2,%al
movzbl %al,%eax
lea    0x0(,%rax,8),%ecx
sub    %ecx,%eax
mov    %r12,%rdi
add    %bl,%al
je     1150 <main+0x30>
mov    %r13,%rdi
jmp    1150 <main+0x30>
lea    0xe5f(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = icmp sle i32 %4, 50
br i1 %5, label %6, label %35
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %32
13: ; preds = %6
%14 = load i32, i32* %2
%15 = srem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %31
20: ; preds = %13
%21 = load i32, i32* %2
%22 = srem i32 %21, 7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %30
27: ; preds = %20
%28 = load i32, i32* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30, %17
br label %32
32: ; preds = %31, %10
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %3
35: ; preds = %3
%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 = %0, %13
%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 i8 %3, 5
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = urem i8 %3, 7
%11 = icmp eq i8 %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
}