xunge/DecIR huggingface dataset:
char test_62_0(char *mem) { return __atomic_nand_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_62_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_62_0+0x4f>
jmp    111f <test_62_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
and    %cl,%al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_62_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
or     $0xfe,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_62_0+0x10>
not    %al
or     $0xfe,%al
ret

LLVM IR (-O0):
define signext i8 @test_62_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw nand i8* %6, i8 %7 acq_rel
%9 = and i8 %8, %7
%10 = xor i8 %9, -1
store i8 %10, i8* %4
%11 = load i8, i8* %4
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @test_62_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
%3 = and i8 %2, 1
%4 = xor i8 %3, -1
ret i8 %4
}
/* Variables and functions */
int leftmost_one(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("%x leftmost one is: %x\n", 0xFF00, leftmost_one(0xFF00));
  printf("%x leftmost one is: %x\n", 0x6600, leftmost_one(0x6600));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff00,%edi
call   1040 <leftmost_one@plt>
mov    %eax,%edx
lea    0xebe(%rip),%rdi
mov    $0xff00,%esi
call   1030 <printf@plt>
mov    $0x6600,%edi
call   1040 <leftmost_one@plt>
mov    %eax,%edx
lea    0xea1(%rip),%rdi
mov    $0x6600,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xff00,%edi
call   1040 <leftmost_one@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0xff00,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x6600,%edi
call   1040 <leftmost_one@plt>
mov    %rbx,%rdi
mov    $0x6600,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%x leftmost one is: %x\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @leftmost_one(i32 65280)
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 65280, i32 %2)
%4 = call i32 @leftmost_one(i32 26112)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 26112, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%x leftmost one is: %x\0A\00"
define i32 @main() {
%1 = tail call i32 @leftmost_one(i32 65280)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 65280, i32 %1)
%3 = tail call i32 @leftmost_one(i32 26112)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 26112, i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ inrange(char, char, char);
char uch(char ch) {
  register char uch;
  uch = ch;
  if (inrange(ch, 'a', 'z'))
    uch = ch & 0x5F;
  return uch;
}


