_Noreturn void the_count(void) {
  for (int i = 5; i-- > 0;) {
    printf("%i\n", i);
    sleep(1);
  }
  quick_exit(1);
  _Exit(1);
  exit(1);
}


x86 assembly (clang, -O0):
<the_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1185 <the_count+0x45>
mov    -0x4(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <sleep@plt>
jmp    114f <the_count+0xf>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <quick_exit@plt>
mov    $0x1,%edi
call   1050 <_Exit@plt>

x86 assembly (clang, -O2):
<the_count>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <quick_exit@plt>
mov    $0x1,%edi
call   1050 <_Exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @the_count() {
%1 = alloca i32
store i32 5, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
br label %2
10: ; preds = %2
%11 = call i32 (i32, ...) bitcast (i32 (...)* @quick_exit to i32 (i32, ...)*)(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @the_count() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @quick_exit to i32 (i32, ...)*)(i32 1)
tail call void @_Exit(i32 1)
unreachable
}