xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int n, m, r;
  printf("Greatest Common Divisor!\n");
  printf("Insert First Number : \n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Greatest Common Divisor!\0A\00"
@.str.1 = [24 x i8] c"Insert First Number : \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Greatest Common Divisor!\00"
@str.2 = [23 x i8] c"Insert First Number : \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintTermType(int);
int /*<<< orphan*/ putchar(char);
void PrintLnTermType(int t) {
  PrintTermType(t);
  putchar('\n');
}


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

x86 assembly (clang, -O2):
<PrintLnTermType>:
push   %rax
call   1040 <PrintTermType@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @PrintLnTermType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @PrintTermType(i32 %3)
%5 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @PrintLnTermType(i32 %0) {
%2 = tail call i32 @PrintTermType(i32 %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
int is_memstore(int opcode) { return (opcode & 0xF8) == 0x28; }


x86 assembly (clang, -O0):
<is_memstore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
cmp    $0x28,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_memstore>:
and    $0xf8,%edi
xor    %eax,%eax
cmp    $0x28,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_memstore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 248
%5 = icmp eq i32 %4, 40
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_memstore(i32 %0) {
%2 = and i32 %0, 248
%3 = icmp eq i32 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
imm0imm1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
ret i32 1
}

LLVM IR (-O2):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int parseexpr(char *);
char *resolvealiases(char *);
int parse_from_file(char *line) {
  char *resolved = resolvealiases(line);
  int rv = parseexpr(resolved);
  free(resolved);
  return rv;
}


x86 assembly (clang, -O0):
<parse_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <resolvealiases@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <parseexpr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_from_file>:
push   %rbp
push   %rbx
push   %rax
call   1040 <resolvealiases@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <parseexpr@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @parse_from_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @resolvealiases(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @parseexpr(i8* %7)
store i32 %8, i32* %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @parse_from_file(i8* %0) {
%2 = tail call i8* @resolvealiases(i8* %0)
%3 = tail call i32 @parseexpr(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/, int /*<<< orphan*/, long long,
                       long long);
void bar(long long x, long long y) { foo(0, 0, 0, 0, x / y, x % y); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%r8
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%r9
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1129 <bar+0x19>
cqto
idiv   %rsi
mov    %rdx,%r9
jmp    1130 <bar+0x20>
xor    %edx,%edx
div    %esi
mov    %edx,%r9d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rax,%r8
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sdiv i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = srem i64 %8, %9
%11 = call i32 @foo(i32 0, i32 0, i32 0, i32 0, i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @bar(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = tail call i32 @foo(i32 0, i32 0, i32 0, i32 0, i64 %3, i64 %4)
ret void
}
void setChar(void *stream, unsigned long offset, unsigned char b) {
  char *lstream = stream;
  lstream[offset] = b;
}


x86 assembly (clang, -O0):
<setChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setChar>:
mov    %dl,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @setChar(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8, i8* %6
%10 = load i8*, i8** %7
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 %9, i8* %12
ret void
}

LLVM IR (-O2):
define void @setChar(i8* nocapture writeonly %0, i64 %1, i8 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 %2, i8* %4
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_uk(int);
uint32_t __stdfix_smul_uk(uint32_t x, uint32_t y) {
  return (__stdfix_sat_uk(((uint64_t)x * (uint64_t)y) >> 16));
}


x86 assembly (clang, -O0):
<__stdfix_smul_uk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
imul   %eax,%edi
sar    $0x10,%edi
call   1030 <__stdfix_sat_uk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_uk>:
imul   %esi,%edi
sar    $0x10,%edi
jmp    1030 <__stdfix_sat_uk@plt>

LLVM IR (-O0):
define i64 @__stdfix_smul_uk(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 16
%11 = call i64 @__stdfix_sat_uk(i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @__stdfix_smul_uk(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = ashr i32 %5, 16
%7 = tail call i64 @__stdfix_sat_uk(i32 %6)
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CERT_AUX;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CERT_AUX_it;
void X509_CERT_AUX_free(X509_CERT_AUX *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_CERT_AUX_it);
}


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

x86 assembly (clang, -O2):
<X509_CERT_AUX_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@X509_CERT_AUX_it = global i32 0
define void @X509_CERT_AUX_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @X509_CERT_AUX_it)
ret void
}

LLVM IR (-O2):
@X509_CERT_AUX_it = global i32 0
define void @X509_CERT_AUX_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_CERT_AUX_it)
ret void
}
char const *zlibVersion(void) {
  char const *__retres;
  __retres = "1.2.8";
  return __retres;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.8\00"
define i8* @zlibVersion() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.8\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, long, long);
size_t snarf_from_kernel(void *, void *, size_t);
int /*<<< orphan*/ stderr;
void snarf(void *to, void *from, size_t len) {
  size_t cc = 0;
  cc = snarf_from_kernel(to, from, len);
  if (cc) {
    fprintf(stderr, "snarf: read failed at %p, len %lx rc=%ld\n", from,
            (long)len, (long)cc);
  }
}


x86 assembly (clang, -O0):
<snarf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <snarf_from_kernel@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117d <snarf+0x5d>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snarf>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <snarf_from_kernel@plt>
test   %rax,%rax
je     1159 <snarf+0x39>
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"snarf: read failed at %p, len %lx rc=%ld\0A\00"
define void @snarf(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @snarf_from_kernel(i8* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %16, i64 %17, i64 %18)
br label %20
20: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"snarf: read failed at %p, len %lx rc=%ld\0A\00"
define void @snarf(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @snarf_from_kernel(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2, i64 %4)
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int close(int const);
int errno;
int /*<<< orphan*/ perror(char *);
int gpiotools_release_line(const int fd) {
  int ret;
  ret = close(fd);
  if (ret == -1) {
    perror("Failed to close GPIO LINE device file");
    ret = -errno;
  }
  return ret;
}


x86 assembly (clang, -O0):
<gpiotools_release_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    115a <gpiotools_release_line+0x3a>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpiotools_release_line>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <gpiotools_release_line+0xd>
pop    %rcx
ret
lea    0xecc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2ea0(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Failed to close GPIO LINE device file\00"
@errno = global i32 0
define i32 @gpiotools_release_line(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @errno
%11 = sub nsw i32 0, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [38 x i8] c"Failed to close GPIO LINE device file\00"
@errno = global i32 0
define i32 @gpiotools_release_line(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ %7, %4 ], [ %2, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t startTimer(time_t *timer) {
  time_t now = time(timer);
  return now;
}


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

x86 assembly (clang, -O2):
<startTimer>:
jmp    1030 <time@plt>

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

LLVM IR (-O2):
define i32 @startTimer(i32* %0) {
%2 = tail call i32 @time(i32* %0)
ret i32 %2
}
int test_imm_F6uint8_mem(unsigned char *val) {
  return ((*val) & (0xF6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -10
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
void inputb_none_disable(void) {
  log_f("inputb:none: inputb_none_disable()\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"inputb:none: inputb_none_disable()\0A\00"
define void @inputb_none_disable() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"inputb:none: inputb_none_disable()\0A\00"
define void @inputb_none_disable() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ AddIP(char *);
int /*<<< orphan*/ G_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_Argv(int, char *, int);
void Svcmd_AddIP_f(void) {
  char str[1024];
  if (trap_Argc() < 2) {
    G_Printf("Usage: addip <ip-mask>\n");
    return;
  }
  trap_Argv(1, str, sizeof(str));
  AddIP(str);
}


x86 assembly (clang, -O0):
<Svcmd_AddIP_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    $0x0,%al
call   1030 <trap_Argc@plt>
cmp    $0x2,%eax
jge    116c <Svcmd_AddIP_f+0x2c>
lea    0xe9e(%rip),%rdi
call   1050 <G_Printf@plt>
jmp    118e <Svcmd_AddIP_f+0x4e>
lea    -0x400(%rbp),%rsi
mov    $0x1,%edi
mov    $0x400,%edx
call   1060 <trap_Argv@plt>
lea    -0x400(%rbp),%rdi
call   1040 <AddIP@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_AddIP_f>:
push   %rbx
sub    $0x400,%rsp
xor    %eax,%eax
call   1030 <trap_Argc@plt>
cmp    $0x1,%eax
jg     1168 <Svcmd_AddIP_f+0x28>
lea    0xea5(%rip),%rdi
add    $0x400,%rsp
pop    %rbx
jmp    1050 <G_Printf@plt>
mov    %rsp,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <trap_Argv@plt>
mov    %rbx,%rdi
call   1040 <AddIP@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: addip <ip-mask>\0A\00"
define void @Svcmd_AddIP_f() {
%1 = alloca [1024 x i8]
%2 = call i32 (...) @trap_Argc()
%3 = icmp slt i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @G_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %11
6: ; preds = %0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i32 @trap_Argv(i32 1, i8* %7, i32 1024)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%10 = call i32 @AddIP(i8* %9)
br label %11
11: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: addip <ip-mask>\0A\00"
define void @Svcmd_AddIP_f() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @trap_Argc()
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @G_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = call i32 @trap_Argv(i32 1, i8* %2, i32 1024)
%9 = call i32 @AddIP(i8* %2)
br label %10
10: ; preds = %7, %5
ret void
}
unsigned int GetU32(unsigned char *pSource) {
  unsigned int a, b, c, d;
  a = pSource[0];
  b = pSource[1];
  c = pSource[2];
  d = pSource[3];
  return a | (b << 8) | (c << 16) | (d << 24);
}


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

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

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

LLVM IR (-O2):
define i32 @GetU32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %6, 8
%14 = or i32 %13, %3
%15 = shl nuw nsw i32 %9, 16
%16 = or i32 %14, %15
%17 = shl nuw i32 %12, 24
%18 = or i32 %16, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: create_long_dirs nr_dirs parent_dir\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: create_long_dirs nr_dirs parent_dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: create_long_dirs nr_dirs parent_dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_IA5STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_IA5STRING_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, const unsigned char **in,
                                   long len) {
  return (ASN1_IA5STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &ASN1_IA5STRING_it);
}


x86 assembly (clang, -O0):
<d2i_ASN1_IA5STRING>:
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
mov    0x2ea1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ASN1_IA5STRING>:
mov    0x2ec1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_IA5STRING_it = global i32 0
define i32* @d2i_ASN1_IA5STRING(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_IA5STRING_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_IA5STRING_it = global i32 0
define i32* @d2i_ASN1_IA5STRING(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_IA5STRING_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void dbg_print_reg(const char *name, int reg) {}


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

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

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

LLVM IR (-O2):
define void @dbg_print_reg(i8* nocapture %0, i32 %1) {
ret void
}
void troca(int *v, int pos) {
  int aux = v[pos];
  v[pos] = v[pos + 1];
  v[pos + 1] = aux;
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
movslq %esi,%rax
rolq   $0x20,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %1, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %4
store i32 %5, i32* %8
ret void
}
int mbo_save_local(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mbo_save_local() {
ret i32 1
}
void modify_char_refs_old_syntax(char *first, char *second) {
  (*first)++;
  (*second)--;
}


x86 assembly (clang, -O0):
<modify_char_refs_old_syntax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0xff,%cl
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_char_refs_old_syntax>:
addb   $0x1,(%rdi)
addb   $0xff,(%rsi)
ret

LLVM IR (-O0):
define void @modify_char_refs_old_syntax(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 = load i8, i8* %5
%7 = add i8 %6, 1
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = add i8 %9, -1
store i8 %10, i8* %8
ret void
}

LLVM IR (-O2):
define void @modify_char_refs_old_syntax(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 1
store i8 %4, i8* %0
%5 = load i8, i8* %1
%6 = add i8 %5, -1
store i8 %6, i8* %1
ret void
}
/* Variables and functions */
float bessj0(float);
float fx(float x) { return bessj0(x); }


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

x86 assembly (clang, -O2):
<fx>:
jmp    1030 <bessj0@plt>

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

LLVM IR (-O2):
define float @fx(float %0) {
%2 = tail call float @bessj0(float %0)
ret float %2
}
/* Variables and functions */
double exp(double);
double f_eq42_n0(double r, double a, double c0) { return exp(-a * r) * c0; }


x86 assembly (clang, -O0):
<f_eq42_n0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mulsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq42_n0>:
push   %rax
movsd  %xmm2,(%rsp)
xorpd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f_eq42_n0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call double @exp(double %10)
%12 = load double, double* %6
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @f_eq42_n0(double %0, double %1, double %2) {
%4 = fneg double %1
%5 = fmul double %4, %0
%6 = tail call double @exp(double %5)
%7 = fmul double %6, %2
ret double %7
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int ioc_completed() { return sys_call(0x17, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<ioc_completed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioc_completed>:
mov    $0x17,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @ioc_completed() {
%1 = call i32 @sys_call(i32 23, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ioc_completed() {
%1 = tail call i32 @sys_call(i32 23, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
void nrf_raal_continuous_ended(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_raal_continuous_ended() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __aeabi_memmove4(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memmove4>:
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 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memmove4>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @__aeabi_memmove4(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 @memmove(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__aeabi_memmove4(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int singleNumber(int *, int);
int main() {
  int a[] = {1, 1, 2, 1, 3, 3, 3};
  printf("%d\n", singleNumber(a, sizeof(a) / sizeof(*a)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <singleNumber@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <singleNumber@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 1, i32 2, i32 1, i32 3, i32 3, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @singleNumber(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assume_internal(int, int);
void __VERIFIER_assume(int expr) { __VERIFIER_assume_internal(expr, 1); }


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

x86 assembly (clang, -O2):
<__VERIFIER_assume>:
mov    $0x1,%esi
jmp    1030 <__VERIFIER_assume_internal@plt>

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

LLVM IR (-O2):
define void @__VERIFIER_assume(i32 %0) {
%2 = tail call i32 @__VERIFIER_assume_internal(i32 %0, i32 1)
ret void
}
void init() { ; }


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

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

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

LLVM IR (-O2):
define void @init() {
ret void
}
int test_imm_00int32_mem(int *val) {
  return ((*val) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 0
%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_00int32_mem(i32* nocapture readnone %0) {
ret i32 -40
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
__gettimeofday_syscall_is_not_implemented_without_vtimer_or_rtc_module();
int _gettimeofday(struct timeval *tp, void *restrict tzp) {
  (void)tzp;
  __gettimeofday_syscall_is_not_implemented_without_vtimer_or_rtc_module();
  return 0;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @_gettimeofday(%struct.timeval* %0, i8* noalias %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (...) @__gettimeofday_syscall_is_not_implemented_without_vtimer_or_rtc_module()
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @_gettimeofday(%struct.timeval* nocapture readnone %0, i8* noalias nocapture readnone %1) {
%3 = tail call i32 (...) @__gettimeofday_syscall_is_not_implemented_without_vtimer_or_rtc_module()
ret i32 0
}
/* Variables and functions */
char *delspc(char const *);
int /*<<< orphan*/ printerr(int, char *, char const *);
void rd_comma(const char **p) {
  *p = delspc(*p);
  if (**p != ',') {
    printerr(1, "`,' expected. Remainder of line: %s\n", *p);
    return;
  }
  *p = delspc((*p) + 1);
}


x86 assembly (clang, -O0):
<rd_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <delspc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1172 <rd_comma+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
call   1030 <printerr@plt>
jmp    118c <rd_comma+0x6c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
call   1040 <delspc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_comma>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <delspc@plt>
mov    %rax,(%rbx)
cmpb   $0x2c,(%rax)
jne    1145 <rd_comma+0x25>
add    $0x1,%rax
mov    %rax,%rdi
call   1040 <delspc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret
lea    0xeb4(%rip),%rsi
mov    $0x1,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printerr@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"`,' expected. Remainder of line: %s\0A\00"
define void @rd_comma(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i8* @delspc(i8* %4)
%6 = load i8**, i8*** %2
store i8* %5, i8** %6
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 44
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = call i32 @printerr(i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %22
16: ; preds = %1
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = call i8* @delspc(i8* %19)
%21 = load i8**, i8*** %2
store i8* %20, i8** %21
br label %22
22: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"`,' expected. Remainder of line: %s\0A\00"
define void @rd_comma(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @delspc(i8* %2)
store i8* %3, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 44
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @printerr(i32 1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %11
8: ; preds = %1
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = tail call i8* @delspc(i8* %9)
store i8* %10, i8** %0
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int main() {
  static int local_one = 1;
  int local_two;
  print(local_one);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2f03(%rip),%edi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.local_one = internal global i32 1
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @main.local_one
%4 = call i32 @print(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(i32 1)
ret i32 0
}
/* Variables and functions */
void *my_malloc2(int, int);
void testUniqueingByallocationSiteInTopLevelFunction() {
  void *data = my_malloc2(1, 4);
  data = 0;
  int x = 5;
  data = my_malloc2(1, 4);
}


x86 assembly (clang, -O0):
<testUniqueingByallocationSiteInTopLevelFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <my_malloc2@plt>
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <my_malloc2@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUniqueingByallocationSiteInTopLevelFunction>:
push   %rax
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <my_malloc2@plt>
mov    $0x1,%edi
mov    $0x4,%esi
pop    %rax
jmp    1030 <my_malloc2@plt>

LLVM IR (-O0):
define void @testUniqueingByallocationSiteInTopLevelFunction() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @my_malloc2(i32 1, i32 4)
store i8* %3, i8** %1
store i8* null, i8** %1
store i32 5, i32* %2
%4 = call i8* @my_malloc2(i32 1, i32 4)
store i8* %4, i8** %1
ret void
}

LLVM IR (-O2):
define void @testUniqueingByallocationSiteInTopLevelFunction() {
%1 = tail call i8* @my_malloc2(i32 1, i32 4)
%2 = tail call i8* @my_malloc2(i32 1, i32 4)
ret void
}
/* Variables and functions */
int data_geteast(int);
int data_getwest(int);
int data_getdir(int dir, int p) {
  if (dir == 0)
    return data_geteast(p);
  if (dir == 1)
    return data_getwest(p);
  return p;
}


x86 assembly (clang, -O0):
<data_getdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <data_getdir+0x28>
mov    -0xc(%rbp),%edi
call   1040 <data_geteast@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <data_getdir+0x48>
cmpl   $0x1,-0x8(%rbp)
jne    1162 <data_getdir+0x42>
mov    -0xc(%rbp),%edi
call   1030 <data_getwest@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <data_getdir+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_getdir>:
cmp    $0x1,%edi
je     1130 <data_getdir+0x10>
test   %edi,%edi
jne    1137 <data_getdir+0x17>
mov    %esi,%edi
jmp    1040 <data_geteast@plt>
mov    %esi,%edi
jmp    1030 <data_getwest@plt>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @data_getdir(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @data_geteast(i32 %9)
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = call i32 @data_getwest(i32 %15)
store i32 %16, i32* %3
br label %19
17: ; preds = %11
%18 = load i32, i32* %5
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @data_getdir(i32 %0, i32 %1) {
switch i32 %0, label %7 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @data_geteast(i32 %1)
br label %7
5: ; preds = %2
%6 = tail call i32 @data_getwest(i32 %1)
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  pid_t pid;
  pid = fork();
  if (pid < 0) {
    printf("error occurred!");
  } else if (pid == 0) {
    exit(0);
  } else {
    sleep(60);
    wait(NULL);
  }
  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)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    118d <main+0x3d>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0x67>
cmpq   $0x0,-0x18(%rbp)
jne    119f <main+0x4f>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x3c,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <wait@plt>
jmp    11b7 <main+0x67>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
js     1172 <main+0x22>
je     1182 <main+0x32>
mov    $0x3c,%edi
call   1050 <sleep@plt>
xor    %edi,%edi
call   1060 <wait@plt>
jmp    117e <main+0x2e>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"error occurred!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @fork()
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %21
12: ; preds = %2
%13 = load i64, i64* %6
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %12
%18 = call i32 @sleep(i32 60)
%19 = call i32 @wait(i32* null)
br label %20
20: ; preds = %17
br label %21
21: ; preds = %20, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"error occurred!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %2
%8 = icmp eq i64 %3, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %7
%12 = tail call i32 @sleep(i32 60)
%13 = tail call i32 @wait(i32* null)
br label %14
14: ; preds = %11, %5
ret i32 0
}