xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int ec_cmd_successfull(int cmd_status) {
  return WIFEXITED(cmd_status) && WEXITSTATUS(cmd_status) == 0;
}


x86 assembly (clang, -O0):
<ec_cmd_successfull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <WIFEXITED@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <ec_cmd_successfull+0x37>
mov    -0x4(%rbp),%edi
call   1030 <WEXITSTATUS@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_cmd_successfull>:
push   %rbx
mov    %edi,%ebx
call   1040 <WIFEXITED@plt>
test   %rax,%rax
je     1141 <ec_cmd_successfull+0x21>
mov    %ebx,%edi
call   1030 <WEXITSTATUS@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ec_cmd_successfull(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @WIFEXITED(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @WEXITSTATUS(i32 %7)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ec_cmd_successfull(i32 %0) {
%2 = tail call i64 @WIFEXITED(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @WEXITSTATUS(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int main() {
  int data1 = 10;
  int data2 = 20;
  int result;
  __asm__ __volatile__("cmp %1, %2\n\t"
                       "jge greater\n\t"
                       "movl %1, %0\n\t"
                       "jmp end\n"
                       "greater:\n\t"
                       "movl %2, %0\n"
                       "end:"
                       : "=r"(result)
                       : "r"(data1), "r"(data2));
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
cmp    %eax,%ecx
jge    1142 <greater>
mov    %eax,%eax
jmp    1144 <end>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%eax
mov    $0x14,%ecx
cmp    %eax,%ecx
jge    1123 <greater>
mov    %eax,%esi
jmp    1125 <end>

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "cmp $1, $2\0A\09jge greater\0A\09movl $1, $0\0A\09jmp end\0Agreater:\0A\09movl $2, $0\0Aend:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "cmp $1, $2\0A\09jge greater\0A\09movl $1, $0\0A\09jmp end\0Agreater:\0A\09movl $2, $0\0Aend:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *malloc(unsigned long);
void *realloc(void *, unsigned long);
void *Xrealloc(void *n, unsigned long m) {
  if (!n)
    return malloc(m);
  else
    return realloc(n, m);
}


x86 assembly (clang, -O0):
<Xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <Xrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    115e <Xrealloc+0x3e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xrealloc>:
test   %rdi,%rdi
je     112a <Xrealloc+0xa>
jmp    1040 <realloc@plt>
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @Xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
ret i8* %9
}
/* Variables and functions */
double strtod(char const *, char **);
int isFloat(float *value, const char *string) {
  if (*string) {
    char *end;
    double d = strtod(string, &end);
    if (!*end) {
      *value = d;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <isFloat+0x5e>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1169 <isFloat+0x59>
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <isFloat+0x65>
jmp    116e <isFloat+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFloat>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmpb   $0x0,(%rsi)
je     1143 <isFloat+0x33>
mov    %rdi,%r14
mov    %rsp,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    1143 <isFloat+0x33>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @isFloat(float* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = bitcast i8** %3 to i8*
%8 = call double @strtod(i8* %1, i8** %3)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %6
br label %15
13: ; preds = %6
%14 = fptrunc double %8 to float
store float %14, float* %0
br label %15
15: ; preds = %2, %12, %13
%16 = phi i32 [ 1, %13 ], [ 0, %12 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ close(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int close_socket(int sock) {
  if (close(sock) < 0) {
    fprintf(stderr, "Can't close socket\n");
    return -errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1165 <close_socket+0x45>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
mov    0x2e7d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <close_socket+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rax
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1132 <close_socket+0x12>
pop    %rcx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e8a(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Can't close socket\0A\00"
@errno = global i32 0
define i32 @close_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @errno
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Can't close socket\0A\00"
@errno = global i32 0
define i32 @close_socket(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int u_int16_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
void __put_unaligned_le16(u_int16_t val, u_char *p) {
  *p++ = val;
  *p++ = val >> 8;
}


x86 assembly (clang, -O0):
<__put_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_le16>:
mov    %edi,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

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

LLVM IR (-O2):
define void @__put_unaligned_le16(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %0, i32* %1
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
ret void
}
int test_imm_73uint16_reg(unsigned short val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_73uint16_reg>:
test   $0x73,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_73uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 115
%6 = icmp ne i32 %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_73uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 115
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ parse_string(char const *, char const **);
ssize_t parse_sqstring(const char *buffer,
                       __attribute__((unused)) const char **error) {
  if (*buffer != '\'')
    return 0;
  return parse_string(buffer, error);
}


x86 assembly (clang, -O0):
<parse_sqstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     113c <parse_sqstring+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114c <parse_sqstring+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <parse_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_sqstring>:
cmpb   $0x27,(%rdi)
jne    111a <parse_sqstring+0xa>
jmp    1030 <parse_string@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parse_sqstring(i8* %0, i8** %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 39
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @parse_string(i8* %0, i8** %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ logDebug(char);
int max(int, int);
int doComputation(int a, float b) {
  int c = max(3, 4);
  logDebug('d');
  return c;
}


x86 assembly (clang, -O0):
<doComputation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <max@plt>
mov    %eax,-0xc(%rbp)
mov    $0x64,%edi
call   1040 <logDebug@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doComputation>:
push   %rbx
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <max@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1040 <logDebug@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @doComputation(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%6 = call i32 @max(i32 3, i32 4)
store i32 %6, i32* %5
%7 = call i32 @logDebug(i8 signext 100)
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
define i32 @doComputation(i32 %0, float %1) {
%3 = tail call i32 @max(i32 3, i32 4)
%4 = tail call i32 @logDebug(i8 signext 100)
ret i32 %3
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double sinl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
long oldk(long n, long h, long l, long m) { return h * m / n - 1; }


x86 assembly (clang, -O0):
<oldk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
cqto
idivq  -0x8(%rbp)
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oldk>:
mov    %rsi,%rax
imul   %rcx,%rax
mov    %rax,%rcx
or     %rdi,%rcx
shr    $0x20,%rcx
je     111d <oldk+0x1d>
cqto
idiv   %rdi
add    $0xffffffffffffffff,%rax
ret
xor    %edx,%edx
div    %edi
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @oldk(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = load i64, i64* %8
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %5
%13 = sdiv i64 %11, %12
%14 = sub nsw i64 %13, 1
ret i64 %14
}

LLVM IR (-O2):
define i64 @oldk(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %3, %1
%6 = sdiv i64 %5, %0
%7 = add nsw i64 %6, -1
ret i64 %7
}
void glutFullScreen(void) {}


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

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

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

LLVM IR (-O2):
define void @glutFullScreen() {
ret void
}
char *errmsg(code)
int code;
{
  extern int sys_nerr;
  extern char *sys_errlist[];
  static char ebuf[6 + 5 + 1];
  if (code > sys_nerr) {
    (void)sprintf(ebuf, "Error %d", code);
    return ebuf;
  } else
    return sys_errlist[code];
}


x86 assembly (clang, -O0):
<errmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jle    1155 <errmsg+0x45>
mov    -0xc(%rbp),%edx
lea    0x2ef2(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2edd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <errmsg+0x58>
movslq -0xc(%rbp),%rcx
mov    0x2e98(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errmsg>:
push   %rbx
mov    %edi,%edx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jge    1138 <errmsg+0x28>
lea    0x2f04(%rip),%rbx
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
jmp    1146 <errmsg+0x36>
movslq %edx,%rax
mov    0x2eb6(%rip),%rcx
mov    (%rcx,%rax,8),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errmsg.ebuf = internal global [12 x i8] zeroinitializer
@sys_nerr = external global i32
@.str = [9 x i8] c"Error %d\00"
@sys_errlist = external global [0 x i8*]
define i8* @errmsg(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @sys_nerr
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @errmsg.ebuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @errmsg.ebuf, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %15
15: ; preds = %10, %7
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@errmsg.ebuf = internal global [12 x i8] zeroinitializer
@sys_nerr = external global i32
@.str = [9 x i8] c"Error %d\00"
@sys_errlist = external global [0 x i8*]
define i8* @errmsg(i32 %0) {
%2 = load i32, i32* @sys_nerr
%3 = icmp slt i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @errmsg.ebuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
6: ; preds = %1
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @errmsg.ebuf, i64 0, i64 0), %4 ], [ %9, %6 ]
ret i8* %11
}
int P(int n1, int n2) {
  int prodotto;
  prodotto = n1 * n2;
  return prodotto;
}


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

x86 assembly (clang, -O2):
<P>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @P(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int example_func(int *ptr) { return *ptr + 1234; }


x86 assembly (clang, -O0):
<example_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x4d2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_func>:
mov    $0x4d2,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @example_func(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1234
ret i32 %5
}

LLVM IR (-O2):
define i32 @example_func(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1234
ret i32 %3
}
/* Variables and functions */
double Slater_5S_6S(double, double, double);
double Slater_6S_5S(double rij, double xii, double xij) {
  return Slater_5S_6S(rij, xij, xii);
}


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

x86 assembly (clang, -O2):
<Slater_6S_5S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_5S_6S@plt>

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

LLVM IR (-O2):
define double @Slater_6S_5S(double %0, double %1, double %2) {
%4 = tail call double @Slater_5S_6S(double %0, double %2, double %1)
ret double %4
}
int test_imm_88uint8_reg(unsigned char val) {
  return ((val) & (0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_88uint8_reg>:
test   $0x88,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_88uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 136
%6 = icmp ne i32 %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_88uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -120
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  for (int i = 0; i < 1000000000; i++) {
    int a = 131 & (4 - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3b9aca00,-0x8(%rbp)
jge    1134 <main+0x34>
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *, char *);
void badline(const char *field, const char *bad) {
  syslog(LOG_ERR, "bad mounttab %s field '%s'", field,
         (bad == NULL) ? "<null>" : bad);
}


x86 assembly (clang, -O0):
<badline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <badline+0x3f>
lea    0xed5(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1157 <badline+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rcx
lea    0xe97(%rip),%rsi
call   1030 <syslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badline>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
test   %rsi,%rsi
lea    0xef5(%rip),%rcx
cmovne %rsi,%rcx
lea    0xecf(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"bad mounttab %s field '%s'\00"
@.str.1 = [7 x i8] c"<null>\00"
define void @badline(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_ERR
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i8*, i8** %4
br label %12
12: ; preds = %10, %9
%13 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %9 ], [ %11, %10 ]
%14 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %13)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"bad mounttab %s field '%s'\00"
@.str.1 = [7 x i8] c"<null>\00"
define void @badline(i8* %0, i8* %1) {
%3 = load i32, i32* @LOG_ERR
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1
%6 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret void
}
int makeTreeNode_bound(int UNUSED_a __attribute__((__unused__)),
                       int UNUSED_b __attribute__((__unused__)),
                       int UNUSED_c __attribute__((__unused__))) {
  return 4;
}


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

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

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

LLVM IR (-O2):
define i32 @makeTreeNode_bound(i32 %0, i32 %1, i32 %2) {
ret i32 4
}
int mutex_lock_interruptible(struct mutex *m) {
  (void)m;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mutex = type opaque
define i32 @mutex_lock_interruptible(%struct.mutex* %0) {
%2 = alloca %struct.mutex*
store %struct.mutex* %0, %struct.mutex** %2
%3 = load %struct.mutex*, %struct.mutex** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mutex = type opaque
define i32 @mutex_lock_interruptible(%struct.mutex* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ embedded_ltoa(char *, long, int, int /*<<< orphan*/,
                                 unsigned int, int /*<<< orphan*/, char);
unsigned int embedded_prints(char *, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int print_binary(long number, unsigned int bits) {
  char buffer[36];
  embedded_ltoa(buffer, number, 2, 0, bits, 0, 'a');
  return embedded_prints(buffer, 0, 0);
}


x86 assembly (clang, -O0):
<print_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%r8d
mov    $0x2,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
movl   $0x61,(%rsp)
call   1030 <embedded_ltoa@plt>
lea    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_binary>:
push   %rbx
sub    $0x40,%rsp
mov    %esi,%r8d
mov    %rdi,%rsi
movl   $0x61,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
call   1030 <embedded_ltoa@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_binary(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca [36 x i8]
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [36 x i8], [36 x i8]* %5, i64 0, i64 0
%7 = load i64, i64* %3
%8 = load i32, i32* %4
%9 = call i32 @embedded_ltoa(i8* %6, i64 %7, i32 2, i32 0, i32 %8, i32 0, i8 signext 97)
%10 = getelementptr inbounds [36 x i8], [36 x i8]* %5, i64 0, i64 0
%11 = call i32 @embedded_prints(i8* %10, i32 0, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @print_binary(i64 %0, i32 %1) {
%3 = alloca [36 x i8]
%4 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 0
%5 = call i32 @embedded_ltoa(i8* %4, i64 %0, i32 2, i32 0, i32 %1, i32 0, i8 signext 97)
%6 = call i32 @embedded_prints(i8* %4, i32 0, i32 0)
ret i32 %6
}
_forsgn(v) double v;
{
  if (v >= 0)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<_forsgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1127 <_forsgn+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_forsgn+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_forsgn>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @_forsgn(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, i32 -1, i32 1
ret i32 %3
}
double mink(int i, int j) {
  if (i == j) {
    if (i == 0)
      return (-1.);
    else
      return (1.);
  } else
    return (0.);
}


x86 assembly (clang, -O0):
<mink>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1144 <mink+0x44>
cmpl   $0x0,-0xc(%rbp)
jne    1132 <mink+0x32>
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <mink+0x4c>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <mink+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mink>:
xor    %eax,%eax
test   %edi,%edi
sete   %cl
cmp    %esi,%edi
je     110f <mink+0xf>
xorps  %xmm0,%xmm0
ret
mov    %cl,%al
lea    0xee8(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

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

LLVM IR (-O2):
define double @mink(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, double -1.000000e+00, double 1.000000e+00
%6 = select i1 %3, double %5, double 0.000000e+00
ret double %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ed_swap_2(uint16_t v) {
  return (uint16_t)(((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8));
}


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

x86 assembly (clang, -O2):
<ed_swap_2>:
mov    %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @ed_swap_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711935
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, -16711936
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ed_swap_2(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int exp(float);
float fabs(float);
float laplace(float x, float mu, float b) {
  float v;
  v = (-fabs(x - mu)) / b;
  return (1 / (2 * b)) * exp(v);
}


x86 assembly (clang, -O0):
<laplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe9f(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  0xe8e(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laplace>:
push   %rax
subss  %xmm1,%xmm0
orps   0xee4(%rip),%xmm0
divss  %xmm2,%xmm0
addss  %xmm2,%xmm2
movss  0xee4(%rip),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @laplace(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = call float @fabs(float %10)
%12 = fneg float %11
%13 = load float, float* %6
%14 = fdiv float %12, %13
store float %14, float* %7
%15 = load float, float* %6
%16 = fmul float 2.000000e+00, %15
%17 = fdiv float 1.000000e+00, %16
%18 = load float, float* %7
%19 = call i32 @exp(float %18)
%20 = sitofp i32 %19 to float
%21 = fmul float %17, %20
ret float %21
}

LLVM IR (-O2):
define float @laplace(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fneg float %5
%7 = fdiv float %6, %2
%8 = fmul float %2, 2.000000e+00
%9 = fdiv float 1.000000e+00, %8
%10 = tail call i32 @exp(float %7)
%11 = sitofp i32 %10 to float
%12 = fmul float %9, %11
ret float %12
}
int f(int i) { return 12; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 12
}
int __child_r(const int idx) { return idx * 2 + 2; }


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

x86 assembly (clang, -O2):
<__child_r>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @__child_r(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Type definitions */
struct t_hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void string_shared_free_key(struct t_hashtable *hashtable, void *key,
                            const void *value) {
  (void)hashtable;
  (void)value;
  free(key);
}


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

x86 assembly (clang, -O2):
<string_shared_free_key>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
define void @string_shared_free_key(%struct.t_hashtable* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void setupIPQoSflag(int flag) {
  if (flag)
    system("ethctl setipqos 1");
  else
    system("ethctl setipqos 0");
}


x86 assembly (clang, -O0):
<setupIPQoSflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <setupIPQoSflag+0x26>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
jmp    1142 <setupIPQoSflag+0x32>
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupIPQoSflag>:
test   %edi,%edi
lea    0xef9(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <system@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"ethctl setipqos 1\00"
@.str.1 = [18 x i8] c"ethctl setipqos 0\00"
define void @setupIPQoSflag(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int32_t(int32_t *const dest) { (void)dest; }


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int32_t(i32* nocapture %0) {
ret void
}
int fun916() { return 916; }


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

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

LLVM IR (-O0):
define i32 @fun916() {
ret i32 916
}

LLVM IR (-O2):
define i32 @fun916() {
ret i32 916
}
/* Variables and functions */
int /*<<< orphan*/ monthly_healing();
int /*<<< orphan*/ regenerate_aura();
void process_regeneration(void) {
  monthly_healing();
  regenerate_aura();
}


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

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

LLVM IR (-O0):
define void @process_regeneration() {
%1 = call i32 (...) @monthly_healing()
%2 = call i32 (...) @regenerate_aura()
ret void
}

LLVM IR (-O2):
define void @process_regeneration() {
%1 = tail call i32 (...) @monthly_healing()
%2 = tail call i32 (...) @regenerate_aura()
ret void
}
/* Variables and functions */
int exp(double);
double eta_nucl(double T, double n1, double n2, double mu1, double mu2) {
  return (n1 - n2) / (exp((mu1 - mu2) / T) - 1);
}


x86 assembly (clang, -O0):
<eta_nucl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x30(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eta_nucl>:
push   %rax
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rsp)
subsd  %xmm4,%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
call   1030 <exp@plt>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @eta_nucl(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* %7
%12 = load double, double* %8
%13 = fsub double %11, %12
%14 = load double, double* %9
%15 = load double, double* %10
%16 = fsub double %14, %15
%17 = load double, double* %6
%18 = fdiv double %16, %17
%19 = call i32 @exp(double %18)
%20 = sub nsw i32 %19, 1
%21 = sitofp i32 %20 to double
%22 = fdiv double %13, %21
ret double %22
}

LLVM IR (-O2):
define double @eta_nucl(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %1, %2
%7 = fsub double %3, %4
%8 = fdiv double %7, %0
%9 = tail call i32 @exp(double %8)
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to double
%12 = fdiv double %6, %11
ret double %12
}
void STinspect() {}


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

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

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

LLVM IR (-O2):
define void @STinspect() {
ret void
}
/* Variables and functions */
unsigned int get_unsigned_arg(void **);
int /*<<< orphan*/ memcpy(char *, void *, unsigned int);
unsigned get_str_arg(void **params, char *str) {
  unsigned str_size;
  str_size = get_unsigned_arg(params);
  memcpy(str, *params, str_size);
  *params += str_size;
  return str_size;
}


x86 assembly (clang, -O0):
<get_str_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_unsigned_arg@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    %edx,%edx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_arg>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <get_unsigned_arg@plt>
mov    %eax,%ebp
mov    (%rbx),%rsi
mov    %r14,%rdi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    %rax,(%rbx)
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_str_arg(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = call i32 @get_unsigned_arg(i8** %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = load i32, i32* %5
%12 = call i32 @memcpy(i8* %8, i8* %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = zext i32 %13 to i64
%17 = getelementptr i8, i8* %15, i64 %16
store i8* %17, i8** %14
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_str_arg(i8** %0, i8* %1) {
%3 = tail call i32 @get_unsigned_arg(i8** %0)
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %3)
%6 = load i8*, i8** %0
%7 = zext i32 %3 to i64
%8 = getelementptr i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret i32 %3
}
void g_utf8_to_utf16() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_to_utf16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lib_enable_servos() { printf("enable_servos \n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"enable_servos \00"
define void @lib_enable_servos() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}