xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void *yourFunctionToRenderGraphics(const char *name, va_list args) {
  printf("yourFunctionToRenderGraphics name %s\n", name);
  return NULL;
}


x86 assembly (clang, -O0):
<yourFunctionToRenderGraphics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yourFunctionToRenderGraphics>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"yourFunctionToRenderGraphics name %s\0A\00"
define i8* @yourFunctionToRenderGraphics(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [38 x i8] c"yourFunctionToRenderGraphics name %s\0A\00"
define noalias i8* @yourFunctionToRenderGraphics(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
const char *daq_version_string(void) {
  return "2"
         "."
         "2"
         "."
         "1";
}


x86 assembly (clang, -O0):
<daq_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"2.2.1\00"
define i8* @daq_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"2.2.1\00"
define i8* @daq_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void errexit(s) register char *s;
{
  write(2, "\n", 1);
  perror(s);
  getout(0);
}


x86 assembly (clang, -O0):
<errexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xeb8(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <perror@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <getout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errexit>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <perror@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <getout@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @errexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @getout to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @errexit(i8* %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @getout to i32 (i32, ...)*)(i32 0)
ret void
}
/* Variables and functions */
float sqrt(float);
float f_right_triangle(float b_num, float c_num) {
  float x;
  x = sqrt((b_num * b_num) + (c_num * c_num));
  x = x + b_num + c_num;
  return x;
}


x86 assembly (clang, -O0):
<f_right_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_right_triangle>:
movaps %xmm0,%xmm3
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm0,%xmm0
addss  %xmm2,%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jb     1130 <f_right_triangle+0x20>
sqrtss %xmm0,%xmm0
jmp    1150 <f_right_triangle+0x40>
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm3,(%rsp)
call   1030 <sqrt@plt>
movss  (%rsp),%xmm3
movss  0x4(%rsp),%xmm1
add    $0x8,%rsp
addss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_right_triangle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = load float, float* %4
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float %6, float %7, float %10)
%12 = call float @sqrt(float %11)
store float %12, float* %5
%13 = load float, float* %5
%14 = load float, float* %3
%15 = fadd float %13, %14
%16 = load float, float* %4
%17 = fadd float %15, %16
store float %17, float* %5
%18 = load float, float* %5
ret float %18
}

LLVM IR (-O2):
define float @f_right_triangle(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrt(float %4)
%6 = fadd float %5, %0
%7 = fadd float %6, %1
ret float %7
}
/* Variables and functions */
int iso_init_with_flag(int /*<<< orphan*/);
int iso_init() { return iso_init_with_flag(0); }


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

x86 assembly (clang, -O2):
<iso_init>:
xor    %edi,%edi
jmp    1030 <iso_init_with_flag@plt>

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

LLVM IR (-O2):
define i32 @iso_init() {
%1 = tail call i32 @iso_init_with_flag(i32 0)
ret i32 %1
}
int sh_unset_nodelay_mode(fd)
int fd;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sh_unset_nodelay_mode(i32 %0) {
ret i32 0
}
void Stask(void) {}


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

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

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

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

