#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*/ oosmos_DelayMS(int);
int /*<<< orphan*/ printf(char *);
extern int main(void) {
  for (unsigned LoopCount = 1; LoopCount <= 5; LoopCount++) {
    oosmos_DelayMS(500);
    printf("Work...\n");
  }
  printf("SUCCESS\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   $0x5,-0x8(%rbp)
ja     1164 <main+0x44>
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1f4,%edi
call   1040 <oosmos_DelayMS@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Work...\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\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 = %9, %0
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @oosmos_DelayMS(i32 500)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"SUCCESS\00"
@str.2 = [8 x i8] c"Work...\00"
define i32 @main() {
%1 = tail call i32 @oosmos_DelayMS(i32 500)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @oosmos_DelayMS(i32 500)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @oosmos_DelayMS(i32 500)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 @oosmos_DelayMS(i32 500)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%9 = tail call i32 @oosmos_DelayMS(i32 500)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}