xunge/DecIR huggingface dataset:
void cmpxchg_386_u32(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<cmpxchg_386_u32>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpxchg_386_u32>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.cmpxchg_386_u32 = [16 x i8] c"cmpxchg_386_u32\00"
define void @cmpxchg_386_u32() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.cmpxchg_386_u32, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.cmpxchg_386_u32 = [16 x i8] c"cmpxchg_386_u32\00"
define void @cmpxchg_386_u32() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.cmpxchg_386_u32, i64 0, i64 0))
ret void
}
long NET_test(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @NET_test() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_test() {
ret i64 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void generic_cpu_swap16p(uint16_t *outp, uint16_t in) {
  *outp = ((in & 0xFF00) >> 8) | ((in & 0x00FF) << 8);
}


x86 assembly (clang, -O0):
<generic_cpu_swap16p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_cpu_swap16p>:
rol    $0x8,%si
movzwl %si,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @generic_cpu_swap16p(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @generic_cpu_swap16p(i32* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = tail call i16 @llvm.bswap.i16(i16 %3)
%5 = zext i16 %4 to i32
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMLSD(uint32_t x, uint32_t y,
                                          uint32_t sum) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y << 16) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y) >> 16)) +
                     (((int32_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLSD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
mov    -0x18(%rbp),%rcx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLSD>:
movswl %di,%eax
movswl %si,%ecx
imul   %eax,%ecx
sar    $0x10,%edi
sar    $0x10,%esi
imul   %edi,%esi
sub    %esi,%edx
add    %ecx,%edx
movslq %edx,%rax
ret

LLVM IR (-O0):
define i64 @__SMLSD(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = mul nsw i32 %10, %14
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = ashr i32 %17, 16
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
%21 = ashr i32 %20, 16
%22 = mul nsw i32 %18, %21
%23 = sub nsw i32 %15, %22
%24 = load i64, i64* %6
%25 = trunc i64 %24 to i32
%26 = add nsw i32 %23, %25
%27 = sext i32 %26 to i64
ret i64 %27
}

LLVM IR (-O2):
define i64 @__SMLSD(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 16
%9 = ashr exact i32 %8, 16
%10 = mul nsw i32 %9, %6
%11 = ashr i32 %4, 16
%12 = ashr i32 %7, 16
%13 = mul nsw i32 %12, %11
%14 = trunc i64 %2 to i32
%15 = sub i32 %14, %13
%16 = add i32 %15, %10
%17 = sext i32 %16 to i64
ret i64 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
uint16_t get_16(const uint16_t *p) { return *p; }


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

x86 assembly (clang, -O2):
<get_16>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_16(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
batch_off(unit, flag) int unit, flag;
{ return set_batch(unit, flag, 0); }


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

x86 assembly (clang, -O2):
<batch_off>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <set_batch@plt>

LLVM IR (-O0):
define i32 @batch_off(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @set_batch to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @batch_off(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @set_batch to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
char **kerl_completion(char *text, int start, int end) {
  char **matches;
  matches = (char **)NULL;
  return matches;
}


x86 assembly (clang, -O0):
<kerl_completion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8** @kerl_completion(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8** null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int month, day, year;
  printf("Enter a date (mm/dd/yyyy): ");
  scanf("%d/%d/%d", &month, &day, &year);
  printf("You entered the date: %d%.2d%.2d\n", year, month, day);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [34 x i8] c"You entered the date: %d%.2d%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [34 x i8] c"You entered the date: %d%.2d%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnMR(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0000, data);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <w5100_writeSn_byte@plt>

LLVM IR (-O0):
define void @w5100_writeSnMR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @w5100_writeSn_byte(i32 %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @w5100_writeSnMR(i32 %0, i32 %1) {
%3 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
double sin(double);
double g(double x) { return x * x * sin(x); }


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

x86 assembly (clang, -O2):
<g>:
push   %rax
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = call double @sin(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @sin(double %0)
%4 = fmul double %2, %3
ret double %4
}
char *basename(char *p) {
  int i = 0;
  char *bname = 0;
  while (1) {
    char c = *(p + i);
    if (c == 0) {
      if (bname == 0) {
        bname = p;
      }
      break;
    } else if (c == '\\') {
      bname = p + i + 1;
    }
    i++;
  }
  return bname;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jne    114a <basename+0x4a>
cmpq   $0x0,-0x18(%rbp)
jne    1145 <basename+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117d <basename+0x7d>
movsbl -0x19(%rbp),%eax
cmp    $0x5c,%eax
jne    116a <basename+0x6a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116f <basename+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <basename+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rdx
xor    %esi,%esi
jmp    1117 <basename+0x17>
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rsi
add    $0x1,%rdx
movzbl -0x1(%rdx),%ecx
cmp    $0x5c,%cl
je     1110 <basename+0x10>
test   %cl,%cl
jne    1113 <basename+0x13>
test   %rsi,%rsi
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i8* [ %10, %9 ], [ null, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 92, label %7
]
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %9
9: ; preds = %7, %2
%10 = phi i8* [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = icmp eq i8* %4, null
%14 = select i1 %13, i8* %0, i8* %4
ret i8* %14
}
unsigned int setbits(unsigned int x, int p, int n, unsigned int y) {
  unsigned int mask = ~(~0 << n) << (p + 1 - n);
  y <<= p + 1 - n;
  return (x & ~mask) | y;
}


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

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
shl    %cl,%r8d
not    %eax
and    %edi,%eax
or     %r8d,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = shl i32 %12, %16
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %7
%21 = sub nsw i32 %19, %20
%22 = load i32, i32* %8
%23 = shl i32 %22, %21
store i32 %23, i32* %8
%24 = load i32, i32* %5
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
%27 = and i32 %24, %26
%28 = load i32, i32* %8
%29 = or i32 %27, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = shl i32 %3, %8
%11 = xor i32 %9, -1
%12 = and i32 %11, %0
%13 = or i32 %12, %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void apply_input(void) { push(fgetc(stdin)); }


x86 assembly (clang, -O0):
<apply_input>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%edi
call   1040 <push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_input>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <push@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @apply_input() {
%1 = load i32, i32* @stdin
%2 = call i32 @fgetc(i32 %1)
%3 = call i32 @push(i32 %2)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @apply_input() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = tail call i32 @push(i32 %2)
ret void
}
/* Variables and functions */
long double my_modf(long double, double *);
long double my_modfl(long double x, long double *iptr) {
  double d;
  long double r;
  r = my_modf(x, &d);
  *iptr = d;
  return r;
}


x86 assembly (clang, -O0):
<my_modfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    -0x20(%rbp),%rdi
call   1030 <my_modf@plt>
fstpt  -0x30(%rbp)
fldl   -0x20(%rbp)
mov    -0x18(%rbp),%rax
fstpt  (%rax)
fldt   -0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_modfl>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
fldt   0x30(%rsp)
fstpt  (%rsp)
lea    0x18(%rsp),%rdi
call   1030 <my_modf@plt>
fldl   0x18(%rsp)
fstpt  (%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @my_modfl(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
%5 = alloca double
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %3
%8 = call x86_fp80 @my_modf(x86_fp80 %7, double* %5)
store x86_fp80 %8, x86_fp80* %6
%9 = load double, double* %5
%10 = fpext double %9 to x86_fp80
%11 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %10, x86_fp80* %11
%12 = load x86_fp80, x86_fp80* %6
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @my_modfl(x86_fp80 %0, x86_fp80* nocapture writeonly %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call x86_fp80 @my_modf(x86_fp80 %0, double* %3)
%6 = load double, double* %3
%7 = fpext double %6 to x86_fp80
store x86_fp80 %7, x86_fp80* %1
ret x86_fp80 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ caret;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
int get_XIMPreeditDrawCallbackStruct_caret(void *_p) {
  return (int)((XIMPreeditDrawCallbackStruct *)_p)->caret;
}


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

x86 assembly (clang, -O2):
<get_XIMPreeditDrawCallbackStruct_caret>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XIMPreeditDrawCallbackStruct_caret(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
unsigned int arikkei_int_equal(const void *l, const void *r) {
  return (unsigned int)((const char *)l - (const char *)0) ==
         (unsigned int)((const char *)r - (const char *)0);
}


x86 assembly (clang, -O0):
<arikkei_int_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x0,%rax
mov    -0x10(%rbp),%rcx
sub    $0x0,%rcx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_int_equal>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @arikkei_int_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = sub i64 %6, 0
%8 = trunc i64 %7 to i32
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = sub i64 %10, 0
%12 = trunc i64 %11 to i32
%13 = icmp eq i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @arikkei_int_equal(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
__attribute__((always_)) int rcu_read_lock_sched_held(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @rcu_read_lock_sched_held() {
ret i32 1
}
int inc(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<inc>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @inc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i;
  while (i)
    printf(".");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113a <main+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct defined_networks {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_error();
int load_defined(struct defined_networks *def, char *filename) {
  io_error();
  return 0;
}


x86 assembly (clang, -O0):
<load_defined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <io_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.defined_networks = type { i32 }
define i32 @load_defined(%struct.defined_networks* %0, i8* %1) {
%3 = alloca %struct.defined_networks*
%4 = alloca i8*
store %struct.defined_networks* %0, %struct.defined_networks** %3
store i8* %1, i8** %4
%5 = call i32 (...) @io_error()
ret i32 0
}

LLVM IR (-O2):
%struct.defined_networks = type { i32 }
define i32 @load_defined(%struct.defined_networks* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @io_error()
ret i32 0
}
int livepatch_unpatch(const char *patch) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @livepatch_unpatch(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int lsri(char *);
int main(int argc, char **argv) { return lsri(argv[1]); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <lsri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%rdi
jmp    1030 <lsri@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @lsri(i8* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __be64;

/* Variables and functions */
void *nla_reserve(void **, int, int);
void nla_put_be64(void **ctx, int t, __be64 var) {
  void *data = nla_reserve(ctx, t, sizeof(__be64));
  *(__be64 *)data = var;
}


x86 assembly (clang, -O0):
<nla_put_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_be64>:
push   %rbx
mov    %edx,%ebx
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @nla_put_be64(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = call i8* @nla_reserve(i8** %8, i32 %9, i32 4)
store i8* %10, i8** %7
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @nla_put_be64(i8** %0, i32 %1, i32 %2) {
%4 = tail call i8* @nla_reserve(i8** %0, i32 %1, i32 4)
%5 = bitcast i8* %4 to i32*
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void ssl_init() {
  SSL_library_init();
  SSL_load_error_strings();
  OpenSSL_add_all_algorithms();
}


x86 assembly (clang, -O0):
<ssl_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_init>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @ssl_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @ssl_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
int op_le(int a, int b) { return a <= b; }


x86 assembly (clang, -O0):
<op_le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_le>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @op_le(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_le(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long foo(void) {
  unsigned long x;
  __asm__ __volatile__("" : "=r"(x)::"memory");
  return x;
}


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

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

LLVM IR (-O0):
define i64 @foo() {
%1 = alloca i64
%2 = call i64 asm sideeffect "", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @foo() {
%1 = tail call i64 asm sideeffect "", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
void *sys_mmap(void *, size_t, int, int, int, uintptr_t);
uintptr_t my_mmap_simple(uintptr_t address, size_t size, int prot, int flags,
                         int fd, uintptr_t pos) {
  void *result = sys_mmap((void *)address, size, prot, flags, fd, pos);
  return (uintptr_t)result;
}


x86 assembly (clang, -O0):
<my_mmap_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
call   1030 <sys_mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mmap_simple>:
jmp    1030 <sys_mmap@plt>

LLVM IR (-O0):
define i64 @my_mmap_simple(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i8*
store i64 %0, i64* %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%14 = load i64, i64* %7
%15 = inttoptr i64 %14 to i8*
%16 = load i64, i64* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i64, i64* %12
%21 = call i8* @sys_mmap(i8* %15, i64 %16, i32 %17, i32 %18, i32 %19, i64 %20)
store i8* %21, i8** %13
%22 = load i8*, i8** %13
%23 = ptrtoint i8* %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @my_mmap_simple(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = inttoptr i64 %0 to i8*
%8 = tail call i8* @sys_mmap(i8* %7, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5)
%9 = ptrtoint i8* %8 to i64
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_ENCODE_CTX;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx) { free(ctx); }


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

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

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

LLVM IR (-O2):
define void @EVP_ENCODE_CTX_free(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
int do_762() { return 762; }


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

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

LLVM IR (-O0):
define i32 @do_762() {
ret i32 762
}

LLVM IR (-O2):
define i32 @do_762() {
ret i32 762
}
unsigned int rte_fls(unsigned int x) {
  asm("bsr %1,%0" : "=r"(x) : "rm"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<rte_fls>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @rte_fls(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @rte_fls(i32 %0) {
%2 = tail call i32 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x5f() {
  Assert_real((isxdigit(95) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              480, ("isxdigit should be 0 for _"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x5f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e0,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x5f>:
push   %rax
mov    $0x5f,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1e0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for _\00"
define void @t_isxdigit_0x5f() {
%1 = call i64 @isxdigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for _\00"
define void @t_isxdigit_0x5f() {
%1 = tail call i64 @isxdigit(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
short stub1();
short testClosureVrS(short (*closure)(void)) {
  return closure != NULL ? (*closure)() : (short)0;
}


x86 assembly (clang, -O0):
<testClosureVrS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureVrS+0x23>
call   *-0x8(%rbp)
cwtl
mov    %eax,-0xc(%rbp)
jmp    112d <testClosureVrS+0x2d>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <testClosureVrS+0x2d>
mov    -0xc(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrS>:
test   %rdi,%rdi
je     1107 <testClosureVrS+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @testClosureVrS(i16 ()* %0) {
%2 = alloca i16 ()*
store i16 ()* %0, i16 ()** %2
%3 = load i16 ()*, i16 ()** %2
%4 = icmp ne i16 ()* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i16 ()*, i16 ()** %2
%7 = call signext i16 %6()
%8 = sext i16 %7 to i32
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi i32 [ %8, %5 ], [ 0, %9 ]
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @testClosureVrS(i16 ()* %0) {
%2 = icmp eq i16 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call signext i16 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i16 [ %4, %3 ], [ 0, %1 ]
ret i16 %6
}
void X509_add1_reject_object(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_add1_reject_object() {
ret void
}
void genc_sf_s() {}


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

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

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

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

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
void *__dmmalloc(void *x, uint32_t n) { return (malloc(n)); }


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

x86 assembly (clang, -O2):
<__dmmalloc>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__dmmalloc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
ret i8* %3
}
/* Variables and functions */
int binIndex(char *);
int strlen(char *);
char *subString(int, int, char *);
char *parttwo(char *g) {
  int index = binIndex(g);
  return subString(index + 1, strlen(g) - index - 2, g);
}


x86 assembly (clang, -O0):
<parttwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <binIndex@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
sub    -0xc(%rbp),%esi
sub    $0x2,%esi
mov    -0x8(%rbp),%rdx
call   1050 <subString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parttwo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <binIndex@plt>
mov    %eax,%r14d
lea    0x1(%r14),%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
sub    %r14d,%eax
lea    -0x2(%rax),%esi
mov    %ebp,%edi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <subString@plt>

LLVM IR (-O0):
define i8* @parttwo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @binIndex(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = sub nsw i32 %11, 2
%13 = load i8*, i8** %2
%14 = call i8* @subString(i32 %7, i32 %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @parttwo(i8* %0) {
%2 = tail call i32 @binIndex(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i32 @strlen(i8* %0)
%5 = sub i32 -2, %2
%6 = add i32 %5, %4
%7 = tail call i8* @subString(i32 %3, i32 %6, i8* %0)
ret i8* %7
}
/* Variables and functions */
int __gpio_to_irq(unsigned int);
int gpio_to_irq(unsigned gpio) { return __gpio_to_irq(gpio); }


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

x86 assembly (clang, -O2):
<gpio_to_irq>:
jmp    1030 <__gpio_to_irq@plt>

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

LLVM IR (-O2):
define i32 @gpio_to_irq(i32 %0) {
%2 = tail call i32 @__gpio_to_irq(i32 %0)
ret i32 %2
}
/* Variables and functions */
int abs(int);
int convertLit(int lit) { return (abs(lit) * 2) + (lit < 0); }


x86 assembly (clang, -O0):
<convertLit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
shl    $0x1,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertLit>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
shld   $0x1,%edi,%eax
ret

LLVM IR (-O0):
define i32 @convertLit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = mul nsw i32 %4, 2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @convertLit(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %0, i32 1)
ret i32 %3
}
int media_snd_start_pipeline(struct snd_usb_substream *subs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.snd_usb_substream = type opaque
define i32 @media_snd_start_pipeline(%struct.snd_usb_substream* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_lookup(char *);
int main() {
  print_lookup("once");
  print_lookup("asdf");
  print_lookup("side");
  print_lookup("banana");
  print_lookup("pictures");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <print_lookup@plt>
lea    0xed3(%rip),%rdi
call   1030 <print_lookup@plt>
lea    0xecc(%rip),%rdi
call   1030 <print_lookup@plt>
lea    0xec5(%rip),%rdi
call   1030 <print_lookup@plt>
lea    0xec0(%rip),%rdi
call   1030 <print_lookup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"once\00"
@.str.1 = [5 x i8] c"asdf\00"
@.str.2 = [5 x i8] c"side\00"
@.str.3 = [7 x i8] c"banana\00"
@.str.4 = [9 x i8] c"pictures\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @print_lookup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @print_lookup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"once\00"
@.str.1 = [5 x i8] c"asdf\00"
@.str.2 = [5 x i8] c"side\00"
@.str.3 = [7 x i8] c"banana\00"
@.str.4 = [9 x i8] c"pictures\00"
define i32 @main() {
%1 = tail call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_lookup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @print_lookup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @print_lookup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_SetBaud(unsigned short code) {
  char data[] = {129, code};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_SetBaud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x81,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_SetBaud>:
push   %rax
movb   $0x81,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_SetBaud(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [2 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -127, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i16, i16* %2
%7 = trunc i16 %6 to i8
store i8 %7, i8* %5
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @SerialWriteString(i8* %8)
ret void
}

LLVM IR (-O2):
define void @iRobot_SetBaud(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -127, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = trunc i16 %0 to i8
store i8 %5, i8* %4
%6 = call i32 @SerialWriteString(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_CC_FIFO_PIN() { clear_io_bit(-4, 2); }


x86 assembly (clang, -O0):
<TOSH_CLR_CC_FIFO_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_CC_FIFO_PIN>:
mov    $0xfffffffc,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_CC_FIFO_PIN() {
%1 = call i32 @clear_io_bit(i32 -4, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_CC_FIFO_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -4, i32 2)
ret void
}
void __attribute__((visibility("default"))) main_default(void) {}


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

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

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

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