#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);
void print_to_98(int n) {
  if (n < 98) {
    for (n = n; n < 98; n++)
      printf("%d, ", n);
    printf("%d\n", 98);
  } else {
    for (n = n; n > 98; n--)
      printf("%d, ", n);
    printf("%d\n", 98);
  }
}


x86 assembly (clang, -O0):
<print_to_98>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x62,-0x4(%rbp)
jge    1168 <print_to_98+0x58>
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x62,-0x4(%rbp)
jge    1152 <print_to_98+0x42>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <print_to_98+0x1b>
lea    0xeac(%rip),%rdi
mov    $0x62,%esi
call   1030 <printf@plt>
jmp    11a6 <print_to_98+0x96>
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x62,-0x4(%rbp)
jle    1195 <print_to_98+0x85>
mov    -0x4(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <print_to_98+0x5e>
lea    0xe69(%rip),%rdi
mov    $0x62,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_to_98>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x61,%edi
jg     1144 <print_to_98+0x34>
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x62,%ebx
jne    1130 <print_to_98+0x20>
jmp    1164 <print_to_98+0x54>
cmp    $0x62,%ebx
je     1164 <print_to_98+0x54>
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x63,%ebx
mov    %eax,%ebx
ja     1150 <print_to_98+0x40>
lea    0xe9a(%rip),%rdi
mov    $0x62,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @print_to_98(i32 %0) {
%2 = icmp slt i32 %0, 98
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 98
br i1 %4, label %15, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add i32 %6, 1
%9 = icmp eq i32 %8, 98
br i1 %9, label %15, label %5
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ %0, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nsw i32 %11, -1
%14 = icmp ugt i32 %11, 99
br i1 %14, label %10, label %15
15: ; preds = %10, %5, %3
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 98)
ret void
}