#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*/ __builtin_outb(int, int);
void main(void) {
  int i;
  i = 0;
  do {
    int j;
    __builtin_outb(i, 0xab);
    j = i++;
    __builtin_outb(j, 0xdc);
  } while (i <= 9);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
cmpl   $0x9,-0x4(%rbp)
jle    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
xor    %edi,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x1,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x1,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x2,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x2,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x3,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x3,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x4,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x4,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x5,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x5,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x6,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x6,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x7,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x7,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x8,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x8,%edi
mov    $0xdc,%esi
call   1030 <__builtin_outb@plt>
mov    $0x9,%edi
mov    $0xab,%esi
call   1030 <__builtin_outb@plt>
mov    $0x9,%edi
mov    $0xdc,%esi
pop    %rax
jmp    1030 <__builtin_outb@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = call i32 @__builtin_outb(i32 %4, i32 171)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
store i32 %6, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @__builtin_outb(i32 %8, i32 220)
br label %10
10: ; preds = %3
%11 = load i32, i32* %1
%12 = icmp sle i32 %11, 9
br i1 %12, label %3, label %13
13: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__builtin_outb(i32 0, i32 171)
%2 = tail call i32 @__builtin_outb(i32 0, i32 220)
%3 = tail call i32 @__builtin_outb(i32 1, i32 171)
%4 = tail call i32 @__builtin_outb(i32 1, i32 220)
%5 = tail call i32 @__builtin_outb(i32 2, i32 171)
%6 = tail call i32 @__builtin_outb(i32 2, i32 220)
%7 = tail call i32 @__builtin_outb(i32 3, i32 171)
%8 = tail call i32 @__builtin_outb(i32 3, i32 220)
%9 = tail call i32 @__builtin_outb(i32 4, i32 171)
%10 = tail call i32 @__builtin_outb(i32 4, i32 220)
%11 = tail call i32 @__builtin_outb(i32 5, i32 171)
%12 = tail call i32 @__builtin_outb(i32 5, i32 220)
%13 = tail call i32 @__builtin_outb(i32 6, i32 171)
%14 = tail call i32 @__builtin_outb(i32 6, i32 220)
%15 = tail call i32 @__builtin_outb(i32 7, i32 171)
%16 = tail call i32 @__builtin_outb(i32 7, i32 220)
%17 = tail call i32 @__builtin_outb(i32 8, i32 171)
%18 = tail call i32 @__builtin_outb(i32 8, i32 220)
%19 = tail call i32 @__builtin_outb(i32 9, i32 171)
%20 = tail call i32 @__builtin_outb(i32 9, i32 220)
ret void
}