xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ close(int);
int errno;
int SocketClose(int number) {
  if (close(number) != 0) {
    int errsv = errno;
    return -1 * errsv;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<SocketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1148 <SocketClose+0x38>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <SocketClose+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SocketClose>:
push   %rax
call   1030 <close@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
sub    (%rdx),%ecx
xor    %edx,%edx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @SocketClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @close(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 -1, %10
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @SocketClose(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ testBrackets(int *, int);
void testHeap() {
  int *ar = (int *)malloc(100);
  testBrackets(ar, 25);
  free(ar);
}


x86 assembly (clang, -O0):
<testHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x19,%esi
call   1040 <testBrackets@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHeap>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x19,%esi
call   1040 <testBrackets@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testHeap() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @testBrackets(i32* %4, i32 25)
%6 = load i32*, i32** %1
%7 = call i32 @free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @testHeap() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @testBrackets(i32* %2, i32 25)
%4 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Timer_SetSystemTime(int /*<<< orphan*/);
void Timer_ResetSystemTime(void) { Timer_SetSystemTime(0); }


x86 assembly (clang, -O0):
<Timer_ResetSystemTime>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <Timer_SetSystemTime@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer_ResetSystemTime>:
xor    %edi,%edi
jmp    1030 <Timer_SetSystemTime@plt>

LLVM IR (-O0):
define void @Timer_ResetSystemTime() {
%1 = call i32 @Timer_SetSystemTime(i32 0)
ret void
}

LLVM IR (-O2):
define void @Timer_ResetSystemTime() {
%1 = tail call i32 @Timer_SetSystemTime(i32 0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
replaceWhitespace() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\t')
      putchar('\n');
    else
      putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<replaceWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     1171 <replaceWhitespace+0x51>
cmpl   $0x20,-0x4(%rbp)
je     1155 <replaceWhitespace+0x35>
cmpl   $0x9,-0x4(%rbp)
jne    1164 <replaceWhitespace+0x44>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    116c <replaceWhitespace+0x4c>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <replaceWhitespace+0x8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceWhitespace>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    114c <replaceWhitespace+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1163 <replaceWhitespace+0x43>
mov    $0xa,%edi
cmp    $0x9,%eax
je     1140 <replaceWhitespace+0x20>
cmp    $0x20,%eax
je     1140 <replaceWhitespace+0x20>
mov    %eax,%edi
jmp    1140 <replaceWhitespace+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @replaceWhitespace() {
%1 = alloca i32
br label %2
2: ; preds = %17, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 32
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 9
br i1 %11, label %12, label %14
12: ; preds = %9, %6
%13 = call i32 @putchar(i32 10)
br label %17
14: ; preds = %9
%15 = load i32, i32* %1
%16 = call i32 @putchar(i32 %15)
br label %17
17: ; preds = %14, %12
br label %2
18: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @replaceWhitespace() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %7
%5 = phi i32 [ %10, %7 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 32, label %7
i32 9, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %6
%8 = phi i32 [ %5, %6 ], [ 10, %4 ], [ 10, %4 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int CHAR_BIT;
int main(void) {
  unsigned s = 1;
  1 << s;
  1 >> s;
  s = sizeof(unsigned) * CHAR_BIT - 1;
  ((unsigned)1) << s;
  1 >> s;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x1,%rax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = load i32, i32* %2
%6 = ashr i32 1, %5
%7 = load i32, i32* @CHAR_BIT
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = sub i64 %9, 1
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = load i32, i32* %2
%15 = ashr i32 1, %14
ret i32 0
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct loc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCSMIIREG;
int __phy_op(struct loc const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int phy_write(const struct loc *loc, uint16_t val) {
  int err = __phy_op(loc, &val, SIOCSMIIREG);
  if (err)
    fprintf(stderr, "error: phy_write (%d)\n", err);
  return err;
}


x86 assembly (clang, -O0):
<phy_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1030 <__phy_op@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     116a <phy_write+0x4a>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phy_write>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,0xc(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rsi
call   1030 <__phy_op@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1159 <phy_write+0x39>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.loc = type { i32 }
@SIOCSMIIREG = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"error: phy_write (%d)\0A\00"
define i32 @phy_write(%struct.loc* %0, i32 %1) {
%3 = alloca %struct.loc*
%4 = alloca i32
%5 = alloca i32
store %struct.loc* %0, %struct.loc** %3
store i32 %1, i32* %4
%6 = load %struct.loc*, %struct.loc** %3
%7 = load i32, i32* @SIOCSMIIREG
%8 = call i32 @__phy_op(%struct.loc* %6, i32* %4, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.loc = type { i32 }
@SIOCSMIIREG = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"error: phy_write (%d)\0A\00"
define i32 @phy_write(%struct.loc* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SIOCSMIIREG
%5 = call i32 @__phy_op(%struct.loc* %0, i32* %3, i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
int PAPI_register_thread();
void PAPIF_REGISTER_THREAD(int *check) { *check = PAPI_register_thread(); }


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

x86 assembly (clang, -O2):
<PAPIF_REGISTER_THREAD>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_register_thread@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_REGISTER_THREAD(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_register_thread()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
__attribute__((weak)) bool bar2() { return true; }


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

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

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

LLVM IR (-O2):
define weak i32 @bar2() {
ret i32 1
}
unsigned long long __read_8(void *ptr) {
  unsigned long long data = *(unsigned long long *)ptr;
  return data;
}


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

x86 assembly (clang, -O2):
<__read_8>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @__read_8(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @__read_8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void bail(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @bail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int _falmbDefaultDrawString() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbDefaultDrawString() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_divstep_precomp(uintptr_t);
void fiat_secp256k1_divstep_precomp(uint32_t out1[8]) {
  internal_fiat_secp256k1_divstep_precomp((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_divstep_precomp>:
jmp    1030 <internal_fiat_secp256k1_divstep_precomp@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_divstep_precomp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_secp256k1_divstep_precomp(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_divstep_precomp(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_secp256k1_divstep_precomp(i64 %2)
ret void
}
/* Variables and functions */
const char *mbed_trace_last(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @mbed_trace_last() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mbed_trace_last() {
ret i8* null
}
/* Variables and functions */
int __pskb_trim();
__attribute__((always_)) int pskb_trim(void) { return __pskb_trim(); }


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

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

LLVM IR (-O0):
define i32 @pskb_trim() {
%1 = call i32 (...) @__pskb_trim()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pskb_trim() {
%1 = tail call i32 (...) @__pskb_trim()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ error_print(char *);
scalar_t__ listen(int, int);
void common_listen(int fd, int backlog) {
  if (listen(fd, backlog) < 0)
    error_print("listen error\n");
}


x86 assembly (clang, -O0):
<common_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
jge    114f <common_listen+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <error_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_listen>:
push   %rax
call   1030 <listen@plt>
test   %rax,%rax
js     112d <common_listen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <error_print@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"listen error\0A\00"
define void @common_listen(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 = call i64 @listen(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @error_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"listen error\0A\00"
define void @common_listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void ProgramUsage() {
  printf("usage: dump [options] <table filename> <input filename> <output "
         "directory>\n\n");
  printf("options:\n"
         "\t-f\tAssume input file data is fnt_sys data that's normally in "
         "FNT_SYS.BIN(default)\n"
         "\t-s\tAssume input file data is syswin text data that's normally in "
         "SYSWIN.BIN\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ProgramUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ProgramUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"usage: dump [options] <table filename> <input filename> <output directory>\0A\0A\00"
@.str.1 = [170 x i8] c"options:\0A\09-f\09Assume input file data is fnt_sys data that's normally in FNT_SYS.BIN(default)\0A\09-s\09Assume input file data is syswin text data that's normally in SYSWIN.BIN\0A\00"
define void @ProgramUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [76 x i8] c"usage: dump [options] <table filename> <input filename> <output directory>\0A\00"
@str.2 = [169 x i8] c"options:\0A\09-f\09Assume input file data is fnt_sys data that's normally in FNT_SYS.BIN(default)\0A\09-s\09Assume input file data is syswin text data that's normally in SYSWIN.BIN\00"
define void @ProgramUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([169 x i8], [169 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ fopen(char *, char *);
int main(void) {
  fclose(fopen("/dev/null", "r"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
mov    %eax,%edi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @fclose(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32 @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32 %1)
ret i32 0
}
void ff_hevc_put_hevc_uni_qpel_h64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h64_10_sse4() {
ret void
}
/* Variables and functions */
int printf(char *, long long);
int print_long_long(long long v) { return printf("%lld", v); }


x86 assembly (clang, -O0):
<print_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_long_long>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @print_long_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @print_long_long(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ sqrt(double);
float sqrtf(float num) { return (float)sqrt((double)num); }


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int ocaml_read_term(char *);
int FRONT_RT_readTermAndType(char *str) { return ocaml_read_term(str); }


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

x86 assembly (clang, -O2):
<FRONT_RT_readTermAndType>:
jmp    1030 <ocaml_read_term@plt>

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

LLVM IR (-O2):
define i32 @FRONT_RT_readTermAndType(i8* %0) {
%2 = tail call i32 @ocaml_read_term(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void term_clear(void) { clear(); }


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

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

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

LLVM IR (-O2):
define void @term_clear() {
%1 = tail call i32 (...) @clear()
ret void
}
void TM15_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TM15_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ICPrint();
int main(int argc, const char *argv[]) {
  ICPrint();
  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)
mov    $0x0,%al
call   1030 <ICPrint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ICPrint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @ICPrint()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ICPrint()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ obstack_exit_failure;
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) print_and_abort() {
  fprintf(stderr, "%s\n", ("memory exhausted"));
  exit(obstack_exit_failure);
}


x86 assembly (clang, -O0):
<print_and_abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_and_abort>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
@obstack_exit_failure = global i32 0
define void @print_and_abort() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @obstack_exit_failure
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
@obstack_exit_failure = global i32 0
define void @print_and_abort() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @obstack_exit_failure
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void reset_all_irqs() {
  printf("************************************\n");
  printf("********** reset all irqs **********\n");
  printf("************************************\n");
  printf("interrupt_register 0x%X \n\n",
         *((unsigned char *)(0xfffc0000 + 0x0003)));
}


x86 assembly (clang, -O0):
<reset_all_irqs>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0003,%eax
movzbl (%rax),%esi
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_all_irqs>:
push   %rbx
lea    0xf18(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xfffc0003,%eax
movzbl (%rax),%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"************************************\0A\00"
@.str.1 = [38 x i8] c"********** reset all irqs **********\0A\00"
@.str.2 = [27 x i8] c"interrupt_register 0x%X \0A\0A\00"
define void @reset_all_irqs() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* inttoptr (i64 4294705155 to i8*)
%5 = zext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"interrupt_register 0x%X \0A\0A\00"
@str.3 = [37 x i8] c"********** reset all irqs **********\00"
@str.4 = [37 x i8] c"************************************\00"
define void @reset_all_irqs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%4 = load i8, i8* inttoptr (i64 4294705155 to i8*)
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
int ft_tolower(int c) {
  if (c >= 65 && c <= 90)
    return (c + 32);
  return (c);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((visibility("protected"))) void foo() { printf("TEST1\n"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"TEST1\0A\00"
define protected void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"TEST1\00"
define protected void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int *malloc(int);
int *Obj_int_create(int const inVal) {
  int *const retVal = malloc(sizeof *retVal);
  assert(retVal != NULL);
  *retVal = inVal;
  return retVal;
}


x86 assembly (clang, -O0):
<Obj_int_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Obj_int_create>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %ebp,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @Obj_int_create(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define noalias i32* @Obj_int_create(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i32 %0, i32* %2
ret i32* %2
}
void EventHandler() {}


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

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

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

LLVM IR (-O2):
define void @EventHandler() {
ret void
}
void plugin_exit_raspi(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_raspi() {
ret void
}
int test_imm_6Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x6E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Eint64_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, 110
%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_6Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 110
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *string) { return (int)strtol(string, NULL, 10); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int nip_count_tokens(char const *, int *, int /*<<< orphan*/,
                     int /*<<< orphan*/ *, int /*<<< orphan*/,
                     int /*<<< orphan*/, int);
int nip_count_words(const char *s, int *chars) {
  return nip_count_tokens(s, chars, 0, NULL, 0, 0, 1);
}


x86 assembly (clang, -O0):
<nip_count_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%ecx
mov    %r9d,%edx
mov    %r9d,%r8d
movl   $0x1,(%rsp)
call   1030 <nip_count_tokens@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nip_count_words>:
push   %rax
movl   $0x1,(%rsp)
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <nip_count_tokens@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nip_count_words(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 @nip_count_tokens(i8* %5, i32* %6, i32 0, i32* null, i32 0, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nip_count_words(i8* %0, i32* %1) {
%3 = tail call i32 @nip_count_tokens(i8* %0, i32* %1, i32 0, i32* null, i32 0, i32 0, i32 1)
ret i32 %3
}
void proctal_deinit(struct proctal *p) {}


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

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

LLVM IR (-O0):
%struct.proctal = type opaque
define void @proctal_deinit(%struct.proctal* %0) {
%2 = alloca %struct.proctal*
store %struct.proctal* %0, %struct.proctal** %2
ret void
}

LLVM IR (-O2):
%struct.proctal = type opaque
define void @proctal_deinit(%struct.proctal* nocapture %0) {
ret void
}
int test_imm_76int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 118
%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_76int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7733248
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void _cstartup() {}


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

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

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

LLVM IR (-O2):
define void @_cstartup() {
ret void
}
int foo() {
  int mat[2][1];
  int(*a)[1] = mat;
  int det = 0;
  int i;
  mat[0][0] = 1;
  mat[1][0] = 2;
  for (i = 0; i < 2; ++i)
    det += a[i][0];
  return det;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1151 <foo+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <foo+0x28>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
void wcnss_wlan_register_pm_ops(void *dev, void *pm_ops) {}


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

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

LLVM IR (-O0):
define void @wcnss_wlan_register_pm_ops(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 @wcnss_wlan_register_pm_ops(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_exactly_matching_buffer(char *y) {
  char x[4];
  strncpy(x, y, 4);
  clang_analyzer_eval(strlen(x) > 4);
}


x86 assembly (clang, -O0):
<strncpy_exactly_matching_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_exactly_matching_buffer>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x5,%eax
setge  %dil
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @strncpy_exactly_matching_buffer(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = icmp sgt i32 %8, 4
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}

LLVM IR (-O2):
define void @strncpy_exactly_matching_buffer(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 4)
%5 = call i32 @strlen(i8* %3)
%6 = icmp sgt i32 %5, 4
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}
void nseel_asm_or0(void) {
  __asm__("fistpll (%esi)\n"
          "fildll (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_or0>:
push   %rbp
mov    %rsp,%rbp
fistpll (%esi)
fildll (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_or0>:
fistpll (%esi)
fildll (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_or0() {
tail call void asm sideeffect "fistpll (%esi)\0Afildll (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_type_r(int);
char is_type_i(int inst) { return !is_type_r(inst) && !is_type_r(inst); }


x86 assembly (clang, -O0):
<is_type_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_type_r@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1146 <is_type_i+0x36>
mov    -0x4(%rbp),%edi
call   1030 <is_type_r@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_type_i>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_type_r@plt>
test   %eax,%eax
je     1120 <is_type_i+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <is_type_r@plt>
test   %eax,%eax
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @is_type_i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_type_r(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @is_type_r(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @is_type_i(i32 %0) {
%2 = tail call i32 @is_type_r(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @is_type_r(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i8
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 0, %1 ], [ %7, %4 ]
ret i8 %9
}
int get_vector_bit(char *vector, int index) {
  return ((vector[(index / 8)] & (1 << (index % 8))) >> (index % 8));
}


x86 assembly (clang, -O0):
<get_vector_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vector_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%edx
sar    $0x3,%edx
movslq %edx,%rdx
movsbl (%rdi,%rdx,1),%edx
and    $0xfffffff8,%eax
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @get_vector_bit(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = load i32, i32* %4
%17 = srem i32 %16, 8
%18 = ashr i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_vector_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = srem i32 %1, 8
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = ashr i32 %10, %8
ret i32 %11
}
int pvr_check_cable() {
  volatile unsigned int *porta = (unsigned int *)0xff80002c;
  *porta = (*porta & ~0xf0000) | 0xa0000;
  return ((*(volatile unsigned short *)(porta + 1)) >> 8) & 3;
}


x86 assembly (clang, -O0):
<pvr_check_cable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff80002c,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xfff0ffff,%ecx
or     $0xa0000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ax
movzwl %ax,%eax
sar    $0x8,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvr_check_cable>:
mov    $0xff80002c,%eax
mov    $0xfff0ffff,%ecx
and    (%rax),%ecx
or     $0xa0000,%ecx
mov    %ecx,(%rax)
movzwl 0x4(%rax),%eax
shr    $0x8,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @pvr_check_cable() {
%1 = alloca i32*
store i32* inttoptr (i64 4286578732 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load volatile i32, i32* %2
%4 = and i32 %3, -983041
%5 = or i32 %4, 655360
%6 = load i32*, i32** %1
store volatile i32 %5, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = bitcast i32* %8 to i16*
%10 = load volatile i16, i16* %9
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 8
%13 = and i32 %12, 3
ret i32 %13
}

LLVM IR (-O2):
define i32 @pvr_check_cable() {
%1 = load volatile i32, i32* inttoptr (i64 4286578732 to i32*)
%2 = and i32 %1, -983041
%3 = or i32 %2, 655360
store volatile i32 %3, i32* inttoptr (i64 4286578732 to i32*)
%4 = load volatile i16, i16* inttoptr (i64 4286578736 to i16*)
%5 = lshr i16 %4, 8
%6 = and i16 %5, 3
%7 = zext i16 %6 to i32
ret i32 %7
}