xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ gamma(double);
int /*<<< orphan*/ link_failure_gamma();
void test_gamma(double d) {
  if (gamma(d) != gamma(d))
    link_failure_gamma();
}


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

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

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

LLVM IR (-O2):
define void @test_gamma(double %0) {
%2 = tail call i64 @gamma(double %0)
%3 = tail call i64 @gamma(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_gamma()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
char *strerror(int);
void ShreyasUnlock(pthread_mutex_t *m) {
  int err = pthread_mutex_unlock(m);
  if (err != 0) {
    printf("unlock was NOT successful,error: %s\n", strerror(err));
  }
}


x86 assembly (clang, -O0):
<ShreyasUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1169 <ShreyasUnlock+0x39>
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShreyasUnlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     1151 <ShreyasUnlock+0x21>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"unlock was NOT successful,error: %s\0A\00"
define void @ShreyasUnlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"unlock was NOT successful,error: %s\0A\00"
define void @ShreyasUnlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @strerror(i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int waitagain() { return syscall(127, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<waitagain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitagain>:
mov    $0x7f,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @waitagain() {
%1 = call i32 @syscall(i32 127, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @waitagain() {
%1 = tail call i32 @syscall(i32 127, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int *malloc(int);
int /*<<< orphan*/ puts(char *);
int main() {
  if (!fork()) {
    while (1) {
      fork();
    }
  }
  puts("hello, world");
  int *a = malloc(1024 * 1024 * 10);
  a[0] = 456;
  a[1024 * 1024 * 100 / sizeof(int) - 1] = 123;
  return 233;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%eax
jne    1160 <main+0x30>
jmp    1154 <main+0x24>
mov    $0x0,%al
call   1050 <fork@plt>
jmp    1154 <main+0x24>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa00000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1c8,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7b,0x63ffffc(%rax)
mov    $0xe9,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1160 <main+0x30>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa00000,%edi
call   1040 <malloc@plt>
mov    $0xe9,%eax
pop    %rcx
ret
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <fork@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 (...) @fork()
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
br label %6
6: ; preds = %5, %6
%7 = call i32 (...) @fork()
br label %6
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = call i32* @malloc(i32 10485760)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 456, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 26214399
store i32 123, i32* %14
ret i32 233
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0, %3
%4 = tail call i32 (...) @fork()
br label %3
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32* @malloc(i32 10485760)
ret i32 233
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *mov_right(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Hello boy !";
  printf("string is [ %s ]\n", s);
  s = mov_right(s, 11);
  printf("string is [ %s ]\n", s);
  if (s)
    free(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0xb,%esi
call   1050 <mov_right@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1190 <main+0x60>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed1(%rip),%r14
lea    0xebe(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <mov_right@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
test   %rbx,%rbx
je     1175 <main+0x45>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello boy !\00"
@.str.1 = [18 x i8] c"string is [ %s ]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i8* @mov_right(i8* %5, i32 11)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello boy !\00"
@.str.1 = [18 x i8] c"string is [ %s ]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @mov_right(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int const *, int);
void oswp2s(void *p, const int i) {
  const int16_t tmp = i;
  memcpy(p, &tmp, 2);
}


x86 assembly (clang, -O0):
<oswp2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oswp2s>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @oswp2s(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %1, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("No FIPS RNG support\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"No FIPS RNG support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t _get_critbit_pos(const char *s1, const char *s2) {
  size_t critbit_pos = 0;
  while (((s1[critbit_pos >> 3] ^ s2[critbit_pos >> 3]) &
          (1 << (7 - (critbit_pos & 7)))) == 0)
    critbit_pos++;
  return critbit_pos;
}


x86 assembly (clang, -O0):
<_get_critbit_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
shr    $0x3,%rdx
movsbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    -0x18(%rbp),%rdx
and    $0x7,%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    116b <_get_critbit_pos+0x6b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <_get_critbit_pos+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_critbit_pos>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rcx
shr    $0x3,%rcx
movzbl (%rsi,%rcx,1),%edx
xor    (%rdi,%rcx,1),%dl
movzbl %dl,%ecx
mov    %eax,%edx
not    %dl
and    $0x7,%dl
movzbl %dl,%edx
add    $0x1,%rax
bt     %edx,%ecx
jae    1110 <_get_critbit_pos+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @_get_critbit_pos(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %18, %3 ]
%5 = lshr i64 %4, 3
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 %5
%9 = load i8, i8* %8
%10 = xor i8 %9, %7
%11 = zext i8 %10 to i32
%12 = trunc i64 %4 to i32
%13 = and i32 %12, 7
%14 = xor i32 %13, 7
%15 = shl nuw i32 1, %14
%16 = and i32 %15, %11
%17 = icmp eq i32 %16, 0
%18 = add i64 %4, 1
br i1 %17, label %3, label %19
19: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_command();
int /*<<< orphan*/ test_deliver();
int /*<<< orphan*/ test_report();
int /*<<< orphan*/ test_sreport();
int /*<<< orphan*/ test_submit();
void test_tpdu() {
  test_submit();
  test_deliver();
  test_report();
  test_command();
  test_sreport();
}


x86 assembly (clang, -O0):
<test_tpdu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_submit@plt>
mov    $0x0,%al
call   1040 <test_deliver@plt>
mov    $0x0,%al
call   1050 <test_report@plt>
mov    $0x0,%al
call   1030 <test_command@plt>
mov    $0x0,%al
call   1060 <test_sreport@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tpdu>:
push   %rax
xor    %eax,%eax
call   1070 <test_submit@plt>
xor    %eax,%eax
call   1040 <test_deliver@plt>
xor    %eax,%eax
call   1050 <test_report@plt>
xor    %eax,%eax
call   1030 <test_command@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_sreport@plt>

LLVM IR (-O0):
define void @test_tpdu() {
%1 = call i32 (...) @test_submit()
%2 = call i32 (...) @test_deliver()
%3 = call i32 (...) @test_report()
%4 = call i32 (...) @test_command()
%5 = call i32 (...) @test_sreport()
ret void
}

LLVM IR (-O2):
define void @test_tpdu() {
%1 = tail call i32 (...) @test_submit()
%2 = tail call i32 (...) @test_deliver()
%3 = tail call i32 (...) @test_report()
%4 = tail call i32 (...) @test_command()
%5 = tail call i32 (...) @test_sreport()
ret void
}
sfuncA(int a, int b) { return a * b + 1; }


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

x86 assembly (clang, -O2):
<sfuncA>:
imul   %esi,%edi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sfuncA(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
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @sfuncA(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int m_create(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m_len(int);
int /*<<< orphan*/ m_width(int);
int /*<<< orphan*/ m_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mls(int, int /*<<< orphan*/);
int m_dub(int m) {
  int r = m_create(m_len(m), m_width(m));
  m_write(r, 0, mls(m, 0), m_len(m));
  return r;
}


x86 assembly (clang, -O0):
<m_dub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <m_width@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <m_create@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1070 <mls@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
xor    %esi,%esi
call   1060 <m_write@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_dub>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <m_len@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <m_width@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <m_create@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1070 <mls@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <m_len@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14d,%edx
mov    %eax,%ecx
call   1060 <m_write@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @m_dub(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @m_len(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @m_width(i32 %6)
%8 = call i32 @m_create(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @mls(i32 %10, i32 0)
%12 = load i32, i32* %2
%13 = call i32 @m_len(i32 %12)
%14 = call i32 @m_write(i32 %9, i32 0, i32 %11, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @m_dub(i32 %0) {
%2 = tail call i32 @m_len(i32 %0)
%3 = tail call i32 @m_width(i32 %0)
%4 = tail call i32 @m_create(i32 %2, i32 %3)
%5 = tail call i32 @mls(i32 %0, i32 0)
%6 = tail call i32 @m_len(i32 %0)
%7 = tail call i32 @m_write(i32 %4, i32 0, i32 %5, i32 %6)
ret i32 %4
}
void destroy_element(struct element *element) {
  do {
  } while (0);
  my_debug_free(element,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/tass-belgium/"
                "picotcp-modules/refs/heads/master/pico_mqtt/pico_mqtt_list.c",
                __func__, 198);
}


x86 assembly (clang, -O0):
<destroy_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <destroy_element+0x11>
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
lea    0xf71(%rip),%rdx
mov    $0xc6,%ecx
mov    $0x0,%al
call   1030 <my_debug_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_element>:
lea    0xee9(%rip),%rsi
lea    0xf86(%rip),%rdx
mov    $0xc6,%ecx
xor    %eax,%eax
jmp    1030 <my_debug_free@plt>

LLVM IR (-O0):
%struct.element = type opaque
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tass-belgium/picotcp-modules/refs/heads/master/pico_mqtt/pico_mqtt_list.c\00"
@__func__.destroy_element = [16 x i8] c"destroy_element\00"
define void @destroy_element(%struct.element* %0) {
%2 = alloca %struct.element*
store %struct.element* %0, %struct.element** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load %struct.element*, %struct.element** %2
%6 = call i32 (%struct.element*, i8*, i8*, i32, ...) bitcast (i32 (...)* @my_debug_free to i32 (%struct.element*, i8*, i8*, i32, ...)*)(%struct.element* %5, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.destroy_element, i64 0, i64 0), i32 198)
ret void
}

LLVM IR (-O2):
%struct.element = type opaque
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tass-belgium/picotcp-modules/refs/heads/master/pico_mqtt/pico_mqtt_list.c\00"
@__func__.destroy_element = [16 x i8] c"destroy_element\00"
define void @destroy_element(%struct.element* %0) {
%2 = tail call i32 (%struct.element*, i8*, i8*, i32, ...) bitcast (i32 (...)* @my_debug_free to i32 (%struct.element*, i8*, i8*, i32, ...)*)(%struct.element* %0, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.destroy_element, i64 0, i64 0), i32 198)
ret void
}
int isupperr(char c) {
  if (c >= 'A' && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isupperr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <isupperr+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <isupperr+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isupperr+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupperr>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isupperr(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isupperr(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help() {
  puts("    Allowed options:                                                   "
       "   121\n"
       "      -s [ --samplerate ] arg (=53333) samplerate in Samples/second    "
       "   \n"
       "                                       (53333  | 111111 | 133333 | "
       "185185)\n"
       "      -u [ --usb ] arg (=/dev/ttyUSB0) serial device                   "
       "   \n"
       "      -h [ --help ]                    print usage message             "
       "   \n"
       "      -d [ --debug ] arg (=0)          debug level                     "
       "   \n");
}


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

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

LLVM IR (-O0):
@.str = [454 x i8] c" Allowed options: 121\0A -s [ --samplerate ] arg (=53333) samplerate in Samples/second \0A (53333 | 111111 | 133333 | 185185)\0A -u [ --usb ] arg (=/dev/ttyUSB0) serial device \0A -h [ --help ] print usage message \0A -d [ --debug ] arg (=0) debug level \0A\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([454 x i8], [454 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [454 x i8] c" Allowed options: 121\0A -s [ --samplerate ] arg (=53333) samplerate in Samples/second \0A (53333 | 111111 | 133333 | 185185)\0A -u [ --usb ] arg (=/dev/ttyUSB0) serial device \0A -h [ --help ] print usage message \0A -d [ --debug ] arg (=0) debug level \0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([454 x i8], [454 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct node {
  int dummy;
};
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_node_deepcopy(struct module *, struct node *,
                                    struct node const *, int);
void node_deepcopy_omit_tail_block(struct module *mod, struct node *dst,
                                   const struct node *src) {
  do_node_deepcopy(mod, dst, src, 1);
}


x86 assembly (clang, -O0):
<node_deepcopy_omit_tail_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <do_node_deepcopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_deepcopy_omit_tail_block>:
mov    $0x1,%ecx
jmp    1030 <do_node_deepcopy@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
%struct.node = type { i32 }
define void @node_deepcopy_omit_tail_block(%struct.module* %0, %struct.node* %1, %struct.node* %2) {
%4 = alloca %struct.module*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.module* %0, %struct.module** %4
store %struct.node* %1, %struct.node** %5
store %struct.node* %2, %struct.node** %6
%7 = load %struct.module*, %struct.module** %4
%8 = load %struct.node*, %struct.node** %5
%9 = load %struct.node*, %struct.node** %6
%10 = call i32 @do_node_deepcopy(%struct.module* %7, %struct.node* %8, %struct.node* %9, i32 1)
ret void
}

LLVM IR (-O2):
%struct.module = type { i32 }
%struct.node = type { i32 }
define void @node_deepcopy_omit_tail_block(%struct.module* %0, %struct.node* %1, %struct.node* %2) {
%4 = tail call i32 @do_node_deepcopy(%struct.module* %0, %struct.node* %1, %struct.node* %2, i32 1)
ret void
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int);
int s_atol(const char *s, int init) {
  if (s)
    return strtol(s, NULL, 10);
  return init;
}


x86 assembly (clang, -O0):
<s_atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <s_atol+0x34>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <s_atol+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_atol>:
test   %rdi,%rdi
je     1121 <s_atol+0x11>
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @s_atol(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
ret i32 %7
}
int dbgsysBuildFunName(char *name, int nameLen, int args_size,
                       int encodingIndex) {
  if (encodingIndex == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dbgsysBuildFunName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1127 <dbgsysBuildFunName+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <dbgsysBuildFunName+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dbgsysBuildFunName(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR68_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR68_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR68_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void clean_line(char *lineptr, int length) {
  int i;
  for (i = 0; i < length; i++)
    lineptr[i] = '\0';
}


x86 assembly (clang, -O0):
<clean_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <clean_line+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clean_line+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_line>:
test   %esi,%esi
jle    1122 <clean_line+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clean_line(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_kill(pthread_t thread, int sig) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_kill>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_kill(i32 %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int IPPORT_RESERVED;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int rresvport(int *);
int main(int argc, char **argv) {
  int fd;
  int aport;
  aport = IPPORT_RESERVED - 1;
  fd = rresvport(&aport);
  if (fd == -1) {
    perror("test_bind:rresvport");
    exit(1);
  }
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <rresvport@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1191 <main+0x51>
lea    0xe7e(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <rresvport@plt>
cmp    $0xffffffff,%eax
jne    1176 <main+0x36>
lea    0xe99(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %eax,%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPPORT_RESERVED = global i32 0
@.str = [20 x i8] c"test_bind:rresvport\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @IPPORT_RESERVED
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %7
%10 = call i32 @rresvport(i32* %7)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %6
%18 = call i32 @close(i32 %17)
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@IPPORT_RESERVED = global i32 0
@.str = [20 x i8] c"test_bind:rresvport\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @IPPORT_RESERVED
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = call i32 @rresvport(i32* %3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = call i32 @close(i32 %7)
%14 = call i32 @exit(i32 0)
unreachable
}
int a(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @a(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ q_sort(int /*<<< orphan*/ *, int /*<<< orphan*/, long);
void quick(FILE *fp, int n) { q_sort(fp, 0, (long)n - 1); }


x86 assembly (clang, -O0):
<quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <q_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick>:
movslq %esi,%rdx
add    $0xffffffffffffffff,%rdx
xor    %esi,%esi
jmp    1030 <q_sort@plt>

LLVM IR (-O0):
define void @quick(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 = sext i32 %6 to i64
%8 = sub nsw i64 %7, 1
%9 = call i32 @q_sort(i32* %5, i32 0, i64 %8)
ret void
}

LLVM IR (-O2):
define void @quick(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %3, -1
%5 = tail call i32 @q_sort(i32* %0, i32 0, i64 %4)
ret void
}
__attribute__((optnone)) void esc(int *p) {}


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

x86 assembly (clang, -O2):
<esc>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @esc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}
/* Variables and functions */
int printf(char *, int);
int main(void) {
  int bph2o = 212;
  int rv;
  printf("The printf() function printed %d characters.\n",
         printf("%d F is water's loiling point.\n", bph2o));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"The printf() function printed %d characters.\0A\00"
@.str.1 = [32 x i8] c"%d F is water's loiling point.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 212, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"The printf() function printed %d characters.\0A\00"
@.str.1 = [32 x i8] c"%d F is water's loiling point.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 212)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void outnccname(name) char *name;
{
  outccname(name);
  outnl();
}


x86 assembly (clang, -O0):
<outnccname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <outccname@plt>
mov    $0x0,%al
call   1030 <outnl@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @outnccname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @outnl()
ret void
}

LLVM IR (-O2):
define void @outnccname(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @outnl()
ret void
}
int log2_exact(unsigned int e, unsigned int *ret) {
  unsigned int count = 0;
  if (!e)
    return -1;
  while (e > 1) {
    if (e & 1)
      return -1;
    e >>= 1;
    count++;
  }
  *ret = count;
  return 0;
}


x86 assembly (clang, -O0):
<log2_exact>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1128 <log2_exact+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <log2_exact+0x79>
jmp    112d <log2_exact+0x2d>
cmpl   $0x1,-0x8(%rbp)
jbe    1169 <log2_exact+0x69>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1152 <log2_exact+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <log2_exact+0x79>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <log2_exact+0x2d>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_exact>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     1138 <log2_exact+0x38>
xor    %ecx,%ecx
cmp    $0x1,%edi
je     1134 <log2_exact+0x34>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   $0x1,%dil
jne    1138 <log2_exact+0x38>
mov    %edi,%edx
shr    %edx
add    $0x1,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <log2_exact+0x20>
mov    %ecx,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @log2_exact(i32 %0, i32* nocapture writeonly %1) {
switch i32 %0, label %3 [
i32 0, label %14
i32 1, label %12
]
3: ; preds = %2, %8
%4 = phi i32 [ %10, %8 ], [ 0, %2 ]
%5 = phi i32 [ %9, %8 ], [ %0, %2 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = lshr i32 %5, 1
%10 = add nuw nsw i32 %4, 1
%11 = icmp ugt i32 %5, 3
br i1 %11, label %3, label %12
12: ; preds = %8, %2
%13 = phi i32 [ 0, %2 ], [ %10, %8 ]
store i32 %13, i32* %1
br label %14
14: ; preds = %3, %2, %12
%15 = phi i32 [ 0, %12 ], [ -1, %2 ], [ -1, %3 ]
ret i32 %15
}
/* Variables and functions */
float __infer_nondet_float();
float ceilf(float x) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
bool nrf52_errata_17(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_17() {
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
size_t regex_strlcpy(char *dst, const char *src, size_t dstsize) {
  size_t src_len = strlen(src);
  strncpy(dst, src, dstsize - 1);
  if (src_len >= dstsize)
    dst[dstsize - 1] = '\0';
  return src_len;
}


x86 assembly (clang, -O0):
<regex_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1174 <regex_strlcpy+0x54>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_strlcpy>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r13
lea    -0x1(%r12),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
cmp    %r12,%r13
jb     115a <regex_strlcpy+0x3a>
movb   $0x0,(%r14,%r15,1)
mov    %r13,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @regex_strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = call i32 @strncpy(i8* %10, i8* %11, i64 %13)
%15 = load i64, i64* %7
%16 = load i64, i64* %6
%17 = icmp uge i64 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %3
%19 = load i8*, i8** %4
%20 = load i64, i64* %6
%21 = sub i64 %20, 1
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %18, %3
%24 = load i64, i64* %7
ret i64 %24
}

LLVM IR (-O2):
define i64 @regex_strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %2, -1
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %5)
%7 = icmp ult i64 %4, %2
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %9
br label %10
10: ; preds = %8, %3
ret i64 %4
}
void func2(void) {
  struct s5 {
    int a;
  };
  struct {
    struct s5 a;
  };
}


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

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

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

LLVM IR (-O2):
define void @func2() {
ret void
}
err(fmt, a) char *fmt;
char *a;
{
  printf(fmt, a);
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @err(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* %5, i8* %6)
unreachable
}

LLVM IR (-O2):
define i32 @err(i8* nocapture %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i8* %1)
tail call void @exit(i32 1)
unreachable
}
/* Type definitions */
struct jhlist_node_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __hlist_del(struct jhlist_node_s *);
void hlist_del(struct jhlist_node_s *n) { __hlist_del(n); }


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

x86 assembly (clang, -O2):
<hlist_del>:
jmp    1030 <__hlist_del@plt>

LLVM IR (-O0):
%struct.jhlist_node_s = type { i32 }
define void @hlist_del(%struct.jhlist_node_s* %0) {
%2 = alloca %struct.jhlist_node_s*
store %struct.jhlist_node_s* %0, %struct.jhlist_node_s** %2
%3 = load %struct.jhlist_node_s*, %struct.jhlist_node_s** %2
%4 = call i32 @__hlist_del(%struct.jhlist_node_s* %3)
ret void
}

LLVM IR (-O2):
%struct.jhlist_node_s = type { i32 }
define void @hlist_del(%struct.jhlist_node_s* %0) {
%2 = tail call i32 @__hlist_del(%struct.jhlist_node_s* %0)
ret void
}