xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ paint_it(char const *, char *);
void red(const char *string) { paint_it(string, "\x1b[0;31m"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;31m\00"
define void @red(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @paint_it(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;31m\00"
define void @red(i8* %0) {
%2 = tail call i32 @paint_it(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_09uint32_mem(unsigned int *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_09uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 9
%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_09uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 9
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int test_decode();
int test_encode();
int main() { return test_decode() + test_encode(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <test_decode@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <test_encode@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_decode()
%3 = call i32 (...) @test_encode()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_decode()
%2 = tail call i32 (...) @test_encode()
%3 = add nsw i32 %2, %1
ret i32 %3
}
void targe3(int *p) {}


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

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

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

LLVM IR (-O2):
define void @targe3(i32* nocapture %0) {
ret void
}
/* Variables and functions */
char *strdup(char const *);
int set_string_test(const char *string, char **result) {
  int res = 0;
  *result = strdup(string);
  return res;
}


x86 assembly (clang, -O0):
<set_string_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_string_test>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strdup@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @set_string_test(i8* nocapture %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strdup(i8* %0)
store i8* %3, i8** %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int gint(int v) {
  printf("int is %d\n", v);
  return 10;
}


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

x86 assembly (clang, -O2):
<gint>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"int is %d\0A\00"
define i32 @gint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 10
}

LLVM IR (-O2):
@.str = [11 x i8] c"int is %d\0A\00"
define i32 @gint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 10
}
func(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<func>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @func(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1() { printf("Hello! You have invoked f1().\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello! You have invoked f1().\0A\00"
define void @f1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Hello! You have invoked f1().\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char __builtin_inb(int);
void smbus_read_byte(void) {
  unsigned char host_status_register;
  unsigned char byte;
  int result;
  host_status_register = __builtin_inb(0x1234);
  byte = __builtin_inb(0x4567);
  result = byte;
  if (host_status_register != 0x02) {
    result = -1;
  }
}


x86 assembly (clang, -O0):
<smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
mov    %al,-0x1(%rbp)
mov    $0x4567,%edi
call   1030 <__builtin_inb@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
je     114d <smbus_read_byte+0x3d>
movl   $0xffffffff,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_read_byte>:
push   %rax
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
mov    $0x4567,%edi
pop    %rax
jmp    1030 <__builtin_inb@plt>

LLVM IR (-O0):
define void @smbus_read_byte() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = call zeroext i8 @__builtin_inb(i32 4660)
store i8 %4, i8* %1
%5 = call zeroext i8 @__builtin_inb(i32 17767)
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 -1, i32* %3
br label %12
12: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
define void @smbus_read_byte() {
%1 = tail call zeroext i8 @__builtin_inb(i32 4660)
%2 = tail call zeroext i8 @__builtin_inb(i32 17767)
ret void
}
int streq(char str1[], char str2[]) {
  int k;
  k = 0;
  while (*str2) {
    if ((*str1++) != (*str2++))
      return 0;
    ++k;
  }
  return k;
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <streq+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1158 <streq+0x58>
movl   $0x0,-0x4(%rbp)
jmp    116c <streq+0x6c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <streq+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <streq+0x24>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %cl,(%rdi,%rdx,1)
jne    1124 <streq+0x24>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <streq+0x10>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %16, %12 ], [ %3, %2 ]
%7 = phi i32 [ %15, %12 ], [ 0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %1, %2 ]
%9 = phi i8* [ %14, %12 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %6
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = add nuw nsw i32 %7, 1
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %12, %2
%19 = phi i32 [ 0, %2 ], [ %15, %12 ], [ 0, %5 ]
ret i32 %19
}
/* Variables and functions */
char *stringCopy(char *dest, const char *src, size_t size) { return ""; }


x86 assembly (clang, -O0):
<stringCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @stringCopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @stringCopy(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ le_to_u32(int /*<<< orphan*/ const *);
float le_to_float(const uint8_t *buf) {
  union {
    uint32_t u;
    float f;
  } convert;
  convert.u = le_to_u32(buf);
  return convert.f;
}


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

x86 assembly (clang, -O2):
<le_to_float>:
push   %rax
call   1030 <le_to_u32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @le_to_float(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u32(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @le_to_float(i32* %0) {
%2 = tail call i32 @le_to_u32(i32* %0)
%3 = bitcast i32 %2 to float
ret float %3
}
int fn4(int a, int b, int m) {
  int tem1 = ~m & a;
  int tem2 = b & m;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = and i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ isUpperAlpha(char);
int rand();
char randUpperChar() {
  char alpha = '0';
  while (!isUpperAlpha(alpha)) {
    alpha = (rand() % 26) + 65;
  }
  return alpha;
}


x86 assembly (clang, -O0):
<randUpperChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isUpperAlpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <randUpperChar+0x2a>
jmp    1166 <randUpperChar+0x46>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
jmp    112c <randUpperChar+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randUpperChar>:
push   %rbx
mov    $0x30,%edi
call   1030 <isUpperAlpha@plt>
mov    $0x30,%bl
test   %eax,%eax
jne    1177 <randUpperChar+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x4ec4ec4f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%ebx
add    $0x41,%bl
movsbl %bl,%edi
call   1030 <isUpperAlpha@plt>
test   %eax,%eax
je     1140 <randUpperChar+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @randUpperChar() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %7, %0
%3 = load i8, i8* %1
%4 = call i32 @isUpperAlpha(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 26
%10 = add nsw i32 %9, 65
%11 = trunc i32 %10 to i8
store i8 %11, i8* %1
br label %2
12: ; preds = %2
%13 = load i8, i8* %1
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @randUpperChar() {
%1 = tail call i32 @isUpperAlpha(i8 signext 48)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 26
%6 = trunc i32 %5 to i8
%7 = add nsw i8 %6, 65
%8 = tail call i32 @isUpperAlpha(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = phi i8 [ 48, %0 ], [ %7, %3 ]
ret i8 %11
}
unsigned int cdb_hashadd(unsigned int h, unsigned char c) {
  h += (h << 5);
  return h ^ c;
}


x86 assembly (clang, -O0):
<cdb_hashadd>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_hashadd>:
mov    %edi,%eax
shl    $0x5,%eax
add    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cdb_hashadd(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 5
%7 = load i32, i32* %3
%8 = add i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cdb_hashadd(i32 %0, i8 zeroext %1) {
%3 = mul i32 %0, 33
%4 = zext i8 %1 to i32
%5 = xor i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
char *rtrim(char *string, char junk) {
  char *original = string + strlen(string);
  while (*--original == junk)
    ;
  *(original + 1) = '\0';
  return string;
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movsbl -0x1(%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1167 <rtrim+0x57>
jmp    1143 <rtrim+0x33>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0xffffffffffffffff,%rax
cmp    %bpl,-0x2(%rcx)
je     1130 <rtrim+0x20>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @rtrim(i8* returned %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
br label %6
6: ; preds = %6, %2
%7 = phi i8* [ %5, %2 ], [ %8, %6 ]
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
br i1 %10, label %6, label %11
11: ; preds = %6
store i8 0, i8* %7
ret i8* %0
}
char decode64Char2(char ci2, char ci3) {
  return ((ci2 << 4) | ((ci3 >> 2) & 15));
}


x86 assembly (clang, -O0):
<decode64Char2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x4,%eax
movsbl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0xf,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode64Char2>:
shl    $0x4,%dil
shr    $0x2,%sil
and    $0xf,%sil
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define signext i8 @decode64Char2(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 4
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = ashr i32 %9, 2
%11 = and i32 %10, 15
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @decode64Char2(i8 signext %0, i8 signext %1) {
%3 = shl i8 %0, 4
%4 = lshr i8 %1, 2
%5 = and i8 %4, 15
%6 = or i8 %5, %3
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ calendar(int *, int *, int *, int *, int *, int *);
int calendar_(int *year, int *month, int *day, int *hour, int *minute,
              int *second) {
  calendar(year, month, day, hour, minute, second);
  return 0;
}


x86 assembly (clang, -O0):
<calendar_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <calendar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @calendar_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = tail call i32 @calendar(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
ret i32 0
}
void v_entry() {}


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

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

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

LLVM IR (-O2):
define void @v_entry() {
ret void
}
double MyMax(double x, double y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<MyMax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <MyMax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <MyMax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyMax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @MyMax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @MyMax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
__attribute__((visibility("default"))) const double xfmin(double x, double y) {
  return y != y ? x : (x < y ? x : y);
}


x86 assembly (clang, -O0):
<xfmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1129 <xfmin+0x29>
jp     1129 <xfmin+0x29>
jmp    1138 <xfmin+0x38>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116f <xfmin+0x6f>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115b <xfmin+0x5b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1165 <xfmin+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfmin>:
movapd %xmm1,%xmm2
cmpunordsd %xmm1,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm0,%xmm3
minsd  %xmm1,%xmm0
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @xfmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fcmp une double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %20
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load double, double* %3
br label %18
16: ; preds = %10
%17 = load double, double* %4
br label %18
18: ; preds = %16, %14
%19 = phi double [ %15, %14 ], [ %17, %16 ]
br label %20
20: ; preds = %18, %8
%21 = phi double [ %9, %8 ], [ %19, %18 ]
ret double %21
}

LLVM IR (-O2):
define double @xfmin(double %0, double %1) {
%3 = fcmp uno double %1, 0.000000e+00
%4 = fcmp olt double %0, %1
%5 = or i1 %3, %4
%6 = select i1 %5, double %0, double %1
ret double %6
}
/* Type definitions */
struct _mgmt_login_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _mgmt_login_rsp *);
void mgmt_login_rsp_free(struct _mgmt_login_rsp *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<mgmt_login_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._mgmt_login_rsp = type { i32 }
define void @mgmt_login_rsp_free(%struct._mgmt_login_rsp* %0) {
%2 = alloca %struct._mgmt_login_rsp*
store %struct._mgmt_login_rsp* %0, %struct._mgmt_login_rsp** %2
%3 = load %struct._mgmt_login_rsp*, %struct._mgmt_login_rsp** %2
%4 = call i32 @osapi_free(%struct._mgmt_login_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._mgmt_login_rsp = type { i32 }
define void @mgmt_login_rsp_free(%struct._mgmt_login_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._mgmt_login_rsp* %0)
ret void
}
unsigned long blargg_max(unsigned long x, unsigned long y) {
  if (x < y)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1122 <blargg_max+0x22>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_max>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @blargg_max(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
signed int second_order_IIR_direct_form_I_fixed(const signed int *coefficients,
                                                signed int input,
                                                const signed int *gain) {
  long temp;
  static signed int x[3] = {0};
  static signed int y[3] = {0};
  x[0] = input;
  return ((short int)temp);
}


x86 assembly (clang, -O0):
<second_order_IIR_direct_form_I_fixed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,0x2f0c(%rip)
mov    -0x20(%rbp),%rax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
@second_order_IIR_direct_form_I_fixed.x = internal global [3 x i32] zeroinitializer
@second_order_IIR_direct_form_I_fixed.y = internal global [3 x i32] zeroinitializer
define i32 @second_order_IIR_direct_form_I_fixed(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %5
store i32 %8, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @second_order_IIR_direct_form_I_fixed.x, i64 0, i64 0)
%9 = load i64, i64* %7
%10 = trunc i64 %9 to i16
%11 = sext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @second_order_IIR_direct_form_I_fixed(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, unsigned char *, int);
int getKey(void) {
  unsigned char c;
  read(0, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<getKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKey>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getKey() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @getKey() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int, size_t);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL)
    eprintf("malloc of %u bytes failed:",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/"
            "3rdparty/check/src/check_error.c",
            62 - 2, n);
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <emalloc+0x40>
mov    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x3c,%edx
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <emalloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3c,%edx
mov    %r14,%rcx
call   1040 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/3rdparty/check/src/check_error.c\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 60, i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/3rdparty/check/src/check_error.c\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 60, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
extern int xextnoWeak(int i) { return i * 128; }


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

x86 assembly (clang, -O2):
<xextnoWeak>:
mov    %edi,%eax
shl    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @xextnoWeak(i32 %0) {
%2 = shl nsw i32 %0, 7
ret i32 %2
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_exec_cost(struct task_struct *);
scalar_t__ get_exec_time(struct task_struct *);
int budget_exhausted(struct task_struct *t) {
  return get_exec_time(t) >= get_exec_cost(t);
}


x86 assembly (clang, -O0):
<budget_exhausted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_exec_time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_exec_cost@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<budget_exhausted>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <get_exec_time@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <get_exec_cost@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
setge  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.task_struct = type { i32 }
define i32 @budget_exhausted(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
%3 = load %struct.task_struct*, %struct.task_struct** %2
%4 = call i64 @get_exec_time(%struct.task_struct* %3)
%5 = load %struct.task_struct*, %struct.task_struct** %2
%6 = call i64 @get_exec_cost(%struct.task_struct* %5)
%7 = icmp sge i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define i32 @budget_exhausted(%struct.task_struct* %0) {
%2 = tail call i64 @get_exec_time(%struct.task_struct* %0)
%3 = tail call i64 @get_exec_cost(%struct.task_struct* %0)
%4 = icmp sge i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
extern void y() { printf("hi from %s\n", __func__); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hi from %s\0A\00"
@__func__.y = [2 x i8] c"y\00"
define void @y() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__func__.y, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hi from %s\0A\00"
@__func__.y = [2 x i8] c"y\00"
define void @y() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__func__.y, i64 0, i64 0))
ret void
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_aton(char *, struct in_addr *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct in_addr addr;
  inet_aton("1.2.3.4", &addr);
  printf("addr.s_addr = 0x%08x\n", addr.s_addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <inet_aton@plt>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [8 x i8] c"1.2.3.4\00"
@.str.1 = [22 x i8] c"addr.s_addr = 0x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.in_addr
store i32 0, i32* %1
%3 = call i32 @inet_aton(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %2)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [8 x i8] c"1.2.3.4\00"
@.str.1 = [22 x i8] c"addr.s_addr = 0x%08x\0A\00"
define i32 @main() {
%1 = alloca %struct.in_addr
%2 = bitcast %struct.in_addr* %1 to i8*
%3 = call i32 @inet_aton(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %1)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void tpm_event_log_teardown(struct dentry **dir) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @tpm_event_log_teardown(%struct.dentry** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_psdmatrix(double **m) {
  free((char *)(m[0]));
  free((char *)(m));
}


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

x86 assembly (clang, -O2):
<free_psdmatrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_psdmatrix(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = call i32 @free(i8* %6)
%8 = load double**, double*** %2
%9 = bitcast double** %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_psdmatrix(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast double** %0 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ processMessageQueue();
int main() {
  while (1) {
    processMessageQueue();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <processMessageQueue@plt>
jmp    111f <main+0xf>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @processMessageQueue()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @processMessageQueue()
br label %1
}
/* Variables and functions */
int compress_style_chunk(unsigned char const *, int, unsigned char *);
int hopt_pack_css(const unsigned char *src, int srclen, unsigned char *dst) {
  return (compress_style_chunk(src, srclen, dst));
}


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

x86 assembly (clang, -O2):
<hopt_pack_css>:
jmp    1030 <compress_style_chunk@plt>

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

LLVM IR (-O2):
define i32 @hopt_pack_css(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @compress_style_chunk(i8* %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int AAS_StartFrame(float);
int /*<<< orphan*/ BotLibSetup(char *);
int Export_BotLibStartFrame(float time) {
  if (!BotLibSetup("BotStartFrame")) {
    return 1;
  }
  return AAS_StartFrame(time);
}


x86 assembly (clang, -O0):
<Export_BotLibStartFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <BotLibSetup@plt>
cmp    $0x0,%eax
jne    114e <Export_BotLibStartFrame+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    115b <Export_BotLibStartFrame+0x3b>
movss  -0x8(%rbp),%xmm0
call   1040 <AAS_StartFrame@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Export_BotLibStartFrame>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <BotLibSetup@plt>
test   %eax,%eax
je     1143 <Export_BotLibStartFrame+0x23>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <AAS_StartFrame@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"BotStartFrame\00"
define i32 @Export_BotLibStartFrame(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = call i32 @BotLibSetup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = call i32 @AAS_StartFrame(float %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"BotStartFrame\00"
define i32 @Export_BotLibStartFrame(float %0) {
%2 = tail call i32 @BotLibSetup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @AAS_StartFrame(float %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
double pathcon_nm8_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathcon_nm8_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm8_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathcon_nm8_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
scalar_t__ toupper(char);
char *_strupr(char *p) {
  char *q;
  for (q = p; *q != 0; ++q)
    *q = (char)toupper(*q);
  return p;
}


x86 assembly (clang, -O0):
<_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <_strupr+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <_strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <_strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
unsigned f0(unsigned abcd[]) {
  return (abcd[1] & abcd[2]) | (~abcd[1] & abcd[3]);
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
and    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rdx
and    0xc(%rdx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    0xc(%rdi),%ecx
mov    0x8(%rdi),%eax
xor    %ecx,%eax
and    0x4(%rdi),%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f0(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, %3
%7 = xor i32 %3, -1
%8 = getelementptr inbounds i32, i32* %0, i64 3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
%11 = or i32 %10, %6
ret i32 %11
}