#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 main() {
  int i;
  for (i = 1; i <= 50; i++) {
    if ((i % 3 != 0) && (i % 4 == 0)) {
      printf("[%d],", i);
    } else {
      printf("%d,", i);
    }
  }
  printf("\n");
  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     1192 <main+0x82>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116e <main+0x5e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <main+0x5e>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <main+0x6f>
mov    -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <main+0x74>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xecf(%rip),%r14
lea    0xece(%rip),%r15
jmp    1158 <main+0x38>
nopw   0x0(%rax,%rax,1)
test   $0x3,%bl
cmovne %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x33,%ebx
je     1175 <main+0x55>
movzbl %bl,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
mov    %r14,%rdi
add    %bl,%al
jne    1140 <main+0x20>
mov    %r15,%rdi
jmp    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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