xunge/DecIR huggingface dataset:
/* Variables and functions */
float f(float);
int /*<<< orphan*/ getid(float);
int /*<<< orphan*/ printid(float);
void main() {
  float a, b, d, S;
  int i = 0;
  d = 1e-2;
  S = 0;
  getid(a);
  getid(b);
  while (a + i * d < b) {
    S += d * f(a + i * d);
    i++;
  }
  printid(S);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11db <main+0xab>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <f@plt>
movaps %xmm0,%xmm2
movss  -0x18(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <main+0x38>
movss  -0x10(%rbp),%xmm0
call   1050 <printid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <getid@plt>
call   1030 <getid@plt>
xorps  %xmm0,%xmm0
pop    %rax
jmp    1040 <printid@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %5
store float 0x3F847AE140000000, float* %3
store float 0.000000e+00, float* %4
%6 = load float, float* %1
%7 = call i32 @getid(float %6)
%8 = load float, float* %2
%9 = call i32 @getid(float %8)
br label %10
10: ; preds = %18, %0
%11 = load float, float* %1
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = load float, float* %3
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %11)
%16 = load float, float* %2
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %30
18: ; preds = %10
%19 = load float, float* %3
%20 = load float, float* %1
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = load float, float* %3
%24 = call float @llvm.fmuladd.f32(float %22, float %23, float %20)
%25 = call float @f(float %24)
%26 = load float, float* %4
%27 = call float @llvm.fmuladd.f32(float %19, float %25, float %26)
store float %27, float* %4
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %10
30: ; preds = %10
%31 = load float, float* %4
%32 = call i32 @printid(float %31)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(float undef)
%2 = tail call i32 @getid(float undef)
%3 = tail call i32 @printid(float 0.000000e+00)
ret void
}
void gtk_viewport_get_shadow_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_viewport_get_shadow_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_read(int, unsigned char *, int);
unsigned char *rtc_read(void) {
  unsigned char ret[12];
  i2c_read(0x51, ret, 12);
  return ret;
}


x86 assembly (clang, -O0):
<rtc_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rsi
mov    $0x51,%edi
mov    $0xc,%edx
call   1030 <i2c_read@plt>
lea    -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_read>:
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rbx
mov    $0x51,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1030 <i2c_read@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rtc_read() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @i2c_read(i32 81, i8* %2, i32 12)
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
ret i8* %4
}

LLVM IR (-O2):
define i8* @rtc_read() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @i2c_read(i32 81, i8* %2, i32 12)
ret i8* %2
}
void XAllocColorPlanes() {}


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

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

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

