xunge/DecIR huggingface dataset:
void intarr2free(int **aa, const int n1, const int n2) {
  int i;
  for (i = 0; i < n1; i++) {
    free(aa[i]);
  }
  free(aa);
}


x86 assembly (clang, -O0):
<intarr2free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <intarr2free+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <intarr2free+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intarr2free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <intarr2free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <intarr2free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @intarr2free(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t si470x_setfreq() {}


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

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

LLVM IR (-O0):
define i32 @si470x_setfreq() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @si470x_setfreq() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int modexp(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ rand_int(int, int);
int is_prime(int N) {
  assert(N >= 4);
  return modexp(rand_int(2, N - 2), N - 1, N) == 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%esi
sub    $0x2,%esi
mov    $0x2,%edi
call   1040 <rand_int@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    -0x4(%rbp),%edx
call   1050 <modexp@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x4,%ebx
setge  %dil
call   1030 <assert@plt>
lea    -0x2(%rbx),%esi
mov    $0x2,%edi
call   1040 <rand_int@plt>
lea    -0x1(%rbx),%esi
mov    %eax,%edi
mov    %ebx,%edx
call   1050 <modexp@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 4
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
%9 = call i32 @rand_int(i32 2, i32 %8)
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %2
%13 = call i32 @modexp(i32 %9, i32 %11, i32 %12)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, -2
%6 = tail call i32 @rand_int(i32 2, i32 %5)
%7 = add nsw i32 %0, -1
%8 = tail call i32 @modexp(i32 %6, i32 %7, i32 %0)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number, result;
  printf("Please enter the number you want the factorial of: ");
  scanf("%d", &number);
  result = factorial(number);
  printf("The factorial of %d is %d.\n", number, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"Please enter the number you want the factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"The factorial of %d is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @factorial(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"Please enter the number you want the factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"The factorial of %d is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int a = 10, b = 20, c, d, e, f;
  c = a & b;
  d = a | b;
  e = ~a;
  f = a >> 1;
  printf("%d %d %d %d\n", c, d, e, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
mov    $0xfffffff5,%ecx
mov    $0x5,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 30, i32 -11, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tds_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<tds_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tds_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ returnChange();
int /*<<< orphan*/ setCurrentStateTo(int);
void _cancelOperaionHandler() {
  printf("\n Operation canceled!");
  returnChange();
  setCurrentStateTo(9);
}


x86 assembly (clang, -O0):
<_cancelOperaionHandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <returnChange@plt>
mov    $0x9,%edi
call   1030 <setCurrentStateTo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cancelOperaionHandler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <returnChange@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <setCurrentStateTo@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A Operation canceled!\00"
define void @_cancelOperaionHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @returnChange()
%3 = call i32 @setCurrentStateTo(i32 9)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A Operation canceled!\00"
define void @_cancelOperaionHandler() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @returnChange()
%3 = tail call i32 @setCurrentStateTo(i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor4iv(int *);
void Color4iv(int v[4]) { glColor4iv(v); }


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

x86 assembly (clang, -O2):
<Color4iv>:
jmp    1030 <glColor4iv@plt>

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

LLVM IR (-O2):
define void @Color4iv(i32* %0) {
%2 = tail call i32 @glColor4iv(i32* %0)
ret void
}
void glMultiTexCoord4x(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glMultiTexCoord4x() {
ret void
}
void gp_readline_finit(void *readline_data) {}


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

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

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

LLVM IR (-O2):
define void @gp_readline_finit(i8* nocapture %0) {
ret void
}
f(int i, int j, int *x) {
  x[i, j] = 5;
  x[(void)i, j] = 5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %esi,%rax
movl   $0x5,(%rdx,%rax,4)
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
store i32 5, i32* %5
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void merror(char *error) {
  perror(error);
  exit(1);
}


x86 assembly (clang, -O0):
<merror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<merror>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @merror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @merror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ w;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(void const *, int, int, int /*<<< orphan*/ *);
int putw(int w, FILE *stream) {
  if (fwrite((const void *)&w, sizeof(w), 1, stream) < 1)
    return EOF;
  return 0;
}


x86 assembly (clang, -O0):
<putw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
jge    1150 <putw+0x40>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <putw+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putw>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jg     113d <putw+0x2d>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @putw(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = bitcast i32* %4 to i8*
%7 = load i32*, i32** %5
%8 = call i32 @fwrite(i8* %6, i32 4, i32 1, i32* %7)
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EOF
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @putw(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fwrite(i8* %4, i32 4, i32 1, i32* %1)
%6 = load i32, i32* @EOF
%7 = icmp sgt i32 %5, 0
%8 = select i1 %7, i32 0, i32 %6
ret i32 %8
}
int t() {}


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

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

LLVM IR (-O0):
define i32 @t() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @t() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
void set_XMapEvent_window(void *_p, unsigned long _v) {
  ((XMapEvent *)_p)->window = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XMapEvent_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XMapEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XMapEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int send_msg(int, char *);
int OK(int fd) { return send_msg(fd, "HTTP/1.1 200 OK\r\n\r\n"); }


x86 assembly (clang, -O0):
<OK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OK>:
lea    0xee9(%rip),%rsi
jmp    1030 <send_msg@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"HTTP/1.1 200 OK\0D\0A\0D\0A\00"
define i32 @OK(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_msg(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"HTTP/1.1 200 OK\0D\0A\0D\0A\00"
define i32 @OK(i32 %0) {
%2 = tail call i32 @send_msg(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ enviarCadenaSocket(char *);
void enviarMensaje_a_Socket(char *texto) { enviarCadenaSocket(texto); }


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

x86 assembly (clang, -O2):
<enviarMensaje_a_Socket>:
jmp    1030 <enviarCadenaSocket@plt>

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

LLVM IR (-O2):
define void @enviarMensaje_a_Socket(i8* %0) {
%2 = tail call i32 @enviarCadenaSocket(i8* %0)
ret void
}
int test_imm_7Duint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x7D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Duint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8192000
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand();
double random_bool(double x) { return (double)(rand() % 2); }


x86 assembly (clang, -O0):
<random_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bool>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_bool(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 2
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @random_bool(double %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = sitofp i32 %3 to double
ret double %4
}
double doubleDivide(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<doubleDivide>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleDivide>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @doubleDivide(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @doubleDivide(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
void gtk_font_button_set_show_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_set_show_size() {
ret void
}
long next_pentagonal_num(void) {
  static long last_index = 0;
  static long last_num = 0;
  last_num += 3 * last_index + 1;
  last_index++;
  return last_num;
}


x86 assembly (clang, -O0):
<next_pentagonal_num>:
push   %rbp
mov    %rsp,%rbp
imul   $0x3,0x2f1c(%rip),%rax
03
add    $0x1,%rax
add    0x2f19(%rip),%rax
mov    %rax,0x2f12(%rip)
mov    0x2f03(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2ef8(%rip)
mov    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pentagonal_num>:
mov    0x2f21(%rip),%rcx
lea    (%rcx,%rcx,2),%rax
mov    0x2f1e(%rip),%rdx
add    %rdx,%rax
add    $0x1,%rax
mov    %rax,0x2f10(%rip)
add    $0x1,%rcx
mov    %rcx,0x2efd(%rip)
ret

LLVM IR (-O0):
@next_pentagonal_num.last_index = internal global i64 0
@next_pentagonal_num.last_num = internal global i64 0
define i64 @next_pentagonal_num() {
%1 = load i64, i64* @next_pentagonal_num.last_index
%2 = mul nsw i64 3, %1
%3 = add nsw i64 %2, 1
%4 = load i64, i64* @next_pentagonal_num.last_num
%5 = add nsw i64 %4, %3
store i64 %5, i64* @next_pentagonal_num.last_num
%6 = load i64, i64* @next_pentagonal_num.last_index
%7 = add nsw i64 %6, 1
store i64 %7, i64* @next_pentagonal_num.last_index
%8 = load i64, i64* @next_pentagonal_num.last_num
ret i64 %8
}

LLVM IR (-O2):
@next_pentagonal_num.last_index = internal unnamed_addr global i64 0
@next_pentagonal_num.last_num = internal unnamed_addr global i64 0
define i64 @next_pentagonal_num() {
%1 = load i64, i64* @next_pentagonal_num.last_index
%2 = mul nsw i64 %1, 3
%3 = add nsw i64 %2, 1
%4 = load i64, i64* @next_pentagonal_num.last_num
%5 = add nsw i64 %3, %4
store i64 %5, i64* @next_pentagonal_num.last_num
%6 = add nsw i64 %1, 1
store i64 %6, i64* @next_pentagonal_num.last_index
ret i64 %5
}
int f_blg_rr2(float a1, float a2) { return !(__builtin_islessgreater(a1, a2)); }


x86 assembly (clang, -O0):
<f_blg_rr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blg_rr2>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @f_blg_rr2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp one float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_blg_rr2(float %0, float %1) {
%3 = fcmp ueq float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void SXNET_get_id_ulong(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNET_get_id_ulong() {
ret void
}
void EC_POINT_point2bn(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_point2bn() {
ret void
}
int test_imm_62int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 420906795008
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo339(int p) {}


x86 assembly (clang, -O0):
<foo339>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo339(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rf_ircontrol_command();
void rfcontrol_command() { rf_ircontrol_command(); }


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

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

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

LLVM IR (-O2):
define void @rfcontrol_command() {
%1 = tail call i32 (...) @rf_ircontrol_command()
ret void
}
double cos(double x) {
  double r;
  if (isinf(x))
    return __domain_error();
  __asm__ __volatile__("fcos" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <isinf@plt>
cmp    $0x0,%eax
je     1157 <cos+0x37>
mov    $0x0,%al
call   1030 <__domain_error@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117d <cos+0x5d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
fcos
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1040 <isinf@plt>
test   %eax,%eax
je     1147 <cos+0x27>
xor    %eax,%eax
call   1030 <__domain_error@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
ret
movsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
fldl   0x10(%rsp)
fcos
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 (...) @__domain_error()
%10 = sitofp i32 %9 to double
store double %10, double* %2
br label %15
11: ; preds = %1
%12 = load double, double* %3
%13 = call double asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %12)
store double %13, double* %4
%14 = load double, double* %4
store double %14, double* %2
br label %15
15: ; preds = %11, %8
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @__domain_error()
%6 = sitofp i32 %5 to double
br label %9
7: ; preds = %1
%8 = tail call double asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
br label %9
9: ; preds = %7, %4
%10 = phi double [ %6, %4 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n, triangularNumber;
  triangularNumber = 0;
  for (n = 1; n <= 200; n += 1)
    triangularNumber += n;
  printf("The 200th triangular number is %i\n", triangularNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 20100)
ret i32 0
}
void *rawmemchr(const void *s, int c) {
  const unsigned char *ptr = s;
  while (1) {
    if (*ptr == c)
      return (void *)ptr;
    ptr++;
  }
}


x86 assembly (clang, -O0):
<rawmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1129 <rawmemchr+0x29>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <rawmemchr+0x13>

x86 assembly (clang, -O2):
<rawmemchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <rawmemchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @rawmemchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i8* %4
}
int fun1118() { return 1118; }


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

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

LLVM IR (-O0):
define i32 @fun1118() {
ret i32 1118
}

LLVM IR (-O2):
define i32 @fun1118() {
ret i32 1118
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void osal_exit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @osal_exit() {
%1 = tail call i32 (...) @endwin()
ret void
}
void sem_destroy() {}


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

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

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

LLVM IR (-O2):
define void @sem_destroy() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t GPIO_readDio(uint32_t dioNumber) {
  ;
  return (
      ((*((volatile unsigned long *)(0x40022000 + 0x000000C0))) >> dioNumber) &
      1);
}


x86 assembly (clang, -O0):
<GPIO_readDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400220c0,%eax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_readDio>:
mov    %rdi,-0x8(%rsp)
mov    0x400220c0,%rax
40
mov    -0x8(%rsp),%rcx
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @GPIO_readDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881280 to i64*)
%4 = load volatile i64, i64* %2
%5 = lshr i64 %3, %4
%6 = and i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @GPIO_readDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881280 to i64*)
%4 = load volatile i64, i64* %2
%5 = lshr i64 %3, %4
%6 = and i64 %5, 1
ret i64 %6
}
__attribute__((__const__)) unsigned long long
__rthal_generic_ullmul(const unsigned m0, const unsigned m1) {
  return (unsigned long long)m0 * m1;
}


x86 assembly (clang, -O0):
<__rthal_generic_ullmul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rthal_generic_ullmul>:
mov    %edi,%ecx
mov    %esi,%eax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__rthal_generic_ullmul(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 = zext i32 %5 to i64
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = mul i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @__rthal_generic_ullmul(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = mul nuw i64 %4, %3
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_swap16p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void cpu_to_be16p(uint16_t *outp, uint16_t in) { cpu_swap16p(outp, in); }


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

x86 assembly (clang, -O2):
<cpu_to_be16p>:
jmp    1030 <cpu_swap16p@plt>

LLVM IR (-O0):
define void @cpu_to_be16p(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 = call i32 @cpu_swap16p(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cpu_to_be16p(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_swap16p(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mywait(int);
int /*<<< orphan*/ printf(char *);
void *fun(void *arg) {
  printf("Thread wait ..\n");
  mywait(1);
  mywait(1);
  return NULL;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <mywait@plt>
mov    $0x1,%edi
call   1030 <mywait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <mywait@plt>
mov    $0x1,%edi
call   1040 <mywait@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Thread wait ..\0A\00"
define i8* @fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @mywait(i32 1)
%5 = call i32 @mywait(i32 1)
ret i8* null
}

LLVM IR (-O2):
@str = [15 x i8] c"Thread wait ..\00"
define noalias i8* @fun(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @mywait(i32 1)
%4 = tail call i32 @mywait(i32 1)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ALflangerState_Delete(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<ALflangerState_Delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ALflangerState_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct fuse_args {
  int dummy;
};

/* Variables and functions */
int fuse_opt_insert_arg_common(struct fuse_args *, int, char const *);
int fuse_opt_insert_arg_compat(struct fuse_args *args, int pos,
                               const char *arg) {
  return fuse_opt_insert_arg_common(args, pos, arg);
}


x86 assembly (clang, -O0):
<fuse_opt_insert_arg_compat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fuse_opt_insert_arg_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_opt_insert_arg_compat>:
jmp    1030 <fuse_opt_insert_arg_common@plt>

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

LLVM IR (-O2):
%struct.fuse_args = type { i32 }
define i32 @fuse_opt_insert_arg_compat(%struct.fuse_args* %0, i32 %1, i8* %2) {
%4 = tail call i32 @fuse_opt_insert_arg_common(%struct.fuse_args* %0, i32 %1, i8* %2)
ret i32 %4
}
unsigned int _mpyu(unsigned int src1, unsigned int src2) {
  unsigned v = (unsigned short)src1 * (unsigned short)src2;
  return v;
}


x86 assembly (clang, -O0):
<_mpyu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyu>:
movzwl %di,%ecx
movzwl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_mpyu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @_mpyu(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = mul nuw nsw i32 %4, %3
ret i32 %5
}
int entry(void) {
  register int a, b, c;
  a = 120923429;
  b = 30030;
  do {
    c = a % b;
    a = b;
    b = c;
  } while (c);
  return a;
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7352525,-0x4(%rbp)
movl   $0x754e,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1112 <entry+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry>:
mov    $0x7352525,%ecx
mov    $0x754e,%edx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%eax
mov    %edx,%ecx
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <entry+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @entry() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 30030, %0 ], [ %4, %1 ]
%3 = phi i32 [ 120923429, %0 ], [ %2, %1 ]
%4 = srem i32 %3, %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 %2
}
void cprop_test5(int *data) {
  int j = 5;
  if (data[0])
    data[1] = 5 + j;
  else
    data[2] = 10 + j;
  data[3] = 20 + j;
}


x86 assembly (clang, -O0):
<cprop_test5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     112e <cprop_test5+0x2e>
mov    -0xc(%rbp),%ecx
add    $0x5,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    113b <cprop_test5+0x3b>
mov    -0xc(%rbp),%ecx
add    $0xa,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
add    $0x14,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test5>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
lea    (%rax,%rax,4),%ecx
add    $0xa,%ecx
mov    %ecx,0x4(%rdi,%rax,4)
movl   $0x19,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_test5(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 15, i32 10
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 25, i32* %7
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ print_int(int);
int main() {
  int x = 5;
  int result = factorial(x);
  print_int(x);
  print_int(result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1030 <factorial@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1040 <print_int@plt>
mov    %ebx,%edi
call   1040 <print_int@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial(i32 5)
%2 = tail call i32 @print_int(i32 5)
%3 = tail call i32 @print_int(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dj_set_nosound(int);
void menu_deinit() { dj_set_nosound(1); }


x86 assembly (clang, -O0):
<menu_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <dj_set_nosound@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @menu_deinit() {
%1 = call i32 @dj_set_nosound(i32 1)
ret void
}

LLVM IR (-O2):
define void @menu_deinit() {
%1 = tail call i32 @dj_set_nosound(i32 1)
ret void
}
__attribute__((section(".nocrossrefs"))) void foo() {}


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

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

LLVM IR (-O0):
define void @foo() section ".nocrossrefs" {
ret void
}

LLVM IR (-O2):
define void @foo() section ".nocrossrefs" {
ret void
}
/* Variables and functions */
const char *irc_config_check_gnutls_priorities(const char *priorities) {
  (void)priorities;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @irc_config_check_gnutls_priorities(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @irc_config_check_gnutls_priorities(i8* nocapture readnone %0) {
ret i8* null
}