#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_outl(int, int);
void main(void) {
  int i;
  int dest;
  goto start;
foo:
  __builtin_outl(dest, 0x5678);
  if (dest == 2)
    goto middle;
  goto head;
start:
  dest = 1;
  goto foo;
head:
  for (i = 0; i < 10; i++) {
    dest = 2;
    goto foo;
  middle:
    __builtin_outl(i, 0x1234);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    113e <main+0x2e>
mov    -0x8(%rbp),%edi
mov    $0x5678,%esi
call   1030 <__builtin_outl@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1139 <main+0x29>
jmp    1167 <main+0x57>
jmp    114a <main+0x3a>
movl   $0x1,-0x8(%rbp)
jmp    111d <main+0xd>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1182 <main+0x72>
movl   $0x2,-0x8(%rbp)
jmp    111d <main+0xd>
mov    -0x4(%rbp),%edi
mov    $0x1234,%esi
call   1030 <__builtin_outl@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <main+0x41>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
br label %10
3: ; preds = %15, %10
%4 = load i32, i32* %2
%5 = call i32 @__builtin_outl(i32 %4, i32 22136)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %3
br label %16
9: ; preds = %3
br label %11
10: ; preds = %0
store i32 1, i32* %2
br label %3
11: ; preds = %9
store i32 0, i32* %1
br label %12
12: ; preds = %19, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %22
15: ; preds = %12
store i32 2, i32* %2
br label %3
16: ; preds = %8
%17 = load i32, i32* %1
%18 = call i32 @__builtin_outl(i32 %17, i32 4660)
br label %19
19: ; preds = %16
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %12
22: ; preds = %12
ret void
}

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