xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
extern char *safe_strncpy(char *dst, const char *src, size_t size) {
  dst[size - 1] = '\0';
  return strncpy(dst, src, size - 1);
}


x86 assembly (clang, -O0):
<safe_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strncpy>:
movb   $0x0,-0x1(%rdi,%rdx,1)
add    $0xffffffffffffffff,%rdx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @safe_strncpy(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 i64, i64* %6
%9 = sub i64 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = call i8* @strncpy(i8* %11, i8* %12, i64 %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @safe_strncpy(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = add i64 %2, -1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %4)
ret i8* %0
}
int f1(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getBool();
void IF_dropL(void) { getBool(); }


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

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

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

LLVM IR (-O2):
define void @IF_dropL() {
%1 = tail call i32 (...) @getBool()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 1;
  int b = 3;
  printf("a=%d\tb=%d\n", a, b);
  a = a ^ b;
  b = b ^ a;
  a = a ^ b;
  printf("a=%d\tb=%d\n", a, b);
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d\09b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
int drvOCM_Munmap(void *pntr, int len) {
  munmap(pntr, len);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @drvOCM_Munmap(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int);
int north_fill(unsigned long);
int south_fill(unsigned long);
void file_fill_test(void **state) {
  assert_int_equal((north_fill(2ul) | south_fill(2ul)), 0x0202020202020202ul);
}


x86 assembly (clang, -O0):
<file_fill_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1050 <north_fill@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <south_fill@plt>
mov    -0xc(%rbp),%edi
or     %eax,%edi
mov    $0x2020202,%esi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_fill_test>:
push   %rbx
mov    $0x2,%edi
call   1050 <north_fill@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <south_fill@plt>
or     %eax,%ebx
mov    %ebx,%edi
mov    $0x2020202,%esi
pop    %rbx
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @file_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @north_fill(i64 2)
%4 = call i32 @south_fill(i64 2)
%5 = or i32 %3, %4
%6 = call i32 @assert_int_equal(i32 %5, i32 33686018)
ret void
}

LLVM IR (-O2):
define void @file_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @north_fill(i64 2)
%3 = tail call i32 @south_fill(i64 2)
%4 = or i32 %3, %2
%5 = tail call i32 @assert_int_equal(i32 %4, i32 33686018)
ret void
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
double clock();
double GetCPUTime(void) { return clock() / (double)CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<GetCPUTime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCPUTime>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @GetCPUTime() {
%1 = call double (...) @clock()
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @GetCPUTime() {
%1 = tail call double (...) @clock()
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct nlmsg {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int nla_put(struct nlmsg *, int, int /*<<< orphan*/ *, int);
int nla_put_u16(struct nlmsg *msg, int type, uint16_t data) {
  return nla_put(msg, type, &data, sizeof(data));
}


x86 assembly (clang, -O0):
<nla_put_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_u16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i32
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i32* %6, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i32* %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  if (a == 2 && b == 8)
    printf("0");
  else
    printf("1");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1168 <main+0x48>
cmpl   $0x8,-0xc(%rbp)
jne    1168 <main+0x48>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <main+0x54>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    $0x2,%eax
mov    (%rsp),%ecx
xor    $0x8,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
xor    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 8
%10 = select i1 %7, i1 %9, i1 false
%11 = select i1 %10, i32 48, i32 49
%12 = call i32 @putchar(i32 %11)
ret i32 0
}
char *strcpy2(char *dest, const char *src) {
  char *rval = dest;
  while ((*dest++ = *src++) != 0)
    ;
  return rval;
}


x86 assembly (clang, -O0):
<strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy2+0x47>
jmp    1114 <strcpy2+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy2>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy2+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy2(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ stdinout_open(int, char *, int);
void stdinout_reopen(int fd, char *path, int flags) {
  assert(!close(fd));
  stdinout_open(fd, path, flags);
}


x86 assembly (clang, -O0):
<stdinout_reopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <stdinout_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdinout_reopen>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <close@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <stdinout_open@plt>

LLVM IR (-O0):
define void @stdinout_reopen(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @close(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @stdinout_open(i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @stdinout_reopen(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @close(i32 %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @stdinout_open(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ init_address_table();
int main() {
  init_address_table();
  char c = getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init_address_table@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = call i32 (...) @init_address_table()
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_address_table()
%2 = tail call signext i8 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main() {
  int i;
  fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
#pragma omp target enter data map(alloc : i)
#pragma omp target update CLAUSE(present : i)
#pragma omp target exit data map(delete : i)
  fprintf(stderr, "i is present\n");
#pragma omp target update CLAUSE(present : i)
  fprintf(stderr, "i is present\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0xedb(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed3(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [14 x i8] c"i is present\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %2, i64 4)
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [14 x i8] c"i is present\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %1, i64 4)
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void outw(unsigned short addr, unsigned short val) {
  __asm__ __volatile__("outw %%ax, %%dx" ::"d"(addr), "a"(val));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw %ax, %dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int get_buffer_size(int *);
int remove_item(int semid, int *shared_buffer) {
  int index = get_buffer_size(shared_buffer) - 1;
  int item = shared_buffer[index];
  shared_buffer[index] = 0x00;
  return item;
}


x86 assembly (clang, -O0):
<remove_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_buffer_size@plt>
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_item>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <get_buffer_size@plt>
movslq %eax,%rcx
mov    -0x4(%rbx,%rcx,4),%eax
movl   $0x0,-0x4(%rbx,%rcx,4)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @remove_item(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = call i32 @get_buffer_size(i32* %7)
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %6
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 0, i32* %18
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @remove_item(i32 %0, i32* %1) {
%3 = tail call i32 @get_buffer_size(i32* %1)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
store i32 0, i32* %6
ret i32 %7
}
__attribute__((always_)) void add_entropy_words(void) {}


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

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

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

LLVM IR (-O2):
define void @add_entropy_words() {
ret void
}
void CPY_STR(tt, ff) int *ff, *tt;
{
  int i;
  char *f, *t;
  f = (char *)ff;
  t = (char *)tt;
  i = 0;
  while (f[i] != '\0') {
    t[i] = f[i];
    i = i + 1;
  };
  t[i] = '\0';
}


x86 assembly (clang, -O0):
<CPY_STR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <CPY_STR+0x5c>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <CPY_STR+0x23>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPY_STR>:
mov    (%rsi),%al
test   %al,%al
je     1127 <CPY_STR+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <CPY_STR+0x10>
mov    %ecx,%eax
movb   $0x0,(%rdi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @CPY_STR(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %0 to i8*
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = phi i8 [ %13, %7 ], [ %5, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 %9, i8* %10
%11 = add nuw nsw i64 %8, 1
%12 = getelementptr inbounds i8, i8* %3, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7
%16 = and i64 %11, 4294967295
br label %17
17: ; preds = %15, %2
%18 = phi i64 [ 0, %2 ], [ %16, %15 ]
%19 = getelementptr inbounds i8, i8* %4, i64 %18
store i8 0, i8* %19
ret void
}
int detect_rtai() { return 0; }


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

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

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

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

/* Variables and functions */
char const *inet_ntop(int, unsigned int *, char *, int);
const char *get_netname(unsigned int *ip, int family) {
  static char buf[64];
  return inet_ntop(family, ip, buf, sizeof(buf) - 1);
}


x86 assembly (clang, -O0):
<get_netname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
lea    0x2f13(%rip),%rdx
mov    $0x3f,%ecx
call   1030 <inet_ntop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_netname>:
mov    %rdi,%rax
lea    0x2f26(%rip),%rdx
mov    %esi,%edi
mov    %rax,%rsi
mov    $0x3f,%ecx
jmp    1030 <inet_ntop@plt>

LLVM IR (-O0):
@get_netname.buf = internal global [64 x i8] zeroinitializer
define i8* @get_netname(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = call i8* @inet_ntop(i32 %5, i32* %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @get_netname.buf, i64 0, i64 0), i32 63)
ret i8* %7
}

LLVM IR (-O2):
@get_netname.buf = internal global [64 x i8] zeroinitializer
define i8* @get_netname(i32* %0, i32 %1) {
%3 = tail call i8* @inet_ntop(i32 %1, i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @get_netname.buf, i64 0, i64 0), i32 63)
ret i8* %3
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hashlittle2(char const *, size_t, int *, int *);
uint64_t get_hashed_token(const char *token_start, size_t token_length) {
  uint32_t h1 = 0xac867c1d;
  uint32_t h2 = 0x5434e4c4;
  hashlittle2(token_start, token_length, &h1, &h2);
  return ((uint64_t)h1 << 32) + h2;
}


x86 assembly (clang, -O0):
<get_hashed_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xac867c1d,-0x14(%rbp)
movl   $0x5434e4c4,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <hashlittle2@plt>
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hashed_token>:
push   %rax
movl   $0xac867c1d,0x4(%rsp)
ac
movl   $0x5434e4c4,(%rsp)
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1030 <hashlittle2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_hashed_token(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 -1400472547, i32* %5
store i32 1412752580, i32* %6
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @hashlittle2(i8* %7, i64 %8, i32* %5, i32* %6)
%10 = load i32, i32* %5
%11 = shl i32 %10, 32
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_hashed_token(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 -1400472547, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 1412752580, i32* %4
%7 = call i32 @hashlittle2(i8* %0, i64 %1, i32* %3, i32* %4)
ret i32 poison
}
/* Type definitions */
struct xmlnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ XmlDestroy(struct xmlnode **);
struct xmlnode *XmlFindSubNode(struct xmlnode *, char const *);
struct xmlnode *XmlFindSubNodeFree(struct xmlnode *n, const char *tag) {
  struct xmlnode *r = XmlFindSubNode(n, tag);
  XmlDestroy(&n);
  return r;
}


x86 assembly (clang, -O0):
<XmlFindSubNodeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <XmlFindSubNode@plt>
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <XmlDestroy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmlFindSubNodeFree>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
call   1030 <XmlFindSubNode@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1040 <XmlDestroy@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.xmlnode = type { i32 }
define %struct.xmlnode* @XmlFindSubNodeFree(%struct.xmlnode* %0, i8* %1) {
%3 = alloca %struct.xmlnode*
%4 = alloca i8*
%5 = alloca %struct.xmlnode*
store %struct.xmlnode* %0, %struct.xmlnode** %3
store i8* %1, i8** %4
%6 = load %struct.xmlnode*, %struct.xmlnode** %3
%7 = load i8*, i8** %4
%8 = call %struct.xmlnode* @XmlFindSubNode(%struct.xmlnode* %6, i8* %7)
store %struct.xmlnode* %8, %struct.xmlnode** %5
%9 = call i32 @XmlDestroy(%struct.xmlnode** %3)
%10 = load %struct.xmlnode*, %struct.xmlnode** %5
ret %struct.xmlnode* %10
}

LLVM IR (-O2):
%struct.xmlnode = type { i32 }
define %struct.xmlnode* @XmlFindSubNodeFree(%struct.xmlnode* %0, i8* %1) {
%3 = alloca %struct.xmlnode*
store %struct.xmlnode* %0, %struct.xmlnode** %3
%4 = tail call %struct.xmlnode* @XmlFindSubNode(%struct.xmlnode* %0, i8* %1)
%5 = call i32 @XmlDestroy(%struct.xmlnode** %3)
ret %struct.xmlnode* %4
}
/* Variables and functions */
int /*<<< orphan*/ ls(char const *, int /*<<< orphan*/);
void ls_command(const char *dir) { ls(dir, 0); }


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

x86 assembly (clang, -O2):
<ls_command>:
xor    %esi,%esi
jmp    1030 <ls@plt>

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

LLVM IR (-O2):
define void @ls_command(i8* %0) {
%2 = tail call i32 @ls(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AL_writeRegister(int, int);
void AL_initiateTone(int channel, int exponent, int mantissa) {
  AL_writeRegister((0XA0 + (channel)), (mantissa & 0XFF));
  AL_writeRegister((0XB0 + (channel)),
                   (((mantissa >> 8) & 0X3) | ((exponent & 0X7) << 2) | 0X20));
}


x86 assembly (clang, -O0):
<AL_initiateTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0xa0,%edi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <AL_writeRegister@plt>
mov    -0x4(%rbp),%edi
add    $0xb0,%edi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
and    $0x3,%esi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
shl    $0x2,%eax
or     %eax,%esi
or     $0x20,%esi
call   1030 <AL_writeRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_initiateTone>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r15d
lea    0xa0(%r15),%edi
movzbl %bl,%esi
call   1030 <AL_writeRegister@plt>
add    $0xb0,%r15d
shr    $0x8,%ebx
and    $0x3,%ebx
and    $0x7,%r14d
lea    (%rbx,%r14,4),%esi
add    $0x20,%esi
mov    %r15d,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <AL_writeRegister@plt>

LLVM IR (-O0):
define void @AL_initiateTone(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = add nsw i32 160, %7
%9 = load i32, i32* %6
%10 = and i32 %9, 255
%11 = call i32 @AL_writeRegister(i32 %8, i32 %10)
%12 = load i32, i32* %4
%13 = add nsw i32 176, %12
%14 = load i32, i32* %6
%15 = ashr i32 %14, 8
%16 = and i32 %15, 3
%17 = load i32, i32* %5
%18 = and i32 %17, 7
%19 = shl i32 %18, 2
%20 = or i32 %16, %19
%21 = or i32 %20, 32
%22 = call i32 @AL_writeRegister(i32 %13, i32 %21)
ret void
}

LLVM IR (-O2):
define void @AL_initiateTone(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 160
%5 = and i32 %2, 255
%6 = tail call i32 @AL_writeRegister(i32 %4, i32 %5)
%7 = add nsw i32 %0, 176
%8 = lshr i32 %2, 8
%9 = and i32 %8, 3
%10 = shl i32 %1, 2
%11 = and i32 %10, 28
%12 = or i32 %11, %9
%13 = or i32 %12, 32
%14 = tail call i32 @AL_writeRegister(i32 %7, i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
unsigned long UARTIntNumberGet(unsigned long);
void UARTIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = UARTIntNumberGet(ulBase);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <UARTIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntUnregister>:
push   %rbx
call   1030 <UARTIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @UARTIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @UARTIntNumberGet(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @IntDisable(i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @IntUnregister(i64 %8)
ret void
}

LLVM IR (-O2):
define void @UARTIntUnregister(i64 %0) {
%2 = tail call i64 @UARTIntNumberGet(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
int someFunc(int a, int b) {
  (void)a;
  (void)b;
  return 0;
}


x86 assembly (clang, -O0):
<someFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @someFunc(i32 %0, i32 %1) {
ret i32 0
}
int execute_timer_gettime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_timer_gettime() {
ret i32 0
}
int test_imm_91int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91int64_highword_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, 32
%6 = and i64 %5, 145
%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_91int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 622770257920
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long char_cipher(char st) {
  static long f, s;
  long r;
  if (st) {
    f = 37;
    s = 7;
    return (0L);
  }
  r = ((f * s) + 9337) % 8887;
  f = s;
  s = r;
  return (r);
}


x86 assembly (clang, -O0):
<char_cipher>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1137 <char_cipher+0x37>
movq   $0x25,0x2f09(%rip)
movq   $0x7,0x2f06(%rip)
movq   $0x0,-0x8(%rbp)
jmp    117b <char_cipher+0x7b>
mov    0x2eea(%rip),%rax
imul   0x2eea(%rip),%rax
add    $0x2479,%rax
mov    $0x22b7,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    0x2ecf(%rip),%rax
mov    %rax,0x2ec0(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,0x2ebd(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_cipher>:
test   %dil,%dil
je     1113 <char_cipher+0x13>
mov    $0x7,%ecx
mov    $0x25,%esi
xor    %eax,%eax
jmp    1157 <char_cipher+0x57>
mov    0x2f16(%rip),%rsi
mov    0x2f07(%rip),%rcx
imul   %rsi,%rcx
add    $0x2479,%rcx
movabs $0x75fd684e9545f857,%rdx
68 fd 75
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xc,%rdx
add    %rax,%rdx
imul   $0x22b7,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
mov    %rsi,0x2eca(%rip)
mov    %rcx,0x2ecb(%rip)
ret

LLVM IR (-O0):
@char_cipher.f = internal global i64 0
@char_cipher.s = internal global i64 0
define i64 @char_cipher(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 37, i64* @char_cipher.f
store i64 7, i64* @char_cipher.s
store i64 0, i64* %2
br label %17
8: ; preds = %1
%9 = load i64, i64* @char_cipher.f
%10 = load i64, i64* @char_cipher.s
%11 = mul nsw i64 %9, %10
%12 = add nsw i64 %11, 9337
%13 = srem i64 %12, 8887
store i64 %13, i64* %4
%14 = load i64, i64* @char_cipher.s
store i64 %14, i64* @char_cipher.f
%15 = load i64, i64* %4
store i64 %15, i64* @char_cipher.s
%16 = load i64, i64* %4
store i64 %16, i64* %2
br label %17
17: ; preds = %8, %7
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
@char_cipher.f = internal unnamed_addr global i64 0
@char_cipher.s = internal unnamed_addr global i64 0
define i64 @char_cipher(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i64, i64* @char_cipher.f
%5 = load i64, i64* @char_cipher.s
%6 = mul nsw i64 %5, %4
%7 = add nsw i64 %6, 9337
%8 = srem i64 %7, 8887
br label %9
9: ; preds = %1, %3
%10 = phi i64 [ %5, %3 ], [ 37, %1 ]
%11 = phi i64 [ %8, %3 ], [ 7, %1 ]
%12 = phi i64 [ %8, %3 ], [ 0, %1 ]
store i64 %10, i64* @char_cipher.f
store i64 %11, i64* @char_cipher.s
ret i64 %12
}
void rop3_38_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_38_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_38_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = and i32 %37, %39
%41 = or i32 %34, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_38_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ns2thline(float, float, float, float, float, float, float,
                             float, float, int);
void ns2line(float ix1, float iy1, float iz1, float ix2, float iy2, float iz2,
             float ired, float igreen, float iblue) {
  ns2thline(ix1, iy1, iz1, ix2, iy2, iz2, ired, igreen, iblue, 1.);
  return;
}


x86 assembly (clang, -O0):
<ns2line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
movss  -0x1c(%rbp),%xmm6
movss  -0x20(%rbp),%xmm7
movss  0x10(%rbp),%xmm8
mov    $0x1,%edi
movss  %xmm8,(%rsp)
call   1030 <ns2thline@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns2line>:
mov    $0x1,%edi
jmp    1030 <ns2thline@plt>

LLVM IR (-O0):
define void @ns2line(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %10
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %13
%23 = load float, float* %14
%24 = load float, float* %15
%25 = load float, float* %16
%26 = load float, float* %17
%27 = load float, float* %18
%28 = call i32 @ns2thline(float %19, float %20, float %21, float %22, float %23, float %24, float %25, float %26, float %27, i32 1)
ret void
}

LLVM IR (-O2):
define void @ns2line(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = tail call i32 @ns2thline(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned int _mm_extract_epi32(int /*<<< orphan*/, int);
unsigned int foo32(__m128i x) { return _mm_extract_epi32(x, 2); }


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

x86 assembly (clang, -O2):
<foo32>:
mov    $0x2,%esi
jmp    1030 <_mm_extract_epi32@plt>

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

LLVM IR (-O2):
define i32 @foo32(i32 %0) {
%2 = tail call i32 @_mm_extract_epi32(i32 %0, i32 2)
ret i32 %2
}
unsigned int f82(unsigned int x, long int y) {
  return (x << ((-y) & (8 * 4 - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f82>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f82>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f82(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 0, %6
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
%10 = shl i32 %5, %9
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = lshr i32 %11, %13
%15 = add i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f82(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 0, %3
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = lshr i32 %0, %3
%8 = add i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ F_ULOCK;
scalar_t__ lockf(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sys_error(char *, int);
void unlock_file(int fd) {
  if (lockf(fd, F_ULOCK, 0) < 0)
    sys_error("lockf (UNLOCK) failed", 270);
}


x86 assembly (clang, -O0):
<unlock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
cmp    $0x0,%rax
jge    1159 <unlock_file+0x39>
lea    0xeb1(%rip),%rdi
mov    $0x10e,%esi
call   1040 <sys_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_file>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
test   %rax,%rax
js     1138 <unlock_file+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
mov    $0x10e,%esi
pop    %rax
jmp    1040 <sys_error@plt>

LLVM IR (-O0):
@F_ULOCK = global i32 0
@.str = [22 x i8] c"lockf (UNLOCK) failed\00"
define void @unlock_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_ULOCK
%5 = call i64 @lockf(i32 %3, i32 %4, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @sys_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 270)
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@F_ULOCK = global i32 0
@.str = [22 x i8] c"lockf (UNLOCK) failed\00"
define void @unlock_file(i32 %0) {
%2 = load i32, i32* @F_ULOCK
%3 = tail call i64 @lockf(i32 %0, i32 %2, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @sys_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 270)
br label %7
7: ; preds = %5, %1
ret void
}