xunge/DecIR huggingface dataset:
const char *_glewNextSpace(const char *i) {
  const char *j = i;
  if (j)
    while (*j != ' ' && *j)
      ++j;
  return j;
}


x86 assembly (clang, -O0):
<_glewNextSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <_glewNextSpace+0x6b>
jmp    1120 <_glewNextSpace+0x20>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1145 <_glewNextSpace+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <_glewNextSpace+0x55>
jmp    1166 <_glewNextSpace+0x66>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <_glewNextSpace+0x20>
jmp    116b <_glewNextSpace+0x6b>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glewNextSpace>:
test   %rdi,%rdi
je     111a <_glewNextSpace+0x1a>
mov    %rdi,%rax
testb  $0xdf,(%rax)
je     1119 <_glewNextSpace+0x19>
nopl   (%rax)
add    $0x1,%rax
testb  $0xdf,(%rax)
jne    1110 <_glewNextSpace+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_glewNextSpace(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %24
7: ; preds = %1
br label %8
8: ; preds = %20, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %8
23: ; preds = %18
br label %24
24: ; preds = %23, %1
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @_glewNextSpace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 32, label %8
i8 0, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ], [ %4, %3 ]
ret i8* %9
}
int f8(unsigned char c) {
  if (c == 0x22 && c <= 0x20)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x22,%eax
jne    1130 <f8+0x30>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jg     1130 <f8+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <f8+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f8(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 34
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 32
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %13
12: ; preds = %7, %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @f8(i8 zeroext %0) {
ret i32 1
}
void foo_1_2_1_1_1_1_1_1_1() {}


x86 assembly (clang, -O0):
<foo_1_2_1_1_1_1_1_1_1>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_1_2_1_1_1_1_1_1_1>:
ret

LLVM IR (-O0):
define void @foo_1_2_1_1_1_1_1_1_1() {
ret void
}

LLVM IR (-O2):
define void @foo_1_2_1_1_1_1_1_1_1() {
ret void
}
void irafswap2(char *string, int nbytes) {
  char *sbyte, temp, *slast;
  slast = string + nbytes;
  sbyte = string;
  while (sbyte < slast) {
    temp = sbyte[0];
    sbyte[0] = sbyte[1];
    sbyte[1] = temp;
    sbyte = sbyte + 2;
  }
  return;
}


x86 assembly (clang, -O0):
<irafswap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1161 <irafswap2+0x61>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1122 <irafswap2+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irafswap2>:
test   %esi,%esi
jle    111d <irafswap2+0x1d>
movslq %esi,%rax
add    %rdi,%rax
nopw   0x0(%rax,%rax,1)
rolw   $0x8,(%rdi)
add    $0x2,%rdi
cmp    %rax,%rdi
jb     1110 <irafswap2+0x10>
ret

LLVM IR (-O0):
define void @irafswap2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %7
%12 = load i8*, i8** %3
store i8* %12, i8** %5
br label %13
13: ; preds = %17, %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %7
%16 = icmp ult i8* %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
store i8 %20, i8* %6
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 0
store i8 %23, i8* %25
%26 = load i8, i8* %6
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 1
store i8 %26, i8* %28
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 2
store i8* %30, i8** %5
br label %13
31: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @irafswap2(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %7
store i8 %8, i8* %9
%11 = getelementptr inbounds i8, i8* %7, i64 2
%12 = icmp ult i8* %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ swapcontext(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int foo(ucontext_t *old, ucontext_t *new) { swapcontext(old, new); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <swapcontext@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <swapcontext@plt>

LLVM IR (-O0):
define i32 @foo(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = call i32 @swapcontext(i32* %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32* %0, i32* %1) {
%3 = tail call i32 @swapcontext(i32* %0, i32* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_save(int /*<<< orphan*/);
void g2_save_(float *dev) { g2_save(dtoi(*dev)); }


x86 assembly (clang, -O0):
<g2_save_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
call   1030 <g2_save@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_save_>:
push   %rax
movss  (%rdi),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <g2_save@plt>

LLVM IR (-O0):
define void @g2_save_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call i32 @dtoi(float %4)
%6 = call i32 @g2_save(i32 %5)
ret void
}

LLVM IR (-O2):
define void @g2_save_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @dtoi(float %2)
%4 = tail call i32 @g2_save(i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t vga_entry(unsigned char uc, uint8_t color) {
  return (uint16_t)uc | (uint16_t)color << 8;
}


x86 assembly (clang, -O0):
<vga_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_entry>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @vga_entry(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @vga_entry(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IstrFreeZone(int);
void IstrFreeAll() {
  int zone;
  for (zone = 0; zone < (4 + 1); zone++)
    IstrFreeZone(zone);
}


x86 assembly (clang, -O0):
<IstrFreeAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113f <IstrFreeAll+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <IstrFreeZone@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <IstrFreeAll+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IstrFreeAll>:
push   %rax
xor    %edi,%edi
call   1030 <IstrFreeZone@plt>
mov    $0x1,%edi
call   1030 <IstrFreeZone@plt>
mov    $0x2,%edi
call   1030 <IstrFreeZone@plt>
mov    $0x3,%edi
call   1030 <IstrFreeZone@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <IstrFreeZone@plt>

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

LLVM IR (-O2):
define void @IstrFreeAll() {
%1 = tail call i32 @IstrFreeZone(i32 0)
%2 = tail call i32 @IstrFreeZone(i32 1)
%3 = tail call i32 @IstrFreeZone(i32 2)
%4 = tail call i32 @IstrFreeZone(i32 3)
%5 = tail call i32 @IstrFreeZone(i32 4)
ret void
}
int sys$open(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(16), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x10,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$open>:
mov    $0x10,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$open"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 16, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$open"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 16, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
void fred(int n, int a, int b, int c, int d, int e, int f) {
  printf("fred: n=%d n=%d a=%d %d %d %d %d %d\n", n, n * 3, a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<fred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
imul   $0x3,-0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%r11d
mov    -0x18(%rbp),%r10d
mov    0x10(%rbp),%eax
lea    0xead(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fred>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%esi
mov    0x10(%rsp),%r11d
lea    (%rsi,%rsi,2),%edx
sub    $0x8,%rsp
lea    0xecc(%rip),%rdi
push   %r11
push   %rax
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fred: n=%d n=%d a=%d %d %d %d %d %d\0A\00"
define void @fred(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %8
%17 = mul nsw i32 %16, 3
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"fred: n=%d n=%d a=%d %d %d %d %d %d\0A\00"
define void @fred(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = mul nsw i32 %0, 3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %8, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}
void vec3_sign(double v[3]) {
  int i;
  for (i = 0; i < 3; i++)
    v[i] = -v[i];
}


x86 assembly (clang, -O0):
<vec3_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1158 <vec3_sign+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <vec3_sign+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_sign>:
movups (%rdi),%xmm0
movaps 0xef6(%rip),%xmm1
xorps  %xmm1,%xmm0
movups %xmm0,(%rdi)
movsd  0x10(%rdi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec3_sign(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load double*, double** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %8, i64 %10
%12 = load double, double* %11
%13 = fneg double %12
%14 = load double*, double** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @vec3_sign(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = fneg <2 x double> %3
%5 = bitcast double* %0 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = fneg double %7
store double %8, double* %6
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int compare_stats(const void *a, const void *b) {
  uint64_t sa = *(const uint64_t *)a;
  uint64_t sb = *(const uint64_t *)b;
  if (sa < sb)
    return -1;
  if (sa > sb)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <compare_stats+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <compare_stats+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <compare_stats+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare_stats+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_stats>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_stats(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp sgt i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_stats(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  do {
    fprintf(stderr, "usage: sim2png [--geom=WxH] SIMFILES...\n");
  } while (0);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <usage+0x9>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: sim2png [--geom=WxH] SIMFILES...\0A\00"
define void @usage() {
br label %1
1: ; preds = %0
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: sim2png [--geom=WxH] SIMFILES...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
void unaligned_write_be16(void *_u, uint16_t a) {
  struct __attribute__((packed, may_alias)) {
    uint16_t x;
  } *u = _u;
  u->x = be16toh(a);
}


x86 assembly (clang, -O0):
<unaligned_write_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <be16toh@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_be16>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <be16toh@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_be16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @be16toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_be16(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @be16toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
int test_imm_48uint32_reg(unsigned int val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_48uint32_reg>:
test   $0x48,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 72
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_48uint32_reg(i32 %0) {
%2 = and i32 %0, 72
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ltq_lxfreq_state_change_disable(void) { return 0; }


x86 assembly (clang, -O0):
<ltq_lxfreq_state_change_disable>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltq_lxfreq_state_change_disable>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ltq_lxfreq_state_change_disable() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ltq_lxfreq_state_change_disable() {
ret i32 0
}
void test_transac() {}


x86 assembly (clang, -O0):
<test_transac>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_transac>:
ret

LLVM IR (-O0):
define void @test_transac() {
ret void
}

LLVM IR (-O2):
define void @test_transac() {
ret void
}
const char *db_create_nomaccts_table_sql(void) {
  static const char *query =
      "CREATE TABLE nomaccts ("
      "    num            VARCHAR(20)     NOT NULL,"
      "    description    VARCHAR(100)    NOT NULL,"
      "    enabled        BOOLEAN         NOT NULL DEFAULT TRUE,"
      "  CONSTRAINT nomaccts"
      "    PRIMARY KEY (num)"
      ");";
  return query;
}


x86 assembly (clang, -O0):
<db_create_nomaccts_table_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_create_nomaccts_table_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_create_nomaccts_table_sql.query = internal global i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i32 0, i32 0)
@.str = [213 x i8] c"CREATE TABLE nomaccts ( num VARCHAR(20) NOT NULL, description VARCHAR(100) NOT NULL, enabled BOOLEAN NOT NULL DEFAULT TRUE, CONSTRAINT nomaccts PRIMARY KEY (num));\00"
define i8* @db_create_nomaccts_table_sql() {
%1 = load i8*, i8** @db_create_nomaccts_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [213 x i8] c"CREATE TABLE nomaccts ( num VARCHAR(20) NOT NULL, description VARCHAR(100) NOT NULL, enabled BOOLEAN NOT NULL DEFAULT TRUE, CONSTRAINT nomaccts PRIMARY KEY (num));\00"
define i8* @db_create_nomaccts_table_sql() {
ret i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0)
}
int bcnn_omp_get_num_threads() { return 1; }


x86 assembly (clang, -O0):
<bcnn_omp_get_num_threads>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcnn_omp_get_num_threads>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bcnn_omp_get_num_threads() {
ret i32 1
}

LLVM IR (-O2):
define i32 @bcnn_omp_get_num_threads() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, char);
void serial_configure_line(unsigned short com, char config) {
  outb((com + 3), config);
}


x86 assembly (clang, -O0):
<serial_configure_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
movzwl %ax,%edi
movsbl -0x3(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_line>:
add    $0x3,%edi
movzwl %di,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_line(i16 zeroext %0, i8 signext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 3
%8 = trunc i32 %7 to i16
%9 = load i8, i8* %4
%10 = call i32 @outb(i16 zeroext %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @serial_configure_line(i16 zeroext %0, i8 signext %1) {
%3 = add i16 %0, 3
%4 = tail call i32 @outb(i16 zeroext %3, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_partialfilelock(char const *);
void do_clear(const char *hostname) { clear_partialfilelock(hostname); }


x86 assembly (clang, -O0):
<do_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clear_partialfilelock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_clear>:
jmp    1030 <clear_partialfilelock@plt>

LLVM IR (-O0):
define void @do_clear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @clear_partialfilelock(i8* %3)
ret void
}

LLVM IR (-O2):
define void @do_clear(i8* %0) {
%2 = tail call i32 @clear_partialfilelock(i8* %0)
ret void
}
/* Type definitions */
struct header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, unsigned long);
struct header **tests_memory_find(void *);
struct header **tests_free_find(void *ptr) {
  struct header **hp = tests_memory_find(ptr);
  if (hp == NULL) {
    printf("tests_free(): attempt to free bad pointer 0x%lX\n",
           (unsigned long)ptr);
    abort();
  }
  return hp;
}


x86 assembly (clang, -O0):
<tests_free_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <tests_memory_find@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <tests_free_find+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_free_find>:
push   %rbx
mov    %rdi,%rbx
call   1050 <tests_memory_find@plt>
test   %rax,%rax
je     1140 <tests_free_find+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.header = type { i32 }
@.str = [49 x i8] c"tests_free(): attempt to free bad pointer 0x%lX\0A\00"
define %struct.header** @tests_free_find(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.header**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.header** @tests_memory_find(i8* %4)
store %struct.header** %5, %struct.header*** %3
%6 = load %struct.header**, %struct.header*** %3
%7 = icmp eq %struct.header** %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load %struct.header**, %struct.header*** %3
ret %struct.header** %14
}

LLVM IR (-O2):
%struct.header = type { i32 }
@.str = [49 x i8] c"tests_free(): attempt to free bad pointer 0x%lX\0A\00"
define %struct.header** @tests_free_find(i8* %0) {
%2 = tail call %struct.header** @tests_memory_find(i8* %0)
%3 = icmp eq %struct.header** %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = ptrtoint i8* %0 to i64
%6 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret %struct.header** %2
}
/* Variables and functions */
int /*<<< orphan*/ nmn4_read_data();
void nmn4_read(void) { nmn4_read_data(); }


x86 assembly (clang, -O0):
<nmn4_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nmn4_read_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmn4_read>:
xor    %eax,%eax
jmp    1030 <nmn4_read_data@plt>

LLVM IR (-O0):
define void @nmn4_read() {
%1 = call i32 (...) @nmn4_read_data()
ret void
}

LLVM IR (-O2):
define void @nmn4_read() {
%1 = tail call i32 (...) @nmn4_read_data()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_msr_reg_op();
int /*<<< orphan*/ arm_reg_to_psr(int /*<<< orphan*/);
void arm_msr_reg() { arm_reg_to_psr(arm_msr_reg_op()); }


x86 assembly (clang, -O0):
<arm_msr_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_msr_reg_op@plt>
mov    %eax,%edi
call   1040 <arm_reg_to_psr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_msr_reg>:
push   %rax
xor    %eax,%eax
call   1030 <arm_msr_reg_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_reg_to_psr@plt>

LLVM IR (-O0):
define void @arm_msr_reg() {
%1 = call i32 (...) @arm_msr_reg_op()
%2 = call i32 @arm_reg_to_psr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_msr_reg() {
%1 = tail call i32 (...) @arm_msr_reg_op()
%2 = tail call i32 @arm_reg_to_psr(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  if (errno)
    perror(message);
  else
    printf("ERROR: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <die+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_ADDUSB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xdc);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_ADDUSB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xdc,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_ADDUSB>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xdc,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_ADDUSB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 220)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_ADDUSB(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 220)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int detruitSegment(int shmid) {
  if ((shmctl(shmid, IPC_RMID, NULL)) == -1) {
    perror("shmctl destroy");
    return -1;
  }
  printf("Destroy\n");
  return 0;
}


x86 assembly (clang, -O0):
<detruitSegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1171 <detruitSegment+0x41>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <detruitSegment+0x54>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detruitSegment>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1158 <detruitSegment+0x28>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1154 <detruitSegment+0x24>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [15 x i8] c"shmctl destroy\00"
@.str.1 = [9 x i8] c"Destroy\0A\00"
define i32 @detruitSegment(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @shmctl(i32 %4, i32 %5, i32* null)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [15 x i8] c"shmctl destroy\00"
@str = [8 x i8] c"Destroy\00"
define i32 @detruitSegment(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %10
}
/* Type definitions */
struct Barcode_Item {
  int dummy;
};

/* Variables and functions */
int Barcode_ean_encode(struct Barcode_Item *);
int Barcode_upc_encode(struct Barcode_Item *bc) {
  return Barcode_ean_encode(bc);
}


x86 assembly (clang, -O0):
<Barcode_upc_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Barcode_ean_encode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Barcode_upc_encode>:
jmp    1030 <Barcode_ean_encode@plt>

LLVM IR (-O0):
%struct.Barcode_Item = type { i32 }
define i32 @Barcode_upc_encode(%struct.Barcode_Item* %0) {
%2 = alloca %struct.Barcode_Item*
store %struct.Barcode_Item* %0, %struct.Barcode_Item** %2
%3 = load %struct.Barcode_Item*, %struct.Barcode_Item** %2
%4 = call i32 @Barcode_ean_encode(%struct.Barcode_Item* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.Barcode_Item = type { i32 }
define i32 @Barcode_upc_encode(%struct.Barcode_Item* %0) {
%2 = tail call i32 @Barcode_ean_encode(%struct.Barcode_Item* %0)
ret i32 %2
}
void __DELETE_java_io_FilterOutputStream(void *me, void *client_data) {}


x86 assembly (clang, -O0):
<__DELETE_java_io_FilterOutputStream>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__DELETE_java_io_FilterOutputStream>:
ret

LLVM IR (-O0):
define void @__DELETE_java_io_FilterOutputStream(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_io_FilterOutputStream(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
float area(float);
float volume(float r, float h) {
  float v = 0.0;
  v = area(r) * h;
  return v;
}


x86 assembly (clang, -O0):
<volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <area@plt>
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <area@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @volume(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = call float @area(float %6)
%8 = load float, float* %4
%9 = fmul float %7, %8
store float %9, float* %5
%10 = load float, float* %5
ret float %10
}

LLVM IR (-O2):
define float @volume(float %0, float %1) {
%3 = tail call float @area(float %0)
%4 = fmul float %3, %1
ret float %4
}
int ASCIItolower(int c) { return (c >= 0x41 && c <= 0x5A) ? c | 0x20 : c; }


x86 assembly (clang, -O0):
<ASCIItolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <ASCIItolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <ASCIItolower+0x29>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <ASCIItolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASCIItolower>:
lea    -0x41(%rdi),%ecx
mov    %edi,%eax
or     $0x20,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ASCIItolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = or i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @ASCIItolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void fatal(msg) char *msg;
{
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
xor    %eax,%eax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %3)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int get_current_memory(void *);
unsigned int current_memory(void *stack_limit) {
  return get_current_memory(stack_limit);
}


x86 assembly (clang, -O0):
<current_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_current_memory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_memory>:
jmp    1030 <get_current_memory@plt>

LLVM IR (-O0):
define i32 @current_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_current_memory(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @current_memory(i8* %0) {
%2 = tail call i32 @get_current_memory(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *fgetc(int /*<<< orphan*/ *);
int read_int(FILE *f) {
  unsigned char extra;
  int number;
  number = fgetc(f);
  if (number & 0x80) {
    extra = fgetc(f);
    number += (extra - 1) * 0x80;
  }
  return number;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1155 <read_int+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
sub    $0x1,%eax
shl    $0x7,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %rax,%rbx
test   $0x80,%bl
je     1137 <read_int+0x27>
mov    %r14,%rdi
call   1030 <fgetc@plt>
movzbl %al,%eax
shl    $0x7,%eax
add    %eax,%ebx
add    $0xffffff80,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @fgetc(i32* %5)
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %1
%12 = load i32*, i32** %2
%13 = call i8* @fgetc(i32* %12)
%14 = ptrtoint i8* %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = sub nsw i32 %16, 1
%18 = mul nsw i32 %17, 128
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
br label %21
21: ; preds = %11, %1
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @read_int(i32* nocapture %0) {
%2 = tail call i8* @fgetc(i32* %0)
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = tail call i8* @fgetc(i32* %0)
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 7
%12 = and i32 %11, 32640
%13 = add i32 %4, -128
%14 = add i32 %13, %12
br label %15
15: ; preds = %7, %1
%16 = phi i32 [ %14, %7 ], [ %4, %1 ]
ret i32 %16
}
void platform_execute(void *sp, void *func, void *arg) {
  asm volatile("movq %0,  %%rsp;"
               "movq %%rsp, %%rbp;"
               "movq %0, -8(%%rbp);"
               "movq %1, -16(%%rbp);"
               "movq %2, -24(%%rbp);"
               "sub  $24, %%rsp;"
               "movq %2, %%rdi;"
               "call *-16(%%rbp);"
               :
               : "r"(sp), "r"(func), "r"(arg));
}


x86 assembly (clang, -O0):
<platform_execute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %rax,%rsp
mov    %rsp,%rbp
mov    %rax,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
sub    $0x18,%rsp
mov    %rdx,%rdi
call   *-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_execute>:
mov    %rdi,%rsp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
sub    $0x18,%rsp
mov    %rdx,%rdi
call   *-0x10(%rbp)
ret

LLVM IR (-O0):
define void @platform_execute(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @platform_execute(i8* %0, i8* %1, i8* %2) {
tail call void asm sideeffect "movq $0, %rsp;movq %rsp, %rbp;movq $0, -8(%rbp);movq $1, -16(%rbp);movq $2, -24(%rbp);sub $$24, %rsp;movq $2, %rdi;call *-16(%rbp);", "r,r,r,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i8* %2)
ret void
}
int test_imm_8Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Euint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Euint8_mem>:
testb  $0x72,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Euint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -142
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_8Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 114
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}