xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fault(char *, int /*<<< orphan*/);
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void noblock(int fd) {
  int on = 1;
  if (ioctl(fd, FIONBIO, &on) < 0)
    fault("ioctl: FIONBIO: %s\n", strerror(errno));
}


x86 assembly (clang, -O0):
<noblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    117d <noblock+0x4d>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1040 <fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noblock>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
js     1153 <noblock+0x23>
pop    %rax
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1040 <fault@plt>
pop    %rax
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
@.str = [20 x i8] c"ioctl: FIONBIO: %s\0A\00"
@errno = global i32 0
define void @noblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i64 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @fault(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@FIONBIO = global i32 0
@.str = [20 x i8] c"ioctl: FIONBIO: %s\0A\00"
@errno = global i32 0
define void @noblock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @FIONBIO
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @fault(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}
void glVertexAttrib3fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttrib3fv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_buffer();
int /*<<< orphan*/ system(int /*<<< orphan*/);
void do_shell() { system(fill_buffer()); }


x86 assembly (clang, -O0):
<do_shell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fill_buffer@plt>
mov    %eax,%edi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_shell>:
push   %rax
xor    %eax,%eax
call   1030 <fill_buffer@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
define void @do_shell() {
%1 = call i32 (...) @fill_buffer()
%2 = call i32 @system(i32 %1)
ret void
}

LLVM IR (-O2):
define void @do_shell() {
%1 = tail call i32 (...) @fill_buffer()
%2 = tail call i32 @system(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char name[40];
  float cash;
  scanf("%s", &name);
  scanf("%f", &cash);
  printf("The %s family just may be $%.2f dollars richer.\n", name, cash);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0x34(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
movss  -0x34(%rbp),%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [49 x i8] c"The %s family just may be $%.2f dollars richer.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [40 x i8]* %2)
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* %6, float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [49 x i8] c"The %s family just may be $%.2f dollars richer.\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca float
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [40 x i8]* %1)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* %3, float %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ write(int, char *, int);
void write_message(char *buffer, int fd) {
  if (write(fd, buffer, 256) < 0) {
    exit(1);
  }
  memset(buffer, 0, 256);
}


x86 assembly (clang, -O0):
<write_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x100,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1164 <write_message+0x34>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_message>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1030 <write@plt>
test   %rax,%rax
js     1158 <write_message+0x28>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
pop    %rbx
jmp    1040 <memset@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @write_message(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 = load i8*, i8** %3
%7 = call i64 @write(i32 %5, i8* %6, i32 256)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @memset(i8* %12, i32 0, i32 256)
ret void
}

LLVM IR (-O2):
define void @write_message(i8* %0, i32 %1) {
%3 = tail call i64 @write(i32 %1, i8* %0, i32 256)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = tail call i32 @memset(i8* %0, i32 0, i32 256)
ret void
}
void Vector_Scale(float vectorOut[3], float vectorIn[3], float scale2) {
  int c;
  for (c = 0; c < 3; c++) {
    vectorOut[c] = vectorIn[c] * scale2;
  }
}


x86 assembly (clang, -O0):
<Vector_Scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    114f <Vector_Scale+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <Vector_Scale+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Scale>:
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @Vector_Scale(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoQuestion(void) { InlineWords(2, 7, 6); }


x86 assembly (clang, -O0):
<DoQuestion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x7,%esi
mov    $0x6,%edx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoQuestion>:
mov    $0x2,%edi
mov    $0x7,%esi
mov    $0x6,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoQuestion() {
%1 = call i32 @InlineWords(i32 2, i32 7, i32 6)
ret void
}

LLVM IR (-O2):
define void @DoQuestion() {
%1 = tail call i32 @InlineWords(i32 2, i32 7, i32 6)
ret void
}
int solib_wrapper(int (*function)(int)) { return (*function)(100); }


x86 assembly (clang, -O0):
<solib_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solib_wrapper>:
mov    %rdi,%rax
mov    $0x64,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @solib_wrapper(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 100)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ escbatch(char *);
char *test_dcs() {
  escbatch("\033P123456789\033\\");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"\1BP123456789\1B\\\00"
define i8* @test_dcs() {
%1 = call i32 @escbatch(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"\1BP123456789\1B\\\00"
define noalias i8* @test_dcs() {
%1 = tail call i32 @escbatch(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int unlink(char const *);
int t_unlink(const char *path) {
  int rc;
  rc = unlink(path);
  if (rc)
    fprintf(stderr, "unlink(%s) error: %s\n", path, strerror(errno));
  return rc;
}


x86 assembly (clang, -O0):
<t_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     118a <t_unlink+0x5a>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_unlink>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <unlink@plt>
mov    %eax,%ebx
test   %eax,%eax
je     116d <t_unlink+0x3d>
mov    0x2e97(%rip),%rax
mov    (%rax),%ebp
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea0(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"unlink(%s) error: %s\0A\00"
@errno = global i32 0
define i32 @t_unlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @unlink(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
br label %14
14: ; preds = %8, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"unlink(%s) error: %s\0A\00"
@errno = global i32 0
define i32 @t_unlink(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
br label %9
9: ; preds = %4, %1
ret i32 %2
}
int fn_35(int v) {
  int res = 28;
  if (v == 2) {
    res = 27;
  } else {
    res = 18;
  }
  return res;
}


x86 assembly (clang, -O0):
<fn_35>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1c,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1124 <fn_35+0x24>
movl   $0x1b,-0x8(%rbp)
jmp    112b <fn_35+0x2b>
movl   $0x12,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_35>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
lea    (%rax,%rax,8),%eax
add    $0x12,%eax
ret

LLVM IR (-O0):
define i32 @fn_35(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 28, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 27, i32* %3
br label %8
7: ; preds = %1
store i32 18, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @fn_35(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 27, i32 18
ret i32 %3
}
double seconds_to_milliseconds(double seconds) { return seconds * 1000; }


x86 assembly (clang, -O0):
<seconds_to_milliseconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @seconds_to_milliseconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @seconds_to_milliseconds(double %0) {
%2 = fmul double %0, 1.000000e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ closeConnections();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sigINT_handler(int signum) {
  syslog(LOG_INFO, "Caught SIGINT. Exiting...");
  closeConnections();
  exit(0);
}


x86 assembly (clang, -O0):
<sigINT_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigINT_handler>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Caught SIGINT. Exiting...\00"
define void @sigINT_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @closeConnections()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Caught SIGINT. Exiting...\00"
define void @sigINT_handler(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @closeConnections()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char *a = "-123";
  char *b = "482";
  int ia = atoi(a);
  int ib = atoi(b);
  printf("%d %d\n", ia, ib);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"-123\00"
@.str.1 = [4 x i8] c"482\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 -123, i32 482)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parallel(int, int);
int main() {
  parallel(1, 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <parallel@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parallel(i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ odwracaj(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int napis;
  printf("Podaj cyfre: ");
  scanf("%d", &napis);
  printf("Odwrocona cyfra: ", odwracaj(napis));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <odwracaj@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <odwracaj@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Podaj cyfre: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Odwrocona cyfra: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @odwracaj(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Podaj cyfre: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Odwrocona cyfra: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @odwracaj(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ WStoSPI(int /*<<< orphan*/ *, int /*<<< orphan*/);
void WSSetLEDGreen(uint8_t *pi8SPILEDs, uint16_t ui16LED, uint8_t ui8Color) {
  WStoSPI(pi8SPILEDs + (3 * 8 * ui16LED) + (8 * 0), ui8Color);
}


x86 assembly (clang, -O0):
<WSSetLEDGreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0x18,-0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
call   1030 <WStoSPI@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WSSetLEDGreen>:
shl    $0x3,%esi
lea    (%rsi,%rsi,2),%eax
cltq
lea    (%rdi,%rax,4),%rdi
mov    %edx,%esi
jmp    1030 <WStoSPI@plt>

LLVM IR (-O0):
define void @WSSetLEDGreen(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 = mul nsw i32 24, %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %6
%14 = call i32 @WStoSPI(i32* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @WSSetLEDGreen(i32* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 24
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = tail call i32 @WStoSPI(i32* %6, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void return_nothing() {
  print(":)\n");
  return;
  print("X(\n");
  return;
}


x86 assembly (clang, -O0):
<return_nothing>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_nothing>:
lea    0xee9(%rip),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c":)\0A\00"
define void @return_nothing() {
%1 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c":)\0A\00"
define void @return_nothing() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_epel_h64_12_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @TOSH_wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t sz) {
  ptr = realloc(ptr, sz);
  if (!ptr)
    die("xrealloc failed\n");
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"xrealloc failed\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [17 x i8] c"xrealloc failed\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int main() {
  execl("gdb.multi/multi-arch-exec-hello", "gdb.multi/multi-arch-exec-hello",
        (char *)NULL);
  perror("execl failed");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1050 <execl@plt>
lea    0xec7(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1050 <execl@plt>
lea    0xed7(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"gdb.multi/multi-arch-exec-hello\00"
@.str.1 = [13 x i8] c"execl failed\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* null)
%3 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"gdb.multi/multi-arch-exec-hello\00"
@.str.1 = [13 x i8] c"execl failed\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t getpid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getpid() {
ret i32 0
}
int stringlength1(char *s) {
  int n;
  for (n = 0; *s++ != '\0'; n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<stringlength1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <stringlength1+0x3d>
jmp    112f <stringlength1+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringlength1+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlength1>:
cmpb   $0x0,(%rdi)
je     111c <stringlength1+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringlength1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stringlength1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *);
my_error(char *file, int line, int severity, char *texte) {
  printf("%s:%d # %s\n", file, line, texte);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"%s:%d # %s\0A\00"
define i32 @my_error(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s:%d # %s\0A\00"
define i32 @my_error(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %3)
ret i32 0
}
int count_bits(unsigned int a) {
  a = (a & 0x55555555) + ((a >> 1) & 0x55555555);
  a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
  a = (a & 0x0f0f0f0f) + ((a >> 4) & 0x0f0f0f0f);
  a = (a & 0x00ff00ff) + ((a >> 8) & 0x00ff00ff);
  a = (a & 0x0000ffff) + ((a >> 16) & 0x0000ffff);
  return a;
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @count_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 252645135
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = add i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = and i32 %21, 16711935
%23 = load i32, i32* %2
%24 = lshr i32 %23, 8
%25 = and i32 %24, 16711935
%26 = add i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 65535
%29 = load i32, i32* %2
%30 = lshr i32 %29, 16
%31 = and i32 %30, 65535
%32 = add i32 %28, %31
store i32 %32, i32* %2
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @count_bits(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
void swap(int *__restrict__ left, int *__restrict__ right) {
  int temp = *left;
  *left = *right;
  *right = temp;
}


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

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

LLVM IR (-O0):
define void @swap(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* noalias nocapture %0, i32* noalias nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmp(int, int);
void main() {
  cmp(15, 20);
  cmp(42, 30);
  cmp(57, 57);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
mov    $0x14,%esi
call   1030 <cmp@plt>
mov    $0x2a,%edi
mov    $0x1e,%esi
call   1030 <cmp@plt>
mov    $0x39,%esi
mov    %esi,%edi
call   1030 <cmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
mov    $0x14,%esi
call   1030 <cmp@plt>
mov    $0x2a,%edi
mov    $0x1e,%esi
call   1030 <cmp@plt>
mov    $0x39,%edi
mov    $0x39,%esi
pop    %rax
jmp    1030 <cmp@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @cmp(i32 15, i32 20)
%2 = call i32 @cmp(i32 42, i32 30)
%3 = call i32 @cmp(i32 57, i32 57)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @cmp(i32 15, i32 20)
%2 = tail call i32 @cmp(i32 42, i32 30)
%3 = tail call i32 @cmp(i32 57, i32 57)
ret void
}
/* Variables and functions */
int def_prog_mode();
int wrap_def_prog_mode(void) { return def_prog_mode(); }


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

x86 assembly (clang, -O2):
<wrap_def_prog_mode>:
xor    %eax,%eax
jmp    1030 <def_prog_mode@plt>

LLVM IR (-O0):
define i32 @wrap_def_prog_mode() {
%1 = call i32 (...) @def_prog_mode()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_def_prog_mode() {
%1 = tail call i32 (...) @def_prog_mode()
ret i32 %1
}
double abs_scale_data(short signed int data, double gain) {
  double d_result = (double)data * gain;
  if (d_result < 0.0)
    d_result = -d_result;
  return d_result;
}


x86 assembly (clang, -O0):
<abs_scale_data>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movsd  %xmm0,-0x10(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1151 <abs_scale_data+0x51>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_scale_data>:
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
movapd 0xef0(%rip),%xmm2
xorpd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @abs_scale_data(i16 signext %0, double %1) {
%3 = alloca i16
%4 = alloca double
%5 = alloca double
store i16 %0, i16* %3
store double %1, double* %4
%6 = load i16, i16* %3
%7 = sitofp i16 %6 to double
%8 = load double, double* %4
%9 = fmul double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %5
%14 = fneg double %13
store double %14, double* %5
br label %15
15: ; preds = %12, %2
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @abs_scale_data(i16 signext %0, double %1) {
%3 = sitofp i16 %0 to double
%4 = fmul double %3, %1
%5 = fcmp olt double %4, 0.000000e+00
%6 = fneg double %4
%7 = select i1 %5, double %6, double %4
ret double %7
}
/* Type definitions */
struct TLVs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_value(struct TLVs *, float *);
float get_next_float32(struct TLVs *params) {
  float val = 0;
  get_value(params, &val);
  return val;
}


x86 assembly (clang, -O0):
<get_next_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <get_value@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_float32>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <get_value@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.TLVs = type { i32 }
define float @get_next_float32(%struct.TLVs* %0) {
%2 = alloca %struct.TLVs*
%3 = alloca float
store %struct.TLVs* %0, %struct.TLVs** %2
store float 0.000000e+00, float* %3
%4 = load %struct.TLVs*, %struct.TLVs** %2
%5 = call i32 @get_value(%struct.TLVs* %4, float* %3)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
%struct.TLVs = type { i32 }
define float @get_next_float32(%struct.TLVs* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%4 = call i32 @get_value(%struct.TLVs* %0, float* %2)
%5 = load float, float* %2
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_setup;
long syscall(int /*<<< orphan*/, unsigned int, int /*<<< orphan*/ *);
long io_setup(unsigned nr_reqs, aio_context_t *ctx) {
  return syscall(__NR_io_setup, nr_reqs, ctx);
}


x86 assembly (clang, -O0):
<io_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_setup>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_io_setup = global i32 0
define i64 @io_setup(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* @__NR_io_setup
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = call i64 @syscall(i32 %5, i32 %6, i32* %7)
ret i64 %8
}

LLVM IR (-O2):
@__NR_io_setup = global i32 0
define i64 @io_setup(i32 %0, i32* %1) {
%3 = load i32, i32* @__NR_io_setup
%4 = tail call i64 @syscall(i32 %3, i32 %0, i32* %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc(size_t size) {
  void *data = malloc(size);
  if (!data) {
    fprintf(stderr, "error: out of memory\n");
    exit(EXIT_FAILURE);
  }
  return data;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <safe_malloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
void clock(void) {}


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

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

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

LLVM IR (-O2):
define void @clock() {
ret void
}
/* Variables and functions */
char *get_option_value(int, char **, char *);
char *set_char_option_value(int argc, char **argv, char *option_id,
                            char **optvariable) {
  char *chval = get_option_value(argc, argv, option_id);
  if (chval != NULL)
    *optvariable = chval;
  return chval;
}


x86 assembly (clang, -O0):
<set_char_option_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <get_option_value@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1151 <set_char_option_value+0x41>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_char_option_value>:
push   %rbx
mov    %rcx,%rbx
call   1030 <get_option_value@plt>
test   %rax,%rax
je     1121 <set_char_option_value+0x11>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @set_char_option_value(i32 %0, i8** %1, i8* %2, i8** nocapture writeonly %3) {
%5 = tail call i8* @get_option_value(i32 %0, i8** %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* %5, i8** %3
br label %8
8: ; preds = %7, %4
ret i8* %5
}
void store64_reverse_3(long long *p, long long x, int i) {
  p[i] = __builtin_bswap64(x);
}


x86 assembly (clang, -O0):
<store64_reverse_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
bswap  %rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64_reverse_3>:
bswap  %rsi
movslq %edx,%rax
mov    %rsi,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @store64_reverse_3(i64* %0, i64 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i32
store i64* %0, i64** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = call i64 @llvm.bswap.i64(i64 %7)
%9 = load i64*, i64** %4
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %9, i64 %11
store i64 %8, i64* %12
ret void
}

LLVM IR (-O2):
define void @store64_reverse_3(i64* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = tail call i64 @llvm.bswap.i64(i64 %1)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 %5
store i64 %4, i64* %6
ret void
}