xunge/DecIR huggingface dataset:
int ffs(int x) {
  int bit, mask;
  if (x == 0)
    return 0;
  for (bit = 1, mask = 1; (x & mask) == 0; bit++, mask <<= 1)
    ;
  return bit;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <ffs+0x5c>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
jne    1156 <ffs+0x56>
jmp    113f <ffs+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <ffs+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112a <ffs+0x2a>
mov    $0x1,%eax
test   $0x1,%dil
jne    1129 <ffs+0x29>
mov    $0x1,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ 1, %3 ]
%9 = add nuw nsw i32 %8, 1
%10 = shl i32 %7, 1
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
void *Sys_GetGameAPI(void *parms) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @Sys_GetGameAPI(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Sys_GetGameAPI(i8* nocapture readnone %0) {
ret i8* null
}
const char *__attribute__((weak)) __attribute__((section(".test.c")))
__attribute__((no)) weak_n3(void) {
  return "weak_n3";
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"weak_n3\00"
define weak i8* @weak_n3() section ".test.c" {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"weak_n3\00"
define weak i8* @weak_n3() section ".test.c" {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ __gmpf_dump(int /*<<< orphan*/);
int /*<<< orphan*/ __gmpz_dump(int /*<<< orphan*/);
void foo_debug() {
  if (0) {
    __gmpf_dump(0);
    __gmpz_dump(0);
  }
}


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

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

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

LLVM IR (-O2):
define void @foo_debug() {
ret void
}
int ObjectSize1(void *const p __attribute__((pass_object_size(1)))) {
  return __builtin_object_size(p, 1);
}


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

x86 assembly (clang, -O2):
<ObjectSize1>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i32 @ObjectSize1(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ObjectSize1(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(FILE *stream) { return 0; }


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

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

LLVM IR (-O0):
define i32 @fflush(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XVisibilityEvent;

/* Variables and functions */
int get_XVisibilityEvent_type(void *_p) {
  return (int)((XVisibilityEvent *)_p)->type;
}


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

x86 assembly (clang, -O2):
<get_XVisibilityEvent_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XVisibilityEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XVisibilityEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_ptrdiff_t_compare(const void *p1, const void *p2,
                                                size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_ptrdiff_t_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_ptrdiff_t_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_ptrdiff_t_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_ptrdiff_t_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ printhostent(struct hostent *);
int main(int argc, char **argv) {
  struct hostent *ret;
  if (argc == 1)
    return 1;
  ret = gethostbyname(argv[1]);
  if (ret)
    printhostent(ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1171 <main+0x51>
mov    -0x18(%rbp),%rdi
call   1030 <printhostent@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x1,%edi
je     1143 <main+0x23>
mov    0x8(%rsi),%rdi
call   1040 <gethostbyname@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1143 <main+0x23>
mov    %rax,%rdi
call   1030 <printhostent@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.hostent*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %21
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call %struct.hostent* @gethostbyname(i8* %13)
store %struct.hostent* %14, %struct.hostent** %6
%15 = load %struct.hostent*, %struct.hostent** %6
%16 = icmp ne %struct.hostent* %15, null
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load %struct.hostent*, %struct.hostent** %6
%19 = call i32 @printhostent(%struct.hostent* %18)
br label %20
20: ; preds = %17, %10
store i32 0, i32* %3
br label %21
21: ; preds = %20, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call %struct.hostent* @gethostbyname(i8* %6)
%8 = icmp eq %struct.hostent* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @printhostent(%struct.hostent* %7)
br label %11
11: ; preds = %4, %9, %2
%12 = phi i32 [ 1, %2 ], [ 0, %9 ], [ 0, %4 ]
ret i32 %12
}
int negate(int x) { return 2; }


x86 assembly (clang, -O0):
<negate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @negate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 2
}

LLVM IR (-O2):
define i32 @negate(i32 %0) {
ret i32 2
}
void foo086(int p) {}


x86 assembly (clang, -O0):
<foo086>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo086(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo086(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void string_destroy(void *string) { free(string); }


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

x86 assembly (clang, -O2):
<string_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @string_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int streamaccept(int);
int tcpaccept(int lsock) { return streamaccept(lsock); }


x86 assembly (clang, -O0):
<tcpaccept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <streamaccept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpaccept>:
jmp    1030 <streamaccept@plt>

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

LLVM IR (-O2):
define i32 @tcpaccept(i32 %0) {
%2 = tail call i32 @streamaccept(i32 %0)
ret i32 %2
}
void dot_matrix_4x_generic_output(void *data, unsigned *out_width,
                                  unsigned *out_height, unsigned width,
                                  unsigned height) {
  *out_width = width << 2;
  *out_height = height << 2;
}


x86 assembly (clang, -O0):
<dot_matrix_4x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_matrix_4x_generic_output>:
shl    $0x2,%ecx
mov    %ecx,(%rsi)
shl    $0x2,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @dot_matrix_4x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = shl i32 %11, 2
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = shl i32 %14, 2
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @dot_matrix_4x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 2
store i32 %6, i32* %1
%7 = shl i32 %4, 2
store i32 %7, i32* %2
ret void
}
/* Type definitions */
struct range {
  int dummy;
};
struct genomeRangeTree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genomeRangeTreeFindOrAddRangeTree(struct genomeRangeTree *,
                                                     char *);
struct range *rangeTreeAdd(int /*<<< orphan*/, int, int);
struct range *genomeRangeTreeAdd(struct genomeRangeTree *tree, char *chrom,
                                 int start, int end) {
  return rangeTreeAdd(genomeRangeTreeFindOrAddRangeTree(tree, chrom), start,
                      end);
}


x86 assembly (clang, -O0):
<genomeRangeTreeAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <genomeRangeTreeFindOrAddRangeTree@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <rangeTreeAdd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genomeRangeTreeAdd>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <genomeRangeTreeFindOrAddRangeTree@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <rangeTreeAdd@plt>

LLVM IR (-O0):
%struct.range = type { i32 }
%struct.genomeRangeTree = type { i32 }
define %struct.range* @genomeRangeTreeAdd(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.genomeRangeTree*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.genomeRangeTree* %0, %struct.genomeRangeTree** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.genomeRangeTree*, %struct.genomeRangeTree** %5
%10 = load i8*, i8** %6
%11 = call i32 @genomeRangeTreeFindOrAddRangeTree(%struct.genomeRangeTree* %9, i8* %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call %struct.range* @rangeTreeAdd(i32 %11, i32 %12, i32 %13)
ret %struct.range* %14
}

LLVM IR (-O2):
%struct.range = type { i32 }
%struct.genomeRangeTree = type { i32 }
define %struct.range* @genomeRangeTreeAdd(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @genomeRangeTreeFindOrAddRangeTree(%struct.genomeRangeTree* %0, i8* %1)
%6 = tail call %struct.range* @rangeTreeAdd(i32 %5, i32 %2, i32 %3)
ret %struct.range* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_MOD;
int epoll_mod_internal(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                       void *);
int epoll_mod(int epfd, int fd, uint32_t events, void *ptr) {
  return epoll_mod_internal(epfd, EPOLL_CTL_MOD, fd, events, ptr);
}


x86 assembly (clang, -O0):
<epoll_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1030 <epoll_mod_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_mod>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
jmp    1030 <epoll_mod_internal@plt>

LLVM IR (-O0):
@EPOLL_CTL_MOD = global i32 0
define i32 @epoll_mod(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* @EPOLL_CTL_MOD
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @epoll_mod_internal(i32 %9, i32 %10, i32 %11, i32 %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@EPOLL_CTL_MOD = global i32 0
define i32 @epoll_mod(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = load i32, i32* @EPOLL_CTL_MOD
%6 = tail call i32 @epoll_mod_internal(i32 %0, i32 %5, i32 %1, i32 %2, i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void err_sys(char *s) {
  perror(s);
  exit(127);
}


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

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

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

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 127)
unreachable
}
int ceph_osd_op_mode_cache(int op) { return op & 0x8000; }


x86 assembly (clang, -O0):
<ceph_osd_op_mode_cache>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_osd_op_mode_cache>:
mov    %edi,%eax
and    $0x8000,%eax
ret

LLVM IR (-O0):
define i32 @ceph_osd_op_mode_cache(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
ret i32 %4
}

LLVM IR (-O2):
define i32 @ceph_osd_op_mode_cache(i32 %0) {
%2 = and i32 %0, 32768
ret i32 %2
}
int test_imm_C5int32_reg(int val) { return ((val) & (0xC5 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C5int32_reg(i32 %0) {
%2 = and i32 %0, 197
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void l1_scratchpad_jump(void) {
  int (*foo)(void);
  foo = (void *)((0xFFB00000));
  (*foo)();
}


x86 assembly (clang, -O0):
<l1_scratchpad_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffb00000,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_scratchpad_jump>:
mov    $0xffb00000,%eax
jmp    *%rax

LLVM IR (-O0):
define void @l1_scratchpad_jump() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 4289724416 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret void
}

LLVM IR (-O2):
define void @l1_scratchpad_jump() {
%1 = tail call i32 inttoptr (i64 4289724416 to i32 ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x13_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x13_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x13_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x13_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x13_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ sleep(int);
void test_function(void) {
  sleep(1);
  (void)getpid();
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_function>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define void @test_function() {
%1 = call i32 @sleep(i32 1)
%2 = call i32 (...) @getpid()
ret void
}

LLVM IR (-O2):
define void @test_function() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 (...) @getpid()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_resize_window() { exit(1); }


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

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

LLVM IR (-O0):
define void @caml_gr_resize_window() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_resize_window() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ RateDesiredHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void RateDesiredLogging() { UAVObjLogging(RateDesiredHandle()); }


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

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

LLVM IR (-O0):
define void @RateDesiredLogging() {
%1 = call i32 (...) @RateDesiredHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RateDesiredLogging() {
%1 = tail call i32 (...) @RateDesiredHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl32(uint32_t x, uint8_t r) { return (x << r) | (x >> (32 - r)); }


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(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 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
scalar_t__ isascii(int);
scalar_t__ isspace(int);
int Cisspace(int c) { return isascii(c) && isspace(c); }


x86 assembly (clang, -O0):
<Cisspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <Cisspace+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %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):
<Cisspace>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <Cisspace+0x21>
mov    %ebx,%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Cisspace(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int sign(int x) {
  int z = x & (1 << 31);
  int y = !(!x);
  return (z >> 30) | y;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1e,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
sar    $0x1e,%edi
and    $0xfffffffe,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -2147483648
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = ashr i32 %12, 30
%14 = load i32, i32* %4
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 30
%5 = and i32 %4, -2
%6 = or i32 %5, %3
ret i32 %6
}
int attr_copy_file(const char *src_path, const char *dst_path,
                   int (*check)(const char *, struct error_context *),
                   struct error_context *ctx) {
  return 0;
}


x86 assembly (clang, -O0):
<attr_copy_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.error_context = type opaque
%struct.error_context.0 = type opaque
define i32 @attr_copy_file(i8* %0, i8* %1, i32 (i8*, %struct.error_context*)* %2, %struct.error_context.0* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32 (i8*, %struct.error_context*)*
%8 = alloca %struct.error_context.0*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 (i8*, %struct.error_context*)* %2, i32 (i8*, %struct.error_context*)** %7
store %struct.error_context.0* %3, %struct.error_context.0** %8
ret i32 0
}

LLVM IR (-O2):
%struct.error_context = type opaque
%struct.error_context.0 = type opaque
define i32 @attr_copy_file(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 (i8*, %struct.error_context*)* nocapture readnone %2, %struct.error_context.0* nocapture readnone %3) {
ret i32 0
}
int __simple_strlen(const char *text) {
  int len = 0;
  while (*text++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<__simple_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <__simple_strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <__simple_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__simple_strlen>:
cmpb   $0x0,(%rdi)
je     111c <__simple_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <__simple_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__simple_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @__simple_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
unsigned long rho_ruby_get_time_part(unsigned long rDate, const char *szPart) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @rho_ruby_get_time_part(i64 %0, i8* nocapture readnone %1) {
ret i64 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xfocus_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xfocus.send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xfocus_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xfocus_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xfocus_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_OV7670(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_OV7670>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_OV7670>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_OV7670(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_OV7670(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
void RTUtf16Free(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16Free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
u_int16_t _inet_port(struct sockaddr *sa) {
  switch (sa->sa_family) {
  case AF_INET:
    return (ntohs(((struct sockaddr_in *)sa)->sin_port));
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<_inet_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    1145 <_inet_port+0x35>
jmp    1132 <_inet_port+0x22>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x4(%rbp)
jmp    114c <_inet_port+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_inet_port>:
cmpl   $0x80,(%rdi)
jne    1122 <_inet_port+0x12>
mov    $0x80,%edi
jmp    1030 <ntohs@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @_inet_port(%struct.sockaddr* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %13 [
i32 128, label %7
]
7: ; preds = %1
%8 = load %struct.sockaddr*, %struct.sockaddr** %3
%9 = bitcast %struct.sockaddr* %8 to %struct.sockaddr_in*
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @ntohs(i32 %11)
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @_inet_port(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @ntohs(i32 128)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
ret i32 %8
}
int test_imm_78uint16_reg(unsigned short val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_78uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 120
%6 = icmp ne i32 %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_78uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 120
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void inc(void *data, void *item) { *(int *)item += *(int *)data; }


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

x86 assembly (clang, -O2):
<inc>:
mov    (%rdi),%eax
add    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @inc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %7
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @inc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
store i32 %7, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kmem_init();
int /*<<< orphan*/ pmem_init();
void mm_init() {
  pmem_init();
  kmem_init();
}


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

x86 assembly (clang, -O2):
<mm_init>:
push   %rax
xor    %eax,%eax
call   1040 <pmem_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kmem_init@plt>

LLVM IR (-O0):
define void @mm_init() {
%1 = call i32 (...) @pmem_init()
%2 = call i32 (...) @kmem_init()
ret void
}

LLVM IR (-O2):
define void @mm_init() {
%1 = tail call i32 (...) @pmem_init()
%2 = tail call i32 (...) @kmem_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_create_sdp();
void test_soa() { test_create_sdp(); }


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

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

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

LLVM IR (-O2):
define void @test_soa() {
%1 = tail call i32 (...) @test_create_sdp()
ret void
}
/* Variables and functions */
float __rinff(float);
scalar_t__ signbit(float);
float truncf(float);
float ceilf(float x) { return signbit(x) ? truncf(x) : __rinff(x); }


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <signbit@plt>
cmp    $0x0,%rax
je     1165 <ceilf+0x35>
movss  -0x4(%rbp),%xmm0
call   1050 <truncf@plt>
movss  %xmm0,-0x8(%rbp)
jmp    1174 <ceilf+0x44>
movss  -0x4(%rbp),%xmm0
call   1030 <__rinff@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <signbit@plt>
test   %rax,%rax
je     114d <ceilf+0x1d>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1050 <truncf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <__rinff@plt>

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @signbit(float %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = call float @llvm.trunc.f32(float %7)
br label %12
9: ; preds = %1
%10 = load float, float* %2
%11 = call float @__rinff(float %10)
br label %12
12: ; preds = %9, %6
%13 = phi float [ %8, %6 ], [ %11, %9 ]
ret float %13
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call i64 @signbit(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @llvm.trunc.f32(float %0)
br label %8
6: ; preds = %1
%7 = tail call float @__rinff(float %0)
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ %7, %6 ]
ret float %9
}
void dev_punchrd_reset(void *dev) {}


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

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

LLVM IR (-O0):
define void @dev_punchrd_reset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @dev_punchrd_reset(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void cleanMessageQueue(int msqid) {
  if (msgctl(msqid, IPC_RMID, NULL) == -1) {
    printf("Message queue could not be deleted.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<cleanMessageQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <msgctl@plt>
cmp    $0xffffffff,%eax
jne    1173 <cleanMessageQueue+0x43>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanMessageQueue>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <msgctl@plt>
cmp    $0xffffffff,%eax
je     1148 <cleanMessageQueue+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [37 x i8] c"Message queue could not be deleted.\0A\00"
@EXIT_FAILURE = global i32 0
define void @cleanMessageQueue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @msgctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@EXIT_FAILURE = global i32 0
@str = [36 x i8] c"Message queue could not be deleted.\00"
define void @cleanMessageQueue(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void test1(void) {
  int *p = __builtin_malloc(sizeof(int) * 4);
  int *q = p;
  *q++ = 4;
  *q++ = 4;
  __builtin_free(p);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x4,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i8* @malloc(i64 16)
%4 = bitcast i8* %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
store i32 4, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %2
store i32 4, i32* %8
%10 = load i32*, i32** %1
%11 = bitcast i32* %10 to i8*
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void error_read_line(char *fname, int nlin) {
  fprintf(stderr, "CUTE: Couldn't read file %s, line %d \n", fname, nlin);
  exit(1);
}


x86 assembly (clang, -O0):
<error_read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_read_line>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"CUTE: Couldn't read file %s, line %d \0A\00"
define void @error_read_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"CUTE: Couldn't read file %s, line %d \0A\00"
define void @error_read_line(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_assign(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *psvec2i_assign(struct vec2i *result,
                                                      struct vec2i *a) {
  vec2i_assign((int32_t *)result, (int32_t *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2i_assign>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_assign@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_assign(%struct.vec2i* %0, %struct.vec2i* %1) {
%3 = alloca %struct.vec2i*
%4 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %3
store %struct.vec2i* %1, %struct.vec2i** %4
%5 = load %struct.vec2i*, %struct.vec2i** %3
%6 = bitcast %struct.vec2i* %5 to i32*
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = call i32 @vec2i_assign(i32* %6, i32* %8)
%10 = load %struct.vec2i*, %struct.vec2i** %3
ret %struct.vec2i* %10
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_assign(%struct.vec2i* returned %0, %struct.vec2i* %1) {
%3 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%5 = tail call i32 @vec2i_assign(i32* %3, i32* %4)
ret %struct.vec2i* %0
}