xunge/DecIR huggingface dataset:
/* Variables and functions */
void *__real_realloc(void *, size_t);
unsigned int irq_disable();
int /*<<< orphan*/ irq_restore(unsigned int);
void *__wrap_realloc(void *ptr, size_t size) {
  unsigned state = irq_disable();
  void *new = __real_realloc(ptr, size);
  irq_restore(state);
  return new;
}


x86 assembly (clang, -O0):
<__wrap_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <irq_disable@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__real_realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <irq_restore@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_realloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <irq_disable@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <__real_realloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1050 <irq_restore@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @__wrap_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i32 (...) @irq_disable()
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i8* @__real_realloc(i8* %8, i64 %9)
store i8* %10, i8** %6
%11 = load i32, i32* %5
%12 = call i32 @irq_restore(i32 %11)
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
define i8* @__wrap_realloc(i8* %0, i64 %1) {
%3 = tail call i32 (...) @irq_disable()
%4 = tail call i8* @__real_realloc(i8* %0, i64 %1)
%5 = tail call i32 @irq_restore(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int);
int main(void) {
  ft_putnbr(222);
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ft_putnbr(i32 222)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ft_putnbr(i32 222)
ret i32 0
}
const char *ajXmlinTypeGetQlinks(void) { return "|"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
define i8* @ajXmlinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i8* @ajXmlinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
struct cvec *allmcces(v, cv)
struct vars *v;
struct cvec *cv;
{
  return clearcvec(cv);
}


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

x86 assembly (clang, -O2):
<allmcces>:
push   %rax
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <clearcvec@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.vars = type opaque
%struct.cvec = type opaque
define %struct.cvec* @allmcces(%struct.vars* %0, %struct.cvec* %1) {
%3 = alloca %struct.vars*
%4 = alloca %struct.cvec*
store %struct.vars* %0, %struct.vars** %3
store %struct.cvec* %1, %struct.cvec** %4
%5 = load %struct.cvec*, %struct.cvec** %4
%6 = call i32 (%struct.cvec*, ...) bitcast (i32 (...)* @clearcvec to i32 (%struct.cvec*, ...)*)(%struct.cvec* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.cvec*
ret %struct.cvec* %8
}

LLVM IR (-O2):
%struct.vars = type opaque
%struct.cvec = type opaque
define %struct.cvec* @allmcces(%struct.vars* nocapture readnone %0, %struct.cvec* %1) {
%3 = tail call i32 (%struct.cvec*, ...) bitcast (i32 (...)* @clearcvec to i32 (%struct.cvec*, ...)*)(%struct.cvec* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.cvec*
ret %struct.cvec* %5
}
void Hal_hook_rd_sgndrecfield_recelemc(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgndrecfield_recelemc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gdt_install();
int /*<<< orphan*/ gdt_set();
void gdt_init() {
  gdt_set();
  gdt_install();
}


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

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

LLVM IR (-O0):
define void @gdt_init() {
%1 = call i32 (...) @gdt_set()
%2 = call i32 (...) @gdt_install()
ret void
}

LLVM IR (-O2):
define void @gdt_init() {
%1 = tail call i32 (...) @gdt_set()
%2 = tail call i32 (...) @gdt_install()
ret void
}
void gmem_init() {}


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

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

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

LLVM IR (-O2):
define void @gmem_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void puts(const char *s) {
  for (; *s; s++)
    putchar(*s);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigsafe_printf(char *, int, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/);
void dump_mem(void *dumpme, int len_bytes) {
  char *c = (void *)dumpme;
  int i;
  for (i = 0; i < len_bytes; i += sizeof(uint64_t)) {
    uint64_t *ptr = (uint64_t *)(c + i);
    do {
      if (1 <= 0)
        sigsafe_printf("dump[%03d][@%p]: %016jx\n", i, ptr, *ptr);
      fflush(NULL);
    } while (0);
  }
}


x86 assembly (clang, -O0):
<dump_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <dump_mem+0x57>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
jmp    1157 <dump_mem+0x47>
movslq -0x1c(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x1c(%rbp)
jmp    112e <dump_mem+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_mem>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112e <dump_mem+0x1e>
mov    %esi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <fflush@plt>
add    $0x4,%ebx
cmp    %ebp,%ebx
jl     1120 <dump_mem+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dump_mem(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fflush(i32* null)
%7 = add i32 %5, 4
%8 = icmp slt i32 %7, %1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_int64(char *str, int64_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(int64_t), true);
}


x86 assembly (clang, -O0):
<try_parse_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_int64>:
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_int64(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 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_int64(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void reverse(char a[], int n) {
  if (n == 0)
    return;
  else {
    putchar(a[n - 1]);
    reverse(a, n - 1);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <reverse+0x1e>
jmp    1163 <reverse+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <putchar@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <reverse+0x33>
mov    %esi,%r14d
movslq %esi,%rax
neg    %r14d
lea    (%rax,%rdi,1),%r15
add    $0xffffffffffffffff,%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r15,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r14d
jne    1130 <reverse+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @reverse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %19
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putchar(i8 signext %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
br label %19
19: ; preds = %7, %8
ret void
}

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @putchar(i8 signext %10)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbEnd(char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t Size) {
  void *P = 0;
  if (Size) {
    P = malloc(Size);
    if (P == 0) {
      AbEnd("Out of memory - requested block size = %lu", (unsigned long)Size);
    }
  }
  return P;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <xmalloc+0x4c>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <xmalloc+0x47>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <AbEnd@plt>
jmp    116c <xmalloc+0x4c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
test   %rdi,%rdi
je     1144 <xmalloc+0x24>
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1135 <xmalloc+0x15>
pop    %rbx
ret
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <AbEnd@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Out of memory - requested block size = %lu\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i64, i64* %2
%13 = call i32 @AbEnd(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %6
br label %15
15: ; preds = %14, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [43 x i8] c"Out of memory - requested block size = %lu\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @AbEnd(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %6 ], [ %4, %3 ], [ null, %1 ]
ret i8* %9
}
unsigned getInvertedbits(unsigned x, int p, int n) {
  return ((~x >> (p + 1 - n)) & ~(~0 << n)) << (p + 1 - n);
}


x86 assembly (clang, -O0):
<getInvertedbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInvertedbits>:
not    %edi
sub    %edx,%esi
add    $0x1,%esi
mov    %esi,%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @getInvertedbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = lshr i32 %8, %12
%14 = load i32, i32* %6
%15 = shl i32 -1, %14
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = shl i32 %17, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @getInvertedbits(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = add nsw i32 %1, 1
%6 = sub i32 %5, %2
%7 = lshr i32 %4, %6
%8 = shl nsw i32 -1, %2
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = shl i32 %10, %6
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void ROM_GetSRAM1(uint32_t *address, uint32_t *size) {
  void (*p_ROM_GetSRAM1)(uint32_t * address, uint32_t * size);
  p_ROM_GetSRAM1 = (void (*)(uint32_t * address, uint32_t * size))0x03000e35U;
  p_ROM_GetSRAM1(address, size);
}


x86 assembly (clang, -O0):
<ROM_GetSRAM1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3000e35,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ROM_GetSRAM1(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca void (i32*, i32*)*
store i32* %0, i32** %3
store i32* %1, i32** %4
store void (i32*, i32*)* inttoptr (i64 50335285 to void (i32*, i32*)*), void (i32*, i32*)** %5
%6 = load void (i32*, i32*)*, void (i32*, i32*)** %5
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
define void @ROM_GetSRAM1(i32* %0, i32* %1) {
tail call void inttoptr (i64 50335285 to void (i32*, i32*)*)(i32* %0, i32* %1)
ret void
}
void f1(char *a, char *p, int b) {}


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

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

LLVM IR (-O0):
define void @f1(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
ret void
}

LLVM IR (-O2):
define void @f1(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char *);
void vf_printk(char *string) { printk("%s", string); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @vf_printk(i8* %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CAN1_IRQ1_DriverIRQHandler();
__attribute__((weak)) void CAN1_IRQ1_IRQHandler(void) {
  CAN1_IRQ1_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @CAN1_IRQ1_IRQHandler() {
%1 = tail call i32 (...) @CAN1_IRQ1_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getpeereid(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(void) {
  uid_t uid;
  gid_t gid;
  int fd = 0;
  return getpeereid(fd, &uid, &gid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <getpeereid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <getpeereid@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getpeereid(i32 0, i32* %1, i32* %2)
ret i32 %5
}
/* Variables and functions */
int gridInqTrunc(int);
int /*<<< orphan*/ sp2sp(double *, int, double *, int);
void spec2spec(int gridIDin, double *arrayIn, int gridIDout, double *arrayOut) {
  int ntrIn, ntrOut;
  ntrIn = gridInqTrunc(gridIDin);
  ntrOut = gridInqTrunc(gridIDout);
  sp2sp(arrayIn, ntrIn, arrayOut, ntrOut);
}


x86 assembly (clang, -O0):
<spec2spec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gridInqTrunc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <gridInqTrunc@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
call   1030 <sp2sp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec2spec>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
call   1040 <gridInqTrunc@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <gridInqTrunc@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <sp2sp@plt>

LLVM IR (-O0):
define void @spec2spec(i32 %0, double* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = call i32 @gridInqTrunc(i32 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %7
%14 = call i32 @gridInqTrunc(i32 %13)
store i32 %14, i32* %10
%15 = load double*, double** %6
%16 = load i32, i32* %9
%17 = load double*, double** %8
%18 = load i32, i32* %10
%19 = call i32 @sp2sp(double* %15, i32 %16, double* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @spec2spec(i32 %0, double* %1, i32 %2, double* %3) {
%5 = tail call i32 @gridInqTrunc(i32 %0)
%6 = tail call i32 @gridInqTrunc(i32 %2)
%7 = tail call i32 @sp2sp(double* %1, i32 %5, double* %3, i32 %6)
ret void
}
/* Variables and functions */
int om2eu(double *, double *, int);
int ro2om(double *, double *, int);
int ro2eu(double *ro, double *eu, int p) {
  double om[9];
  int trash;
  trash = ro2om(ro, om, p);
  trash = om2eu(om, eu, p);
  return 1;
}


x86 assembly (clang, -O0):
<ro2eu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ro2om@plt>
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <om2eu@plt>
mov    %eax,-0x64(%rbp)
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ro2eu>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <ro2om@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <om2eu@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ro2eu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [9 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ro2om(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @om2eu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ro2eu(double* %0, double* %1, i32 %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @ro2om(double* %0, double* %6, i32 %2)
%8 = call i32 @om2eu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
int resolve_heater_lvl(unsigned int);
int get_active_heater(unsigned int *heat_core) {
  return resolve_heater_lvl(heat_core[1]);
}


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

x86 assembly (clang, -O2):
<get_active_heater>:
mov    0x4(%rdi),%edi
jmp    1030 <resolve_heater_lvl@plt>

LLVM IR (-O0):
define i32 @get_active_heater(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = call i32 @resolve_heater_lvl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_active_heater(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = tail call i32 @resolve_heater_lvl(i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ pdu_encode(char *, char *, char *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int test_check_buffer_size() {
  if (pdu_encode("001234567", "1234567", "hellohello", NULL, 0) >= 0) {
    printf("SMS check buffer size failed!\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_check_buffer_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xecd(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <pdu_encode@plt>
cmp    $0x0,%rax
jl     116b <test_check_buffer_size+0x4b>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <test_check_buffer_size+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_check_buffer_size>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed3(%rip),%rsi
lea    0xed4(%rip),%rdx
xor    %ebx,%ebx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <pdu_encode@plt>
test   %rax,%rax
js     1158 <test_check_buffer_size+0x38>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"001234567\00"
@.str.1 = [8 x i8] c"1234567\00"
@.str.2 = [11 x i8] c"hellohello\00"
@.str.3 = [31 x i8] c"SMS check buffer size failed!\0A\00"
define i32 @test_check_buffer_size() {
%1 = alloca i32
%2 = call i64 @pdu_encode(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* null, i32 0)
%3 = icmp sge i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"001234567\00"
@.str.1 = [8 x i8] c"1234567\00"
@.str.2 = [11 x i8] c"hellohello\00"
@str = [30 x i8] c"SMS check buffer size failed!\00"
define i32 @test_check_buffer_size() {
%1 = tail call i64 @pdu_encode(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* null, i32 0)
%2 = icmp sgt i64 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
void gmp_dbg_msg(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @gmp_dbg_msg(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort(char *, int, int /*<<< orphan*/);
void display_anagrams(char *s1) {
  int taille = 0;
  do {
    taille++;
  } while (s1[taille] != '\0');
  sort(s1, taille, 0);
}


x86 assembly (clang, -O0):
<display_anagrams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1123 <display_anagrams+0x13>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_anagrams>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <display_anagrams+0x10>
xor    %edx,%edx
jmp    1030 <sort@plt>

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

LLVM IR (-O2):
define void @display_anagrams(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
%10 = tail call i32 @sort(i8* %0, i32 %9, i32 0)
ret void
}
void delayms(unsigned int tt) {
  unsigned char i;
  unsigned char j;
  while (tt > 0) {
    tt--;
    for (j = 0; j < 5; j++) {
      for (i = 0; i < 168; i++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<delayms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1167 <delayms+0x67>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x5,%eax
jge    1162 <delayms+0x62>
movb   $0x0,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xa8,%eax
jge    1150 <delayms+0x50>
jmp    1143 <delayms+0x43>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    112f <delayms+0x2f>
jmp    1155 <delayms+0x55>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    111e <delayms+0x1e>
jmp    1107 <delayms+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delayms(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
br label %5
5: ; preds = %28, %1
%6 = load i32, i32* %2
%7 = icmp ugt i32 %6, 0
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add i32 %9, -1
store i32 %10, i32* %2
store i8 0, i8* %4
br label %11
11: ; preds = %25, %8
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %28
15: ; preds = %11
store i8 0, i8* %3
br label %16
16: ; preds = %21, %15
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp slt i32 %18, 168
br i1 %19, label %20, label %24
20: ; preds = %16
br label %21
21: ; preds = %20
%22 = load i8, i8* %3
%23 = add i8 %22, 1
store i8 %23, i8* %3
br label %16
24: ; preds = %16
br label %25
25: ; preds = %24
%26 = load i8, i8* %4
%27 = add i8 %26, 1
store i8 %27, i8* %4
br label %11
28: ; preds = %11
br label %5
29: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @delayms(i32 %0) {
ret void
}
void rop3_22_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T & S;
  stk4 = ~stk4;
  stk3 = *D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_22_1_0>:
mov    %edx,%eax
and    %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%al
xor    %sil,%dl
xor    %al,%dl
xor    %dl,%cl
and    %sil,%cl
xor    %dl,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_22_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %2, %1
%9 = xor i8 %8, %7
%10 = xor i8 %1, -1
%11 = and i8 %9, %10
%12 = and i8 %6, %1
%13 = or i8 %11, %12
store i8 %13, i8* %0
ret void
}
int i2adr(int i) { return (i - 1) * 0x20 + 0x1000; }


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

x86 assembly (clang, -O2):
<i2adr>:
shl    $0x5,%edi
lea    0xfe0(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i2adr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = mul nsw i32 %4, 32
%6 = add nsw i32 %5, 4096
ret i32 %6
}

LLVM IR (-O2):
define i32 @i2adr(i32 %0) {
%2 = shl i32 %0, 5
%3 = add i32 %2, 4064
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ usart_in_out(int /*<<< orphan*/);
void usart_out_byte(uint8_t byte) { (void)usart_in_out(byte); }


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

x86 assembly (clang, -O2):
<usart_out_byte>:
jmp    1030 <usart_in_out@plt>

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

LLVM IR (-O2):
define void @usart_out_byte(i32 %0) {
%2 = tail call i32 @usart_in_out(i32 %0)
ret void
}
int test_imm_FDint16_mem(short *val) {
  return ((*val) & (-0xFD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FDint16_mem>:
movzwl (%rdi),%eax
test   $0xff03,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FDint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -253
%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_FDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -253
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink5() {
  int c = 0;
  while (c != 5) {
    blinkdot();
    c++;
  }
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     114e <blink5+0x2e>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <blink5+0xf>
movsd  0xeaa(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink5>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeb4(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink5() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 5
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdot()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink5() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 (...) @blinkdot()
%6 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_solve_stable_standard_start_system(int k, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(882, &k, mv, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_solve_stable_standard_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x372,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_solve_stable_standard_start_system>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x372,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_solve_stable_standard_start_system(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 882, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_solve_stable_standard_start_system(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 882, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
void gtk_accel_map_save() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_map_save() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *DSynth_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<DSynth_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @DSynth_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void _programmable_interval_timer() { printf("Exception: %s\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<_programmable_interval_timer>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._programmable_interval_timer = [29 x i8] c"_programmable_interval_timer\00"
define void @_programmable_interval_timer() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__._programmable_interval_timer, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._programmable_interval_timer = [29 x i8] c"_programmable_interval_timer\00"
define void @_programmable_interval_timer() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__._programmable_interval_timer, i64 0, i64 0))
ret void
}
void abort(void) { __builtin_trap(); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
ud2

x86 assembly (clang, -O2):
<abort>:
ud2

LLVM IR (-O0):
define void @abort() {
unreachable
}

LLVM IR (-O2):
define void @abort() {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_MAKE_HUM_PWR_INPUT();
void HUMIDITY_MAKE_PWR_INPUT() { TOSH_MAKE_HUM_PWR_INPUT(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_MAKE_PWR_INPUT() {
%1 = tail call i32 (...) @TOSH_MAKE_HUM_PWR_INPUT()
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bind(int /*<<< orphan*/, struct sockaddr *,
                        int /*<<< orphan*/);
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ recvfrom(int /*<<< orphan*/, void *, int /*<<< orphan*/,
                            int /*<<< orphan*/, struct sockaddr *,
                            int /*<<< orphan*/);
int /*<<< orphan*/ socket(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void initHooks() {
  socket(0, 0, 0);
  close(0);
  bind(0, (struct sockaddr *)NULL, 0);
  recvfrom(0, (void *)NULL, 0, 0, (struct sockaddr *)NULL, 0);
}


x86 assembly (clang, -O0):
<initHooks>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1060 <socket@plt>
xor    %edi,%edi
call   1030 <close@plt>
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1050 <bind@plt>
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edi
mov    %r8,%rsi
mov    %r9d,%edx
mov    %r9d,%ecx
call   1040 <recvfrom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initHooks>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <socket@plt>
xor    %edi,%edi
call   1030 <close@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <bind@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rax
jmp    1040 <recvfrom@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @initHooks() {
%1 = call i32 @socket(i32 0, i32 0, i32 0)
%2 = call i32 @close(i32 0)
%3 = call i32 @bind(i32 0, %struct.sockaddr* null, i32 0)
%4 = call i32 @recvfrom(i32 0, i8* null, i32 0, i32 0, %struct.sockaddr* null, i32 0)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @initHooks() {
%1 = tail call i32 @socket(i32 0, i32 0, i32 0)
%2 = tail call i32 @close(i32 0)
%3 = tail call i32 @bind(i32 0, %struct.sockaddr* null, i32 0)
%4 = tail call i32 @recvfrom(i32 0, i8* null, i32 0, i32 0, %struct.sockaddr* null, i32 0)
ret void
}