xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char const *, char const *);
void str07(char *buf, const char *newBuf) {
  const char *str = "test";
  strcat(buf, "bla");
  strcat(buf, str);
  strcat(buf, newBuf);
  strcpy(str, newBuf);
}


x86 assembly (clang, -O0):
<str07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str07>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1040 <strcat@plt>
lea    0xec2(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [4 x i8] c"bla\00"
define void @str07(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [4 x i8] c"bla\00"
define void @str07(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %0, i8* %1)
%6 = tail call i32 @strcpy(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int func3(int a, int b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @func3(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ time_usleep(int);
void thread_a(void *arg) {
  printf("starting thread A\n");
  while (1) {
    printf("A\n");
    time_usleep(30000);
  }
}


x86 assembly (clang, -O0):
<thread_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7530,%edi
call   1040 <time_usleep@plt>
jmp    1138 <thread_a+0x18>

x86 assembly (clang, -O2):
<thread_a>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x7530,%edi
call   1040 <time_usleep@plt>
jmp    1140 <thread_a+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"starting thread A\0A\00"
@.str.1 = [3 x i8] c"A\0A\00"
define void @thread_a(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @time_usleep(i32 30000)
br label %4
}

LLVM IR (-O2):
@str = [18 x i8] c"starting thread A\00"
@str.2 = [2 x i8] c"A\00"
define void @thread_a(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @time_usleep(i32 30000)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ pthread_rwlock_init(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
void *__attribute__((__unused__))
_hash_pthread_rwlock_init_hnode_hh(void *_HU_d __attribute__((__unused__))) {
  pthread_rwlock_t *rwlck;
  rwlck = malloc(sizeof(*rwlck));
  if (rwlck != NULL)
    pthread_rwlock_init(rwlck, NULL);
  return (void *)rwlck;
}


x86 assembly (clang, -O0):
<_hash_pthread_rwlock_init_hnode_hh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <_hash_pthread_rwlock_init_hnode_hh+0x32>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_rwlock_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_pthread_rwlock_init_hnode_hh>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <_hash_pthread_rwlock_init_hnode_hh+0x1d>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_rwlock_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_hash_pthread_rwlock_init_hnode_hh(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i32 @pthread_rwlock_init(i32* %8, i32* null)
br label %10
10: ; preds = %7, %1
%11 = load i32*, i32** %3
%12 = bitcast i32* %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @_hash_pthread_rwlock_init_hnode_hh(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pthread_rwlock_init(i32* %2, i32* null)
br label %6
6: ; preds = %4, %1
%7 = bitcast i32* %2 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
int *pa_cvolume_set(int *a, unsigned channels, uint32_t v) {
  empty_log("pa_cvolume_set: not implemented\n");
}


x86 assembly (clang, -O0):
<pa_cvolume_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <empty_log@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"pa_cvolume_set: not implemented\0A\00"
define i32* @pa_cvolume_set(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 @empty_log(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
ret i32* %9
}

LLVM IR (-O2):
@.str = [33 x i8] c"pa_cvolume_set: not implemented\0A\00"
define noalias i32* @pa_cvolume_set(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @empty_log(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_word_format();
void usage(const char *x) {
  fprintf(stderr, "Usage: %s [-Wformat] < file\n", x);
  usage_word_format();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s [-Wformat] < file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @usage_word_format()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s [-Wformat] < file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @usage_word_format()
%5 = tail call i32 @exit(i32 1)
unreachable
}
int fun253() { return 253; }


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

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

LLVM IR (-O0):
define i32 @fun253() {
ret i32 253
}

LLVM IR (-O2):
define i32 @fun253() {
ret i32 253
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ solv_oom(int /*<<< orphan*/, size_t);
void *solv_malloc(size_t len) {
  void *r = malloc(len ? len : 1);
  if (!r)
    solv_oom(0, len);
  return r;
}


x86 assembly (clang, -O0):
<solv_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <solv_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <solv_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1152 <solv_malloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <solv_malloc+0x55>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <solv_oom@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solv_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
mov    $0x1,%edi
cmovne %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <solv_malloc+0x2a>
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <solv_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @solv_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @solv_oom(i32 0, i64 %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void lcd_putch(char data) { putchar(data); }


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

x86 assembly (clang, -O2):
<lcd_putch>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @lcd_putch(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
int hta_int_comp(void *left, void *right) {
  int *l = (int *)left, *r = (int *)right;
  return *l - *r;
}


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

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

LLVM IR (-O0):
define i32 @hta_int_comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @hta_int_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
float mlb_abs(float number) {
  if (number < 0) {
    number *= -1;
  }
  return (number);
}


x86 assembly (clang, -O0):
<mlb_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1128 <mlb_abs+0x28>
movss  0xee2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlb_abs>:
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 @mlb_abs(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 = fmul float %6, -1.000000e+00
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @mlb_abs(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
}
int __attribute__((aligned(128))) test_align128(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @test_align128() align 128 {
ret i32 0
}

LLVM IR (-O2):
define i32 @test_align128() align 128 {
ret i32 0
}
/* Type definitions */
typedef int wchar_t;
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
wchar_t _WLocale_mon_thousands_sep(struct _Locale_monetary *lmon
                                   __attribute__((__unused__))) {
  return L',';
}


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

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

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
define i32 @_WLocale_mon_thousands_sep(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i32 44
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
define i32 @_WLocale_mon_thousands_sep(%struct._Locale_monetary* nocapture readnone %0) {
ret i32 44
}
int trovaPipe(int matrice[][2], int numeroFantasma) {
  return matrice[numeroFantasma][0];
}


x86 assembly (clang, -O0):
<trovaPipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trovaPipe>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @trovaPipe([2 x i32]* %0, i32 %1) {
%3 = alloca [2 x i32]*
%4 = alloca i32
store [2 x i32]* %0, [2 x i32]** %3
store i32 %1, i32* %4
%5 = load [2 x i32]*, [2 x i32]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 %7
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @trovaPipe([2 x i32]* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ pthread_self();
void *thread(void *arg) {
  printf("thread is running.\n");
  printf("the thread id is %u.\n", (unsigned int)pthread_self());
  printf("the process pid is %i.\n", getpid());
  return (void *)0;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"thread is running.\0A\00"
@.str.1 = [22 x i8] c"the thread id is %u.\0A\00"
@.str.2 = [24 x i8] c"the process pid is %i.\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getpid()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"the thread id is %u.\0A\00"
@.str.2 = [24 x i8] c"the process pid is %i.\0A\00"
@str = [19 x i8] c"thread is running.\00"
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "./%s [-mt n] [-minB1 b1] [-mineff e] [-maxeff E] [-seed s] -target "
          "t <filename>\n",
          argv0);
  abort();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"./%s [-mt n] [-minB1 b1] [-mineff e] [-maxeff E] [-seed s] -target t <filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"./%s [-mt n] [-minB1 b1] [-mineff e] [-maxeff E] [-seed s] -target t <filename>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
long sys_bsdthread_ctl(long command, void *arg1, void *arg2, void *arg3) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @sys_bsdthread_ctl(i64 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @sys_bsdthread_ctl(i64 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ _mm_free(void *);
void util_free_(void *ptr) {
  if ((ptr) != NULL)
    _mm_free(ptr);
}


x86 assembly (clang, -O0):
<util_free_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <util_free_+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <_mm_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_free_>:
test   %rdi,%rdi
je     111a <util_free_+0xa>
jmp    1030 <_mm_free@plt>
ret

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

LLVM IR (-O2):
define void @util_free_(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @_mm_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int releasesockfd(int sock) {
  if (close(sock) < 0) {
    fprintf(stderr, "Error al cerrar el socket");
    return (-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<releasesockfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    115e <releasesockfd+0x3e>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <releasesockfd+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releasesockfd>:
push   %rax
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1132 <releasesockfd+0x12>
pop    %rcx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error al cerrar el socket\00"
define i32 @releasesockfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error al cerrar el socket\00"
define i32 @releasesockfd(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %8
}
char *skip_white(char *buf) {
  while (buf[0] == ' ' || buf[0] == '\t') {
    buf++;
  }
  return buf;
}


x86 assembly (clang, -O0):
<skip_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_white+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_white+0x3d>
jmp    114e <skip_white+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_white+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white>:
mov    %rdi,%rax
jmp    1114 <skip_white+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_white+0x10>
cmp    $0x9,%cl
je     1110 <skip_white+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_white(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void cleanupPlatformSockets(void) {}


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

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

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

LLVM IR (-O2):
define void @cleanupPlatformSockets() {
ret void
}
/* Type definitions */
struct winsize {
  int ws_row;
  int ws_col;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  struct winsize ws;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
  printf("height: %d, width: %d\n", ws.ws_row, ws.ws_col);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1040 <ioctl@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32, i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
@.str = [23 x i8] c"height: %d, width: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.winsize
store i32 0, i32* %1
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %2)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
%struct.winsize = type { i32, i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
@.str = [23 x i8] c"height: %d, width: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ non_det;

/* Variables and functions */
int /*<<< orphan*/ klee_make_symbolic(char *, int, char *);
char map2check_non_det_char() {
  char non_det;
  klee_make_symbolic(&non_det, sizeof(non_det), "non_det_#type");
  return non_det;
}


x86 assembly (clang, -O0):
<map2check_non_det_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
lea    0xed8(%rip),%rdx
call   1030 <klee_make_symbolic@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map2check_non_det_char>:
push   %rax
lea    0xee8(%rip),%rdx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <klee_make_symbolic@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"non_det_#type\00"
define signext i8 @map2check_non_det_char() {
%1 = alloca i8
%2 = call i32 @klee_make_symbolic(i8* %1, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"non_det_#type\00"
define signext i8 @map2check_non_det_char() {
%1 = alloca i8
%2 = call i32 @klee_make_symbolic(i8* %1, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %1
ret i8 %3
}
int baz(int a) { return a + a; }


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

x86 assembly (clang, -O2):
<baz>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void panic_print_hex(const uint32_t value) { printf("%x", value); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define void @panic_print_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @panic_print_hex(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _libdeflate_aligned_free(void *ptr) {
  if (ptr)
    free(((void **)ptr)[-1]);
}


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

x86 assembly (clang, -O2):
<_libdeflate_aligned_free>:
test   %rdi,%rdi
je     111e <_libdeflate_aligned_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @_libdeflate_aligned_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = getelementptr inbounds i8*, i8** %7, i64 -1
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_libdeflate_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ heap_sort(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ random_array(int *, int);
int main() {
  int a[13];
  int n = sizeof(a) / sizeof(a[0]);
  random_array(a, n);
  print_array(a, n);
  heap_sort(a, n);
  print_array(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <random_array@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1040 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <heap_sort@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1050 <random_array@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <heap_sort@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %3
%4 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %3
%6 = call i32 @random_array(i32* %4, i32 %5)
%7 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @print_array(i32* %7, i32 %8)
%10 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @heap_sort(i32* %10, i32 %11)
%13 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @print_array(i32* %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 13)
%5 = call i32 @print_array(i32* %3, i32 13)
%6 = call i32 @heap_sort(i32* %3, i32 13)
%7 = call i32 @print_array(i32* %3, i32 13)
ret i32 0
}
int htoi(str)
unsigned char str[];
{
  int result;
  (void)sscanf((char *)str, "%x", &result);
  return (result);
}


x86 assembly (clang, -O0):
<htoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i32 @htoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @htoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
void identity(char *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @identity(i8* nocapture %0) {
ret void
}
void progress_mode0_cb(const char *msg, int pos, int size) {}


x86 assembly (clang, -O0):
<progress_mode0_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @progress_mode0_cb(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SSynth_Delete(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<SSynth_Delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @SSynth_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int strcommon(char *a, char *b) {
  int c = 0;
  while (*a == *b) {
    if (!*a)
      break;
    a++;
    b++;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<strcommon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1161 <strcommon+0x61>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <strcommon+0x3b>
jmp    1161 <strcommon+0x61>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcommon+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcommon>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1126 <strcommon+0x26>
cmp    (%rsi),%cl
jne    1126 <strcommon+0x26>
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl 0x1(%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
test   %dl,%dl
je     1126 <strcommon+0x26>
cmp    0x1(%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <strcommon+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcommon(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %20, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %14, %8 ], [ 0, %2 ]
%10 = phi i8* [ %13, %8 ], [ %1, %2 ]
%11 = phi i8* [ %12, %8 ], [ %0, %2 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = add nuw nsw i32 %9, 1
%15 = load i8, i8* %12
%16 = load i8, i8* %13
%17 = icmp ne i8 %15, %16
%18 = icmp eq i8 %15, 0
%19 = or i1 %18, %17
br i1 %19, label %20, label %8
20: ; preds = %8, %2
%21 = phi i32 [ 0, %2 ], [ %14, %8 ]
ret i32 %21
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *zalloc(size_t size) {
  void *p;
  p = malloc(size);
  memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ foo(int);
int rand();
int main(void) {
  int a = 0, i;
  for (i = 0; i < 1000; i++) {
    a += foo(rand() % 65536);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    117b <main+0x5b>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <foo@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1030 <foo@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 65536
%10 = call i64 @foo(i32 %9)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 65536
%5 = tail call i64 @foo(i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
double LSKeyframeAnimationFunctionEaseInQuad(double t, double b, double c,
                                             double d) {
  return c * (t /= d) * t + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInQuad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInQuad>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionEaseInQuad(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = fmul double %9, %12
%14 = load double, double* %5
%15 = load double, double* %6
%16 = call double @llvm.fmuladd.f64(double %13, double %14, double %15)
ret double %16
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionEaseInQuad(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %1)
ret double %7
}