xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int fchdir(int fd) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<fchdir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchdir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @fchdir(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @fchdir(i32 %0) {
%2 = load i32, i32* @EACCES
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
void strcmp_unknown_arg(char *unknown) {
  if (strcmp(unknown, unknown) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcmp_unknown_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1133 <strcmp_unknown_arg+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_unknown_arg>:
mov    %rdi,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define void @strcmp_unknown_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %3, i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @strcmp_unknown_arg(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* %0)
ret void
}
/* Variables and functions */
size_t strlen(char const *str) {
  char const *s;
  s = str;
  while (*s) {
    ++s;
  }
  return ((size_t)(s - str));
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ chacha_init(void const *, int const *);
void chaha_init_512(const void *key) {
  const uint8_t nonce[] = {0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
                           0x00, 0x4a, 0x00, 0x00, 0x00, 0x00};
  chacha_init(key, nonce);
}


x86 assembly (clang, -O0):
<chaha_init_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
movl   $0x9,-0x34(%rbp)
movl   $0x4a,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <chacha_init@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaha_init_512>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movl   $0x9,0xc(%rsp)
movl   $0x4a,0x1c(%rsp)
mov    %rsp,%rsi
call   1030 <chacha_init@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @chaha_init_512(i8* %0) {
%2 = alloca i8*
%3 = alloca [12 x i32]
store i8* %0, i8** %2
%4 = bitcast [12 x i32]* %3 to i8*
%5 = bitcast i8* %4 to [12 x i32]*
%6 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i32 0, i32 3
store i32 9, i32* %6
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i32 0, i32 7
store i32 74, i32* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 @chacha_init(i8* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @chaha_init_512(i8* %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 3
store i32 9, i32* %4
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 7
store i32 74, i32* %5
%6 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%7 = call i32 @chacha_init(i8* %0, i32* %6)
ret void
}
int test_imm_DDint64_lowword_mem(long long *val) {
  return ((*val) & (0xDD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DDint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 221
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo5() {}


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

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

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

LLVM IR (-O2):
define void @foo5() {
ret void
}
char *GetFileType(mode)
int mode;
{
  if (0) {
    return "file";
  } else if (0) {
    return "directory";
  } else if (0) {
    return "characterSpecial";
  } else if (0) {
    return "blockSpecial";
  } else if (0) {
    return "fifo";
  } else if (0) {
    return "link";
  } else if (0) {
    return "socket";
  }
  return "unknown";
}


x86 assembly (clang, -O0):
<GetFileType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @GetFileType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @GetFileType(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA9_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA9_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRA9_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRA9_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void failInfo(int errorId, char *msg) {
  printf("<rsp state=\"fail\"><return errorId=\"%d\" msg=\"%s\" /></rsp>",
         errorId, msg);
}


x86 assembly (clang, -O0):
<failInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failInfo>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"<rsp state=\22fail\22><return errorId=\22%d\22 msg=\22%s\22 /></rsp>\00"
define void @failInfo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"<rsp state=\22fail\22><return errorId=\22%d\22 msg=\22%s\22 /></rsp>\00"
define void @failInfo(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail();
int main() {
  int x = 0;
  while (1) {
    x += 1;
    if (x == 2) {
      x = 0;
    }
    if (x >= 2) {
      __assert_fail();
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1140 <main+0x30>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     115c <main+0x4c>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int);
int main(void) {
  char c __attribute__((unused));
  char *c0, *c1;
  c0 = malloc(10000);
  c1 = malloc(10000);
  assert(c0 && c1);
  c = c0[15000];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2710,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x2710,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1166 <main+0x46>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x3a98(%rax),%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i8* @malloc(i32 10000)
store i8* %5, i8** %3
%6 = call i8* @malloc(i32 10000)
store i8* %6, i8** %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 15000
%18 = load i8, i8* %17
store i8 %18, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
char arithmetics() {
  volatile char foo = 0x33;
  volatile char bar = 0x03;
  volatile char baz = 0x30;
  volatile char qux = 0x22;
  volatile char quux = ((foo & bar) | baz) ^ qux;
  volatile char quuux = quux + foo - bar;
  return quuux;
}


x86 assembly (clang, -O0):
<arithmetics>:
push   %rbp
mov    %rsp,%rbp
movb   $0x33,-0x1(%rbp)
movb   $0x3,-0x2(%rbp)
movb   $0x30,-0x3(%rbp)
movb   $0x22,-0x4(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%eax
mov    -0x2(%rbp),%cl
movsbl %cl,%ecx
and    %ecx,%eax
mov    -0x3(%rbp),%cl
movsbl %cl,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%cl
movsbl %cl,%ecx
xor    %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
movsbl %al,%eax
mov    -0x1(%rbp),%cl
movsbl %cl,%ecx
add    %ecx,%eax
mov    -0x2(%rbp),%cl
movsbl %cl,%ecx
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmetics>:
movb   $0x33,-0x5(%rsp)
movb   $0x3,-0x6(%rsp)
movb   $0x30,-0x1(%rsp)
movb   $0x22,-0x2(%rsp)
mov    -0x5(%rsp),%al
and    -0x6(%rsp),%al
or     -0x1(%rsp),%al
xor    -0x2(%rsp),%al
mov    %al,-0x3(%rsp)
mov    -0x3(%rsp),%al
add    -0x5(%rsp),%al
sub    -0x6(%rsp),%al
mov    %al,-0x4(%rsp)
mov    -0x4(%rsp),%al
ret

LLVM IR (-O0):
define signext i8 @arithmetics() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store volatile i8 51, i8* %1
store volatile i8 3, i8* %2
store volatile i8 48, i8* %3
store volatile i8 34, i8* %4
%7 = load volatile i8, i8* %1
%8 = sext i8 %7 to i32
%9 = load volatile i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %8, %10
%12 = load volatile i8, i8* %3
%13 = sext i8 %12 to i32
%14 = or i32 %11, %13
%15 = load volatile i8, i8* %4
%16 = sext i8 %15 to i32
%17 = xor i32 %14, %16
%18 = trunc i32 %17 to i8
store volatile i8 %18, i8* %5
%19 = load volatile i8, i8* %5
%20 = sext i8 %19 to i32
%21 = load volatile i8, i8* %1
%22 = sext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = load volatile i8, i8* %2
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %23, %25
%27 = trunc i32 %26 to i8
store volatile i8 %27, i8* %6
%28 = load volatile i8, i8* %6
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @arithmetics() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store volatile i8 51, i8* %1
store volatile i8 3, i8* %2
store volatile i8 48, i8* %3
store volatile i8 34, i8* %4
%7 = load volatile i8, i8* %1
%8 = load volatile i8, i8* %2
%9 = and i8 %8, %7
%10 = load volatile i8, i8* %3
%11 = or i8 %9, %10
%12 = load volatile i8, i8* %4
%13 = xor i8 %11, %12
store volatile i8 %13, i8* %5
%14 = load volatile i8, i8* %5
%15 = load volatile i8, i8* %1
%16 = add i8 %15, %14
%17 = load volatile i8, i8* %2
%18 = sub i8 %16, %17
store volatile i8 %18, i8* %6
%19 = load volatile i8, i8* %6
ret i8 %19
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void SetBitUInt8(uint8_t *x, const uint8_t bitNum) { *x |= (1 << bitNum); }


x86 assembly (clang, -O0):
<SetBitUInt8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBitUInt8>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @SetBitUInt8(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", (int)sizeof(long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ start_serial_threads();
void main() { start_serial_threads(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @start_serial_threads()
ret void
}
void av_jni_get_java_vm() {}


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

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

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

LLVM IR (-O2):
define void @av_jni_get_java_vm() {
ret void
}
int assemble4le(char *p) {
  return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24));
}


x86 assembly (clang, -O0):
<assemble4le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble4le>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x10,%edx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @assemble4le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @assemble4le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
void sub5(jmp_buf buf) { longjmp(buf, 1); }


x86 assembly (clang, -O0):
<sub5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<sub5>:
push   %rax
mov    $0x1,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
define void @sub5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @longjmp(i32 %3, i32 1)
unreachable
}

LLVM IR (-O2):
define void @sub5(i32 %0) {
%2 = tail call i32 @longjmp(i32 %0, i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
size_t fwrite(char const *, int, size_t, int /*<<< orphan*/ *);
size_t strlen(char const *);
int fputs(const char *string, FILE *stream) {
  size_t n = strlen(string);
  size_t r;
  r = fwrite(string, 1, n, stream);
  return n > r ? EOF : 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1176 <fputs+0x56>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <fputs+0x60>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <fputs+0x60>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fwrite@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r15
jbe    1159 <fputs+0x39>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fputs(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = load i32*, i32** %4
%12 = call i64 @fwrite(i8* %9, i32 1, i64 %10, i32* %11)
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp ugt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32, i32* @EOF
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %16
%20 = phi i32 [ %17, %16 ], [ 0, %18 ]
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @fwrite(i8* %0, i32 1, i64 %3, i32* %1)
%5 = icmp ugt i64 %3, %4
%6 = load i32, i32* @EOF
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ recurse(int /*<<< orphan*/ *, int, int, int *, int,
                           char ***);
char **generateParenthesis(int n, int *returnSize) {
  char **result = NULL;
  int num = 0;
  recurse(NULL, n, n, &num, 2 * n, &result);
  *returnSize = num;
  int i = 0;
  return result;
}


x86 assembly (clang, -O0):
<generateParenthesis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%r8d
shl    $0x1,%r8d
xor    %eax,%eax
mov    %eax,%edi
lea    -0x1c(%rbp),%rcx
lea    -0x18(%rbp),%r9
call   1030 <recurse@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateParenthesis>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%edx
movq   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    (%rdx,%rdx,1),%r8d
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r9
xor    %edi,%edi
mov    %edx,%esi
call   1030 <recurse@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8** @generateParenthesis(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i8** null, i8*** %5
store i32 0, i32* %6
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 2, %10
%12 = call i32 @recurse(i32* null, i32 %8, i32 %9, i32* %6, i32 %11, i8*** %5)
%13 = load i32, i32* %6
%14 = load i32*, i32** %4
store i32 %13, i32* %14
store i32 0, i32* %7
%15 = load i8**, i8*** %5
ret i8** %15
}

LLVM IR (-O2):
define i8** @generateParenthesis(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = bitcast i8*** %3 to i8*
store i8** null, i8*** %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = shl nsw i32 %0, 1
%8 = call i32 @recurse(i32* null, i32 %0, i32 %0, i32* %4, i32 %7, i8*** %3)
%9 = load i32, i32* %4
store i32 %9, i32* %1
%10 = load i8**, i8*** %3
ret i8** %10
}
void cellgen_idle_start() {}


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

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

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

LLVM IR (-O2):
define void @cellgen_idle_start() {
ret void
}
int main(int argc, const char *argv[]) {
  int i;
  int fact[6];
  fact[0] = 1;
  for (i = 1; i < 6; ++i) {
    fact[i] = fact[i - 1] * i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1150 <main+0x50>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
imul   -0x14(%rbp),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [6 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
store i32 1, i32* %8
store i32 1, i32* %6
br label %9
9: ; preds = %23, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 6
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %21
store i32 %19, i32* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %9
26: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void triexit(int status) { exit(status); }


x86 assembly (clang, -O0):
<triexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<triexit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @triexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @triexit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_int();
int main(void) {
  unsigned int a = __VERIFIER_nondet_int();
  if (a < 0) {
    return a;
  }
  __VERIFIER_assert(a >= 0);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jae    114e <main+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <main+0x45>
cmpl   $0x0,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %14
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp uge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @__VERIFIER_assert(i32 %11)
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %14
14: ; preds = %8, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void handler(int sig) {
  pid_t pid;
  int status;
  while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
    printf("Signal %d received\n", sig);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <handler+0x42>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb7(%rip),%r12
mov    (%r12),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117f <handler+0x5f>
lea    0xeb1(%rip),%r14
lea    0x4(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    (%r12),%edx
mov    $0xffffffff,%edi
mov    %r15,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <handler+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [20 x i8] c"Signal %d received\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [20 x i8] c"Signal %d received\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%9 = load i32, i32* @WNOHANG
%10 = call i32 @waitpid(i32 -1, i32* %2, i32 %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret void
}
void f4(void) {
#pragma omp task
  {
#pragma omp ordered
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @f4() {
ret void
}
int test_imm_8Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x8c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_8Cuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 140
%7 = icmp ne i64 %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_8Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9175040
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int x86_cpu_support_standard_flag(int flag, int mask) {
  return (flag & (1 << mask));
}


x86 assembly (clang, -O0):
<x86_cpu_support_standard_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_cpu_support_standard_flag>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @x86_cpu_support_standard_flag(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
void UI_dup_input_boolean(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_dup_input_boolean() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char *);
int println() {
  putchar("\r");
  putchar("\n");
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <putchar@plt>
lea    0xed7(%rip),%rdi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <putchar@plt>
lea    0xede(%rip),%rdi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0D\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @println() {
%1 = alloca i32
%2 = call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0D\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @println() {
%1 = tail call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *malloc(size_t);
char *skip_nonspaces(char *);
int /*<<< orphan*/ unmangle_to_buffer(char *, char *, size_t);
char *unmangle(char *s) {
  char *buf, *end;
  size_t sz;
  end = skip_nonspaces(s);
  sz = end - s + 1;
  buf = malloc(sz);
  if (!buf)
    return NULL;
  unmangle_to_buffer(s, buf, sz);
  return buf;
}


x86 assembly (clang, -O0):
<unmangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <skip_nonspaces@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1181 <unmangle+0x51>
movq   $0x0,-0x8(%rbp)
jmp    119a <unmangle+0x6a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <unmangle_to_buffer@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmangle>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <skip_nonspaces@plt>
mov    %rax,%rbx
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1165 <unmangle+0x35>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <unmangle_to_buffer@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @unmangle(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @skip_nonspaces(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = add nsw i64 %13, 1
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = call i8* @malloc(i64 %15)
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %1
store i8* null, i8** %2
br label %26
20: ; preds = %1
%21 = load i8*, i8** %3
%22 = load i8*, i8** %4
%23 = load i64, i64* %6
%24 = call i32 @unmangle_to_buffer(i8* %21, i8* %22, i64 %23)
%25 = load i8*, i8** %4
store i8* %25, i8** %2
br label %26
26: ; preds = %20, %19
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
define i8* @unmangle(i8* %0) {
%2 = tail call i8* @skip_nonspaces(i8* %0)
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = add nsw i64 %5, 1
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @unmangle_to_buffer(i8* %0, i8* %7, i64 %6)
br label %11
11: ; preds = %1, %9
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: at [-q x] [-f file] [-m] time\n"
                  "       at -c job [job ...]\n"
                  "       at [-f file] -t [[CC]YY]MMDDhhmm[.SS]\n"
                  "       at -r job [job ...]\n"
                  "       at -l -q queuename\n"
                  "       at -l [job ...]\n"
                  "       atq [-q x] [-v]\n"
                  "       atrm job [job ...]\n"
                  "       batch [-f file] [-m]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [263 x i8] c"usage: at [-q x] [-f file] [-m] time\0A at -c job [job ...]\0A at [-f file] -t [[CC]YY]MMDDhhmm[.SS]\0A at -r job [job ...]\0A at -l -q queuename\0A at -l [job ...]\0A atq [-q x] [-v]\0A atrm job [job ...]\0A batch [-f file] [-m]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [263 x i8] c"usage: at [-q x] [-f file] [-m] time\0A at -c job [job ...]\0A at [-f file] -t [[CC]YY]MMDDhhmm[.SS]\0A at -r job [job ...]\0A at -l -q queuename\0A at -l [job ...]\0A atq [-q x] [-v]\0A atrm job [job ...]\0A batch [-f file] [-m]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rtc_memw();
uint32_t rtc_reg_read(uint32_t addr) {
  addr += 0x60000700;
  rtc_memw();
  return *((volatile uint32_t *)addr);
}


x86 assembly (clang, -O0):
<rtc_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60000700,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rtc_memw@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_reg_read>:
push   %rax
mov    %rdi,(%rsp)
addq   $0x60000700,(%rsp)
60
xor    %eax,%eax
call   1030 <rtc_memw@plt>
mov    (%rsp),%rax
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @rtc_reg_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 1610614528
store volatile i64 %4, i64* %2
%5 = call i32 (...) @rtc_memw()
%6 = load volatile i64, i64* %2
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @rtc_reg_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 1610614528
store volatile i64 %4, i64* %2
%5 = tail call i32 (...) @rtc_memw()
%6 = load volatile i64, i64* %2
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}
void glVertexAttrib4fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttrib4fv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int bar(char *arg, char *out) {
  strcpy(out, arg);
  return 0;
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bar(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
ret i32 0
}
/* Variables and functions */
int func(int, int, int (*)());
int /*<<< orphan*/ printf(char *, int);
int sum();
int main() {
  int x = 1;
  int y = 4;
  int compare(), sum();
  int (*cfunc)();
  cfunc = compare;
  printf("result = %d\n", func(x, y, cfunc));
  cfunc = sum;
  printf("\nresult = %d\n", func(x, y, cfunc));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <func@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <func@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rdx
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <func@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e94(%rip),%rdx
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <func@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"result = %d\0A\00"
@.str.1 = [14 x i8] c"\0Aresult = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32 (...)*
store i32 1, i32* %1
store i32 4, i32* %2
store i32 (...)* @compare, i32 (...)** %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = load i32 (...)*, i32 (...)** %3
%7 = call i32 @func(i32 %4, i32 %5, i32 (...)* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 (...)* @sum, i32 (...)** %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32 (...)*, i32 (...)** %3
%12 = call i32 @func(i32 %9, i32 %10, i32 (...)* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"result = %d\0A\00"
@.str.1 = [14 x i8] c"\0Aresult = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @func(i32 1, i32 4, i32 (...)* @compare)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @func(i32 1, i32 4, i32 (...)* @sum)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ isalpha(int);
bool isvariable(int chr) { return isalpha(chr) || chr == '_'; }


x86 assembly (clang, -O0):
<isvariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <isvariable+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvariable>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isvariable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isvariable(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}