xunge/DecIR huggingface dataset:
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_reverse(struct genlist *);
void clause_list_reverse(struct clause_list *tthis) {
  genlist_reverse((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_reverse>:
jmp    1030 <genlist_reverse@plt>

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_reverse(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i32 @genlist_reverse(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_reverse(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_reverse(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
void halt(void) {
  for (;;)
    io_hlt();
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <halt+0x9>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    1119 <halt+0x9>

x86 assembly (clang, -O2):
<halt>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1120 <halt+0x10>

LLVM IR (-O0):
define void @halt() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @io_hlt()
br label %1
}

LLVM IR (-O2):
define void @halt() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @io_hlt()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __hlt_init_common() {
  if (!setlocale(LC_CTYPE, "")) {
    fprintf(stderr, "libhilti: cannot set locale");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<__hlt_init_common>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1040 <setlocale@plt>
cmp    $0x0,%eax
jne    1171 <__hlt_init_common+0x41>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hlt_init_common>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1040 <setlocale@plt>
test   %eax,%eax
je     114c <__hlt_init_common+0x1c>
pop    %rax
ret
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [28 x i8] c"libhilti: cannot set locale\00"
define void @__hlt_init_common() {
%1 = load i32, i32* @LC_CTYPE
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.1 = [28 x i8] c"libhilti: cannot set locale\00"
define void @__hlt_init_common() {
%1 = load i32, i32* @LC_CTYPE
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}
void updatePhysics() {}


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

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

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

LLVM IR (-O2):
define void @updatePhysics() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ static_assert(int);
void main() {
  int i;
  int j;
  int x = i;
  int y = j;
  int l = 0;
  while (x != l) {
    x--;
    y--;
  }
  if (i == j)
    static_assert(y == l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <main+0x1b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *newwin(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
WINDOW *initMainWindow(int height, int width, int minusHeight) {
  return newwin(height - minusHeight, width, 0, 0);
}


x86 assembly (clang, -O0):
<initMainWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <newwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMainWindow>:
sub    %edx,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <newwin@plt>

LLVM IR (-O0):
define i32* @initMainWindow(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 = load i32, i32* %6
%9 = sub nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = call i32* @newwin(i32 %9, i32 %10, i32 0, i32 0)
ret i32* %11
}

LLVM IR (-O2):
define i32* @initMainWindow(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %2
%5 = tail call i32* @newwin(i32 %4, i32 %1, i32 0, i32 0)
ret i32* %5
}
/* Variables and functions */
char *align_up(char *ptr, int align) {
  return (char *)(((uintptr_t)ptr + align - 1) & ~(uintptr_t)(align - 1));
}


x86 assembly (clang, -O0):
<align_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
sub    $0x1,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_up>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
neg    %eax
cltq
and    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @align_up(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 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add i64 %6, %8
%10 = sub i64 %9, 1
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = xor i64 %13, -1
%15 = and i64 %10, %14
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @align_up(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = add i64 %3, -1
%6 = add i64 %5, %4
%7 = sub i32 0, %1
%8 = sext i32 %7 to i64
%9 = and i64 %6, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
double M_LN10;
double exp(double);
double dex(double x) { return exp(M_LN10 * x); }


x86 assembly (clang, -O0):
<dex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dex>:
mov    0x2ec9(%rip),%rax
mulsd  (%rax),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
@M_LN10 = global double 0.000000e+00
define double @dex(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_LN10
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
@M_LN10 = global double 0.000000e+00
define double @dex(double %0) {
%2 = load double, double* @M_LN10
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getMaxTorque(unsigned char id) {
  return dxl_read_word(id, (14));
}


x86 assembly (clang, -O0):
<getMaxTorque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxTorque>:
mov    $0xe,%esi
jmp    1030 <dxl_read_word@plt>

LLVM IR (-O0):
define zeroext i16 @getMaxTorque(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 14)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getMaxTorque(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 14)
ret i16 %2
}
extern __attribute__((always_)) int
__compare_and_swap(long int *__p, long int __oldval, long int __newval) {
  char ret;
  long int readval;
  __asm__ __volatile__("lock; cmpxchgq %3, %1; sete %0"
                       : "=q"(ret), "=m"(*__p), "=a"(readval)
                       : "r"(__newval), "m"(*__p), "a"(__oldval)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<__compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %cl,-0x19(%rbp)
mov    %rax,-0x28(%rbp)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
sete   %cl
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64*, i64** %4
%10 = load i64, i64* %6
%11 = load i64*, i64** %4
%12 = load i64, i64* %5
%13 = call { i8, i64 } asm sideeffect "lock; cmpxchgq $3, $1; sete $0", "=q,=*m,={ax},r,*m,{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %9, i64 %10, i64* elementtype(i64) %11, i64 %12)
%14 = extractvalue { i8, i64 } %13, 0
%15 = extractvalue { i8, i64 } %13, 1
store i8 %14, i8* %7
store i64 %15, i64* %8
%16 = load i8, i8* %7
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @__compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = tail call { i8, i64 } asm sideeffect "lock; cmpxchgq $3, $1; sete $0", "=q,=*m,={ax},r,*m,{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %2, i64* elementtype(i64) %0, i64 %1)
%5 = extractvalue { i8, i64 } %4, 0
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_failed() {
  assert(0);
  return;
}


x86 assembly (clang, -O0):
<test_failed>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_failed>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_failed() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_failed() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_char_something(char c) { putc(c, stdout); }


x86 assembly (clang, -O0):
<print_char_something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char_something>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_char_something(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* @stdout
%5 = call i32 @putc(i8 signext %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_char_something(i8 signext %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @putc(i8 signext %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ decompress_rtf(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char *argv[]) {
  FILE *file = fopen(argv[1], "rb");
  decompress_rtf(file);
  fclose(file);
}


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
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <decompress_rtf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <decompress_rtf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\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 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = call i32 @decompress_rtf(i32* %10)
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @decompress_rtf(i32* %5)
%7 = tail call i32 @fclose(i32* %5)
ret i32 0
}
int gcdr(int a, int b) {
  if (a == 0)
    return b;
  return gcdr(b % a, a);
}


x86 assembly (clang, -O0):
<gcdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcdr+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcdr+0x37>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <gcdr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcdr>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcdr+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcdr+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcdr(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
int getValue(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<getValue>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @getValue(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
float axt_decode_angle(int angle) { return angle / 10000.0; }


x86 assembly (clang, -O0):
<axt_decode_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<axt_decode_angle>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @axt_decode_angle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+04
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @axt_decode_angle(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+04
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ seq_ctrl_set_record_mode(int /*<<< orphan*/);
int /*<<< orphan*/ seq_engine_reset_track(int);
void seq_ctrl_reset_track(int track) {
  seq_ctrl_set_record_mode(0);
  seq_engine_reset_track(track);
}


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

x86 assembly (clang, -O2):
<seq_ctrl_reset_track>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <seq_ctrl_set_record_mode@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <seq_engine_reset_track@plt>

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

LLVM IR (-O2):
define void @seq_ctrl_reset_track(i32 %0) {
%2 = tail call i32 @seq_ctrl_set_record_mode(i32 0)
%3 = tail call i32 @seq_engine_reset_track(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void safe_free(char **adr) {
  free(*adr);
  *adr = NULL;
}


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

x86 assembly (clang, -O2):
<safe_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @safe_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t u32_b1(uint32_t value) { return (uint8_t)((value & 0x0000FF00) >> 8); }


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

x86 assembly (clang, -O2):
<u32_b1>:
mov    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @u32_b1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @u32_b1(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ map2check_assume(int);
void map2check_assume_loop(char expr) { map2check_assume((int)expr); }


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

x86 assembly (clang, -O2):
<map2check_assume_loop>:
jmp    1030 <map2check_assume@plt>

LLVM IR (-O0):
define void @map2check_assume_loop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 @map2check_assume(i32 %4)
ret void
}

LLVM IR (-O2):
define void @map2check_assume_loop(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @map2check_assume(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("\033[0;33mHello, World!\n\033[0m"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"\1B[0;33mHello, World!\0A\1B[0m\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\1B[0;33mHello, World!\0A\1B[0m\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double lam_LC(int i, int j, int k) {
  const double f1 = 1.57542E9, f2 = 1.22760E9, f5 = 1.17645E9;
  return 299792458.0 / (i * f1 + j * f2 + k * f5);
}


x86 assembly (clang, -O0):
<lam_LC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  0xefb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xef6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xed2(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xebe(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xea1(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lam_LC>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
mulsd  0xef0(%rip),%xmm1
mulsd  0xef0(%rip),%xmm0
cvtsi2sd %edx,%xmm2
mulsd  0xeec(%rip),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
movsd  0xee4(%rip),%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @lam_LC(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 1.575420e+09, double* %7
store double 1.227600e+09, double* %8
store double 1.176450e+09, double* %9
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 1.227600e+09
%15 = call double @llvm.fmuladd.f64(double %11, double 1.575420e+09, double %14)
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %17, double 1.176450e+09, double %15)
%19 = fdiv double 0x41B1DE784A000000, %18
ret double %19
}

LLVM IR (-O2):
define double @lam_LC(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fmul double %5, 1.227600e+09
%7 = tail call double @llvm.fmuladd.f64(double %4, double 1.575420e+09, double %6)
%8 = sitofp i32 %2 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.176450e+09, double %7)
%10 = fdiv double 0x41B1DE784A000000, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_LITTLE_GUY_RESET_OUTPUT() { set_io_bit(0x72, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_LITTLE_GUY_RESET_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_LITTLE_GUY_RESET_OUTPUT>:
mov    $0x72,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_LITTLE_GUY_RESET_OUTPUT() {
%1 = call i32 @set_io_bit(i32 114, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_LITTLE_GUY_RESET_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 114, i32 6)
ret void
}
unsigned xrop3_253_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_253_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_253_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %esi,%edi
lea    -0x100(%rdi),%edx
not    %ecx
or     %eax,%ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_253_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %8, -256
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %11, %9
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %12, %14
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_getpid;
int /*<<< orphan*/ syscall_0(int /*<<< orphan*/);
pid_t getpid(void) { return (pid_t)syscall_0(SYS_getpid); }


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_0@plt>

LLVM IR (-O0):
@SYS_getpid = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @SYS_getpid
%2 = call i32 @syscall_0(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_getpid = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @SYS_getpid
%2 = tail call i32 @syscall_0(i32 %1)
ret i32 %2
}
/* Variables and functions */
int create_privileged_child();
scalar_t__ create_socketpair();
scalar_t__ geteuid();
scalar_t__ getuid();
int privsep_init(void) {
  if (geteuid() == getuid())
    return 0;
  if (create_socketpair() < 0)
    return -1;
  return (create_privileged_child());
}


x86 assembly (clang, -O0):
<privsep_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    1176 <privsep_init+0x36>
movl   $0x0,-0x4(%rbp)
jmp    119d <privsep_init+0x5d>
mov    $0x0,%al
call   1030 <create_socketpair@plt>
cmp    $0x0,%rax
jge    1193 <privsep_init+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <privsep_init+0x5d>
mov    $0x0,%al
call   1060 <create_privileged_child@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<privsep_init>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getuid@plt>
cmp    %rax,%rbx
je     1179 <privsep_init+0x39>
xor    %eax,%eax
call   1030 <create_socketpair@plt>
test   %rax,%rax
js     1174 <privsep_init+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <create_privileged_child@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @privsep_init() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = call i64 (...) @getuid()
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %12
6: ; preds = %0
%7 = call i64 (...) @create_socketpair()
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 -1, i32* %1
br label %12
10: ; preds = %6
%11 = call i32 (...) @create_privileged_child()
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %9, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @privsep_init() {
%1 = tail call i64 (...) @geteuid()
%2 = tail call i64 (...) @getuid()
%3 = icmp eq i64 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i64 (...) @create_socketpair()
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (...) @create_privileged_child()
br label %9
9: ; preds = %4, %0, %7
%10 = phi i32 [ %8, %7 ], [ 0, %0 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ reverse(void *, int, int, void (*)(void *, int, int));
void shift(void *list, int count, int i,
           void (*swapFunc)(void *list, int i, int j)) {
  reverse(list, 0, i - 1, swapFunc);
  reverse(list, i, count - 1, swapFunc);
  reverse(list, 0, count - 1, swapFunc);
}


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    -0x1(%r14),%edx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %r15,%rcx
call   1030 <reverse@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @shift(i8* %0, i32 %1, i32 %2, void (i8*, i32, i32)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca void (i8*, i32, i32)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store void (i8*, i32, i32)* %3, void (i8*, i32, i32)** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %10, 1
%12 = load void (i8*, i32, i32)*, void (i8*, i32, i32)** %8
%13 = call i32 @reverse(i8* %9, i32 0, i32 %11, void (i8*, i32, i32)* %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = load void (i8*, i32, i32)*, void (i8*, i32, i32)** %8
%19 = call i32 @reverse(i8* %14, i32 %15, i32 %17, void (i8*, i32, i32)* %18)
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = load void (i8*, i32, i32)*, void (i8*, i32, i32)** %8
%24 = call i32 @reverse(i8* %20, i32 0, i32 %22, void (i8*, i32, i32)* %23)
ret void
}

LLVM IR (-O2):
define void @shift(i8* %0, i32 %1, i32 %2, void (i8*, i32, i32)* %3) {
%5 = add nsw i32 %2, -1
%6 = tail call i32 @reverse(i8* %0, i32 0, i32 %5, void (i8*, i32, i32)* %3)
%7 = add nsw i32 %1, -1
%8 = tail call i32 @reverse(i8* %0, i32 %2, i32 %7, void (i8*, i32, i32)* %3)
%9 = tail call i32 @reverse(i8* %0, i32 0, i32 %7, void (i8*, i32, i32)* %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool _is_addr_page_aligned(uint32_t addr) { return !(addr & 0x3ff); }


x86 assembly (clang, -O0):
<_is_addr_page_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_addr_page_aligned>:
xor    %eax,%eax
test   $0x3ff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @_is_addr_page_aligned(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1023
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @_is_addr_page_aligned(i32 %0) {
%2 = and i32 %0, 1023
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, a;
  scanf("%d", &n);
  a = n * n;
  n = n * n * n;
  printf("%d\n%d\n", a, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
mov    %edx,0x4(%rsp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
store i32 %6, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void *thread2(void *arg) {
  long i = (long)arg;
  printf("u: running, i %ld!\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"u: running, i %ld!\0A\00"
define i8* @thread2(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [20 x i8] c"u: running, i %ld!\0A\00"
define noalias i8* @thread2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* null
}
void update_child_state(int **child_state, int x, int y) {
  child_state[y][x] |= (1 << 12);
}


x86 assembly (clang, -O0):
<update_child_state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1000,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_child_state>:
movslq %edx,%rax
mov    (%rdi,%rax,8),%rax
movslq %esi,%rcx
orl    $0x1000,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @update_child_state(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 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32*, i32** %7, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = or i32 %15, 4096
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
define void @update_child_state(i32** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, 4096
store i32 %10, i32* %8
ret void
}
int lan2_get_fd(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @lan2_get_fd() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removeSpace(char *);
int main() {
  char s[81];
  gets(s);
  removeSpace(s);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1050 <removeSpace@plt>
lea    -0x60(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <removeSpace@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%6 = call i32 @removeSpace(i8* %5)
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @removeSpace(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void _io_cellize_cursor(void) {}


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

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

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

LLVM IR (-O2):
define void @_io_cellize_cursor() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ udp_addr;
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int sendto(int, char **, int, int /*<<< orphan*/, struct sockaddr *, int);
int sendUDP(int sockfd, char *buffer, int len, struct sockaddr_in *udp_addr) {
  return sendto(sockfd, &buffer, len, 0, (struct sockaddr *)&udp_addr,
                sizeof(udp_addr));
}


x86 assembly (clang, -O0):
<sendUDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%r8
lea    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x8,%r9d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendUDP>:
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%r8
xor    %ecx,%ecx
mov    $0x8,%r9d
call   1030 <sendto@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @sendUDP(i32 %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.sockaddr_in*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.sockaddr_in* %3, %struct.sockaddr_in** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = bitcast %struct.sockaddr_in** %8 to %struct.sockaddr*
%12 = call i32 @sendto(i32 %9, i8** %6, i32 %10, i32 0, %struct.sockaddr* %11, i32 8)
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @sendUDP(i32 %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = alloca i8*
%6 = alloca %struct.sockaddr_in*
store i8* %1, i8** %5
store %struct.sockaddr_in* %3, %struct.sockaddr_in** %6
%7 = bitcast %struct.sockaddr_in** %6 to %struct.sockaddr*
%8 = call i32 @sendto(i32 %0, i8** %5, i32 %2, i32 0, %struct.sockaddr* %7, i32 8)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void error_lexico(int numlinea, char *mensaje) {
  printf("Linea: %d. Error Lexico: %s\n", numlinea, mensaje);
}


x86 assembly (clang, -O0):
<error_lexico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_lexico>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Linea: %d. Error Lexico: %s\0A\00"
define void @error_lexico(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Linea: %d. Error Lexico: %s\0A\00"
define void @error_lexico(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test4u(unsigned int x) {
  unsigned int y = (unsigned int)INT_MIN;
  return x ^ y;
}


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

x86 assembly (clang, -O2):
<test4u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test4u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test4u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *);
void OpenRow(const char *cFieldLabel, const char *cColor) {
  printf("<tr><td width=20%% valign=top><a "
         "href=iDNS.cgi?gcFunction=tGlossary&cSearch=%s class=darkLink><font "
         "color=%.32s>%.32s</a></td><td>",
         cFieldLabel, cColor, cFieldLabel);
}


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

x86 assembly (clang, -O2):
<OpenRow>:
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
mov    %rcx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [131 x i8] c"<tr><td width=20%% valign=top><a href=iDNS.cgi?gcFunction=tGlossary&cSearch=%s class=darkLink><font color=%.32s>%.32s</a></td><td>\00"
define void @OpenRow(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 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"<tr><td width=20%% valign=top><a href=iDNS.cgi?gcFunction=tGlossary&cSearch=%s class=darkLink><font color=%.32s>%.32s</a></td><td>\00"
define void @OpenRow(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %0)
ret void
}