xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int *malloc(int);
int *inttoptr(int i) {
  int *ptr = malloc(sizeof(int));
  assert(ptr);
  *ptr = i;
  return ptr;
}


x86 assembly (clang, -O0):
<inttoptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttoptr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %ebp,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @inttoptr(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32 @assert(i32* %2)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ c1(int);
int main(int argc, char **argv) {
  if (argc != 2) {
    return -1;
  }
  int i = atoi(argv[1]);
  c1(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <c1@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jne    1141 <main+0x21>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <c1@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @c1(i32 %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %10
}
int _read(int file, char *ptr, int len) { return len; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
int boaDeleteAccessLimit(char *url) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @boaDeleteAccessLimit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void platformProgress(int perc, char *speed) {
  printf("(%d) %s\n", perc, speed);
}


x86 assembly (clang, -O0):
<platformProgress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platformProgress>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"(%d) %s\0A\00"
define void @platformProgress(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
set2(buf, off, val) char *buf;
int val;
{
  buf[off + 0] = val >> 8;
  buf[off + 1] = val;
}


x86 assembly (clang, -O0):
<set2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set2>:
movslq %esi,%rax
rol    $0x8,%dx
mov    %dx,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define i32 @set2(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 8
%5 = trunc i32 %4 to i8
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %5, i8* %7
%8 = trunc i32 %2 to i8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %8, i8* %11
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ libc_exit(int);
void _exit(int status) { libc_exit(status); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <libc_exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <libc_exit@plt>

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

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @libc_exit(i32 %0)
unreachable
}
void SeError(msg) char *msg;
{
  char buf[256];
  sprintf(buf, "\r>> Error: %s.", msg);
  show(buf);
}


x86 assembly (clang, -O0):
<SeError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1030 <show@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeError>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <show@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0D>> Error: %s.\00"
define void @SeError(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @show to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0D>> Error: %s.\00"
define void @SeError(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @show to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_epi8(char);
__m128i test_mm_set1_epi8(char A) { return _mm_set1_epi8(A); }


x86 assembly (clang, -O0):
<test_mm_set1_epi8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_mm_set1_epi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_set1_epi8>:
jmp    1030 <_mm_set1_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_set1_epi8(i8 signext %0) {
%2 = tail call i32 @_mm_set1_epi8(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("hello from process ID %d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"hello from process ID %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"hello from process ID %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct conf_sec {
  int dummy;
};

/* Variables and functions */
size_t fetch_section_count(struct conf_sec **s) {
  size_t ret = 0;
  while (s[ret])
    ++ret;
  return ret;
}


x86 assembly (clang, -O0):
<fetch_section_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <fetch_section_count+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fetch_section_count+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_section_count>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <fetch_section_count+0x10>
ret

LLVM IR (-O0):
%struct.conf_sec = type { i32 }
define i64 @fetch_section_count(%struct.conf_sec** %0) {
%2 = alloca %struct.conf_sec**
%3 = alloca i64
store %struct.conf_sec** %0, %struct.conf_sec*** %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load %struct.conf_sec**, %struct.conf_sec*** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds %struct.conf_sec*, %struct.conf_sec** %5, i64 %6
%8 = load %struct.conf_sec*, %struct.conf_sec** %7
%9 = icmp ne %struct.conf_sec* %8, null
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.conf_sec = type { i32 }
define i64 @fetch_section_count(%struct.conf_sec** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds %struct.conf_sec*, %struct.conf_sec** %0, i64 %3
%5 = load %struct.conf_sec*, %struct.conf_sec** %4
%6 = icmp eq %struct.conf_sec* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int isqr(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @isqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
struct iio_channel_info {
  int dummy;
};

/* Variables and functions */
int enable_se(char const *, struct iio_channel_info **, int *, char *, int);
int enable_quaternion_se(const char *device_dir,
                         struct iio_channel_info **ci_array, int *counter,
                         int en) {
  return enable_se(device_dir, ci_array, counter, "quaternion", en);
}


x86 assembly (clang, -O0):
<enable_quaternion_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
lea    0xec2(%rip),%rcx
call   1030 <enable_se@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_quaternion_se>:
mov    %ecx,%r8d
lea    0xee6(%rip),%rcx
jmp    1030 <enable_se@plt>

LLVM IR (-O0):
%struct.iio_channel_info = type { i32 }
@.str = [11 x i8] c"quaternion\00"
define i32 @enable_quaternion_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.iio_channel_info**
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store %struct.iio_channel_info** %1, %struct.iio_channel_info*** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load %struct.iio_channel_info**, %struct.iio_channel_info*** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @enable_se(i8* %9, %struct.iio_channel_info** %10, i32* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.iio_channel_info = type { i32 }
@.str = [11 x i8] c"quaternion\00"
define i32 @enable_quaternion_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i32 %3) {
%5 = tail call i32 @enable_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
void send_message(int sock, char to[], char message[]) {
  char message_packet[512];
  sprintf(message_packet, "PRIVMSG %s :%s\r\n", to, message);
  send(sock, message_packet, strlen(message_packet), 0);
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea4(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x22c(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x228(%rbp)
lea    -0x220(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x22c(%rbp),%edi
mov    -0x228(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xeb8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"PRIVMSG %s :%s\0D\0A\00"
define void @send_message(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [512 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32, i32* %4
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @send(i32 %12, i8* %13, i32 %15, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"PRIVMSG %s :%s\0D\0A\00"
define void @send_message(i32 %0, i8* %1, i8* %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i32 @strlen(i8* %5)
%8 = call i32 @send(i32 %0, i8* %5, i32 %7, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ pow(float, int);
float stbir__linear_to_srgb(float f) {
  if (f <= 0.0031308f)
    return f * 12.92f;
  else
    return 1.055f * (float)pow(f, 1 / 2.4f) - 0.055f;
}


x86 assembly (clang, -O0):
<stbir__linear_to_srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1146 <stbir__linear_to_srgb+0x36>
movss  0xed5(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1174 <stbir__linear_to_srgb+0x64>
movss  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
movss  0xea5(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe9d(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__linear_to_srgb>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113f <stbir__linear_to_srgb+0x2f>
xor    %edi,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mulss  0xed3(%rip),%xmm0
addss  0xecf(%rip),%xmm0
pop    %rax
ret
mulss  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stbir__linear_to_srgb(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0x3F69A5C380000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float %7, 0x4029D70A40000000
store float %8, float* %2
br label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = call i64 @pow(float %10, i32 0)
%12 = sitofp i64 %11 to float
%13 = call float @llvm.fmuladd.f32(float 0x3FF0E147A0000000, float %12, float 0xBFAC28F5C0000000)
store float %13, float* %2
br label %14
14: ; preds = %9, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @stbir__linear_to_srgb(float %0) {
%2 = fcmp ugt float %0, 0x3F69A5C380000000
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul float %0, 0x4029D70A40000000
br label %9
5: ; preds = %1
%6 = tail call i64 @pow(float %0, i32 0)
%7 = sitofp i64 %6 to float
%8 = tail call float @llvm.fmuladd.f32(float %7, float 0x3FF0E147A0000000, float 0xBFAC28F5C0000000)
br label %9
9: ; preds = %5, %3
%10 = phi float [ %4, %3 ], [ %8, %5 ]
ret float %10
}
/* Variables and functions */
int SIGUSR1;
int SIGUSR2;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void manager(int sig) {
  if (sig == SIGUSR1) {
    fprintf(stdout, "Father Wake-up\n");
  } else if (sig == SIGUSR2) {
    fprintf(stdout, "Child Wake-up\n");
  }
}


x86 assembly (clang, -O0):
<manager>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1147 <manager+0x37>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1173 <manager+0x63>
mov    -0x4(%rbp),%eax
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%eax
jne    116e <manager+0x5e>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1173 <manager+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manager>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1124 <manager+0x14>
lea    0xede(%rip),%rsi
jmp    1136 <manager+0x26>
mov    0x2ead(%rip),%rax
cmp    %edi,(%rax)
jne    1144 <manager+0x34>
lea    0xeda(%rip),%rsi
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@stdout = global i32 0
@.str = [16 x i8] c"Father Wake-up\0A\00"
@SIGUSR2 = global i32 0
@.str.1 = [15 x i8] c"Child Wake-up\0A\00"
define void @manager(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @SIGUSR2
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* @stdout
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %9
br label %17
17: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@stdout = global i32 0
@.str = [16 x i8] c"Father Wake-up\0A\00"
@SIGUSR2 = global i32 0
@.str.1 = [15 x i8] c"Child Wake-up\0A\00"
define void @manager(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @SIGUSR2
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %11
7: ; preds = %4, %1
%8 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %4 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* %8)
br label %11
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_write;
long syscall3(int /*<<< orphan*/, int, long, long);
long write(int fd, void *p, long n) {
  return syscall3(SYS_write, fd, (long)p, n);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
@SYS_write = global i32 0
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @SYS_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %6
%12 = call i64 @syscall3(i32 %7, i32 %8, i64 %10, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
@SYS_write = global i32 0
define i64 @write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @SYS_write
%5 = ptrtoint i8* %1 to i64
%6 = tail call i64 @syscall3(i32 %4, i32 %0, i64 %5, i64 %2)
ret i64 %6
}
unsigned char rx_async(unsigned char p) { return p & 512; }


x86 assembly (clang, -O0):
<rx_async>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x200,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @rx_async(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 512
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @rx_async(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ pagetable_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stats_init();
int /*<<< orphan*/ util_test();
void test() {
  printf("Running vmtrace tests...\n");
  util_test();
  stats_init();
  pagetable_test();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <util_test@plt>
mov    $0x0,%al
call   1030 <stats_init@plt>
mov    $0x0,%al
call   1040 <pagetable_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <util_test@plt>
xor    %eax,%eax
call   1030 <stats_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pagetable_test@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Running vmtrace tests...\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @util_test()
%3 = call i32 (...) @stats_init()
%4 = call i32 (...) @pagetable_test()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Running vmtrace tests...\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @util_test()
%3 = tail call i32 (...) @stats_init()
%4 = tail call i32 (...) @pagetable_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eq(int, int);
int /*<<< orphan*/ sub3(int const *);
void testTortureExecute(void) {
  int i;
  for (i = 0; i < 4; i++) {
    const int j = i;
    int k;
    sub3(&j);
    k = j;
    eq(k, k);
  }
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1167 <testTortureExecute+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <sub3@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <eq@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <testTortureExecute+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1040 <eq@plt>
movl   $0x1,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1040 <eq@plt>
movl   $0x2,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1040 <eq@plt>
movl   $0x3,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1040 <eq@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %1
store i32 %8, i32* %2
%9 = call i32 @sub3(i32* %2)
%10 = load i32, i32* %2
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @eq(i32 %11, i32 %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @sub3(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @eq(i32 %4, i32 %4)
store i32 1, i32* %1
%6 = call i32 @sub3(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @eq(i32 %7, i32 %7)
store i32 2, i32* %1
%9 = call i32 @sub3(i32* %1)
%10 = load i32, i32* %1
%11 = call i32 @eq(i32 %10, i32 %10)
store i32 3, i32* %1
%12 = call i32 @sub3(i32* %1)
%13 = load i32, i32* %1
%14 = call i32 @eq(i32 %13, i32 %13)
ret void
}
/* Type definitions */
struct passwd {
  scalar_t__ pw_uid;
};

/* Variables and functions */
scalar_t__ errno;
struct passwd *getpwnam(char *);
int userid(char *name) {
  struct passwd *pwd;
  errno = 0;
  pwd = getpwnam(name);
  if (pwd == NULL || errno)
    return -1;
  return (int)pwd->pw_uid;
}


x86 assembly (clang, -O0):
<userid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <userid+0x43>
mov    0x2e97(%rip),%rax
cmpq   $0x0,(%rax)
je     115f <userid+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <userid+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userid>:
push   %rbx
mov    0x2ec8(%rip),%rbx
movq   $0x0,(%rbx)
call   1030 <getpwnam@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1139 <userid+0x29>
cmpq   $0x0,(%rbx)
jne    1139 <userid+0x29>
mov    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i64 }
@errno = global i64 0
define i32 @userid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.passwd*
store i8* %0, i8** %3
store i64 0, i64* @errno
%5 = load i8*, i8** %3
%6 = call %struct.passwd* @getpwnam(i8* %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp eq %struct.passwd* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 -1, i32* %2
br label %18
13: ; preds = %9
%14 = load %struct.passwd*, %struct.passwd** %4
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.passwd = type { i64 }
@errno = global i64 0
define i32 @userid(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call %struct.passwd* @getpwnam(i8* %0)
%3 = icmp eq %struct.passwd* %2, null
%4 = load i64, i64* @errno
%5 = icmp ne i64 %4, 0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ -1, %1 ]
ret i32 %12
}
/* Type definitions */
typedef int u_int8_t;
typedef int u_int16_t;

/* Variables and functions */
u_int16_t decode_16(u_int8_t *cp) { return cp[0] << 8 | cp[1]; }


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

x86 assembly (clang, -O2):
<decode_16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @decode_16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @decode_16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, double);
char *csv_float_to_string(double num, char *buff, size_t size) {
  snprintf(buff, size, "%.11g", num);
  return buff;
}


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

x86 assembly (clang, -O2):
<csv_float_to_string>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.11g\00"
define i8* @csv_float_to_string(double %0, i8* returned %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_mul_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_mul_ss(__m128 A, __m128 B) { return _mm_mul_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_mul_ss>:
jmp    1030 <_mm_mul_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_mul_ss(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_mul_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_mul_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *const, char *);
scalar_t__ isatty(int /*<<< orphan*/);
void fclearline(FILE *const f) {
  if (isatty(fileno(f)))
    fprintf(f, "\r\x1b[2K");
}


x86 assembly (clang, -O0):
<fclearline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     1166 <fclearline+0x36>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclearline>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
je     115f <fclearline+0x2f>
lea    0xeb4(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1050 <fwrite@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\0D\1B[2K\00"
define void @fclearline(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = call i64 @isatty(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0D\1B[2K\00"
define void @fclearline(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i64 @isatty(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %0)
br label %7
7: ; preds = %5, %1
ret void
}
void FFTABLEIN(unsigned char *tab, int g, unsigned char *data) {
  *(((int *)tab) + 2 * g) = *((int *)data);
  *(((int *)tab) + 2 * g + 1) = *(((int *)data) + 1);
}


x86 assembly (clang, -O0):
<FFTABLEIN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,0x4(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFTABLEIN>:
mov    (%rdx),%eax
add    %esi,%esi
movslq %esi,%rcx
mov    %eax,(%rdi,%rcx,4)
mov    0x4(%rdx),%eax
mov    %eax,0x4(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @FFTABLEIN(i8* nocapture writeonly %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %0 to i32*
%7 = shl nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32 %5, i32* %9
%10 = getelementptr inbounds i8, i8* %2, i64 4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %9, i64 1
store i32 %12, i32* %13
ret void
}
void limparLista() {}


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

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

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

LLVM IR (-O2):
define void @limparLista() {
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int hasNotEol(char *s) {
  char *p;
  return (p = strstr(s, "\\\n")) && !p[2];
}


x86 assembly (clang, -O0):
<hasNotEol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1152 <hasNotEol+0x42>
mov    -0x10(%rbp),%rax
cmpb   $0x0,0x2(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasNotEol>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1130 <hasNotEol+0x20>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x0,0x2(%rcx)
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\\\0A\00"
define i32 @hasNotEol(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = xor i1 %11, true
br label %13
13: ; preds = %7, %1
%14 = phi i1 [ false, %1 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\\0A\00"
define i32 @hasNotEol(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const, char const *const,
                          char const *const);
void enumerate_providers_fn(const char *const name, const char *const desc,
                            const char *const file, void *ud) {
  printf("%s: '%s' (%s)\n", name, desc, file);
}


x86 assembly (clang, -O0):
<enumerate_providers_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enumerate_providers_fn>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%s: '%s' (%s)\0A\00"
define void @enumerate_providers_fn(i8* %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
void really(void) {
  int i;
  char *p = malloc(10);
  __ESBMC_assume(p);
  for (i = 0; i < 1; i++)
    p[i] = 'z';
  free(p);
  p = malloc(10);
  __ESBMC_assume(p);
}


x86 assembly (clang, -O0):
<really>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    117a <really+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <really+0x26>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<really>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
movb   $0x7a,(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <__ESBMC_assume@plt>

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

LLVM IR (-O2):
define void @really() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @__ESBMC_assume(i8* %1)
store i8 122, i8* %1
%3 = tail call i32 @free(i8* %1)
%4 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%5 = tail call i32 @__ESBMC_assume(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
g() {
  struct {
    int a, b;
  } a = {2}, b = {};
  if (a.b || b.a || b.b)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1161 <g+0x41>
cmpl   $0x0,-0x18(%rbp)
jne    1161 <g+0x41>
cmpl   $0x0,-0x14(%rbp)
je     1168 <g+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
@__const.g.a = %struct.anon { i32 2, i32 0 }
define i32 @g() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca %struct.anon
%4 = bitcast %struct.anon* %2 to i8*
%5 = bitcast %struct.anon* %3 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %0
%10 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13, %9, %0
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %13
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
int test_imm_AFint64_highword_reg(long long val) {
  return ((val >> 32) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFint64_highword_reg(i64 %0) {
%2 = and i64 %0, 751619276800
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}