x86 assembly (clang, -O0):
<uch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
mov    $0x61,%esi
mov    $0x7a,%edx
movsbl -0x1(%rbp),%edi
call   1030 <inrange@plt>
cmp    $0x0,%rax
je     114b <uch+0x3b>
movsbl -0x1(%rbp),%eax
and    $0x5f,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uch>:
push   %rbx
mov    %edi,%ebx
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <inrange@plt>
mov    %ebx,%ecx
and    $0x5f,%cl
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @uch(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
store i8 %4, i8* %3
%5 = load i8, i8* %2
%6 = call i64 @inrange(i8 signext %5, i8 signext 97, i8 signext 122)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 95
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
br label %13
13: ; preds = %8, %1
%14 = load i8, i8* %3
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @uch(i8 signext %0) {
%2 = tail call i64 @inrange(i8 signext %0, i8 signext 97, i8 signext 122)
%3 = icmp eq i64 %2, 0
%4 = and i8 %0, 95
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ test2();
void timer_init(void) { test2(); }


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

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

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

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 (...) @test2()
ret void
}
/* Variables and functions */
void *CCutil_reallocrus(void *, int);
int CCutil_reallocrus_count(void **pptr, int count, unsigned int size) {
  void *p = CCutil_reallocrus(*pptr, count * size);
  if (!p) {
    return 1;
  } else {
    *pptr = p;
    return 0;
  }
}


x86 assembly (clang, -O0):
<CCutil_reallocrus_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
call   1030 <CCutil_reallocrus@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1150 <CCutil_reallocrus_count+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1162 <CCutil_reallocrus_count+0x52>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CCutil_reallocrus_count>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
imul   %edx,%esi
call   1030 <CCutil_reallocrus@plt>
test   %rax,%rax
je     112b <CCutil_reallocrus_count+0x1b>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CCutil_reallocrus_count(i8** nocapture %0, i32 %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = mul i32 %2, %1
%6 = tail call i8* @CCutil_reallocrus(i8* %4, i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8* %6, i8** %0
br label %9
9: ; preds = %3, %8
%10 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %10
}
void EVP_EncodeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_EncodeInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ free_strings(char **, size_t);
void free_string_array(char *array[], size_t len) {
  if (array != NULL) {
    free_strings(array, len);
    free(array);
  }
}


x86 assembly (clang, -O0):
<free_string_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <free_string_array+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <free_strings@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_string_array>:
test   %rdi,%rdi
je     1137 <free_string_array+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <free_strings@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_string_array(i8** %0, i64 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @free_strings(i8** %0, i64 %1)
%6 = tail call i32 @free(i8** %0)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
bool nrf52_errata_3(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_3() {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR86_set(void) { return U_WMRCORENONE_set("U_WMR86"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR86\00"
define i8* @U_WMR86_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR86\00"
define i8* @U_WMR86_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int read(int, unsigned char *, int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int i2c_read_byte(int handle, unsigned char *val) {
  if (read(handle, val, 1) != 1) {
    fprintf(stderr, "i2c_read_byte error: %s\n", strerror(errno));
    return (-1);
  }
  return (1);
}


x86 assembly (clang, -O0):
<i2c_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1191 <i2c_read_byte+0x61>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe80(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <i2c_read_byte+0x68>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_byte>:
push   %rbx
mov    $0x1,%ebx
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1172 <i2c_read_byte+0x42>
mov    0x2e94(%rip),%rax
mov    (%rax),%ebx
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe9d(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"i2c_read_byte error: %s\0A\00"
@errno = global i32 0
define i32 @i2c_read_byte(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ -1, %5 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[256];
  setuid(getuid());
  strcpy(buf, argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getuid()
%8 = call i32 @setuid(i32 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %9, i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @getuid()
%6 = tail call i32 @setuid(i32 %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %4, i8* %8)
ret i32 0
}
extern void __outw(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
}


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),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outw>:
mov    %esi,%edx
mov    %edi,%eax
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 ${0:w},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
char *libintl_bindtextdomain(char const *, char const *);
char *bindtextdomain(const char *domainname, const char *dirname) {
  return libintl_bindtextdomain(domainname, dirname);
}


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

x86 assembly (clang, -O2):
<bindtextdomain>:
jmp    1030 <libintl_bindtextdomain@plt>

LLVM IR (-O0):
define i8* @bindtextdomain(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** %4
%7 = call i8* @libintl_bindtextdomain(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @bindtextdomain(i8* %0, i8* %1) {
%3 = tail call i8* @libintl_bindtextdomain(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_CERT_SEQUENCE;
typedef int /*<<< orphan*/ ASN1_VALUE;

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


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

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

LLVM IR (-O0):
@NETSCAPE_CERT_SEQUENCE_it = global i32 0
define i32* @d2i_NETSCAPE_CERT_SEQUENCE(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* @NETSCAPE_CERT_SEQUENCE_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@NETSCAPE_CERT_SEQUENCE_it = global i32 0
define i32* @d2i_NETSCAPE_CERT_SEQUENCE(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @NETSCAPE_CERT_SEQUENCE_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int parse_motion_command(char *cmd, int *gid, int *pid, int *row, int *col) {
  int outcome = 0;
  return outcome;
}


x86 assembly (clang, -O0):
<parse_motion_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @parse_motion_command(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
float fdimf(float, float);
float __ocl_fdim_float(float src1, float src2) { return fdimf(src1, src2); }


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

x86 assembly (clang, -O2):
<__ocl_fdim_float>:
jmp    1030 <fdimf@plt>

LLVM IR (-O0):
define float @__ocl_fdim_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fdimf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_fdim_float(float %0, float %1) {
%3 = tail call float @fdimf(float %0, float %1)
ret float %3
}
adr0imm1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*((short *)10000000)) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movswl (%rax),%eax
cmp    $0x21,%eax
jg     113c <adr0imm1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <adr0imm1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1>:
xor    %eax,%eax
cmpw   $0x22,0x989680
setl   %al
ret

LLVM IR (-O0):
define i32 @adr0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = sext i16 %16 to i32
%18 = icmp sle i32 %17, 33
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adr0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = icmp slt i16 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void fclear_eol(FILE *fin) {
  while (fgetc(fin) != '\n')
    ;
}


x86 assembly (clang, -O0):
<fclear_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1136 <fclear_eol+0x26>
jmp    111c <fclear_eol+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclear_eol>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1120 <fclear_eol+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @fclear_eol(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %8, %1
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @fclear_eol(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
long double __attribute__((no)) foo(long double x) {
  return __builtin_signbit(x) ? 3.1415926535897932384626433832795029L : 0.0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movswq -0x8(%rbp),%rax
test   %rax,%rax
sets   %al
test   %al,%al
fldt   0xee3(%rip)
fldz
fcmovne %st(1),%st
fstp   %st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movswq 0x10(%rsp),%rax
test   %rax,%rax
sets   %al
test   %al,%al
fldt   0xeec(%rip)
fldz
fcmovne %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @foo(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = bitcast x86_fp80 %3 to i80
%5 = icmp slt i80 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, x86_fp80 0xK4000C90FDAA22168C235, x86_fp80 0xK00000000000000000000
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = icmp slt i80 %2, 0
%4 = select i1 %3, x86_fp80 0xK4000C90FDAA22168C235, x86_fp80 0xK00000000000000000000
ret x86_fp80 %4
}
/* Variables and functions */
scalar_t__ memchr(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *strchr(const char *str, int character) {
  return (char *)memchr(str, character, strlen(str));
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define i8* @strchr(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @memchr(i8* %5, i32 %6, i32 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @memchr(i8* %0, i32 %1, i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ldmatrix(long double **M, long i0, long NI, long j0, long NJ) {
  free((char *)(M[i0] + j0 - 1));
  free((char *)(M + i0 - 1));
}


x86 assembly (clang, -O0):
<free_ldmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdi
add    $0xfffffffffffffff0,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ldmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
shl    $0x4,%rcx
lea    (%rax,%rcx,1),%rdi
add    $0xfffffffffffffff0,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ldmatrix(x86_fp80** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds x86_fp80*, x86_fp80** %0, i64 %1
%7 = load x86_fp80*, x86_fp80** %6
%8 = getelementptr inbounds x86_fp80, x86_fp80* %7, i64 %3
%9 = getelementptr inbounds x86_fp80, x86_fp80* %8, i64 -1
%10 = bitcast x86_fp80* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds x86_fp80*, x86_fp80** %6, i64 -1
%13 = bitcast x86_fp80** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int O_NONBLOCK;
int O_RDWR;
int _sg_io_open(char *, char const *, int *, int);
int _sg_io_open_rw(char *err_msg, const char *disk_path, int *fd) {
  return _sg_io_open(err_msg, disk_path, fd, O_RDWR | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<_sg_io_open_rw>:
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    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
or     (%rax),%ecx
call   1030 <_sg_io_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sg_io_open_rw>:
mov    0x2ed1(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
jmp    1030 <_sg_io_open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
define i32 @_sg_io_open_rw(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @O_RDWR
%11 = load i32, i32* @O_NONBLOCK
%12 = or i32 %10, %11
%13 = call i32 @_sg_io_open(i8* %7, i8* %8, i32* %9, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
define i32 @_sg_io_open_rw(i8* %0, i8* %1, i32* %2) {
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @_sg_io_open(i8* %0, i8* %1, i32* %2, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct FlowNode {
  int dummy;
};

/* Variables and functions */
int AddNodeData(struct FlowNode *node, uint32_t seq, void *payload,
                uint32_t size) {
  return 0;
}


x86 assembly (clang, -O0):
<AddNodeData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.FlowNode = type { i32 }
define i32 @AddNodeData(%struct.FlowNode* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
int _get_joy_button(int button) {
  if (button < 0 || button > 3)
    return (-1);
}


x86 assembly (clang, -O0):
<_get_joy_button>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <_get_joy_button+0x1b>
cmpl   $0x3,-0x8(%rbp)
jle    1122 <_get_joy_button+0x22>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_get_joy_button(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 3
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @_get_joy_button(i32 %0) {
ret i32 -1
}
void ui_keyboard_end(void) {}


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

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

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

LLVM IR (-O2):
define void @ui_keyboard_end() {
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap2420(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x2420)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap2420>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2420,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap2420>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x24200000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap2420() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 9248
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap2420() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 606076928
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void myexit(void) { pr_info("oops myexit\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"oops myexit\0A\00"
define void @myexit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"oops myexit\0A\00"
define void @myexit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(unsigned int);
int /*<<< orphan*/ perror(char *);
void *ec_malloc(unsigned int size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    perror("server: malloc");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<ec_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <ec_malloc+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_malloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <ec_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"server: malloc\00"
define i8* @ec_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"server: malloc\00"
define noalias i8* @ec_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int detexGetComponentSize(uint32_t pixel_format) {
  return 1 << (pixel_format & 0x3);
}


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

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

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

LLVM IR (-O2):
define i32 @detexGetComponentSize(i32 %0) {
%2 = and i32 %0, 3
%3 = shl nuw nsw i32 1, %2
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void smpte_fec_set_snbase_low(uint8_t *p_fec, uint16_t snbase_low) {
  p_fec[0] = snbase_low >> 8;
  p_fec[1] = snbase_low & 0xff;
}


x86 assembly (clang, -O0):
<smpte_fec_set_snbase_low>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_snbase_low>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_set_snbase_low(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @smpte_fec_set_snbase_low(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TMR4_DriverIRQHandler();
__attribute__((weak)) void TMR4_IRQHandler(void) { TMR4_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @TMR4_IRQHandler() {
%1 = call i32 (...) @TMR4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TMR4_IRQHandler() {
%1 = tail call i32 (...) @TMR4_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int car;
  float price;
  int bird = 10;
  printf("car=%d\n", car);
  printf("price=%f\n", price);
  printf("bird=%d\n", bird);
  bird = 20;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
cvttss2si -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x14,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"car=%d\0A\00"
@.str.1 = [10 x i8] c"price=%f\0A\00"
@.str.2 = [9 x i8] c"bird=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load float, float* %3
%8 = fptosi float %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %10)
store i32 20, i32* %4
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"car=%d\0A\00"
@.str.1 = [10 x i8] c"price=%f\0A\00"
@.str.2 = [9 x i8] c"bird=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int levenshtein(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int main(int argc, char **argv) {
  int ed = levenshtein(argv[1], argv[2]);
  printf("edit distance: of %s :: %s :  %d\n", argv[1], argv[2], ed);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <levenshtein@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <levenshtein@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdx
lea    0xec0(%rip),%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"edit distance: of %s :: %s : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @levenshtein(i8* %4, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %7)
ret i32 0
}
void interrupt_ex_handler(unsigned int type, void *execptr, void *dataptr,
                          void *regtable, void *stackptr) {
  uputs(__FUNCTION__);
  putc(' ');
  puti(type);
  putc('\n');
  while (1)
    ;
}


x86 assembly (clang, -O0):
<interrupt_ex_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <uputs@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1040 <putc@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <puti@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1040 <putc@plt>
jmp    117b <interrupt_ex_handler+0x4b>

x86 assembly (clang, -O2):
<interrupt_ex_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <uputs@plt>
mov    $0x20,%edi
xor    %eax,%eax
call   1040 <putc@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <puti@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1040 <putc@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1170 <interrupt_ex_handler+0x40>

LLVM IR (-O0):
@__FUNCTION__.interrupt_ex_handler = [21 x i8] c"interrupt_ex_handler\00"
define void @interrupt_ex_handler(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @uputs to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.interrupt_ex_handler, i64 0, i64 0))
%12 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 32)
%13 = load i32, i32* %6
%14 = call i32 (i32, ...) bitcast (i32 (...)* @puti to i32 (i32, ...)*)(i32 %13)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 10)
br label %16
16: ; preds = %5, %16
br label %16
}

LLVM IR (-O2):
@__FUNCTION__.interrupt_ex_handler = [21 x i8] c"interrupt_ex_handler\00"
define void @interrupt_ex_handler(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @uputs to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.interrupt_ex_handler, i64 0, i64 0))
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 32)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @puti to i32 (i32, ...)*)(i32 %0)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 10)
br label %10
10: ; preds = %5, %10
br label %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printIndent(int times) {
  while (times--) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printIndent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <printIndent+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <printIndent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIndent>:
push   %rbx
test   %edi,%edi
je     112f <printIndent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printIndent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @printIndent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @printIndent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}