xunge/DecIR huggingface dataset:
char *str_trim2(char *src) {
  int i = 0;
  char *begin = src;
  while (src[i] != '\0') {
    if (src[i] != ' ') {
      break;
    } else {
      begin++;
    }
    i++;
  }
  return begin;
}


x86 assembly (clang, -O0):
<str_trim2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <str_trim2+0x60>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1146 <str_trim2+0x46>
jmp    1160 <str_trim2+0x60>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <str_trim2+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_trim2>:
cmpb   $0x20,(%rdi)
jne    111e <str_trim2+0x1e>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rdi),%rax
cmpb   $0x20,0x1(%rdi)
mov    %rax,%rdi
je     1110 <str_trim2+0x10>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @str_trim2(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 32
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %4, label %12
12: ; preds = %4, %1
%13 = phi i8* [ %0, %1 ], [ %7, %4 ]
ret i8* %13
}
int main() {
  int X;
  int x, y, z;
  float f, g;
  X = 2;
  x = 1;
  y = 2;
  z = x + y;
  f = 1.1;
  g = f + 2.2 + X;
  while (g < 10) {
    g += 1;
  }
  switch (y) {
  case 1: {
    z = x + y;
  }
  case 2: {
    z = x - y;
  }
  default: {
    z += 1;
  }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xea7(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1186 <main+0x86>
movss  0xe99(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    115d <main+0x5d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11ab <main+0xab>
jmp    119a <main+0x9a>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     11b4 <main+0xb4>
jmp    11bd <main+0xbd>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 2, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
store float 0x3FF19999A0000000, float* %6
%11 = load float, float* %6
%12 = fpext float %11 to double
%13 = fadd double %12, 2.200000e+00
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = fadd double %13, %15
%17 = fptrunc double %16 to float
store float %17, float* %7
br label %18
18: ; preds = %21, %0
%19 = load float, float* %7
%20 = fcmp olt float %19, 1.000000e+01
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load float, float* %7
%23 = fadd float %22, 1.000000e+00
store float %23, float* %7
br label %18
24: ; preds = %18
%25 = load i32, i32* %4
switch i32 %25, label %34 [
i32 1, label %26
i32 2, label %30
]
26: ; preds = %24
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
store i32 %29, i32* %5
br label %30
30: ; preds = %24, %26
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %5
br label %34
34: ; preds = %24, %30
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %37
37: ; preds = %34
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int gd_get_ep_by_nmb(int nmb) { return 3 + nmb; }


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

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

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

LLVM IR (-O2):
define i32 @gd_get_ep_by_nmb(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
size_t append_hex_pre_loop_jump(uint8_t *dst) {
  dst[0] = 0x80;
  dst[1] = 0x39;
  dst[2] = 0x00;
  dst[3] = 0x0f;
  dst[4] = 0x84;
  return 9;
}


x86 assembly (clang, -O0):
<append_hex_pre_loop_jump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x39,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xf,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x84,0x10(%rax)
mov    $0x9,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_hex_pre_loop_jump>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x84,0x10(%rdi)
mov    $0x9,%eax
ret

LLVM IR (-O0):
define i64 @append_hex_pre_loop_jump(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 128, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 57, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 15, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 132, i32* %12
ret i64 9
}

LLVM IR (-O2):
define i64 @append_hex_pre_loop_jump(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 128, i32 57, i32 0, i32 15>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 132, i32* %3
ret i64 9
}
unsigned long long ff(unsigned long long a) {
  return a & 0xffffffffff000000ull;
}


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

x86 assembly (clang, -O2):
<ff>:
mov    %rdi,%rax
and    $0xffffffffff000000,%rax
ret

LLVM IR (-O0):
define i64 @ff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -16777216
ret i64 %4
}

LLVM IR (-O2):
define i64 @ff(i64 %0) {
%2 = and i64 %0, -16777216
ret i64 %2
}
/* Variables and functions */
unsigned int cgi_getnentryunsignedint(char const *, int /*<<< orphan*/);
unsigned int cgi_getentryunsignedint(const char *field_name) {
  return cgi_getnentryunsignedint(field_name, 0);
}


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

x86 assembly (clang, -O2):
<cgi_getentryunsignedint>:
xor    %esi,%esi
jmp    1030 <cgi_getnentryunsignedint@plt>

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

LLVM IR (-O2):
define i32 @cgi_getentryunsignedint(i8* %0) {
%2 = tail call i32 @cgi_getnentryunsignedint(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int adjtime(struct timeval *, int /*<<< orphan*/ *);
int sntp_set_time_small(unsigned sec, unsigned msec) {
  struct timeval tv;
  tv.tv_sec = sec;
  tv.tv_usec = msec;
  return adjtime(&tv, NULL);
}


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

x86 assembly (clang, -O2):
<sntp_set_time_small>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <adjtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @sntp_set_time_small(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @adjtime(%struct.timeval* %5, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @sntp_set_time_small(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @adjtime(%struct.timeval* %3, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int CED_TestEvent(int fh, int nArea) { return ioctl(fh, _IO(0xce, 46), nArea); }


x86 assembly (clang, -O0):
<CED_TestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xce,%edi
mov    $0x2e,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_TestEvent>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xce,%edi
mov    $0x2e,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_TestEvent(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 = call i32 @_IO(i32 206, i32 46)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @CED_TestEvent(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 206, i32 46)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ bar2();
void foo(unsigned int a, unsigned int b) {
  if (a >= b)
    bar1();
  else if (b <= a)
    bar2();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1146 <foo+0x26>
mov    $0x0,%al
call   1040 <bar1@plt>
jmp    115e <foo+0x3e>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1159 <foo+0x39>
mov    $0x0,%al
call   1030 <bar2@plt>
jmp    115e <foo+0x3e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %esi,%edi
jae    1115 <foo+0x5>
ret
xor    %eax,%eax
jmp    1030 <bar1@plt>

LLVM IR (-O0):
define void @foo(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 uge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @bar1()
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp ule i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @bar2()
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16, %8
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @bar1()
br label %6
6: ; preds = %2, %4
ret void
}
void gtk_list_store_reorder() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_reorder() {
ret void
}
double fd_(double *const d) { return (1.23456789); }


x86 assembly (clang, -O0):
<fd_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fd_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret double 0x3FF3C0CA4283DE1B
}

LLVM IR (-O2):
define double @fd_(double* nocapture readnone %0) {
ret double 0x3FF3C0CA4283DE1B
}
int d_gt_mm1(double *a1, double *a2) { return (((*a1) > (*a2))); }


x86 assembly (clang, -O0):
<d_gt_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_gt_mm1>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @d_gt_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp ogt double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_gt_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *get_message();
int /*<<< orphan*/ set_message(char *);
scalar_t__ strcmp(char *, char const *);
void cttestset() {
  const char *m;
  set_message("foo");
  m = get_message();
  assert(strcmp("foo", m) == 0);
}


x86 assembly (clang, -O0):
<cttestset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <set_message@plt>
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cttestset>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1060 <set_message@plt>
xor    %eax,%eax
call   1030 <get_message@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rbx
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @cttestset() {
%1 = alloca i8*
%2 = call i32 @set_message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i8* (...) @get_message()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define void @cttestset() {
%1 = tail call i32 @set_message(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @get_message()
%3 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
unsigned addmod(unsigned a, unsigned b, unsigned p) {
  unsigned c = a + b;
  return c >= p ? c - p : c;
}


x86 assembly (clang, -O0):
<addmod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1130 <addmod+0x30>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <addmod+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addmod>:
lea    (%rdi,%rsi,1),%eax
xor    %ecx,%ecx
cmp    %edx,%eax
cmovae %edx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @addmod(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = icmp ult i32 %4, %2
%6 = select i1 %5, i32 0, i32 %2
%7 = sub i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct feed_buf {
  int dummy;
};

/* Variables and functions */
char feed_esc_write_n1(struct feed_buf *const, unsigned int const, char);
char feed_esc_write_cud(struct feed_buf *const p_buf,
                        unsigned int const i_count) {
  return feed_esc_write_n1(p_buf, i_count, 'B');
}


x86 assembly (clang, -O0):
<feed_esc_write_cud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x42,%edx
call   1030 <feed_esc_write_n1@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_esc_write_cud>:
mov    $0x42,%edx
jmp    1030 <feed_esc_write_n1@plt>

LLVM IR (-O0):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_cud(%struct.feed_buf* %0, i32 %1) {
%3 = alloca %struct.feed_buf*
%4 = alloca i32
store %struct.feed_buf* %0, %struct.feed_buf** %3
store i32 %1, i32* %4
%5 = load %struct.feed_buf*, %struct.feed_buf** %3
%6 = load i32, i32* %4
%7 = call signext i8 @feed_esc_write_n1(%struct.feed_buf* %5, i32 %6, i8 signext 66)
ret i8 %7
}

LLVM IR (-O2):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_cud(%struct.feed_buf* %0, i32 %1) {
%3 = tail call signext i8 @feed_esc_write_n1(%struct.feed_buf* %0, i32 %1, i8 signext 66)
ret i8 %3
}
char *nextpar(char *text, char *pospar) {
  char *pos;
  pos = pospar + 1;
  while (*pos != ')') {
    if (*pos == '(')
      pos = nextpar(text, pos);
    pos++;
  }
  return pos;
}


x86 assembly (clang, -O0):
<nextpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
je     116e <nextpar+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    115d <nextpar+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nextpar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <nextpar+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextpar>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
jmp    112b <nextpar+0x1b>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <nextpar@plt>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x28,%cl
je     1120 <nextpar+0x10>
cmp    $0x29,%cl
jne    112b <nextpar+0x1b>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @nextpar(i8* nocapture readnone %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 41, label %11
i8 40, label %9
]
7: ; preds = %3, %9
%8 = phi i8* [ %10, %9 ], [ %5, %3 ]
br label %3
9: ; preds = %3
%10 = tail call i8* @nextpar(i8* %0, i8* %5)
br label %7
11: ; preds = %3
ret i8* %5
}
short int shortint_ignoring_longlongint(short int x, long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @shortint_ignoring_longlongint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_longlongint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
size_t __tolower(int);
void __attribute__((always_)) re_set_fastmap(char *fastmap, int icase, int ch) {
  fastmap[ch] = 1;
  if (icase)
    fastmap[__tolower(ch)] = 1;
}


x86 assembly (clang, -O0):
<re_set_fastmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
cmpl   $0x0,-0xc(%rbp)
je     1153 <re_set_fastmap+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <__tolower@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_set_fastmap>:
push   %rbx
movslq %edx,%rax
movb   $0x1,(%rdi,%rax,1)
test   %esi,%esi
je     112a <re_set_fastmap+0x1a>
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <__tolower@plt>
movb   $0x1,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @re_set_fastmap(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 1, i8* %5
%6 = icmp eq i32 %1, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i64 @__tolower(i32 %2)
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 1, i8* %9
br label %10
10: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void part(int arr[], int min, int max) {
  int mid;
  if (min < max) {
    mid = (min + max) / 2;
    part(arr, min, mid);
    part(arr, mid + 1, max);
    merge(arr, min, mid, max);
  }
}


x86 assembly (clang, -O0):
<part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <part+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <part@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <part@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<part>:
cmp    %edx,%esi
jge    1172 <part+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <part@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <part@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @part(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @part(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @part(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int file_wd_perm(char const *);
int file_wd_isexe(const char *zFilename) {
  return file_wd_perm(zFilename) == 1;
}


x86 assembly (clang, -O0):
<file_wd_isexe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file_wd_perm@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_wd_isexe>:
push   %rax
call   1030 <file_wd_perm@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_wd_isexe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_wd_perm(i8* %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @file_wd_isexe(i8* %0) {
%2 = tail call i32 @file_wd_perm(i8* %0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ t1000_configsys_save();
int /*<<< orphan*/ t1000_emsboard_save();
void t1000_nvr_save(void) {
  t1000_emsboard_save();
  t1000_configsys_save();
}


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

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

LLVM IR (-O0):
define void @t1000_nvr_save() {
%1 = call i32 (...) @t1000_emsboard_save()
%2 = call i32 (...) @t1000_configsys_save()
ret void
}

LLVM IR (-O2):
define void @t1000_nvr_save() {
%1 = tail call i32 (...) @t1000_emsboard_save()
%2 = tail call i32 (...) @t1000_configsys_save()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  char *pointer;
  char *pointer2;
  strcpy(str_a, "Hello World\n");
  pointer = str_a;
  printf(pointer);
  pointer2 = pointer + 2;
  printf(pointer2);
  strcpy(pointer2, "y you guys!\n");
  printf(pointer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x2(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %2
%16 = call i32 @printf(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %2)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%6 = call i32 @printf(i8* %5)
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* %2)
ret i32 0
}
void swapFloat(float *a, int pos1, int pos2) {
  float sw = a[pos1];
  a[pos1] = a[pos2];
  a[pos2] = sw;
}


x86 assembly (clang, -O0):
<swapFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapFloat>:
movslq %esi,%rax
movss  (%rdi,%rax,4),%xmm0
movslq %edx,%rcx
movss  (%rdi,%rcx,4),%xmm1
movss  %xmm1,(%rdi,%rax,4)
movss  %xmm0,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @swapFloat(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
%12 = load float, float* %11
store float %12, float* %7
%13 = load float*, float** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
store float %17, float* %21
%22 = load float, float* %7
%23 = load float*, float** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
store float %22, float* %26
ret void
}

LLVM IR (-O2):
define void @swapFloat(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = load float, float* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
store float %9, float* %5
store float %6, float* %8
ret void
}
int linear_search(int *a, int find, int index, int n) {
  if (index > n) {
    return -1;
  }
  if (a[index] == find) {
    return index;
  }
  return linear_search(a, find, index + 1, n);
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    113d <linear_search+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <linear_search+0x64>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    115c <linear_search+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <linear_search+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
mov    -0x1c(%rbp),%ecx
call   1030 <linear_search@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jg     112f <linear_search+0x2f>
movslq %edx,%r8
add    $0x1,%ecx
lea    (%rdi,%r8,4),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %esi,(%rdi)
je     1130 <linear_search+0x30>
add    $0x1,%edx
add    $0x4,%rdi
cmp    %edx,%ecx
jne    1120 <linear_search+0x20>
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @linear_search(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** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = load i32, i32* %9
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 -1, i32* %5
br label %31
14: ; preds = %4
%15 = load i32*, i32** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %8
store i32 %23, i32* %5
br label %31
24: ; preds = %14
%25 = load i32*, i32** %6
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %9
%30 = call i32 @linear_search(i32* %25, i32 %26, i32 %28, i32 %29)
store i32 %30, i32* %5
br label %31
31: ; preds = %24, %22, %13
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
br i1 %5, label %20, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = add i32 %3, 1
br label %9
9: ; preds = %6, %14
%10 = phi i64 [ %7, %6 ], [ %15, %14 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %1
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = add nsw i64 %10, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %8, %16
br i1 %17, label %20, label %9
18: ; preds = %9
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %14, %18, %4
%21 = phi i32 [ -1, %4 ], [ %19, %18 ], [ -1, %14 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  if (((b >> a) & 1) == 1)
    printf("1");
  else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1174 <main+0x54>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
bt     %ecx,%eax
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 48, i32 49
%13 = call i32 @putchar(i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setns(int fd, int nstype) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setns>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setns(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setns(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t PortF_Input(void) {
  return ((*((volatile uint32_t *)0x400253FC)) & 0x11);
}


x86 assembly (clang, -O0):
<PortF_Input>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400253fc,%eax
mov    (%rax),%eax
and    $0x11,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PortF_Input>:
mov    0x400253fc,%eax
and    $0x11,%eax
ret

LLVM IR (-O0):
define i32 @PortF_Input() {
%1 = load volatile i32, i32* inttoptr (i64 1073894396 to i32*)
%2 = and i32 %1, 17
ret i32 %2
}

LLVM IR (-O2):
define i32 @PortF_Input() {
%1 = load volatile i32, i32* inttoptr (i64 1073894396 to i32*)
%2 = and i32 %1, 17
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void do_error(char *s) {
  puts(s);
  exit(1);
}


x86 assembly (clang, -O0):
<do_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_error>:
push   %rax
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @do_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @do_error(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stdout;
void __print_shrink_str_1(void *cc, void *k, void *v) {
  fprintf(stdout, "(%s, %u)\n", (char *)k, *(uint32_t *)v);
}


x86 assembly (clang, -O0):
<__print_shrink_str_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__print_shrink_str_1>:
mov    %rsi,%rax
mov    0x2ec6(%rip),%rcx
mov    (%rcx),%edi
mov    (%rdx),%ecx
lea    0xedb(%rip),%rsi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"(%s, %u)\0A\00"
define void @__print_shrink_str_1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"(%s, %u)\0A\00"
define void @__print_shrink_str_1(i8* nocapture readnone %0, i8* %1, i8* nocapture %2) {
%4 = load i32, i32* @stdout
%5 = bitcast i8* %2 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %6)
ret void
}
void __attribute__((__no_instrument_function__))
__cyg_profile_func_enter(void *this_func, void *call_site) {
  printf("%s: func = %p, called by = %p\n", __FUNCTION__, this_func, call_site);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_enter = [25 x i8] c"__cyg_profile_func_enter\00"
define void @__cyg_profile_func_enter(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 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.__cyg_profile_func_enter, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_enter = [25 x i8] c"__cyg_profile_func_enter\00"
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.__cyg_profile_func_enter, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void prio_changed_rtws(struct rq *rq, struct task_struct *p, int oldprio,
                       int running) {}


x86 assembly (clang, -O0):
<prio_changed_rtws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @prio_changed_rtws(%struct.rq* %0, %struct.task_struct* %1, i32 %2, i32 %3) {
%5 = alloca %struct.rq*
%6 = alloca %struct.task_struct*
%7 = alloca i32
%8 = alloca i32
store %struct.rq* %0, %struct.rq** %5
store %struct.task_struct* %1, %struct.task_struct** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @prio_changed_rtws(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reset_current_packet_pointer_to_client_packet();
int CFC_filter_consecutive_sn_client() {
  int nb_packets = 0;
  puts("Cloaking - Consecutive SN filtering (Client)");
  reset_current_packet_pointer_to_client_packet();
  puts("Not yet implemented");
  return nb_packets;
}


x86 assembly (clang, -O0):
<CFC_filter_consecutive_sn_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <reset_current_packet_pointer_to_client_packet@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFC_filter_consecutive_sn_client>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <reset_current_packet_pointer_to_client_packet@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Cloaking - Consecutive SN filtering (Client)\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @CFC_filter_consecutive_sn_client() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @reset_current_packet_pointer_to_client_packet()
%4 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [45 x i8] c"Cloaking - Consecutive SN filtering (Client)\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @CFC_filter_consecutive_sn_client() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @reset_current_packet_pointer_to_client_packet()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}