#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int PrintASequence(int number) {
  int i;
  for (i = 2; i < (number + 2); i++) {
    if (i % 2 != 0) {
      printf(", -%d", i);
    } else {
      if (i != 2) {
        printf(", %d", i);
      } else {
        printf("%d", i);
      }
    }
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<PrintASequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    11a0 <PrintASequence+0x90>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115b <PrintASequence+0x4b>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <PrintASequence+0x7d>
cmpl   $0x2,-0x8(%rbp)
je     1179 <PrintASequence+0x69>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <PrintASequence+0x78>
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <PrintASequence+0x7d>
jmp    1192 <PrintASequence+0x82>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PrintASequence+0x12>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintASequence>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1174 <PrintASequence+0x64>
mov    %edi,%r14d
lea    0xee2(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
cmp    $0x1,%r14d
je     1174 <PrintASequence+0x64>
neg    %r14d
mov    $0x3,%ebx
lea    0xec1(%rip),%r15
lea    0xeb4(%rip),%r12
nopl   0x0(%rax)
test   $0x1,%bl
mov    %r12,%rdi
cmove  %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    1150 <PrintASequence+0x40>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c", -%d\00"
@.str.1 = [5 x i8] c", %d\00"
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @PrintASequence(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %27, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 2
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %30
9: ; preds = %4
%10 = load i32, i32* %3
%11 = srem i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %26
16: ; preds = %9
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %25
22: ; preds = %16
%23 = load i32, i32* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %4
30: ; preds = %4
%31 = load i32, i32* @EXIT_SUCCESS
ret i32 %31
}

LLVM IR (-O2):
@.str = [6 x i8] c", -%d\00"
@.str.1 = [5 x i8] c", %d\00"
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @PrintASequence(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = add nuw i32 %0, 2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%6 = icmp eq i32 %4, 3
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %13, %7 ], [ 3, %3 ]
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%12 = tail call i32 @printf(i8* %11, i32 %8)
%13 = add nuw i32 %8, 1
%14 = icmp eq i32 %13, %4
br i1 %14, label %15, label %7
15: ; preds = %7, %3, %1
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}