#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 count_down() {
  int upper = 304;
  int lower = 17;
  int step = 5;
  printf("Reverse order list of integers greater than %d, beginning at %d, "
         "stepping by -%d.\n",
         lower, upper, step);
  for (; upper > lower; upper -= step) {
    printf("%d\n", upper);
  }
}


x86 assembly (clang, -O0):
<count_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x130,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1171 <count_down+0x61>
mov    -0x4(%rbp),%esi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <count_down+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_down>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
mov    $0x11,%esi
mov    $0x130,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x135,%ebx
lea    0xf16(%rip),%r14
nopl   (%rax)
add    $0xfffffffb,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x16,%ebx
ja     1140 <count_down+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [83 x i8] c"Reverse order list of integers greater than %d, beginning at %d, stepping by -%d.\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @count_down() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 304, i32* %1
store i32 17, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %3
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32, i32* %1
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, %16
store i32 %18, i32* %1
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [83 x i8] c"Reverse order list of integers greater than %d, beginning at %d, stepping by -%d.\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @count_down() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 17, i32 304, i32 5)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 304, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nsw i32 %3, -5
%6 = icmp ugt i32 %3, 22
br i1 %6, label %2, label %7
7: ; preds = %2
ret void
}