xunge/DecIR huggingface dataset:
void swap_pointers(char *(*x), char *(*y)) {
  char *tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap_pointers(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ rotr(int *, int *, int *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int a, b, c, counter;
  scanf("%d %d %d %d", &a, &b, &c, &counter);
  rotr(&a, &b, &c, counter);
  printf("%d %d %d", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x14(%rbp),%ecx
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <rotr@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%r8
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <scanf@plt>
mov    (%rsp),%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <rotr@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = call i32 @rotr(i32* %1, i32* %2, i32* %3, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void InputArray(int *array, int size) {
  srand(time(NULL));
  for (int i = 0; i < size; i++) {
    array[i] = rand() % 32768;
  }
}


x86 assembly (clang, -O0):
<InputArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118a <InputArray+0x5a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x8000,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <InputArray+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InputArray>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    1177 <InputArray+0x47>
mov    %ebp,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
lea    0x7fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff8000,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <InputArray+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @InputArray(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %9
8: ; preds = %9, %2
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 32768
%13 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %12, i32* %13
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
/* Variables and functions */
int /*<<< orphan*/ mu_assert(char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ trimwhitespace(char *, char *);
char *test_trimwhitespace3() {
  char str[] = "  dt";
  char out[40];
  trimwhitespace(out, str);
  mu_assert("3: after trim str != dt", strcmp(out, "dt") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<test_trimwhitespace3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <trimwhitespace@plt>
lea    -0x30(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe8b(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trimwhitespace3>:
push   %rbx
sub    $0x40,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74642020,0x8(%rsp)
74
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <trimwhitespace@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xe92(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_trimwhitespace3.str = [5 x i8] c" dt\00"
@.str = [24 x i8] c"3: after trim str != dt\00"
@.str.1 = [3 x i8] c"dt\00"
define i8* @test_trimwhitespace3() {
%1 = alloca [5 x i8]
%2 = alloca [40 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @trimwhitespace(i8* %4, i8* %5)
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i8* null
}

LLVM IR (-O2):
@__const.test_trimwhitespace3.str = [5 x i8] c" dt\00"
@.str = [24 x i8] c"3: after trim str != dt\00"
@.str.1 = [3 x i8] c"dt\00"
define noalias i8* @test_trimwhitespace3() {
%1 = alloca [5 x i8]
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @trimwhitespace(i8* %4, i8* %3)
%6 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ gmx_energy(int, char **);
int main(int argc, char *argv[]) {
  gmx_energy(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_energy(i32 %0, i8** %1)
ret i32 0
}
int test() {
  int int_size = sizeof(int);
  int char_size = sizeof(char);
  int ptr_size = sizeof(int *);
  int ary_size = sizeof(int[10]);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x28,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 4, i32* %1
store i32 1, i32* %2
store i32 8, i32* %3
store i32 40, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
/* Type definitions */
struct lb {
  int dummy;
};

/* Variables and functions */
int lb_add(struct lb *, int, int, int /*<<< orphan*/ *, int /*<<< orphan*/,
           int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/ *,
           void const *);
int lb_glue(struct lb *p, int width, const void *info) {
  return lb_add(p, 2, width, NULL, 0, NULL, 0, NULL, info);
}


x86 assembly (clang, -O0):
<lb_glue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    $0x2,%esi
xor    %ecx,%ecx
mov    %ecx,%r9d
xor    %r8d,%r8d
mov    %r9,%rcx
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <lb_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lb_glue>:
push   %rax
mov    %rdx,%rax
mov    %esi,%edx
sub    $0x8,%rsp
mov    $0x2,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   $0x0
push   $0x0
call   1030 <lb_add@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.lb = type { i32 }
define i32 @lb_glue(%struct.lb* %0, i32 %1, i8* %2) {
%4 = alloca %struct.lb*
%5 = alloca i32
%6 = alloca i8*
store %struct.lb* %0, %struct.lb** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.lb*, %struct.lb** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @lb_add(%struct.lb* %7, i32 2, i32 %8, i32* null, i32 0, i32* null, i32 0, i32* null, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.lb = type { i32 }
define i32 @lb_glue(%struct.lb* %0, i32 %1, i8* %2) {
%4 = tail call i32 @lb_add(%struct.lb* %0, i32 2, i32 %1, i32* null, i32 0, i32* null, i32 0, i32* null, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void mempcpy12() {
  char a[4] = {0};
  mempcpy(0, a, 0);
}


x86 assembly (clang, -O0):
<mempcpy12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
mov    %edx,%edi
call   1040 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy12>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <mempcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mempcpy12() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @mempcpy(i32 0, i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @mempcpy12() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @mempcpy(i32 0, i8* %2, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int htonl(int);
scalar_t__ write(int, int *, int);
void _client_putint(int fd, int n) {
  n = htonl(n);
  if (write(fd, &n, sizeof(n)) < 0)
    err(1, "write");
}


x86 assembly (clang, -O0):
<_client_putint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1175 <_client_putint+0x45>
mov    $0x1,%edi
lea    0xe90(%rip),%rsi
call   1050 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_client_putint>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1030 <write@plt>
test   %rax,%rax
js     115e <_client_putint+0x2e>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe9b(%rip),%rsi
mov    $0x1,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <err@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"write\00"
define void @_client_putint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = call i64 @write(i32 %7, i32* %4, i32 4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define void @_client_putint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = call i64 @write(i32 %0, i32* %3, i32 4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errorf(char *, size_t);
int /*<<< orphan*/ exit(int);
char *strndup(char const *, size_t);
char *safe_strndup(const char *s, size_t n) {
  char *result = strndup(s, n);
  if (result == NULL) {
    errorf("Failed to reallocate %i bytes.\n", n + 1);
    exit(127);
  }
  return result;
}


x86 assembly (clang, -O0):
<safe_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strndup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <safe_strndup+0x4a>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0xe95(%rip),%rdi
call   1040 <errorf@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strndup>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strndup@plt>
test   %rax,%rax
je     1140 <safe_strndup+0x10>
pop    %rbx
ret
add    $0x1,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <errorf@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Failed to reallocate %i bytes.\0A\00"
define i8* @safe_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @strndup(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i32 @errorf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 127)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [32 x i8] c"Failed to reallocate %i bytes.\0A\00"
define noalias i8* @safe_strndup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @strndup(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = add i64 %1, 1
%7 = tail call i32 @errorf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = tail call i32 @exit(i32 127)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: random [-er] [denominator]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: random [-er] [denominator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: random [-er] [denominator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_vec_compare(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<string_vec_compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_vec_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_vec_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int TestLibUsefulFunction() { return 42; }


x86 assembly (clang, -O0):
<TestLibUsefulFunction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestLibUsefulFunction>:
mov    $0x2a,%eax
ret

LLVM IR (-O0):
define i32 @TestLibUsefulFunction() {
ret i32 42
}

LLVM IR (-O2):
define i32 @TestLibUsefulFunction() {
ret i32 42
}
int main(void) {
  float f = 1.00;
  short int i = 100;
  long int l = 500L;
  double d = 15.00;
  f + i;
  l / d;
  i / l + f;
  l *i;
  f / 2;
  i / (d * f);
  l / (i * 2.0);
  l + i / (double)l;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xefc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movw   $0x64,-0x6(%rbp)
movq   $0x1f4,-0x10(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca i16
%3 = alloca i64
%4 = alloca double
store float 1.000000e+00, float* %1
store i16 100, i16* %2
store i64 500, i64* %3
store double 1.500000e+01, double* %4
%5 = load float, float* %1
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = sitofp i32 %7 to float
%9 = fadd float %5, %8
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = load double, double* %4
%13 = fdiv double %11, %12
%14 = load i16, i16* %2
%15 = sext i16 %14 to i64
%16 = load i64, i64* %3
%17 = sdiv i64 %15, %16
%18 = sitofp i64 %17 to float
%19 = load float, float* %1
%20 = fadd float %18, %19
%21 = load i64, i64* %3
%22 = load i16, i16* %2
%23 = sext i16 %22 to i64
%24 = mul nsw i64 %21, %23
%25 = load float, float* %1
%26 = fdiv float %25, 2.000000e+00
%27 = load i16, i16* %2
%28 = sext i16 %27 to i32
%29 = sitofp i32 %28 to double
%30 = load double, double* %4
%31 = load float, float* %1
%32 = fpext float %31 to double
%33 = fmul double %30, %32
%34 = fdiv double %29, %33
%35 = load i64, i64* %3
%36 = sitofp i64 %35 to double
%37 = load i16, i16* %2
%38 = sext i16 %37 to i32
%39 = sitofp i32 %38 to double
%40 = fmul double %39, 2.000000e+00
%41 = fdiv double %36, %40
%42 = load i64, i64* %3
%43 = sitofp i64 %42 to double
%44 = load i16, i16* %2
%45 = sext i16 %44 to i32
%46 = sitofp i32 %45 to double
%47 = load i64, i64* %3
%48 = sitofp i64 %47 to double
%49 = fdiv double %46, %48
%50 = fadd double %43, %49
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void *Function1Handle(void *a) { return a; }


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

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

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

LLVM IR (-O2):
define i8* @Function1Handle(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_rint();
scalar_t__ rint(double);
void test_rint(double d) {
  if (rint(d) != rint(d))
    link_failure_rint();
}


x86 assembly (clang, -O0):
<test_rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <rint@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <rint@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_rint+0x3c>
mov    $0x0,%al
call   1030 <link_failure_rint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rint>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <rint@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <rint@plt>
cmp    %rax,%rbx
jne    1149 <test_rint+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_rint@plt>

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

LLVM IR (-O2):
define void @test_rint(double %0) {
%2 = tail call i64 @rint(double %0)
%3 = tail call i64 @rint(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_rint()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
long ceill(int /*<<< orphan*/);
int /*<<< orphan*/ log2(long);
long getNumberOfLevels(long elements) { return ceill(log2(elements)); }


x86 assembly (clang, -O0):
<getNumberOfLevels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumberOfLevels>:
push   %rax
call   1030 <log2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ceill@plt>

LLVM IR (-O0):
define i64 @getNumberOfLevels(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @log2(i64 %3)
%5 = call i64 @ceill(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @getNumberOfLevels(i64 %0) {
%2 = tail call i32 @log2(i64 %0)
%3 = tail call i64 @ceill(i32 %2)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ func;

/* Variables and functions */
scalar_t__ i2c_tiny_usb_read(int, unsigned long *, int);
int /*<<< orphan*/ printf(char *, unsigned long);
void i2c_tiny_usb_get_func(void) {
  unsigned long func;
  if (i2c_tiny_usb_read(1, &func, sizeof(func)) == 0)
    printf("Functionality = %lx\n", func);
}


x86 assembly (clang, -O0):
<i2c_tiny_usb_get_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <i2c_tiny_usb_read@plt>
cmp    $0x0,%rax
jne    1155 <i2c_tiny_usb_get_func+0x35>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_tiny_usb_get_func>:
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <i2c_tiny_usb_read@plt>
test   %rax,%rax
je     113a <i2c_tiny_usb_get_func+0x1a>
pop    %rax
ret
mov    (%rsp),%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Functionality = %lx\0A\00"
define void @i2c_tiny_usb_get_func() {
%1 = alloca i64
%2 = call i64 @i2c_tiny_usb_read(i32 1, i64* %1, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i64, i64* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %7
7: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Functionality = %lx\0A\00"
define void @i2c_tiny_usb_get_func() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @i2c_tiny_usb_read(i32 1, i64* %1, i32 8)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i64, i64* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %0
ret void
}
void destroyMatrix(int **mat, int n) {
  int i;
  for (i = 0; i < n; i++)
    free(mat[i]);
  free(mat);
}


x86 assembly (clang, -O0):
<destroyMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <destroyMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <destroyMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <destroyMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroyMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyMatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
struct linked_list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ linked_list_insert(struct linked_list_t *, void *);
int /*<<< orphan*/ linked_list_out(struct linked_list_t *);
void linked_list_add(struct linked_list_t *list, void *data) {
  linked_list_out(list);
  linked_list_insert(list, data);
  linked_list_out(list);
}


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

x86 assembly (clang, -O2):
<linked_list_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <linked_list_out@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <linked_list_insert@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <linked_list_out@plt>

LLVM IR (-O0):
%struct.linked_list_t = type { i32 }
define void @linked_list_add(%struct.linked_list_t* %0, i8* %1) {
%3 = alloca %struct.linked_list_t*
%4 = alloca i8*
store %struct.linked_list_t* %0, %struct.linked_list_t** %3
store i8* %1, i8** %4
%5 = load %struct.linked_list_t*, %struct.linked_list_t** %3
%6 = call i32 @linked_list_out(%struct.linked_list_t* %5)
%7 = load %struct.linked_list_t*, %struct.linked_list_t** %3
%8 = load i8*, i8** %4
%9 = call i32 @linked_list_insert(%struct.linked_list_t* %7, i8* %8)
%10 = load %struct.linked_list_t*, %struct.linked_list_t** %3
%11 = call i32 @linked_list_out(%struct.linked_list_t* %10)
ret void
}

LLVM IR (-O2):
%struct.linked_list_t = type { i32 }
define void @linked_list_add(%struct.linked_list_t* %0, i8* %1) {
%3 = tail call i32 @linked_list_out(%struct.linked_list_t* %0)
%4 = tail call i32 @linked_list_insert(%struct.linked_list_t* %0, i8* %1)
%5 = tail call i32 @linked_list_out(%struct.linked_list_t* %0)
ret void
}
int bar(void) {
  { return (-1); }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @bar() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 -1
}
signed long long int
signedlonglongint_ignoring_unsignedchar(signed long long int x,
                                        unsigned char y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ FerMem_Free(double *, char *, int);
void tm_free_dyn_mem_(double *lm) {
  FerMem_Free(lm,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/"
              "fmt/src/tm_free_dyn_mem.c",
              11);
}


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

x86 assembly (clang, -O2):
<tm_free_dyn_mem_>:
lea    0xee9(%rip),%rsi
mov    $0xb,%edx
jmp    1030 <FerMem_Free@plt>

LLVM IR (-O0):
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fmt/src/tm_free_dyn_mem.c\00"
define void @tm_free_dyn_mem_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @FerMem_Free(double* %3, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 11)
ret void
}

LLVM IR (-O2):
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fmt/src/tm_free_dyn_mem.c\00"
define void @tm_free_dyn_mem_(double* %0) {
%2 = tail call i32 @FerMem_Free(double* %0, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ergodic(int arr[], int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<ergodic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <ergodic+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ergodic+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ergodic>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <ergodic+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <ergodic+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @ergodic(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("No FIPS DH support\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"No FIPS DH support\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"No FIPS DH support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int fgetxattr(int, char *, char *, int);
int main(void) {
  int fd = 3;
  char value[] = "valuestring";
  return fgetxattr(fd, "name", value, sizeof(value));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rdx
lea    0xec4(%rip),%rsi
mov    $0xc,%ecx
call   1030 <fgetxattr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x72747365756c6176,%rax
73 74 72
mov    %rax,0x8(%rsp)
movl   $0x676e69,0x10(%rsp)
lea    0xeda(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    $0x3,%edi
mov    $0xc,%ecx
call   1030 <fgetxattr@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i8]
store i32 0, i32* %1
store i32 3, i32* %2
%4 = bitcast [12 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%7 = call i32 @fgetxattr(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i32 12)
ret i32 %7
}

LLVM IR (-O2):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @fgetxattr(i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 12)
ret i32 %3
}
void modif_front_ext2modif_front_unit_modif_front_ext() {}


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

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

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

LLVM IR (-O2):
define void @modif_front_ext2modif_front_unit_modif_front_ext() {
ret void
}
lcase(s) register char *s;
{
  register char *ptr;
  for (ptr = s; *ptr; ptr++)
    if (isupper(*ptr))
      *ptr = tolower(*ptr);
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <lcase+0x60>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     116a <lcase+0x4a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    116f <lcase+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <lcase+0x14>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <lcase+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <lcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <lcase+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <lcase+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <lcase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @tolower(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %4, %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret i32 undef
}
void AUXWUCFreezeDisable(void) {
  (*((volatile unsigned long *)(0x400C6000 + 0x00000054))) = 0x00000001;
}


x86 assembly (clang, -O0):
<AUXWUCFreezeDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400c6054,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXWUCFreezeDisable>:
movq   $0x1,0x400c6054
ret

LLVM IR (-O0):
define void @AUXWUCFreezeDisable() {
store volatile i64 1, i64* inttoptr (i64 1074552916 to i64*)
ret void
}

LLVM IR (-O2):
define void @AUXWUCFreezeDisable() {
store volatile i64 1, i64* inttoptr (i64 1074552916 to i64*)
ret void
}
/* Variables and functions */
void *malloc(int);
void *list_alloc_aux(int size, void *pfreelist) { return malloc(size); }


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

x86 assembly (clang, -O2):
<list_alloc_aux>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @list_alloc_aux(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 = call i8* @malloc(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @list_alloc_aux(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @malloc(i32 %0)
ret i8* %3
}
/* Type definitions */
struct sm_fifo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sm_put_bit(struct sm_fifo *, int);
void sm_put_bits(struct sm_fifo *f, int v, int n) {
  int i;
  for (i = n - 1; i >= 0; i--) {
    sm_put_bit(f, (v >> i) & 1);
  }
}


x86 assembly (clang, -O0):
<sm_put_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1157 <sm_put_bits+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
sar    %cl,%esi
and    $0x1,%esi
call   1030 <sm_put_bit@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <sm_put_bits+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_put_bits>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    114b <sm_put_bits+0x3b>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rbx),%ecx
mov    %r14d,%esi
shr    %cl,%esi
and    $0x1,%esi
mov    %rbp,%rdi
call   1030 <sm_put_bit@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <sm_put_bits+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sm_fifo = type { i32 }
define void @sm_put_bits(%struct.sm_fifo* %0, i32 %1, i32 %2) {
%4 = alloca %struct.sm_fifo*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.sm_fifo* %0, %struct.sm_fifo** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %7
br label %10
10: ; preds = %20, %3
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load %struct.sm_fifo*, %struct.sm_fifo** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = ashr i32 %15, %16
%18 = and i32 %17, 1
%19 = call i32 @sm_put_bit(%struct.sm_fifo* %14, i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.sm_fifo = type { i32 }
define void @sm_put_bits(%struct.sm_fifo* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %2, %3 ]
%7 = add nsw i32 %6, -1
%8 = lshr i32 %1, %7
%9 = and i32 %8, 1
%10 = tail call i32 @sm_put_bit(%struct.sm_fifo* %0, i32 %9)
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
OP(fd, d5) {
  illegal_1();
  op_d5();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <illegal_1@plt>
mov    $0x0,%al
call   1030 <op_d5@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d5()
ret i32 undef
}