LLVM IR (-O2):
define void @XAllocColorPlanes() {
ret void
}
adrx0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114e <adrx0adrx1+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <adrx0adrx1+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrx1>:
movslq %edi,%rcx
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %19
%21 = load double, double* %20
%22 = fcmp ole double %17, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adrx0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int test_imm_BDint16_reg(short val) {
  return ((val) & (-0xBD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BDint16_reg>:
test   $0xff43,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BDint16_reg(i16 signext %0) {
%2 = and i16 %0, -189
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_widget_get_pango_context() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_pango_context() {
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void I2CMasterControl(uint32_t ui32Base, uint32_t ui32Cmd) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = ui32Cmd;
}


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

x86 assembly (clang, -O2):
<I2CMasterControl>:
mov    %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_pre_buffer(char *, char const *);
char **handle_switch_U(char *arg, char **next) {
  const char *name = arg + 1;
  add_pre_buffer("#undef %s\n", name);
  return next;
}


x86 assembly (clang, -O0):
<handle_switch_U>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <add_pre_buffer@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_switch_U>:
push   %rbx
mov    %rsi,%rbx
lea    0x1(%rdi),%rsi
lea    0xee1(%rip),%rdi
call   1030 <add_pre_buffer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"#undef %s\0A\00"
define i8** @handle_switch_U(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** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @add_pre_buffer(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8**, i8*** %4
ret i8** %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"#undef %s\0A\00"
define i8** @handle_switch_U(i8* %0, i8** readnone returned %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i32 @add_pre_buffer(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8** %1
}
const char *skip_whitespace(const char *line) {
  for (; (*line == ' ' || *line == '\t') && *line != '\0'; ++line) {
  }
  return line;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     112d <skip_whitespace+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
jne    113d <skip_whitespace+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <skip_whitespace+0x4d>
jmp    1163 <skip_whitespace+0x63>
jmp    1152 <skip_whitespace+0x52>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
mov    %rdi,%rax
jmp    1114 <skip_whitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_whitespace+0x10>
cmp    $0x9,%cl
je     1110 <skip_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
void getRTStreamId(char *streamId, int nLen, const char *szPrefix,
                   const char *szTag) {
  snprintf(streamId, nLen, "%s_%s", szPrefix, szTag);
}


x86 assembly (clang, -O0):
<getRTStreamId>:
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),%esi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRTStreamId>:
mov    %rcx,%r8
mov    %rdx,%rcx
lea    0xee3(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%s\00"
define void @getRTStreamId(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 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%s\00"
define void @getRTStreamId(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret void
}
void ulpmc_fwupdate_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ulpmc_fwupdate_exit() {
ret void
}
/* Variables and functions */
scalar_t__ even(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("4 is %s\n", even(4) ? "even" : "odd");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <even@plt>
mov    %rax,%rcx
lea    0xecb(%rip),%rsi
lea    0xebf(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <even@plt>
test   %rax,%rax
lea    0xed9(%rip),%rax
lea    0xecd(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"4 is %s\0A\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @even(i32 4)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"4 is %s\0A\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = tail call i64 @even(i32 4)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int test_imm_DCint32_reg(int val) { return ((val) & (0xDC << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_DCint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xdc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DCint32_reg(i32 %0) {
%2 = and i32 %0, 220
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void buf_out_uint32(char *buffer, int value) {
  buffer[0] = (value)&0xff;
  buffer[1] = (value >> 8) & 0xff;
  buffer[2] = (value >> 16) & 0xff;
  buffer[3] = (value >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<buf_out_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_out_uint32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @buf_out_uint32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int do_sockname(struct tcb *, int);
int sys_getsockname(struct tcb *tcp) { return do_sockname(tcp, -1); }


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

x86 assembly (clang, -O2):
<sys_getsockname>:
mov    $0xffffffff,%esi
jmp    1030 <do_sockname@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @do_sockname(%struct.tcb* %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = tail call i32 @do_sockname(%struct.tcb* %0, i32 -1)
ret i32 %2
}
void test3(int b) {
  int *p = __builtin_malloc(sizeof(int) * 4);
  if (b)
    __builtin_free(p);
  *p = 5;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <test3+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test3(i32 %0) {
ret void
}
void __set_bit(int nr, volatile unsigned long *addr) {
  asm volatile("bts %1,%0"
               : "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
bts    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "bts $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
void init_port(void) {
  (*(volatile unsigned long *)0x56000028) = 0x00000000;
  (*(volatile unsigned long *)0x56000038) = 0x00000000;
  (*(volatile unsigned long *)0x56000020) = 0xaaaa02a9;
  (*(volatile unsigned long *)0x56000030) = 0xaaaaaaaa;
}


x86 assembly (clang, -O0):
<init_port>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000028,%eax
movq   $0x0,(%rax)
mov    $0x56000038,%eax
movq   $0x0,(%rax)
mov    $0x56000020,%eax
mov    $0xaaaa02a9,%ecx
mov    %rcx,(%rax)
mov    $0x56000030,%eax
mov    $0xaaaaaaaa,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_port>:
movq   $0x0,0x56000028
movq   $0x0,0x56000038
mov    $0xaaaa02a9,%eax
mov    %rax,0x56000020
56
add    $0xa801,%rax
mov    %rax,0x56000030
56
ret

LLVM IR (-O0):
define void @init_port() {
store volatile i64 0, i64* inttoptr (i64 1442840616 to i64*)
store volatile i64 0, i64* inttoptr (i64 1442840632 to i64*)
store volatile i64 2863268521, i64* inttoptr (i64 1442840608 to i64*)
store volatile i64 2863311530, i64* inttoptr (i64 1442840624 to i64*)
ret void
}

LLVM IR (-O2):
define void @init_port() {
store volatile i64 0, i64* inttoptr (i64 1442840616 to i64*)
store volatile i64 0, i64* inttoptr (i64 1442840632 to i64*)
store volatile i64 2863268521, i64* inttoptr (i64 1442840608 to i64*)
store volatile i64 2863311530, i64* inttoptr (i64 1442840624 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_46(int /*<<< orphan*/);
int gen_46(void) {
  handle_46(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_46>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_46@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_46() {
%1 = call i32 @handle_46(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_46() {
%1 = tail call i32 @handle_46(i32 0)
ret i32 0
}
void ff_hevc_put_hevc_uni_pel_pixels4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels4_8_sse4() {
ret void
}
/* Variables and functions */
float CG_DrawPowerups(float);
float CG_DrawScores(float);
void CG_DrawLowerRight(void) {
  float y;
  y = 480 - 32;
  y = CG_DrawScores(y);
  y = CG_DrawPowerups(y);
}


x86 assembly (clang, -O0):
<CG_DrawLowerRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <CG_DrawScores@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <CG_DrawPowerups@plt>
movss  %xmm0,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawLowerRight>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <CG_DrawScores@plt>
pop    %rax
jmp    1030 <CG_DrawPowerups@plt>

LLVM IR (-O0):
define void @CG_DrawLowerRight() {
%1 = alloca float
store float 4.480000e+02, float* %1
%2 = load float, float* %1
%3 = call float @CG_DrawScores(float %2)
store float %3, float* %1
%4 = load float, float* %1
%5 = call float @CG_DrawPowerups(float %4)
store float %5, float* %1
ret void
}

LLVM IR (-O2):
define void @CG_DrawLowerRight() {
%1 = tail call float @CG_DrawScores(float 4.480000e+02)
%2 = tail call float @CG_DrawPowerups(float %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char);
char *cc_format_pos_rank_new(int const j) {
  if ((j < (0)) || ((25) < j))
    return NULL;
  char *new = (char *)malloc(4);
  snprintf(new, 3, "%-hhu", (unsigned char)(j + 1));
  return new;
}


x86 assembly (clang, -O0):
<cc_format_pos_rank_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1143 <cc_format_pos_rank_new+0x23>
mov    $0x19,%eax
cmp    -0xc(%rbp),%eax
jge    1150 <cc_format_pos_rank_new+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1184 <cc_format_pos_rank_new+0x64>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%esi
lea    0xe8c(%rip),%rdx
movzbl %al,%ecx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_format_pos_rank_new>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x19,%edi
jbe    112c <cc_format_pos_rank_new+0xc>
xor    %ebx,%ebx
jmp    1157 <cc_format_pos_rank_new+0x37>
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
add    $0x1,%bpl
movzbl %bpl,%ecx
lea    0xeb6(%rip),%rdx
mov    %rax,%rdi
mov    $0x3,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%-hhu\00"
define i8* @cc_format_pos_rank_new(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 25, %8
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i8* null, i8** %2
br label %20
11: ; preds = %7
%12 = call i64 @malloc(i32 4)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
%18 = call i32 @snprintf(i8* %14, i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %17)
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %11, %10
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"%-hhu\00"
define i8* @cc_format_pos_rank_new(i32 %0) {
%2 = icmp ugt i32 %0, 25
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i8*
%6 = trunc i32 %0 to i8
%7 = add nuw nsw i8 %6, 1
%8 = tail call i32 @snprintf(i8* %5, i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %10
}
double casimir_F_SI_to_scaled(double F_SI, double ScriptL) {
  return ScriptL / (3.161526510740123e-26) * F_SI;
}


x86 assembly (clang, -O0):
<casimir_F_SI_to_scaled>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<casimir_F_SI_to_scaled>:
divsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @casimir_F_SI_to_scaled(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 0x3AA391A38365D6E6
%7 = load double, double* %3
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @casimir_F_SI_to_scaled(double %0, double %1) {
%3 = fdiv double %1, 0x3AA391A38365D6E6
%4 = fmul double %3, %0
ret double %4
}
__attribute__((weak)) void midi_clock_beat_crossed(void) {}


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

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

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

LLVM IR (-O2):
define weak void @midi_clock_beat_crossed() {
ret void
}
/* Variables and functions */
char *strdup(char *);
char tolower(char);
char *stb_duplower(char *s) {
  char *p = strdup(s), *q = p;
  while (*q) {
    *q = tolower(*q);
    ++q;
  }
  return p;
}


x86 assembly (clang, -O0):
<stb_duplower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1173 <stb_duplower+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <stb_duplower+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_duplower>:
push   %r14
push   %rbx
push   %rax
call   1040 <strdup@plt>
mov    %rax,%r14
mov    (%rax),%al
test   %al,%al
je     1156 <stb_duplower+0x36>
mov    %r14,%rbx
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <stb_duplower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @stb_duplower(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %3, %1 ]
%7 = phi i8* [ %9, %5 ], [ %2, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fred();
int main() {
  fred();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fred()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fred()
ret i32 0
}
void sys_warning_1(mesg) const char *mesg;
{ rb_sys_warning("%s", mesg); }


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

x86 assembly (clang, -O2):
<sys_warning_1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <rb_sys_warning@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @sys_warning_1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @rb_sys_warning to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @sys_warning_1(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @rb_sys_warning to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __uportsys_send(int, void const *, size_t, int,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
ssize_t send(int sd, const void *buf, size_t len, int flags) {
  return __uportsys_send(sd, buf, len, flags, &errno);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    0x2ea5(%rip),%r8
call   1030 <__uportsys_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
mov    0x2ec9(%rip),%r8
jmp    1030 <__uportsys_send@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @__uportsys_send(i32 %9, i8* %10, i64 %11, i32 %12, i32* @errno)
ret i32 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @__uportsys_send(i32 %0, i8* %1, i64 %2, i32 %3, i32* @errno)
ret i32 %5
}
/* Variables and functions */
int check_serial(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int rv;
  char *password = argv[1];
  rv = check_serial(password);
  if (rv == 0x1) {
    printf("Success!\n");
  } else {
    printf("Fail!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <check_serial@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1169 <main+0x49>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x55>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <check_serial@plt>
cmp    $0x1,%eax
lea    0xed2(%rip),%rax
lea    0xec5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Fail!\00"
@str.2 = [9 x i8] c"Success!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @check_serial(i8* %4)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int __strverscmp(int /*<<< orphan*/, int /*<<< orphan*/);
int versionsort(const struct dirent **a, const struct dirent **b) {
  return __strverscmp((*a)->d_name, (*b)->d_name);
}


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

x86 assembly (clang, -O2):
<versionsort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <__strverscmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @versionsort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @__strverscmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @versionsort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @__strverscmp(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test(void) {
  static int count;
  if (count)
    printf("PASS\n");
  count++;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
je     112d <test+0x1d>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef0(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
cmpl   $0x0,0x2f14(%rip)
je     1131 <test+0x21>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2f00(%rip),%eax
add    $0x1,%eax
jmp    1136 <test+0x26>
mov    $0x1,%eax
mov    %eax,0x2ef0(%rip)
pop    %rax
ret

LLVM IR (-O0):
@test.count = internal global i32 0
@.str = [6 x i8] c"PASS\0A\00"
define void @test() {
%1 = load i32, i32* @test.count
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @test.count
%7 = add nsw i32 %6, 1
store i32 %7, i32* @test.count
ret void
}

LLVM IR (-O2):
@test.count = internal unnamed_addr global i32 0
@str = [5 x i8] c"PASS\00"
define void @test() {
%1 = load i32, i32* @test.count
%2 = icmp eq i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @test.count
%6 = add i32 %5, 1
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ %6, %3 ], [ 1, %0 ]
store i32 %8, i32* @test.count
ret void
}
/* Variables and functions */
int /*<<< orphan*/ for_asm();
int main(void) {
  for_asm();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @for_asm()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @for_asm()
ret i32 0
}
void swap(int *arr, int i, int j) {
  int t;
  t = arr[i];
  arr[i] = arr[j];
  arr[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
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
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
unsigned char *hmac_blake2s(unsigned char *, unsigned char const *, size_t,
                            unsigned char const *, size_t);
unsigned char *mac_hmac_blake2s(unsigned char *out, const unsigned char *key,
                                size_t key_len, const unsigned char *msg,
                                size_t msg_len) {
  return hmac_blake2s(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_blake2s>:
jmp    1030 <hmac_blake2s@plt>

LLVM IR (-O0):
define i8* @mac_hmac_blake2s(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_blake2s(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_blake2s(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_blake2s(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark) { return; }


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

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

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

LLVM IR (-O2):
%struct.sfe_connection_mark = type opaque
define void @sfe_ipv6_mark_rule(%struct.sfe_connection_mark* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(unsigned char *, char *);
int ParseStreamMode(unsigned char *arg) {
  if (strcasecmp(arg, "vid") == 0)
    return 0;
  if (strcasecmp(arg, "aud") == 0)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<ParseStreamMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1142 <ParseStreamMode+0x32>
movl   $0x0,-0x4(%rbp)
jmp    116f <ParseStreamMode+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1168 <ParseStreamMode+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <ParseStreamMode+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseStreamMode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     113e <ParseStreamMode+0x2e>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"vid\00"
@.str.1 = [4 x i8] c"aud\00"
define i32 @ParseStreamMode(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}