#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 */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void delay_10us(uint8_t delay) {
  volatile uint8_t delay_10us;
  for (; delay > 0; delay--) {
    for (delay_10us = ((uint8_t)28); delay_10us > 0; delay_10us--)
      ;
    ;
  }
}


x86 assembly (clang, -O0):
<delay_10us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1155 <delay_10us+0x55>
movq   $0x1c,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x0,%rax
jle    113f <delay_10us+0x3f>
jmp    112e <delay_10us+0x2e>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <delay_10us+0x1b>
jmp    1144 <delay_10us+0x44>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <delay_10us+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_10us>:
test   %rdi,%rdi
jle    1138 <delay_10us+0x38>
mov    %rdi,%rax
test   $0x1,%dil
je     1132 <delay_10us+0x32>
movq   $0x1c,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jle    112e <delay_10us+0x2e>
nop
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jg     1120 <delay_10us+0x20>
lea    -0x1(%rdi),%rax
cmp    $0x1,%rdi
jne    114d <delay_10us+0x4d>
ret
nopl   0x0(%rax)
lea    -0x2(%rax),%rcx
cmp    $0x2,%rax
mov    %rcx,%rax
jle    1138 <delay_10us+0x38>
movq   $0x1c,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jle    116e <delay_10us+0x6e>
xchg   %ax,%ax
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jg     1160 <delay_10us+0x60>
movq   $0x1c,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jle    1140 <delay_10us+0x40>
nop
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jg     1180 <delay_10us+0x80>
jmp    1140 <delay_10us+0x40>

LLVM IR (-O0):
define void @delay_10us(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
br label %4
4: ; preds = %16, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
store volatile i64 28, i64* %3
br label %8
8: ; preds = %12, %7
%9 = load volatile i64, i64* %3
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load volatile i64, i64* %3
%14 = add nsw i64 %13, -1
store volatile i64 %14, i64* %3
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i64, i64* %2
%18 = add nsw i64 %17, -1
store i64 %18, i64* %2
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_10us(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %41
5: ; preds = %1
%6 = and i64 %0, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5
store volatile i64 28, i64* %2
%9 = load volatile i64, i64* %2
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8, %11
%12 = load volatile i64, i64* %2
%13 = add nsw i64 %12, -1
store volatile i64 %13, i64* %2
%14 = load volatile i64, i64* %2
%15 = icmp sgt i64 %14, 0
br i1 %15, label %11, label %16
16: ; preds = %11, %8
%17 = add nsw i64 %0, -1
br label %18
18: ; preds = %16, %5
%19 = phi i64 [ %0, %5 ], [ %17, %16 ]
%20 = icmp eq i64 %0, 1
br i1 %20, label %41, label %21
21: ; preds = %18, %38
%22 = phi i64 [ %39, %38 ], [ %19, %18 ]
store volatile i64 28, i64* %2
%23 = load volatile i64, i64* %2
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %21, %25
%26 = load volatile i64, i64* %2
%27 = add nsw i64 %26, -1
store volatile i64 %27, i64* %2
%28 = load volatile i64, i64* %2
%29 = icmp sgt i64 %28, 0
br i1 %29, label %25, label %30
30: ; preds = %25, %21
store volatile i64 28, i64* %2
%31 = load volatile i64, i64* %2
%32 = icmp sgt i64 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %30, %33
%34 = load volatile i64, i64* %2
%35 = add nsw i64 %34, -1
store volatile i64 %35, i64* %2
%36 = load volatile i64, i64* %2
%37 = icmp sgt i64 %36, 0
br i1 %37, label %33, label %38
38: ; preds = %33, %30
%39 = add nsw i64 %22, -2
%40 = icmp sgt i64 %22, 2
br i1 %40, label %21, label %41
41: ; preds = %18, %38, %1
ret void
}