xunge/DecIR huggingface dataset:
/* Variables and functions */
void trim_getline_nl(char *line, size_t read) {
  if (line[read - 1] == '\n')
    line[read - 1] = '\0';
}


x86 assembly (clang, -O0):
<trim_getline_nl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1135 <trim_getline_nl+0x35>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_getline_nl>:
cmpb   $0xa,-0x1(%rsi,%rdi,1)
jne    110c <trim_getline_nl+0xc>
movb   $0x0,-0x1(%rdi,%rsi,1)
ret

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

LLVM IR (-O2):
define void @trim_getline_nl(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %2
store i8 0, i8* %4
br label %8
8: ; preds = %7, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
struct timespec {
  int dummy;
};

/* Variables and functions */
int FUTEX_LOCK_PI;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int,
            struct timespec *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_lock_pi(u_int32_t *uaddr, struct timespec *timeout, int detect,
                  int opflags) {
  return syscall(SYS_futex, uaddr, FUTEX_LOCK_PI | opflags, detect, timeout,
                 NULL, 0);
}


x86 assembly (clang, -O0):
<futex_lock_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
or     -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_lock_pi>:
push   %rax
mov    %edx,%eax
mov    %rsi,%r8
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rdx
mov    (%rdx),%edi
mov    0x2eb7(%rip),%rdx
or     (%rdx),%ecx
movl   $0x0,(%rsp)
mov    %ecx,%edx
mov    %eax,%ecx
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
@FUTEX_LOCK_PI = global i32 0
define i32 @futex_lock_pi(i32* %0, %struct.timespec* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca %struct.timespec*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store %struct.timespec* %1, %struct.timespec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @SYS_futex
%10 = load i32*, i32** %5
%11 = load i32, i32* @FUTEX_LOCK_PI
%12 = load i32, i32* %8
%13 = or i32 %11, %12
%14 = load i32, i32* %7
%15 = load %struct.timespec*, %struct.timespec** %6
%16 = call i32 @syscall(i32 %9, i32* %10, i32 %13, i32 %14, %struct.timespec* %15, i32* null, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
@FUTEX_LOCK_PI = global i32 0
define i32 @futex_lock_pi(i32* %0, %struct.timespec* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SYS_futex
%6 = load i32, i32* @FUTEX_LOCK_PI
%7 = or i32 %6, %3
%8 = tail call i32 @syscall(i32 %5, i32* %0, i32 %7, i32 %2, %struct.timespec* %1, i32* null, i32 0)
ret i32 %8
}
/* Variables and functions */
int swap_fs_free();
unsigned swap_minimal_size(void) {
  return (swap_fs_free() < (8 << 20) ? 0 : (8 << 20));
}


x86 assembly (clang, -O0):
<swap_minimal_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <swap_fs_free@plt>
mov    %eax,%edx
mov    $0x800000,%eax
xor    %ecx,%ecx
cmp    $0x800000,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_minimal_size>:
push   %rax
xor    %eax,%eax
call   1030 <swap_fs_free@plt>
xor    %ecx,%ecx
cmp    $0x800000,%eax
setge  %cl
shl    $0x17,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @swap_minimal_size() {
%1 = call i32 (...) @swap_fs_free()
%2 = icmp slt i32 %1, 8388608
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 8388608
ret i32 %4
}

LLVM IR (-O2):
define i32 @swap_minimal_size() {
%1 = tail call i32 (...) @swap_fs_free()
%2 = icmp slt i32 %1, 8388608
%3 = select i1 %2, i32 0, i32 8388608
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(size_t);
size_t wcslen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *wmemcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                            size_t);
wchar_t *wcsdup(const wchar_t *s) {
  size_t l = wcslen(s);
  wchar_t *d = malloc((l + 1) * sizeof(wchar_t));
  if (!d)
    return NULL;
  return wmemcpy(d, s, l + 1);
}


x86 assembly (clang, -O0):
<wcsdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wcslen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1176 <wcsdup+0x46>
movq   $0x0,-0x8(%rbp)
jmp    118f <wcsdup+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <wmemcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <wcslen@plt>
mov    %rax,%rbx
lea    0x4(,%rax,4),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     116a <wcsdup+0x3a>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wmemcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @wcsdup(i32* %0) {
%2 = tail call i64 @wcslen(i32* %0)
%3 = add i64 %2, 1
%4 = shl i64 %3, 2
%5 = tail call i32* @malloc(i64 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32* @wmemcpy(i32* %5, i32* %0, i64 %3)
br label %9
9: ; preds = %1, %7
%10 = phi i32* [ %8, %7 ], [ null, %1 ]
ret i32* %10
}
unsigned char count_ases(char *minterm) {
  unsigned char counter = 0;
  while (*minterm)
    if (*minterm++ == '1')
      counter++;
  return counter;
}


x86 assembly (clang, -O0):
<count_ases>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <count_ases+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    113c <count_ases+0x3c>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    110c <count_ases+0xc>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ases>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <count_ases+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    $0x31,%cl
sete   %cl
add    %cl,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_ases+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @count_ases(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 49
%10 = zext i1 %9 to i8
%11 = add i8 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8 [ 0, %1 ], [ %11, %4 ]
ret i8 %15
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_move_tail(struct list_head *, struct list_head *);
void list_rotate_to_front(struct list_head *list, struct list_head *head) {
  list_move_tail(head, list);
}


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

x86 assembly (clang, -O2):
<list_rotate_to_front>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <list_move_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_rotate_to_front(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %4
%6 = load %struct.list_head*, %struct.list_head** %3
%7 = call i32 @list_move_tail(%struct.list_head* %5, %struct.list_head* %6)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_rotate_to_front(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_move_tail(%struct.list_head* %1, %struct.list_head* %0)
ret void
}
float test_log10f(float x) { return __builtin_log10f(x); }


x86 assembly (clang, -O0):
<test_log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log10f>:
jmp    1030 <log10f@plt>

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

LLVM IR (-O2):
define float @test_log10f(float %0) {
%2 = tail call float @log10f(float %0)
ret float %2
}
int update_finish(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @update_finish() {
ret i32 0
}
int g(short a, short b, int c) { return (short)(a * b) + c; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
imul   %ecx,%eax
cwtl
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
imul   %esi,%edi
movswl %di,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @g(i16 signext %0, i16 signext %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i32
store i16 %0, i16* %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = trunc i32 %11 to i16
%13 = sext i16 %12 to i32
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @g(i16 signext %0, i16 signext %1, i32 %2) {
%4 = mul i16 %1, %0
%5 = sext i16 %4 to i32
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int foo(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() { printf("result:%d\n", foo(3, 4)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <foo@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"result:%d\0A\00"
define void @main() {
%1 = call i32 @foo(i32 3, i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"result:%d\0A\00"
define void @main() {
%1 = tail call i32 @foo(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b1();
int /*<<< orphan*/ b2();
int main() {
  b1();
  b2();
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <b1@plt>
mov    $0x0,%al
call   1030 <b2@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <b1@plt>
xor    %eax,%eax
call   1030 <b2@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @b1()
%3 = call i32 (...) @b2()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @b1()
%2 = tail call i32 (...) @b2()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int ENXIO;
int nc_pm8xxx_mpp_config_current_sink(unsigned mpp, unsigned level,
                                      unsigned control) {
  return -ENXIO;
}


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

x86 assembly (clang, -O2):
<nc_pm8xxx_mpp_config_current_sink>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @nc_pm8xxx_mpp_config_current_sink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENXIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @nc_pm8xxx_mpp_config_current_sink(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENXIO
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int fastrand();
int M_SubRandom(void) { return ((fastrand() & 510) - 255); }


x86 assembly (clang, -O0):
<M_SubRandom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fastrand@plt>
and    $0x1fe,%eax
sub    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_SubRandom>:
push   %rax
xor    %eax,%eax
call   1030 <fastrand@plt>
and    $0x1fe,%eax
add    $0xffffff01,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @M_SubRandom() {
%1 = call i32 (...) @fastrand()
%2 = and i32 %1, 510
%3 = sub nsw i32 %2, 255
ret i32 %3
}

LLVM IR (-O2):
define i32 @M_SubRandom() {
%1 = tail call i32 (...) @fastrand()
%2 = and i32 %1, 510
%3 = add nsw i32 %2, -255
ret i32 %3
}
void SysCtlLSEConfig(unsigned long ulLSEConfig) {

  ;
  (*((volatile unsigned long *)(0x40021020))) &= ~0x00000001;
  (*((volatile unsigned long *)(0x40021020))) |= ulLSEConfig;
  while (!((*((volatile unsigned long *)(0x40021020))) & 0x00000002))
    ;
}


x86 assembly (clang, -O0):
<SysCtlLSEConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40021020,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x40021020,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x40021020,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40021020,%eax
mov    %rcx,(%rax)
mov    $0x40021020,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <SysCtlLSEConfig+0x55>
jmp    115a <SysCtlLSEConfig+0x5a>
jmp    1133 <SysCtlLSEConfig+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLSEConfig>:
andq   $0xfffffffffffffffe,0x40021020
40 fe
or     %rdi,0x40021020
40
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x2,0x40021020
je     1120 <SysCtlLSEConfig+0x20>
ret

LLVM IR (-O0):
define void @SysCtlLSEConfig(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%4 = and i64 %3, -2
store volatile i64 %4, i64* inttoptr (i64 1073877024 to i64*)
%5 = load i64, i64* %2
%6 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%7 = or i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1073877024 to i64*)
br label %8
8: ; preds = %13, %1
%9 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%10 = and i64 %9, 2
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @SysCtlLSEConfig(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%3 = and i64 %2, -2
store volatile i64 %3, i64* inttoptr (i64 1073877024 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%5 = or i64 %4, %0
store volatile i64 %5, i64* inttoptr (i64 1073877024 to i64*)
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* inttoptr (i64 1073877024 to i64*)
%8 = and i64 %7, 2
%9 = icmp eq i64 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
ret void
}
/* Variables and functions */
void *xxh32_init(unsigned int);
void *XXH32_init(unsigned int seed) { return xxh32_init(seed); }


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

x86 assembly (clang, -O2):
<XXH32_init>:
jmp    1030 <xxh32_init@plt>

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

LLVM IR (-O2):
define i8* @XXH32_init(i32 %0) {
%2 = tail call i8* @xxh32_init(i32 %0)
ret i8* %2
}
/* Variables and functions */
int ft_abs(int);
int ft_figure(int number) {
  int i;
  i = 0;
  if (number < 0)
    i++;
  number = ft_abs(number);
  while (number) {
    number /= 10;
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_figure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1135 <ft_figure+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_abs@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1166 <ft_figure+0x56>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ft_figure+0x30>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_figure>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
call   1030 <ft_abs@plt>
test   %eax,%eax
je     1142 <ft_figure+0x32>
nop
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    $0x1,%ebx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <ft_figure+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_figure(i32 %0) {
%2 = lshr i32 %0, 31
%3 = tail call i32 @ft_abs(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ %2, %1 ]
%7 = phi i32 [ %8, %5 ], [ %3, %1 ]
%8 = sdiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ %2, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void INThandler(int sig) {
  signal(sig, SIG_IGN);
  exit(0);
}


x86 assembly (clang, -O0):
<INThandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<INThandler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @INThandler(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x9e() {
  Assert_real((isupper(158) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              795, ("isupper should be 0 for 0x9e"));
}


x86 assembly (clang, -O0):
<t_isupper_0x9e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9e,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x31b,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x31b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9e\00"
define void @t_isupper_0x9e() {
%1 = call i64 @isupper(i32 158)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9e\00"
define void @t_isupper_0x9e() {
%1 = tail call i64 @isupper(i32 158)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int worldYDim(void) { return (int)10; }


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

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

LLVM IR (-O0):
define i32 @worldYDim() {
ret i32 10
}

LLVM IR (-O2):
define i32 @worldYDim() {
ret i32 10
}
float temp(int cel) { return ((9.0 * cel / 5.0) + 32.0); }


x86 assembly (clang, -O0):
<temp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xefc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<temp>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @temp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 9.000000e+00, %4
%6 = fdiv double %5, 5.000000e+00
%7 = fadd double %6, 3.200000e+01
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @temp(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 9.000000e+00
%4 = fdiv double %3, 5.000000e+00
%5 = fadd double %4, 3.200000e+01
%6 = fptrunc double %5 to float
ret float %6
}
void fc146(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    goto a;
    {
      typedef int(*g)[n];
      0;
    };
  a : {
    typedef int(*h)[n];
    0;
  };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc146(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
br label %16
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc146(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  free(*as);
  *as = NULL;
}


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

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_strdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void outofstock(void) {
  lprcat("\nSorry, but we are out of that item.");
  lflush();
  nap(2200);
}


x86 assembly (clang, -O0):
<outofstock>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outofstock>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0ASorry, but we are out of that item.\00"
define void @outofstock() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0ASorry, but we are out of that item.\00"
define void @outofstock() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 2200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printyes() { printf("Yes\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"Yes\00"
define void @printyes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mod_battery_init();
int /*<<< orphan*/ mod_clock_init();
int /*<<< orphan*/ mod_reset_init();
int /*<<< orphan*/ mod_stopwatch_init();
int /*<<< orphan*/ mod_temperature_init();
void mod_init(void) {
  mod_clock_init();
  mod_stopwatch_init();
  mod_temperature_init();
  mod_battery_init();
  mod_reset_init();
}


x86 assembly (clang, -O0):
<mod_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <mod_clock_init@plt>
mov    $0x0,%al
call   1030 <mod_stopwatch_init@plt>
mov    $0x0,%al
call   1070 <mod_temperature_init@plt>
mov    $0x0,%al
call   1040 <mod_battery_init@plt>
mov    $0x0,%al
call   1050 <mod_reset_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_init>:
push   %rax
xor    %eax,%eax
call   1060 <mod_clock_init@plt>
xor    %eax,%eax
call   1030 <mod_stopwatch_init@plt>
xor    %eax,%eax
call   1070 <mod_temperature_init@plt>
xor    %eax,%eax
call   1040 <mod_battery_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <mod_reset_init@plt>

LLVM IR (-O0):
define void @mod_init() {
%1 = call i32 (...) @mod_clock_init()
%2 = call i32 (...) @mod_stopwatch_init()
%3 = call i32 (...) @mod_temperature_init()
%4 = call i32 (...) @mod_battery_init()
%5 = call i32 (...) @mod_reset_init()
ret void
}

LLVM IR (-O2):
define void @mod_init() {
%1 = tail call i32 (...) @mod_clock_init()
%2 = tail call i32 (...) @mod_stopwatch_init()
%3 = tail call i32 (...) @mod_temperature_init()
%4 = tail call i32 (...) @mod_battery_init()
%5 = tail call i32 (...) @mod_reset_init()
ret void
}
int is_wdvarname(s, aok) const char *s;
int aok;
{
  char *p = skip_wdvarname(s, aok);
  return p != s && p[0] == 0;
}


x86 assembly (clang, -O0):
<is_wdvarname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <skip_wdvarname@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
je     1156 <is_wdvarname+0x46>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wdvarname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <skip_wdvarname@plt>
cltq
cmp    %r14,%rax
je     112f <is_wdvarname+0x1f>
xor    %ebx,%ebx
cmpb   $0x0,(%rax)
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_wdvarname(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @skip_wdvarname to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i8* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_ECint32_reg(int val) { return ((val) & (0xEC << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ECint32_reg(i32 %0) {
%2 = and i32 %0, 236
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float absf(float v) { return v < 0.0f ? -v : v; }


x86 assembly (clang, -O0):
<absf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <absf+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <absf+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @absf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ abs(int /*<<< orphan*/);
char const *strerror(int /*<<< orphan*/);
const char *mq_strerror(int32_t error_number) {
  return strerror(abs(error_number));
}


x86 assembly (clang, -O0):
<mq_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <strerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_strerror>:
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
define i8* @mq_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = call i8* @strerror(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @mq_strerror(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i8* @strerror(i32 %2)
ret i8* %3
}
char *test_func_01(char *p, int c) {
  *--p = (char)c;
  *--p = (char)c;
  *--p = (char)c;
  return p;
}


x86 assembly (clang, -O0):
<test_func_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_01>:
mov    %sil,-0x1(%rdi)
mov    %sil,-0x2(%rdi)
mov    %sil,-0x3(%rdi)
lea    -0x3(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @test_func_01(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 -1
store i8* %8, i8** %3
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %3
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 -1
store i8* %16, i8** %3
store i8 %14, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @test_func_01(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 -1
store i8 %3, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 -2
store i8 %3, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 -3
store i8 %3, i8* %6
ret i8* %6
}
int test_fun(int x) {
  int c = 0;
  while ((x > 1) && (x < 100)) {
    x = x * x;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jle    1127 <test_fun+0x27>
cmpl   $0x64,-0x4(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1137 <test_fun+0x37>
jmp    114f <test_fun+0x4f>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_fun+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
lea    -0x2(%rdi),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
ja     111e <test_fun+0x1e>
xor    %eax,%eax
nopl   0x0(%rax)
imul   %edi,%edi
add    $0x1,%eax
lea    -0x2(%rdi),%ecx
cmp    $0x62,%ecx
jb     1110 <test_fun+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 98
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = mul nuw nsw i32 %6, %6
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, -2
%10 = icmp ult i32 %9, 98
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ *procfs__mountpoint();
bool procfs__configured(void) { return procfs__mountpoint() != NULL; }


x86 assembly (clang, -O0):
<procfs__configured>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <procfs__mountpoint@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procfs__configured>:
push   %rax
xor    %eax,%eax
call   1030 <procfs__mountpoint@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @procfs__configured() {
%1 = call i32* (...) @procfs__mountpoint()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @procfs__configured() {
%1 = tail call i32* (...) @procfs__mountpoint()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void illegal_free() {
  int *array = malloc(5 * sizeof(int));
  int *array1 = array;
  free(array1);
  free(array);
}


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

x86 assembly (clang, -O2):
<illegal_free>:
push   %rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @illegal_free() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 20)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @illegal_free() {
%1 = tail call i32* @malloc(i32 20)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
unsigned int get_732(void *pnt) {
  unsigned char *p = (unsigned char *)pnt;
  return ((unsigned int)p[0] << 24) + ((unsigned int)p[1] << 16) +
         ((unsigned int)p[2] << 8) + ((unsigned int)p[3]);
}


x86 assembly (clang, -O0):
<get_732>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_732(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int hashString(char *str) {
  int result = 0;
  for (int i = 0; str[i] != '\0'; i++)
    result += (int)str[i];
  return result;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <hashString+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hashString+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hashString+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashString+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %12, %6 ], [ 0, %1 ]
%8 = phi i8 [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %11, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = add nsw i32 %9, %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %4, label %6
}