xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_InsRead(int, int *, int);
void NRF24_Get_RX_Addr(uint8_t *rx_addr, uint8_t pipe) {
  if (pipe > 5)
    return;
  NRF24_InsRead(0x00 | (0x0A + pipe), rx_addr, 5);
}


x86 assembly (clang, -O0):
<NRF24_Get_RX_Addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    112e <NRF24_Get_RX_Addr+0x1e>
jmp    1145 <NRF24_Get_RX_Addr+0x35>
mov    -0xc(%rbp),%edi
add    $0xa,%edi
or     $0x0,%edi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1030 <NRF24_InsRead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_Get_RX_Addr>:
cmp    $0x5,%esi
jle    1116 <NRF24_Get_RX_Addr+0x6>
ret
mov    %rdi,%rax
add    $0xa,%esi
mov    %esi,%edi
mov    %rax,%rsi
mov    $0x5,%edx
jmp    1030 <NRF24_InsRead@plt>

LLVM IR (-O0):
define void @NRF24_Get_RX_Addr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add nsw i32 10, %9
%11 = or i32 0, %10
%12 = load i32*, i32** %3
%13 = call i32 @NRF24_InsRead(i32 %11, i32* %12, i32 5)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @NRF24_Get_RX_Addr(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 5
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nsw i32 %1, 10
%6 = tail call i32 @NRF24_InsRead(i32 %5, i32* %0, i32 5)
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
char *jsonCmd(char *, int);
char *jsonCmdNfcmode(int nfcMode) { return (jsonCmd("nfcmode", nfcMode)); }


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

x86 assembly (clang, -O2):
<jsonCmdNfcmode>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <jsonCmd@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"nfcmode\00"
define i8* @jsonCmdNfcmode(i32 %0) {
%2 = tail call i8* @jsonCmd(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ put_st(char *);
scalar_t__ strcmp(char *, char *);
void noprompt_puts(char *st) {
  if (strcmp(st, "> ") != 0)
    put_st(st);
}


x86 assembly (clang, -O0):
<noprompt_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     114f <noprompt_puts+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <put_st@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noprompt_puts>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113e <noprompt_puts+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put_st@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @noprompt_puts(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @put_st(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
void f(void) {
  unsigned P = 0;
  unsigned x = P;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int charlong(char *tab) {
  int cpt = 0;
  while (tab[cpt] != '\0')
    cpt++;
  return cpt;
}


x86 assembly (clang, -O0):
<charlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <charlong+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <charlong+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charlong>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <charlong+0x10>
ret

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

LLVM IR (-O2):
define i32 @charlong(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World!\\n\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello World!\\n\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int const, int /*<<< orphan*/ *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int readInt(FILE *fr, char *line, const int maxLineLength, int *target) {
  if (!fgets(line, maxLineLength, fr)) {
    return 0;
  }
  sscanf(line, "%d", target);
  return 1;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%eax
jne    115c <readInt+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1177 <readInt+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1040 <sscanf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <fgets@plt>
test   %eax,%eax
je     1157 <readInt+0x37>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sscanf@plt>
mov    $0x1,%eax
jmp    1159 <readInt+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @readInt(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i32*, i32** %6
%13 = call i32 @fgets(i8* %10, i32 %11, i32* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %4
store i32 0, i32* %5
br label %20
16: ; preds = %4
%17 = load i8*, i8** %7
%18 = load i32*, i32** %9
%19 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
store i32 1, i32* %5
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readInt(i32* nocapture %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @fgets(i8* %1, i32 %2, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %10
}
void sphinx_status_destroy(char **status, int num_rows, int num_cols) {
  int i;
  for (i = 0; i < num_rows * num_cols; i++)
    free(status[i]);
  free(status);
}


x86 assembly (clang, -O0):
<sphinx_status_destroy>:
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
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    115a <sphinx_status_destroy+0x4a>
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 <sphinx_status_destroy+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sphinx_status_destroy(i8** nocapture %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %3
%15 = bitcast i8** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_vgui(char *, void *, void *, char);
void delete_object(void *cv, void *o, char c) {
  sys_vgui(".x%x.c delete %x%c\n", cv, o, c);
}


x86 assembly (clang, -O0):
<delete_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rdi
movsbl -0x11(%rbp),%ecx
call   1030 <sys_vgui@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_object>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <sys_vgui@plt>

LLVM IR (-O0):
@.str = [20 x i8] c".x%x.c delete %x%c\0A\00"
define void @delete_object(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i32 @sys_vgui(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c".x%x.c delete %x%c\0A\00"
define void @delete_object(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @sys_vgui(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8 signext %2)
ret void
}
int fibnacci(int n) {
  if (0 == n)
    return 1;
  if (1 == n)
    return 1;
  return fibnacci(n - 1) + fibnacci(n - 2);
}


x86 assembly (clang, -O0):
<fibnacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1132 <fibnacci+0x22>
movl   $0x1,-0x4(%rbp)
jmp    116f <fibnacci+0x5f>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    114c <fibnacci+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    116f <fibnacci+0x5f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibnacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibnacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibnacci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fibnacci+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fibnacci@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fibnacci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibnacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibnacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
double fabs(double const);
double bisquare(const double x) {
  if (fabs(x) <= 1.0) {
    double f = 1.0 - x * x;
    return (f * f);
  } else
    return 0.0;
}


x86 assembly (clang, -O0):
<bisquare>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps 0xefb(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1175 <bisquare+0x75>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117d <bisquare+0x7d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bisquare>:
movapd 0xef8(%rip),%xmm1
andpd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
movsd  0xef8(%rip),%xmm2
cmpnlesd %xmm2,%xmm1
subsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm2
andnpd %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bisquare(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call double @llvm.fabs.f64(double %5)
%7 = fcmp ole double %6, 1.000000e+00
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
store double %12, double* %4
%13 = load double, double* %4
%14 = load double, double* %4
%15 = fmul double %13, %14
store double %15, double* %2
br label %17
16: ; preds = %1
store double 0.000000e+00, double* %2
br label %17
17: ; preds = %16, %8
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @bisquare(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ugt double %2, 1.000000e+00
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double 1.000000e+00)
%6 = fmul double %5, %5
%7 = select i1 %3, double 0.000000e+00, double %6
ret double %7
}
/* Variables and functions */
float sqrt(float);
float f_sqrt(float x) { return x >= 0.0f ? sqrt(x) : 0.0f; }


x86 assembly (clang, -O0):
<f_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1142 <f_sqrt+0x32>
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
jmp    114f <f_sqrt+0x3f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114f <f_sqrt+0x3f>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1127 <f_sqrt+0x17>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112b <f_sqrt+0x1b>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @f_sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = call float @sqrt(float %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi float [ %7, %5 ], [ 0.000000e+00, %8 ]
ret float %10
}

LLVM IR (-O2):
define float @f_sqrt(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call float @sqrt(float %0)
br label %5
5: ; preds = %1, %3
%6 = phi float [ %4, %3 ], [ 0.000000e+00, %1 ]
ret float %6
}
int cmp(unsigned char *str1, unsigned char *str2, int l) {
  int i = 0;
  for (i = 0; i < l; i++) {
    if (str1[i] != str2[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1168 <cmp+0x68>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1155 <cmp+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116f <cmp+0x6f>
jmp    115a <cmp+0x5a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111d <cmp+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <cmp+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <cmp+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <cmp+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %29, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %32
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8*, i8** %6
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = icmp ne i32 %19, %25
br i1 %26, label %27, label %28
27: ; preds = %13
store i32 0, i32* %4
br label %33
28: ; preds = %13
br label %29
29: ; preds = %28
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %9
32: ; preds = %9
store i32 1, i32* %4
br label %33
33: ; preds = %32, %27
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int func(int);
int __attribute__((no)) call2(int a) { return func(a); }


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

x86 assembly (clang, -O2):
<call2>:
jmp    1030 <func@plt>

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

LLVM IR (-O2):
define i32 @call2(i32 %0) {
%2 = tail call i32 @func(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Call_Inverse(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int n;
  printf("Give the dimension of the matrix: ");
  scanf("%d", &n);
  printf("%d\n", n);
  srand(time(NULL));
  Call_Inverse(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    -0x8(%rbp),%edi
call   1040 <Call_Inverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x4(%rsp),%edi
call   1040 <Call_Inverse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Give the dimension of the matrix: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 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* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @Call_Inverse(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Give the dimension of the matrix: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%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 ([35 x i8], [35 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @Call_Inverse(i32 %9)
ret i32 0
}
/* Variables and functions */
int fread(void *, int, int, void *);
int _readfile(void *handle, void *dst, int size) {
  return fread(dst, 1, size, handle);
}


x86 assembly (clang, -O0):
<_readfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_readfile>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i32 @_readfile(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i8* %0)
ret i32 %4
}
int fb_SGNDouble(double x) {
  if (x == 0.0)
    return 0;
  else if (x > 0.0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<fb_SGNDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112d <fb_SGNDouble+0x2d>
jp     112d <fb_SGNDouble+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <fb_SGNDouble+0x52>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <fb_SGNDouble+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <fb_SGNDouble+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_SGNDouble>:
xor    %eax,%eax
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fb_SGNDouble(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @fb_SGNDouble(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int _setenv(char *, char *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_setenv(char *name, char *val) {
  int ret;
  monLock();
  ret = _setenv(name, val);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_setenv@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_setenv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <_setenv@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @mon_setenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @_setenv(i8* %7, i8* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_setenv(i8* %0, i8* %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_setenv(i8* %0, i8* %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_endian16(uint16_t x) { return (x << 8) | ((x >> 8) & 0xff); }


x86 assembly (clang, -O0):
<swap_endian16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_endian16>:
mov    %edi,%ecx
movzbl %ch,%eax
shl    $0x8,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @swap_endian16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @swap_endian16(i32 %0) {
%2 = shl i32 %0, 8
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int remove(char const *);
int SADRemove(const char *filename) { return remove(filename); }


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

x86 assembly (clang, -O2):
<SADRemove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @SADRemove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("Usage: %s <upstream socket> <downstream socket>\n", program_name);
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: %s <upstream socket> <downstream socket>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Usage: %s <upstream socket> <downstream socket>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_CBuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xCB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CBuint64_midword_reg>:
test   $0xcb0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CBuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13303808
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double cos(double);
double qCos(double a) { return cos(a); }


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

x86 assembly (clang, -O2):
<qCos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @qCos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_reply_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_ewmh_get_window_from_reply(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
uint8_t
xcb_ewmh_get_supporting_wm_check_from_reply(xcb_window_t *window,
                                            xcb_get_property_reply_t *r) {
  return xcb_ewmh_get_window_from_reply(window, r);
}


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

x86 assembly (clang, -O2):
<xcb_ewmh_get_supporting_wm_check_from_reply>:
jmp    1030 <xcb_ewmh_get_window_from_reply@plt>

LLVM IR (-O0):
define i32 @xcb_ewmh_get_supporting_wm_check_from_reply(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 @xcb_ewmh_get_window_from_reply(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xcb_ewmh_get_supporting_wm_check_from_reply(i32* %0, i32* %1) {
%3 = tail call i32 @xcb_ewmh_get_window_from_reply(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int thisisanundefinedfunctionsname();
int main(void) { return thisisanundefinedfunctionsname(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @thisisanundefinedfunctionsname()
ret i32 %1
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main() {
  char ch;
  printf("Type ~ to stop: ");
  while (1) {
    ch = getchar();
    if (ch == '~')
      break;
    putchar(ch);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jne    1167 <main+0x37>
jmp    1175 <main+0x45>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    114b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x7e,%al
je     1155 <main+0x25>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Type ~ to stop: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %10
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %4
br label %13
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call i32 @putchar(i8 signext %11)
br label %4
13: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Type ~ to stop: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 126
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %2, %0 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = icmp eq i8 %7, 126
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ curr_time_str(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int tsmsg(char *msg) {
  char *time_txt;
  time_txt = (char *)malloc(40 * sizeof(char));
  curr_time_str(time_txt);
  fprintf(stderr, "[%s] %s", time_txt, msg);
  return 0;
}


x86 assembly (clang, -O0):
<tsmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <curr_time_str@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsmsg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <curr_time_str@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"[%s] %s\00"
define i32 @tsmsg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 40)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @curr_time_str(i8* %6)
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"[%s] %s\00"
define i32 @tsmsg(i8* %0) {
%2 = tail call i64 @malloc(i32 40)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @curr_time_str(i8* %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f0(int *);
void f1() {
  int a[5];
  a[0] = 1;
  a[4] = 5;
  f0(a);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x20(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <f0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movl   $0x1,(%rsp)
movl   $0x5,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <f0@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f1() {
%1 = alloca [5 x i32]
%2 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32 1, i32* %2
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 5, i32* %3
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @f0(i32* %4)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 5, i32* %4
%5 = call i32 @f0(i32* %3)
ret void
}
/* Variables and functions */
int rand();
unsigned char random_inport(void) {
  unsigned char inport = 0;
  inport = rand() % 256;
  return (inport);
}


x86 assembly (clang, -O0):
<random_inport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @random_inport() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 256
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @random_inport() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ aaha_aux(double, double, double, double *, double *);
void hadec_aa(double lt, double ha, double dec, double *alt, double *az) {
  aaha_aux(lt, ha, dec, az, alt);
}


x86 assembly (clang, -O0):
<hadec_aa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <aaha_aux@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hadec_aa>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <aaha_aux@plt>

LLVM IR (-O0):
define void @hadec_aa(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load double*, double** %10
%15 = load double*, double** %9
%16 = call i32 @aaha_aux(double %11, double %12, double %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @hadec_aa(double %0, double %1, double %2, double* %3, double* %4) {
%6 = tail call i32 @aaha_aux(double %0, double %1, double %2, double* %4, double* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rls_log_cleanup();
void rls_module_cleanup(void) { rls_log_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @rls_module_cleanup() {
%1 = tail call i32 (...) @rls_log_cleanup()
ret void
}
int __mp_remcontents(char *s, void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_remcontents(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
long int get_stat_mtime_ns(struct stat const *st) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i64 @get_stat_mtime_ns(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
ret i64 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i64 @get_stat_mtime_ns(%struct.stat* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_16() {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 0;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc20,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_16>:
push   %rax
mov    $0xc20,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x1,%eax
mov    $0xc20,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_16() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3104, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_16() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3104)
%2 = xor i32 %1, 1
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3104, i32 %2, i32 1)
ret void
}
int getByte(int x, int n) { return x >> (n << 3) & 0xff; }


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

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(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 = shl i32 %6, 3
%8 = ashr i32 %5, %7
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}