/* Variables and functions */
void uDMAChannelSelectSecondary(uint32_t ui32SecPeriphs) {
  (*((volatile unsigned long *)(0x400FF500))) |= ui32SecPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannelSelectSecondary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400ff500,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400ff500,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelSelectSecondary>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x400ff500
40
ret

LLVM IR (-O0):
define void @uDMAChannelSelectSecondary(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074787584 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074787584 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelSelectSecondary(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074787584 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074787584 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ search(int *, int, int ***, int *, int /*<<< orphan*/, int);
int **permute(int *nums, int size, int *returnSize) {
  *returnSize = 0;
  int **arr = (int **)malloc(sizeof(int *));
  search(nums, size, &arr, returnSize, 0, size - 1);
  return arr;
}


x86 assembly (clang, -O0):
<permute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
lea    -0x20(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <search@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permute>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
movl   $0x0,(%rdx)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
lea    -0x1(%rbx),%r9d
lea    0x8(%rsp),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1030 <search@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32** @permute(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** %6
store i32 0, i32* %8
%9 = call i64 @malloc(i32 8)
%10 = inttoptr i64 %9 to i32**
store i32** %10, i32*** %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call i32 @search(i32* %11, i32 %12, i32*** %7, i32* %13, i32 0, i32 %15)
%17 = load i32**, i32*** %7
ret i32** %17
}

LLVM IR (-O2):
define i32** @permute(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32**
store i32 0, i32* %2
%5 = bitcast i32*** %4 to i8*
%6 = tail call i64 @malloc(i32 8)
%7 = inttoptr i64 %6 to i32**
store i32** %7, i32*** %4
%8 = add nsw i32 %1, -1
%9 = call i32 @search(i32* %0, i32 %1, i32*** %4, i32* %2, i32 0, i32 %8)
%10 = load i32**, i32*** %4
ret i32** %10
}
void clts(void) { __asm__("clts"); }


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

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

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

LLVM IR (-O2):
define void @clts() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int play(int k, int a, int b) { return 0; }


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

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

LLVM IR (-O0):
define i32 @play(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @play(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int h = 13 / 2;
  printf("Hello world!\n %d", h);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hello world!\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Hello world!\0A %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cos(double);
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_cos(void) {
  lua_pushnumber(
      cos(((luaL_check_number(1)) * ((3.14159265358979323846) / 180.0))));
}


x86 assembly (clang, -O0):
<math_cos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_cos>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mulsd  0xebd(%rip),%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_cos() {
%1 = call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = call i32 @cos(double %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @math_cos() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @cos(double %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FreeMemory(void *);
void FS_FreeFile(void *buf) { FreeMemory(buf); }


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

x86 assembly (clang, -O2):
<FS_FreeFile>:
jmp    1030 <FreeMemory@plt>

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

LLVM IR (-O2):
define void @FS_FreeFile(i8* %0) {
%2 = tail call i32 @FreeMemory(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ success(int /*<<< orphan*/);
char *ioGetUntrustedUserDirectory(void) { return (char *)success(0); }


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

x86 assembly (clang, -O2):
<ioGetUntrustedUserDirectory>:
xor    %edi,%edi
jmp    1030 <success@plt>

LLVM IR (-O0):
define i8* @ioGetUntrustedUserDirectory() {
%1 = call i64 @success(i32 0)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @ioGetUntrustedUserDirectory() {
%1 = tail call i64 @success(i32 0)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ build_bottom_layer(int *, int);
int main(int argc, const char *argv[]) {
  int test_array[] = {1, 3, 4, 5, 7, 9, 10, 11};
  build_bottom_layer(test_array, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <build_bottom_layer@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <build_bottom_layer@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.test_array = [8 x i32] [i32 1, i32 3, i32 4, i32 5, i32 7, i32 9, i32 10, i32 11]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%9 = call i32 @build_bottom_layer(i32* %8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test_array = [8 x i32] [i32 1, i32 3, i32 4, i32 5, i32 7, i32 9, i32 10, i32 11]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @build_bottom_layer(i32* %5, i32 8)
ret i32 0
}
void rop3_227_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_227_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_227_0_0>:
mov    (%rdi),%al
and    %dl,%al
or     %sil,%al
xor    %dl,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_227_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_227_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map) {}


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

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

LLVM IR (-O0):
%struct.seq_file = type opaque
%struct.pinctrl_map = type opaque
define void @pinconf_show_map(%struct.seq_file* %0, %struct.pinctrl_map* %1) {
%3 = alloca %struct.seq_file*
%4 = alloca %struct.pinctrl_map*
store %struct.seq_file* %0, %struct.seq_file** %3
store %struct.pinctrl_map* %1, %struct.pinctrl_map** %4
ret void
}

LLVM IR (-O2):
%struct.seq_file = type opaque
%struct.pinctrl_map = type opaque
define void @pinconf_show_map(%struct.seq_file* nocapture %0, %struct.pinctrl_map* nocapture %1) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned long getTimeStamp() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (unsigned long)(tv.tv_sec % 86400) * 1000 +
         (unsigned long)tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeStamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xffffffffc22e4507,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x10,%ecx
add    %edx,%ecx
imul   $0x15180,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
movslq %eax,%rcx
mov    0x10(%rsp),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
add    %rdx,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @getTimeStamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = srem i32 %4, 86400
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000
%11 = add i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @getTimeStamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 86400
%7 = mul nsw i32 %6, 1000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = udiv i64 %10, 1000
%12 = add nsw i64 %11, %8
ret i64 %12
}
/* Variables and functions */
scalar_t__ toupper(int);
char *strtoupper(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    str[i] = (char)toupper((int)str[i]);
    i++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <strtoupper+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strtoupper+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strtoupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i64 @toupper(i32 %8)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %7
%11 = add nuw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i8* %0
}
int event_add(struct event *ev, const struct timeval *timeout) { return 0; }


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

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

LLVM IR (-O0):
%struct.event = type opaque
%struct.timeval = type opaque
define i32 @event_add(%struct.event* %0, %struct.timeval* %1) {
%3 = alloca %struct.event*
%4 = alloca %struct.timeval*
store %struct.event* %0, %struct.event** %3
store %struct.timeval* %1, %struct.timeval** %4
ret i32 0
}

LLVM IR (-O2):
%struct.event = type opaque
%struct.timeval = type opaque
define i32 @event_add(%struct.event* nocapture readnone %0, %struct.timeval* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glb_error(char *);
int signal_range(int signal) {
  if ((signal == 3) || (signal == 2))
    return 0;
  glb_error("Signal flag is neither GLB_SIG nor GLB_BG");
  return -1;
}


x86 assembly (clang, -O0):
<signal_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     112f <signal_range+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <signal_range+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    114e <signal_range+0x3e>
lea    0xebe(%rip),%rdi
call   1030 <glb_error@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_range>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
je     1130 <signal_range+0x20>
push   %rax
lea    0xede(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Signal flag is neither GLB_SIG nor GLB_BG\00"
define i32 @signal_range(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 3
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %12
10: ; preds = %6
%11 = call i32 @glb_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [42 x i8] c"Signal flag is neither GLB_SIG nor GLB_BG\00"
define i32 @signal_range(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 2
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @glb_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
void i32_to_double(int i32, double *p) {
  *p = ((((double)i32)) * (1.0 / (2147483648.0)));
}


x86 assembly (clang, -O0):
<i32_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i32_to_double>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @i32_to_double(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3E00000000000000
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @i32_to_double(i32 %0, double* nocapture writeonly %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 0x3E00000000000000
store double %4, double* %1
ret void
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
ulong otol(char *str) {
  ulong sum = 0L;
  char chh;
  while ((chh = *str) >= '0' && chh <= '7') {
    sum *= 8;
    sum += chh - '0';
    str++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<otol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xe(%rbp)
jl     1136 <otol+0x36>
movsbl -0xd(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    1146 <otol+0x46>
jmp    116d <otol+0x6d>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
movsbl -0xd(%rbp),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <otol+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<otol>:
mov    (%rdi),%cl
mov    %ecx,%edx
and    $0xf8,%dl
xor    %eax,%eax
cmp    $0x30,%dl
jne    113a <otol+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1120 <otol+0x20>
ret

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

LLVM IR (-O2):
define i32 @otol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -8
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %13, %5 ], [ %0, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i32
%10 = shl nsw i32 %8, 3
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = and i8 %14, -8
%16 = icmp eq i8 %15, 48
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ red_mult;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_red_mult(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->red_mult;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XStandardColormap_red_mult(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double circle_equation(double);
double integral(double (*)(double), double, double, int);
double area_defect(double x) {
  double y = circle_equation(x);
  return ((0.5 - x) * y) / 2.0 - integral(circle_equation, x, 0.5, 50);
}


x86 assembly (clang, -O0):
<area_defect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <circle_equation@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e95(%rip),%rdi
movsd  0xe9d(%rip),%xmm1
mov    $0x32,%esi
call   1030 <integral@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_defect>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <circle_equation@plt>
mov    0x2eca(%rip),%rdi
movsd  0xed2(%rip),%xmm1
movapd %xmm1,%xmm2
movsd  0x8(%rsp),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm3,%xmm0
mov    $0x32,%esi
call   1030 <integral@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @area_defect(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @circle_equation(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = fsub double 5.000000e-01, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fdiv double %9, 2.000000e+00
%11 = load double, double* %2
%12 = call double @integral(double (double)* @circle_equation, double %11, double 5.000000e-01, i32 50)
%13 = fsub double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @area_defect(double %0) {
%2 = tail call double @circle_equation(double %0)
%3 = fsub double 5.000000e-01, %0
%4 = fmul double %3, %2
%5 = fmul double %4, 5.000000e-01
%6 = tail call double @integral(double (double)* @circle_equation, double %0, double 5.000000e-01, i32 50)
%7 = fsub double %5, %6
ret double %7
}
/* Type definitions */
struct graph_node {
  int dummy;
};

/* Variables and functions */
int dfs(struct graph_node *, struct graph_node *);
int /*<<< orphan*/ prepare_visit();
int route_exists(struct graph_node *from, struct graph_node *to) {
  prepare_visit();
  return dfs(from, to);
}


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

x86 assembly (clang, -O2):
<route_exists>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <prepare_visit@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dfs@plt>

LLVM IR (-O0):
%struct.graph_node = type { i32 }
define i32 @route_exists(%struct.graph_node* %0, %struct.graph_node* %1) {
%3 = alloca %struct.graph_node*
%4 = alloca %struct.graph_node*
store %struct.graph_node* %0, %struct.graph_node** %3
store %struct.graph_node* %1, %struct.graph_node** %4
%5 = call i32 (...) @prepare_visit()
%6 = load %struct.graph_node*, %struct.graph_node** %3
%7 = load %struct.graph_node*, %struct.graph_node** %4
%8 = call i32 @dfs(%struct.graph_node* %6, %struct.graph_node* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.graph_node = type { i32 }
define i32 @route_exists(%struct.graph_node* %0, %struct.graph_node* %1) {
%3 = tail call i32 (...) @prepare_visit()
%4 = tail call i32 @dfs(%struct.graph_node* %0, %struct.graph_node* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ realtimize();
int /*<<< orphan*/ unrealtime();
void rt(int on) {
  if (on)
    realtimize();
  else
    unrealtime();
}


x86 assembly (clang, -O0):
<rt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <rt+0x21>
mov    $0x0,%al
call   1030 <realtimize@plt>
jmp    1148 <rt+0x28>
mov    $0x0,%al
call   1040 <unrealtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt>:
xor    %eax,%eax
test   %edi,%edi
je     112b <rt+0xb>
jmp    1030 <realtimize@plt>
jmp    1040 <unrealtime@plt>

LLVM IR (-O0):
define void @rt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @realtimize()
br label %9
7: ; preds = %1
%8 = call i32 (...) @unrealtime()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @rt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @realtimize()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @unrealtime()
br label %7
7: ; preds = %5, %3
ret void
}
Jprintf(s, a, b, c, d) char *s;
long a, b, c, d;
{
  char buf[90];
  sprintf(buf, s, a, b, c, d);
  Jputstr(buf);
}


x86 assembly (clang, -O0):
<Jprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1030 <Jputstr@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jprintf>:
push   %rbx
sub    $0x60,%rsp
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <Jputstr@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Jprintf(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca [90 x i8]
store i8* %0, i8** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
%13 = getelementptr inbounds [90 x i8], [90 x i8]* %12, i64 0, i64 0
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* %14, i64 %15, i64 %16, i64 %17, i64 %18)
%20 = getelementptr inbounds [90 x i8], [90 x i8]* %12, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @Jputstr to i32 (i8*, ...)*)(i8* %20)
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @Jprintf(i8* nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca [90 x i8]
%7 = getelementptr inbounds [90 x i8], [90 x i8]* %6, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) %0, i64 %1, i64 %2, i64 %3, i64 %4)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @Jputstr to i32 (i8*, ...)*)(i8* %7)
ret i32 undef
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ispeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t cfgetispeed(const struct termios *t) { return t->c_ispeed; }


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_2Auint32_mem(unsigned int *val) {
  return ((*val) & (0x2A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Auint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 42
%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_2Auint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 42
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void err(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
unsigned short I2C1_Rd(int /*<<< orphan*/);
int /*<<< orphan*/ I2C1_Repeated_Start();
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(int);
unsigned short read_ds1307(unsigned short address) {
  unsigned short r_data;
  I2C1_Start();
  I2C1_Wr(0xD0);
  I2C1_Wr(address);
  I2C1_Repeated_Start();
  I2C1_Wr(0xD1);
  r_data = I2C1_Rd(0);
  I2C1_Stop();
  return (r_data);
}


x86 assembly (clang, -O0):
<read_ds1307>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
movzwl -0x2(%rbp),%edi
call   1050 <I2C1_Wr@plt>
mov    $0x0,%al
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <I2C1_Stop@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ds1307>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
mov    %ebx,%edi
call   1050 <I2C1_Wr@plt>
xor    %eax,%eax
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <I2C1_Stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @read_ds1307(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = call i32 (...) @I2C1_Start()
%5 = call i32 @I2C1_Wr(i32 208)
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = call i32 @I2C1_Wr(i32 %7)
%9 = call i32 (...) @I2C1_Repeated_Start()
%10 = call i32 @I2C1_Wr(i32 209)
%11 = call zeroext i16 @I2C1_Rd(i32 0)
store i16 %11, i16* %3
%12 = call i32 (...) @I2C1_Stop()
%13 = load i16, i16* %3
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @read_ds1307(i16 zeroext %0) {
%2 = tail call i32 (...) @I2C1_Start()
%3 = tail call i32 @I2C1_Wr(i32 208)
%4 = zext i16 %0 to i32
%5 = tail call i32 @I2C1_Wr(i32 %4)
%6 = tail call i32 (...) @I2C1_Repeated_Start()
%7 = tail call i32 @I2C1_Wr(i32 209)
%8 = tail call zeroext i16 @I2C1_Rd(i32 0)
%9 = tail call i32 (...) @I2C1_Stop()
ret i16 %8
}
void Interp5(unsigned char *pc, int c1, int c2) {
  *((int *)pc) = (c1 + c2) >> 1;
}


x86 assembly (clang, -O0):
<Interp5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp5>:
add    %edx,%esi
sar    %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @Interp5(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 i32, i32* %5
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = ashr i32 %9, 1
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @Interp5(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = ashr i32 %4, 1
%6 = bitcast i8* %0 to i32*
store i32 %5, i32* %6
ret void
}
int gca_search_long(const void *aa, void *bb) {
  const long a = *(const long *)aa;
  const long b = *(long *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


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

x86 assembly (clang, -O2):
<gca_search_long>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_search_long(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_search_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int Limit(int val, int max, int min) {
  if (val > max)
    val = max;
  else if (val < min)
    val = min;
  return val;
}


x86 assembly (clang, -O0):
<Limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <Limit+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <Limit+0x3b>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1136 <Limit+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <Limit+0x3b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Limit>:
mov    %edx,%eax
cmp    %edx,%edi
cmovge %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Limit(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int get_permissions_rtc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_permissions_rtc() {
ret i32 0
}