#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 */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct timespec tim;
  tim.tv_sec = 0;
  tim.tv_nsec = 500000000L;
  int i = 0;
  while (i < 20) {
    i++;
    if (i == 13) {
      continue;
    }
    printf("%d\n", i);
    nanosleep(&tim, NULL);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1dcd6500,-0x18(%rbp)
1d
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    1189 <main+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xd,-0x1c(%rbp)
jne    1168 <main+0x48>
jmp    1146 <main+0x26>
mov    -0x1c(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <nanosleep@plt>
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movaps 0xed0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0xffffffff,%ebx
lea    0xed0(%rip),%r14
mov    %rsp,%r15
jmp    1158 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x13,%ebx
jae    1174 <main+0x54>
cmp    $0xb,%ebx
je     1150 <main+0x30>
lea    0x2(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <nanosleep@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 500000000, i64* %5
store i32 0, i32* %3
br label %6
6: ; preds = %15, %14, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 13
br i1 %13, label %14, label %15
14: ; preds = %9
br label %6
15: ; preds = %9
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
br label %6
19: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca <2 x i64>
%2 = bitcast <2 x i64>* %1 to %struct.timespec*
%3 = bitcast <2 x i64>* %1 to i8*
store <2 x i64> <i64 500000000, i64 0>, <2 x i64>* %1
br label %4
4: ; preds = %0, %11
%5 = phi i32 [ 0, %0 ], [ %6, %11 ]
%6 = add nuw nsw i32 %5, 1
%7 = icmp eq i32 %6, 13
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
br label %11
11: ; preds = %8, %4
%12 = icmp ult i32 %5, 19
br i1 %12, label %4, label %13
13: ; preds = %11
ret i32 0
}