xunge/DecIR huggingface dataset:
int get_bit(const char *bytes, int idx) {
  int byte = idx >> 3;
  int bit = (byte << 3) ^ idx;
  return (bytes[byte] & (1 << bit)) > 0;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %6
%20 = shl i32 1, %19
%21 = and i32 %18, %20
%22 = icmp sgt i32 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_bit(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = lshr i32 %8, %4
%10 = and i32 %9, 1
ret i32 %10
}
/* Type definitions */
struct ptime_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ptime_data *);
int ptime_free(struct ptime_data *ptime) {
  if (ptime == NULL)
    return (-1);
  free(ptime);
  return (0);
}


x86 assembly (clang, -O0):
<ptime_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <ptime_free+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <ptime_free+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptime_free>:
test   %rdi,%rdi
je     1122 <ptime_free+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.ptime_data = type { i32 }
define i32 @ptime_free(%struct.ptime_data* %0) {
%2 = alloca i32
%3 = alloca %struct.ptime_data*
store %struct.ptime_data* %0, %struct.ptime_data** %3
%4 = load %struct.ptime_data*, %struct.ptime_data** %3
%5 = icmp eq %struct.ptime_data* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load %struct.ptime_data*, %struct.ptime_data** %3
%9 = call i32 @free(%struct.ptime_data* %8)
store i32 0, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.ptime_data = type { i32 }
define i32 @ptime_free(%struct.ptime_data* %0) {
%2 = icmp eq %struct.ptime_data* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.ptime_data* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, double);
int write_double(char *buf, size_t len, double val) {
  snprintf(buf, len, "%f", val);
  return 0;
}


x86 assembly (clang, -O0):
<write_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xec7(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_double>:
push   %rax
lea    0xee8(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @write_double(i8* %0, i64 %1, double %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca double
store i8* %0, i8** %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load double, double* %6
%10 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @write_double(i8* %0, i64 %1, double %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
void startMulticart() {
  unsigned char *cp = (unsigned char *)0x7100;
  *cp++ = 0x3e;
  *cp++ = 0x02;
  *cp++ = 0xd3;
  *cp++ = 0x52;
  *cp++ = 0xc3;
  *cp++ = 0x00;
  *cp++ = 0x00;
  __asm__("jp 0x7100");
}


x86 assembly (clang, -O0):
<startMulticart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7100,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x3e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xd3,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x52,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xc3,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jp     7100 <completed.0+0x30e0>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startMulticart>:
movb   $0x3e,0x7100
3e
movb   $0x2,0x7101
02
movb   $0xd3,0x7102
d3
movb   $0x52,0x7103
52
movb   $0xc3,0x7104
c3
movb   $0x0,0x7105
movb   $0x0,0x7106
jp     7100 <completed.0+0x30e0>
ret

LLVM IR (-O0):
define void @startMulticart() {
%1 = alloca i8*
store i8* inttoptr (i64 28928 to i8*), i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i32 1
store i8* %3, i8** %1
store i8 62, i8* %2
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
store i8 2, i8* %4
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %1
store i8 -45, i8* %6
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %1
store i8 82, i8* %8
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %1
store i8 -61, i8* %10
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %1
store i8 0, i8* %12
%14 = load i8*, i8** %1
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %1
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @startMulticart() {
store i8 62, i8* inttoptr (i64 28928 to i8*)
store i8 2, i8* inttoptr (i64 28929 to i8*)
store i8 -45, i8* inttoptr (i64 28930 to i8*)
store i8 82, i8* inttoptr (i64 28931 to i8*)
store i8 -61, i8* inttoptr (i64 28932 to i8*)
store i8 0, i8* inttoptr (i64 28933 to i8*)
store i8 0, i8* inttoptr (i64 28934 to i8*)
tail call void asm sideeffect "jp 0x7100", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
main(void) {
  unsigned int val = 0xabcd1234;
  unsigned char *cPtr;
  cPtr = (char *)&val;
  *(cPtr + 2) = 0xef;
  printf(" the replaced value = %x\n", val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xabcd1234,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xef,0x2(%rax)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c" the replaced value = %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 -1412623820, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 2
store i8 -17, i8* %5
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c" the replaced value = %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 -1410395596)
ret i32 0
}
/* Variables and functions */
scalar_t__ xchg_u64(long *, unsigned long);
extern void *xchg_ptr(void *m, void *val) {
  return (void *)xchg_u64((long *)m, (unsigned long)val);
}


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

x86 assembly (clang, -O2):
<xchg_ptr>:
jmp    1030 <xchg_u64@plt>

LLVM IR (-O0):
define i8* @xchg_ptr(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 = bitcast i8* %5 to i64*
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = call i64 @xchg_u64(i64* %6, i64 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @xchg_ptr(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i64*
%4 = ptrtoint i8* %1 to i64
%5 = tail call i64 @xchg_u64(i64* %3, i64 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
scalar_t__ MT_delete_entry(unsigned long, char *, int, char const *,
                           char const *);
int /*<<< orphan*/ free(void *);
void MT_Free(void *ptr, int line, const char *func, const char *file_name) {
  if (MT_delete_entry((unsigned long int)ptr, "FRE", line, func, file_name))
    free(ptr);
  return;
}


x86 assembly (clang, -O0):
<MT_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb3(%rip),%rsi
call   1040 <MT_delete_entry@plt>
cmp    $0x0,%rax
je     1165 <MT_Free+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_Free>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
call   1040 <MT_delete_entry@plt>
test   %rax,%rax
je     1146 <MT_Free+0x26>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"FRE\00"
define void @MT_Free(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = ptrtoint i8* %0 to i64
%6 = tail call i64 @MT_delete_entry(i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %8, %4
ret void
}
void f48(void) {
  ({
    ({ 0; });
    goto a;
    ({ 0; });
    0;
  });
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f48>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f48() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %1
br label %7
7: ; preds = %0
store i32 0, i32* %3
%8 = load i32, i32* %3
store i32 0, i32* %4
%9 = load i32, i32* %4
store i32 0, i32* %5
%10 = load i32, i32* %5
ret void
}

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

/* Variables and functions */
int sigsetjmp(sigjmp_buf env, int savemask) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sigsetjmp(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x35() {
  Assert_real((isbdigit(53) == 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_isbdigit.c",
              270, ("isbdigit should be 0 for 5"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x35>:
push   %rax
mov    $0x35,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x10e,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 5\00"
define void @t_isbdigit_0x35() {
%1 = call i64 @isbdigit(i32 53)
%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 270, 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 5\00"
define void @t_isbdigit_0x35() {
%1 = tail call i64 @isbdigit(i32 53)
%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 270, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void XAddToExtensionList() {}


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

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

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

LLVM IR (-O2):
define void @XAddToExtensionList() {
ret void
}
void modem_set_slave_wakeup(int state) {}


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

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

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

LLVM IR (-O2):
define void @modem_set_slave_wakeup(i32 %0) {
ret void
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int __send_command(struct iax_session *, char, int, unsigned int,
                   unsigned char *, int, int, int /*<<< orphan*/,
                   int /*<<< orphan*/, int /*<<< orphan*/, int);
int send_command_samples(struct iax_session *i, char type, int command,
                         unsigned int ts, unsigned char *data, int datalen,
                         int seqno, int samples) {
  return __send_command(i, type, command, ts, data, datalen, seqno, 0, 0, 0,
                        samples);
}


x86 assembly (clang, -O0):
<send_command_samples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %sil,%al
mov    0x18(%rbp),%esi
mov    0x10(%rbp),%esi
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%sil
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
xor    %r11d,%r11d
movsbl %sil,%esi
mov    %r10d,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <__send_command@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command_samples>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%eax
sub    $0x8,%rsp
push   %rax
push   $0x0
push   $0x0
push   $0x0
push   %r10
call   1030 <__send_command@plt>
add    $0x30,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.iax_session = type { i32 }
define i32 @send_command_samples(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca %struct.iax_session*
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store %struct.iax_session* %0, %struct.iax_session** %9
store i8 %1, i8* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load %struct.iax_session*, %struct.iax_session** %9
%18 = load i8, i8* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i8*, i8** %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @__send_command(%struct.iax_session* %17, i8 signext %18, i32 %19, i32 %20, i8* %21, i32 %22, i32 %23, i32 0, i32 0, i32 0, i32 %24)
ret i32 %25
}

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define i32 @send_command_samples(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @__send_command(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 0, i32 0, i32 0, i32 %7)
ret i32 %9
}
void mulmf(float *result, const float t) {
  int i;
  for (i = 0; i < 16; i++)
    result[i] *= t;
}


x86 assembly (clang, -O0):
<mulmf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1143 <mulmf+0x43>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <mulmf+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulmf>:
shufps $0x0,%xmm0,%xmm0
movups (%rdi),%xmm1
movups 0x10(%rdi),%xmm2
movups 0x20(%rdi),%xmm3
movups 0x30(%rdi),%xmm4
mulps  %xmm0,%xmm1
movups %xmm1,(%rdi)
mulps  %xmm0,%xmm2
movups %xmm2,0x10(%rdi)
mulps  %xmm0,%xmm3
movups %xmm3,0x20(%rdi)
mulps  %xmm0,%xmm4
movups %xmm4,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @mulmf(float* nocapture %0, float %1) {
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = insertelement <4 x float> poison, float %1, i64 0
%6 = shufflevector <4 x float> %5, <4 x float> poison, <4 x i32> zeroinitializer
%7 = fmul <4 x float> %4, %6
%8 = bitcast float* %0 to <4 x float>*
store <4 x float> %7, <4 x float>* %8
%9 = getelementptr inbounds float, float* %0, i64 4
%10 = bitcast float* %9 to <4 x float>*
%11 = load <4 x float>, <4 x float>* %10
%12 = fmul <4 x float> %11, %6
%13 = bitcast float* %9 to <4 x float>*
store <4 x float> %12, <4 x float>* %13
%14 = getelementptr inbounds float, float* %0, i64 8
%15 = bitcast float* %14 to <4 x float>*
%16 = load <4 x float>, <4 x float>* %15
%17 = fmul <4 x float> %16, %6
%18 = bitcast float* %14 to <4 x float>*
store <4 x float> %17, <4 x float>* %18
%19 = getelementptr inbounds float, float* %0, i64 12
%20 = bitcast float* %19 to <4 x float>*
%21 = load <4 x float>, <4 x float>* %20
%22 = fmul <4 x float> %21, %6
%23 = bitcast float* %19 to <4 x float>*
store <4 x float> %22, <4 x float>* %23
ret void
}
int d5(int a) { return a % 5; }


x86 assembly (clang, -O0):
<d5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d5>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @d5(i32 %0) {
%2 = srem i32 %0, 5
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ check(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  char input[13];
  fgets(input, 13, stdin);
  check(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0xd,%esi
call   1030 <fgets@plt>
lea    -0x11(%rbp),%rdi
call   1040 <check@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1040 <check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 13, i32 %4)
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = call i32 @check(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 13, i32 %3)
%5 = call i32 @check(i8* %2)
ret i32 0
}
char intToChar(int num) {
  char ret = '\0';
  switch (num) {
  case 0:
    ret = '0';
    break;
  case 1:
    ret = '1';
    break;
  case 2:
    ret = '2';
    break;
  case 3:
    ret = '3';
    break;
  case 4:
    ret = '4';
    break;
  case 5:
    ret = '5';
    break;
  case 6:
    ret = '6';
    break;
  case 7:
    ret = '7';
    break;
  case 8:
    ret = '8';
    break;
  case 9:
    ret = '9';
    break;
  default:
    ret = 'x';
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<intToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     118a <intToChar+0x8a>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x30,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x31,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x32,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x33,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x34,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x35,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x36,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x37,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x38,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x39,-0x5(%rbp)
jmp    118e <intToChar+0x8e>
movb   $0x78,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToChar>:
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
movzbl %al,%ecx
mov    $0x78,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @intToChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
switch i32 %4, label %15 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
]
5: ; preds = %1
store i8 48, i8* %3
br label %16
6: ; preds = %1
store i8 49, i8* %3
br label %16
7: ; preds = %1
store i8 50, i8* %3
br label %16
8: ; preds = %1
store i8 51, i8* %3
br label %16
9: ; preds = %1
store i8 52, i8* %3
br label %16
10: ; preds = %1
store i8 53, i8* %3
br label %16
11: ; preds = %1
store i8 54, i8* %3
br label %16
12: ; preds = %1
store i8 55, i8* %3
br label %16
13: ; preds = %1
store i8 56, i8* %3
br label %16
14: ; preds = %1
store i8 57, i8* %3
br label %16
15: ; preds = %1
store i8 120, i8* %3
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i8, i8* %3
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @intToChar(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 48
%5 = select i1 %2, i8 %4, i8 120
ret i8 %5
}
extern void pdinstance_free(struct _pdinstance *x) {}


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

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

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

LLVM IR (-O2):
%struct._pdinstance = type opaque
define void @pdinstance_free(%struct._pdinstance* nocapture %0) {
ret void
}
struct p4_add_table_entry *
netconv_p4_add_table_entry(struct p4_add_table_entry *m) {
  return m;
}


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

x86 assembly (clang, -O2):
<netconv_p4_add_table_entry>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.p4_add_table_entry = type opaque
define %struct.p4_add_table_entry* @netconv_p4_add_table_entry(%struct.p4_add_table_entry* readnone returned %0) {
ret %struct.p4_add_table_entry* %0
}
/* Variables and functions */
int /*<<< orphan*/ TestCase01_1();
int /*<<< orphan*/ TestCase02_1();
int /*<<< orphan*/ TestCase03_1();
int /*<<< orphan*/ TestCase04_1();
int /*<<< orphan*/ TestCase05_1();
int /*<<< orphan*/ TestCase06_1();
int /*<<< orphan*/ TestCase07_1();
int /*<<< orphan*/ TestCase08_1();
int /*<<< orphan*/ TestCase09_1();
int main(void) {
  TestCase01_1();
  TestCase02_1();
  TestCase03_1();
  TestCase04_1();
  TestCase05_1();
  TestCase06_1();
  TestCase07_1();
  TestCase08_1();
  TestCase09_1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <TestCase01_1@plt>
mov    $0x0,%al
call   1040 <TestCase02_1@plt>
mov    $0x0,%al
call   10a0 <TestCase03_1@plt>
mov    $0x0,%al
call   1050 <TestCase04_1@plt>
mov    $0x0,%al
call   1070 <TestCase05_1@plt>
mov    $0x0,%al
call   10b0 <TestCase06_1@plt>
mov    $0x0,%al
call   1080 <TestCase07_1@plt>
mov    $0x0,%al
call   1090 <TestCase08_1@plt>
mov    $0x0,%al
call   1060 <TestCase09_1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestCase01_1@plt>
xor    %eax,%eax
call   1040 <TestCase02_1@plt>
xor    %eax,%eax
call   10a0 <TestCase03_1@plt>
xor    %eax,%eax
call   1050 <TestCase04_1@plt>
xor    %eax,%eax
call   1070 <TestCase05_1@plt>
xor    %eax,%eax
call   10b0 <TestCase06_1@plt>
xor    %eax,%eax
call   1080 <TestCase07_1@plt>
xor    %eax,%eax
call   1090 <TestCase08_1@plt>
xor    %eax,%eax
call   1060 <TestCase09_1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @TestCase01_1()
%3 = call i32 (...) @TestCase02_1()
%4 = call i32 (...) @TestCase03_1()
%5 = call i32 (...) @TestCase04_1()
%6 = call i32 (...) @TestCase05_1()
%7 = call i32 (...) @TestCase06_1()
%8 = call i32 (...) @TestCase07_1()
%9 = call i32 (...) @TestCase08_1()
%10 = call i32 (...) @TestCase09_1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestCase01_1()
%2 = tail call i32 (...) @TestCase02_1()
%3 = tail call i32 (...) @TestCase03_1()
%4 = tail call i32 (...) @TestCase04_1()
%5 = tail call i32 (...) @TestCase05_1()
%6 = tail call i32 (...) @TestCase06_1()
%7 = tail call i32 (...) @TestCase07_1()
%8 = tail call i32 (...) @TestCase08_1()
%9 = tail call i32 (...) @TestCase09_1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_task_section() { write("msproject.xml", "<Tasks>\n", NULL); }


x86 assembly (clang, -O0):
<init_task_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_task_section>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [9 x i8] c"<Tasks>\0A\00"
define void @init_task_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [9 x i8] c"<Tasks>\0A\00"
define void @init_task_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void dag_to_dax_footer(FILE *output) { fprintf(output, "</adag>\n"); }


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

x86 assembly (clang, -O2):
<dag_to_dax_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"</adag>\0A\00"
define void @dag_to_dax_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"</adag>\0A\00"
define void @dag_to_dax_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
int test_imm_8Bint16_mem(short *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 139
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int \U000000c1(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @"\C3\81"() {
ret i32 2
}

LLVM IR (-O2):
define i32 @"\C3\81"() {
ret i32 2
}
int test_imm_E7int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E7int64_highword_reg>:
movabs $0xe700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E7int64_highword_reg(i64 %0) {
%2 = and i64 %0, 992137445376
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char int_to_char(int i) {
  char c;
  switch (i) {
  case 1:
    return '1';
  case 2:
    return '2';
  case 3:
    return '3';
  case 4:
    return '4';
  case 5:
    return '5';
  case 6:
    return '6';
  case 7:
    return '7';
  case 8:
    return '8';
  case 9:
    return '9';
  case 0:
    return '0';
  default:
    return '\0';
  }
}


x86 assembly (clang, -O0):
<int_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x9,%rax
ja     1186 <int_to_char+0x86>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x31,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x32,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x33,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x34,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x35,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x36,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x37,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x38,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x39,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x30,-0x1(%rbp)
jmp    118a <int_to_char+0x8a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_char>:
lea    0x30(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xa,%edi
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @int_to_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %16 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 0, label %15
]
6: ; preds = %1
store i8 49, i8* %2
br label %17
7: ; preds = %1
store i8 50, i8* %2
br label %17
8: ; preds = %1
store i8 51, i8* %2
br label %17
9: ; preds = %1
store i8 52, i8* %2
br label %17
10: ; preds = %1
store i8 53, i8* %2
br label %17
11: ; preds = %1
store i8 54, i8* %2
br label %17
12: ; preds = %1
store i8 55, i8* %2
br label %17
13: ; preds = %1
store i8 56, i8* %2
br label %17
14: ; preds = %1
store i8 57, i8* %2
br label %17
15: ; preds = %1
store i8 48, i8* %2
br label %17
16: ; preds = %1
store i8 0, i8* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @int_to_char(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 48
%5 = select i1 %2, i8 %4, i8 0
ret i8 %5
}
/* Type definitions */
struct bl_serial {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bl_serial *);
void bl_free_scsi_string(struct bl_serial *str) {
  if (str)
    free(str);
}


x86 assembly (clang, -O0):
<bl_free_scsi_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <bl_free_scsi_string+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_free_scsi_string>:
test   %rdi,%rdi
je     111a <bl_free_scsi_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.bl_serial = type { i32 }
define void @bl_free_scsi_string(%struct.bl_serial* %0) {
%2 = alloca %struct.bl_serial*
store %struct.bl_serial* %0, %struct.bl_serial** %2
%3 = load %struct.bl_serial*, %struct.bl_serial** %2
%4 = icmp ne %struct.bl_serial* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.bl_serial*, %struct.bl_serial** %2
%7 = call i32 @free(%struct.bl_serial* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.bl_serial = type { i32 }
define void @bl_free_scsi_string(%struct.bl_serial* %0) {
%2 = icmp eq %struct.bl_serial* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.bl_serial* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(unsigned int);
void print_alert_hex32(unsigned int value) { __console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_alert_hex32>:
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_alert_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 %0)
ret void
}
int compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

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

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int proximity_open_calibration(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @proximity_open_calibration(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
int set_B_flag(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @set_B_flag() {
ret i32 0
}

LLVM IR (-O2):
define i32 @set_B_flag() {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void integer_overflow_by_multiplication_Bad() {
  char arr[10];
  int32_t x = 300000;
  int32_t y = 300000;
  int32_t z = x * y;
  if (z < 10) {
    arr[z] = 0;
  }
}


x86 assembly (clang, -O0):
<integer_overflow_by_multiplication_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x493e0,-0x10(%rbp)
movl   $0x493e0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    112f <integer_overflow_by_multiplication_Bad+0x2f>
movslq -0x18(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @integer_overflow_by_multiplication_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 300000, i32* %2
store i32 300000, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @integer_overflow_by_multiplication_Bad() {
ret void
}
int check_plus(char *str) {
  if (*str == '+')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<check_plus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1124 <check_plus+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <check_plus+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_plus>:
xor    %eax,%eax
cmpb   $0x2b,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @check_plus(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 43
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @check_plus(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 43
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_arithm_shift_left(void) {
  gen_pop();
  gen_call("_lsl");
}


x86 assembly (clang, -O0):
<gen_arithm_shift_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_arithm_shift_left>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_lsl\00"
define void @gen_arithm_shift_left() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_lsl\00"
define void @gen_arithm_shift_left() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void *execute_prg(void *cp) {
  char *command = (char *)cp;
  system(command);
}


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

x86 assembly (clang, -O2):
<execute_prg>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define noalias i8* @execute_prg(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i8* undef
}
void ff_hevc_put_hevc_bi_w_qpel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCODE_LOCK_LITTLE_ADD;
int /*<<< orphan*/ do_lock_request(int /*<<< orphan*/);
void do_add_little(void) { do_lock_request(TCODE_LOCK_LITTLE_ADD); }


x86 assembly (clang, -O0):
<do_add_little>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <do_lock_request@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_add_little>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_lock_request@plt>

LLVM IR (-O0):
@TCODE_LOCK_LITTLE_ADD = global i32 0
define void @do_add_little() {
%1 = load i32, i32* @TCODE_LOCK_LITTLE_ADD
%2 = call i32 @do_lock_request(i32 %1)
ret void
}

LLVM IR (-O2):
@TCODE_LOCK_LITTLE_ADD = global i32 0
define void @do_add_little() {
%1 = load i32, i32* @TCODE_LOCK_LITTLE_ADD
%2 = tail call i32 @do_lock_request(i32 %1)
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *speex_alloc_scratch(int size) { return calloc(size, 1); }


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

x86 assembly (clang, -O2):
<speex_alloc_scratch>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @speex_alloc_scratch(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void _rlrshift(uint64_t *v) { *v = (*v & 1) + (*v >> 1); }


x86 assembly (clang, -O0):
<_rlrshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rlrshift>:
mov    (%rdi),%eax
mov    %eax,%ecx
and    $0x1,%ecx
sar    %eax
add    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @_rlrshift(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 %5, %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @_rlrshift(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
%4 = ashr i32 %2, 1
%5 = add nsw i32 %3, %4
store i32 %5, i32* %0
ret void
}