xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
size_t write_FD(int, int /*<<< orphan*/ const *, int);
size_t int8WriteToFD(int fd, const int8_t *data) {
  return write_FD(fd, data, sizeof(int8_t));
}


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

x86 assembly (clang, -O2):
<int8WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD@plt>

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

LLVM IR (-O2):
define i64 @int8WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
scalar_t__ closetoint(int);
int denum(double x) {
  int i;
  for (i = 1; i < 1000; i++)
    if (closetoint(i * x))
      return i;
  return 1;
}


x86 assembly (clang, -O0):
<denum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    116c <denum+0x5c>
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <closetoint@plt>
cmp    $0x0,%rax
je     1159 <denum+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <denum+0x63>
jmp    115e <denum+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <denum+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<denum>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <closetoint@plt>
test   %rax,%rax
jne    114b <denum+0x3b>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1120 <denum+0x10>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @denum(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 1, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = fptosi double %12 to i32
%14 = call i64 @closetoint(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %23
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
store i32 1, i32* %2
br label %23
23: ; preds = %22, %16
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @denum(double %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i32 [ 1, %1 ], [ %10, %9 ]
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
%6 = fptosi double %5 to i32
%7 = tail call i64 @closetoint(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 1000
br i1 %11, label %12, label %2
12: ; preds = %9, %2
%13 = phi i32 [ %3, %2 ], [ 1, %9 ]
ret i32 %13
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_17() {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 6;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc20,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_17>:
push   %rax
mov    $0xc20,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x40,%eax
mov    $0xc20,%edi
mov    %eax,%esi
mov    $0x40,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_17() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3104, i32* %1
store i32 6, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_17() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3104)
%2 = xor i32 %1, 64
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3104, i32 %2, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_http_put_destroy(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_http_put_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ unescape(char *, char *);
main() {
  char t[] = "Hello\\tWorld!!!\\r\\nEOF\\v";
  printf("%s\n", t);
  char s[1024] = "";
  unescape(s, t);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <unescape@plt>
lea    -0x420(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x420,%rsp
movups 0xec6(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebf(%rip),%r14
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0x20(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <unescape@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.t = [25 x i8] c"Hello\\tWorld!!!\\r\\nEOF\\v\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca [1024 x i8]
%3 = bitcast [25 x i8]* %1 to i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = bitcast [1024 x i8]* %2 to i8*
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%9 = call i32 @unescape(i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.t = [25 x i8] c"Hello\\tWorld!!!\\r\\nEOF\\v\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @unescape(i8* %5, i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int main() {
  const char a[] = "abcde";
  const char *z = "vwxyz";
  printf("%s %s", a, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x6(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x65,0x4(%rsp)
movl   $0x64636261,(%rsp)
lea    0xee6(%rip),%rdi
lea    0xed9(%rip),%rdx
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"abcde\00"
@.str = [6 x i8] c"vwxyz\00"
@.str.1 = [6 x i8] c"%s %s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void putstr(message) char *message;
{
  while (*message != 0)
    putbyte(*message++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <putstr+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putbyte@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <putstr+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putbyte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putbyte to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void pft_free(void *mem, size_t size) { munmap(mem, size); }


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

x86 assembly (clang, -O2):
<pft_free>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @pft_free(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
unsigned short int f30(unsigned short int x, long int y) {
  return (x >> ((-y) & (8 * sizeof(unsigned short) - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f30>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f30>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f30(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 15
%10 = trunc i64 %9 to i32
%11 = ashr i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = shl i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f30(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = shl i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
char *c4pkg_net_extract_file_from_url(char const *);
const char *c4pkg_github_repo_name(const char *repo) {
  const char *name = c4pkg_net_extract_file_from_url(repo);
  return name ? name : repo;
}


x86 assembly (clang, -O0):
<c4pkg_github_repo_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <c4pkg_net_extract_file_from_url@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <c4pkg_github_repo_name+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <c4pkg_github_repo_name+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c4pkg_github_repo_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <c4pkg_net_extract_file_from_url@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @c4pkg_github_repo_name(i8* %0) {
%2 = tail call i8* @c4pkg_net_extract_file_from_url(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int test_directory_exists(const char *path) {
  DIR *dir = opendir(path);
  if (dir) {
    closedir(dir);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<test_directory_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <test_directory_exists+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <test_directory_exists+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_directory_exists>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     1137 <test_directory_exists+0x17>
mov    %rax,%rdi
call   1040 <closedir@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_directory_exists(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ GPS_Math_LatLonH_To_XYZ(double, double, double, double *,
                                           double *, double *, double, double);
void GPS_Math_Airy1830LatLonH_To_XYZ(double phi, double lambda, double H,
                                     double *x, double *y, double *z) {
  double a = 6377563.396;
  double b = 6356256.910;
  GPS_Math_LatLonH_To_XYZ(phi, lambda, H, x, y, z, a, b);
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_Airy1830LatLonH_To_XYZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
movsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
call   1030 <GPS_Math_LatLonH_To_XYZ@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Airy1830LatLonH_To_XYZ>:
movsd  0xee8(%rip),%xmm3
movsd  0xee8(%rip),%xmm4
jmp    1030 <GPS_Math_LatLonH_To_XYZ@plt>

LLVM IR (-O0):
define void @GPS_Math_Airy1830LatLonH_To_XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store double 0x41585416D9581062, double* %13
store double 0x41583F483A3D70A4, double* %14
%15 = load double, double* %7
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double, double* %13
%22 = load double, double* %14
%23 = call i32 @GPS_Math_LatLonH_To_XYZ(double %15, double %16, double %17, double* %18, double* %19, double* %20, double %21, double %22)
ret void
}

LLVM IR (-O2):
define void @GPS_Math_Airy1830LatLonH_To_XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = tail call i32 @GPS_Math_LatLonH_To_XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5, double 0x41585416D9581062, double 0x41583F483A3D70A4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ traceEvent(int, char *, int, char *, char *);
void copyright() {
  traceEvent(2,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/kvitaly2005/lprobe/refs/heads/master/"
             "utils/nf_reflector.c",
             73, "nf_reflector v.%s - (C) 2010 ltop.org", "1.0");
}


x86 assembly (clang, -O0):
<copyright>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x49,%edx
lea    0xf68(%rip),%rcx
lea    0xf87(%rip),%r8
call   1030 <traceEvent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright>:
lea    0xee9(%rip),%rsi
lea    0xf76(%rip),%rcx
lea    0xf95(%rip),%r8
mov    $0x2,%edi
mov    $0x49,%edx
jmp    1030 <traceEvent@plt>

LLVM IR (-O0):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kvitaly2005/lprobe/refs/heads/master/utils/nf_reflector.c\00"
@.str.1 = [38 x i8] c"nf_reflector v.%s - (C) 2010 ltop.org\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @copyright() {
%1 = call i32 @traceEvent(i32 2, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kvitaly2005/lprobe/refs/heads/master/utils/nf_reflector.c\00"
@.str.1 = [38 x i8] c"nf_reflector v.%s - (C) 2010 ltop.org\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @copyright() {
%1 = tail call i32 @traceEvent(i32 2, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double errorMult(double, double, double, double);
double *uncertainMult(double A, double errorA, double B, double errorB) {
  static double retorno[2];
  retorno[0] = A * B;
  retorno[1] = errorMult(A, errorA, B, errorB);
  return retorno;
}


x86 assembly (clang, -O0):
<uncertainMult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,0x2f02(%rip)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <errorMult@plt>
movsd  %xmm0,0x2ee9(%rip)
lea    0x2eda(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncertainMult>:
push   %rbx
movapd %xmm0,%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x2f1f(%rip)
lea    0x2f18(%rip),%rbx
call   1030 <errorMult@plt>
movsd  %xmm0,0x2f13(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@uncertainMult.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainMult(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* %5
%10 = load double, double* %7
%11 = fmul double %9, %10
store double %11, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 0)
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %7
%15 = load double, double* %8
%16 = call double @errorMult(double %12, double %13, double %14, double %15)
store double %16, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 0)
}

LLVM IR (-O2):
@uncertainMult.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainMult(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, %2
store double %5, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 0)
%6 = tail call double @errorMult(double %0, double %1, double %2, double %3)
store double %6, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainMult.retorno, i64 0, i64 0)
}
unsigned int check_integer_format(const char format) {
  unsigned int retValue = 0;
  switch (format) {
  case 'c':
  case 'h':
  case 'd':
    retValue = 1;
    break;
  }
  return retValue;
}


x86 assembly (clang, -O0):
<check_integer_format>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff9d,%eax
sub    $0x2,%eax
jb     113a <check_integer_format+0x3a>
jmp    1129 <check_integer_format+0x29>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
jne    1141 <check_integer_format+0x41>
jmp    113a <check_integer_format+0x3a>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_integer_format>:
add    $0xffffff9d,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <check_integer_format+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @check_integer_format(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 99, label %6
i32 104, label %6
i32 100, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %3
br label %7
7: ; preds = %1, %6
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@switch.table.check_integer_format = [6 x i32] [i32 1, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @check_integer_format(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -99
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.check_integer_format, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t GSM_MULT(int16_t a, int16_t b) {
  return (((int32_t)(a)) * ((int32_t)(b))) >> 15;
}


x86 assembly (clang, -O0):
<GSM_MULT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %ecx,%eax
sar    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSM_MULT>:
mov    %rsi,%rax
imul   %edi,%eax
sar    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @GSM_MULT(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 15
ret i32 %10
}

LLVM IR (-O2):
define i32 @GSM_MULT(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = ashr i32 %5, 15
ret i32 %6
}
/* Variables and functions */
unsigned int alphex_stoui(char const *);
unsigned int hausy_parse_id(const char *id) {
  if (id[0] == '0' && id[1] == 'a')
    return alphex_stoui(&(id[2]));
  return (unsigned int)-1;
}


x86 assembly (clang, -O0):
<hausy_parse_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1152 <hausy_parse_id+0x42>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x61,%eax
jne    1152 <hausy_parse_id+0x42>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <alphex_stoui@plt>
mov    %eax,-0x4(%rbp)
jmp    1159 <hausy_parse_id+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hausy_parse_id>:
cmpb   $0x30,(%rdi)
jne    1124 <hausy_parse_id+0x14>
cmpb   $0x61,0x1(%rdi)
jne    1124 <hausy_parse_id+0x14>
add    $0x2,%rdi
jmp    1030 <alphex_stoui@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @hausy_parse_id(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 97
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i32 @alphex_stoui(i8* %9)
br label %11
11: ; preds = %1, %4, %8
%12 = phi i32 [ %10, %8 ], [ -1, %4 ], [ -1, %1 ]
ret i32 %12
}
float beckmannToBlinn(float slope) { return 2 / (slope * slope) - 2; }


x86 assembly (clang, -O0):
<beckmannToBlinn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xee5(%rip),%xmm0
divss  %xmm1,%xmm0
movss  0xed9(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<beckmannToBlinn>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
divss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @beckmannToBlinn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fdiv float 2.000000e+00, %5
%7 = fsub float %6, 2.000000e+00
ret float %7
}

LLVM IR (-O2):
define float @beckmannToBlinn(float %0) {
%2 = fmul float %0, %0
%3 = fdiv float 2.000000e+00, %2
%4 = fadd float %3, -2.000000e+00
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ system(char *);
void _clear_neighbor_cache(const char *ifname) {
  char tmp[20 + IFNAMSIZ];
  snprintf(tmp, sizeof(tmp), "ip neigh flush dev %s", ifname);
  system(tmp);
}


x86 assembly (clang, -O0):
<_clear_neighbor_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x14,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    %eax,%esi
mov    -0x8(%rbp),%rcx
lea    0xe98(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <system@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear_neighbor_cache>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rcx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
add    $0x14,%esi
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xeb3(%rip),%rdx
mov    %rbx,%rdi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i32 0
@.str = [22 x i8] c"ip neigh flush dev %s\00"
define void @_clear_neighbor_cache(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @IFNAMSIZ
%6 = add nsw i32 20, %5
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = trunc i64 %7 to i32
%11 = load i8*, i8** %2
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @system(i8* %9)
%14 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@IFNAMSIZ = global i32 0
@.str = [22 x i8] c"ip neigh flush dev %s\00"
define void @_clear_neighbor_cache(i8* %0) {
%2 = load i32, i32* @IFNAMSIZ
%3 = add nsw i32 %2, 20
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @snprintf(i8* %5, i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @system(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int main() {
  char *foo;
  char *bar;
  foo = (char *)malloc(10);
  bar = (char *)malloc(10);
  free(foo);
  foo = (char *)malloc(10);
  bar[3] = 'w';
  memcpy(foo, bar, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x77,0x3(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
movb   $0x77,0x3(%rbx)
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i64 @malloc(i32 10)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = call i64 @malloc(i32 10)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %2
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8 119, i8* %13
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = call i32 @memcpy(i8* %14, i8* %15, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @free(i8* %2)
%6 = tail call i64 @malloc(i32 10)
%7 = inttoptr i64 %6 to i8*
%8 = getelementptr inbounds i8, i8* %4, i64 3
store i8 119, i8* %8
%9 = tail call i32 @memcpy(i8* %7, i8* %4, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SETVAL;
int /*<<< orphan*/ printf(char *);
int semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int reset_semvalue(int sem_id, int idx) {
  if (semctl(sem_id, idx, SETVAL, 0) == -1) {
    printf("semaphore reset fail\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<reset_semvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
jne    1165 <reset_semvalue+0x45>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <reset_semvalue+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_semvalue>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     113f <reset_semvalue+0x1f>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SETVAL = global i32 0
@.str = [22 x i8] c"semaphore reset fail\0A\00"
define i32 @reset_semvalue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = load i32, i32* @SETVAL
%9 = call i32 @semctl(i32 %6, i32 %7, i32 %8, i32 0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SETVAL = global i32 0
@str = [21 x i8] c"semaphore reset fail\00"
define i32 @reset_semvalue(i32 %0, i32 %1) {
%3 = load i32, i32* @SETVAL
%4 = tail call i32 @semctl(i32 %0, i32 %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writeRTR(unsigned data) {
  w5100_write_byte(0x0017, data >> 8);
  w5100_write_byte(0x0017 + 1, data & 0xFF);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shr    $0x8,%esi
mov    $0x17,%edi
call   1030 <w5100_write_byte@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x18,%edi
call   1030 <w5100_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
shr    $0x8,%esi
mov    $0x17,%edi
call   1030 <w5100_write_byte@plt>
movzbl %bl,%esi
mov    $0x18,%edi
pop    %rbx
jmp    1030 <w5100_write_byte@plt>

LLVM IR (-O0):
define void @w5100_writeRTR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = call i32 @w5100_write_byte(i32 23, i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @w5100_write_byte(i32 24, i32 %7)
ret void
}

LLVM IR (-O2):
define void @w5100_writeRTR(i32 %0) {
%2 = lshr i32 %0, 8
%3 = tail call i32 @w5100_write_byte(i32 23, i32 %2)
%4 = and i32 %0, 255
%5 = tail call i32 @w5100_write_byte(i32 24, i32 %4)
ret void
}
void AnalyseData(char *AD) {}


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

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

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

LLVM IR (-O2):
define void @AnalyseData(i8* nocapture %0) {
ret void
}
void foo470(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo470(i32 %0) {
ret void
}
int delta(int a, int b) {
  if (a > b) {
    return a - b;
  } else {
    return b - a;
  }
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <delta+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <delta+0x2d>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @delta(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
long long add(int a, int b) { return (long long)a + (long long)b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
movslq %edi,%rcx
movslq %esi,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @add(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 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @add(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = add nsw i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ lpt_closeport();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_reset();
void chip_shutdown(void) {
  fflush(stdout);
  test_reset();
  lpt_closeport();
}


x86 assembly (clang, -O0):
<chip_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1030 <test_reset@plt>
mov    $0x0,%al
call   1050 <lpt_closeport@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chip_shutdown>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   1030 <test_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <lpt_closeport@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @chip_shutdown() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = call i32 (...) @test_reset()
%4 = call i32 (...) @lpt_closeport()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @chip_shutdown() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 (...) @test_reset()
%4 = tail call i32 (...) @lpt_closeport()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ int_init();
int /*<<< orphan*/ loader_data_init();
int /*<<< orphan*/ mem_init();
int /*<<< orphan*/ vty_init();
void init() {
  loader_data_init();
  vty_init();
  gdt_init();
  int_init();
  mem_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <loader_data_init@plt>
mov    $0x0,%al
call   1030 <vty_init@plt>
mov    $0x0,%al
call   1060 <gdt_init@plt>
mov    $0x0,%al
call   1050 <int_init@plt>
mov    $0x0,%al
call   1040 <mem_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1070 <loader_data_init@plt>
xor    %eax,%eax
call   1030 <vty_init@plt>
xor    %eax,%eax
call   1060 <gdt_init@plt>
xor    %eax,%eax
call   1050 <int_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <mem_init@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @loader_data_init()
%2 = call i32 (...) @vty_init()
%3 = call i32 (...) @gdt_init()
%4 = call i32 (...) @int_init()
%5 = call i32 (...) @mem_init()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @loader_data_init()
%2 = tail call i32 (...) @vty_init()
%3 = tail call i32 (...) @gdt_init()
%4 = tail call i32 (...) @int_init()
%5 = tail call i32 (...) @mem_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_LDBU_PTR(int r, int r2) { C67_asm("LDBU.D *", r, r2, 0); }


x86 assembly (clang, -O0):
<C67_LDBU_PTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDBU_PTR>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"LDBU.D *\00"
define void @C67_LDBU_PTR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
long int labs(long int i) { return (i >= 0) ? i : -i; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void gtk_ui_manager_get_add_tearoffs() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_get_add_tearoffs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ylsysfs_write_control_file(char *, char *);
void set_yldisp_text(char *text) { ylsysfs_write_control_file("line3", text); }


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

x86 assembly (clang, -O2):
<set_yldisp_text>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <ylsysfs_write_control_file@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"line3\00"
define void @set_yldisp_text(i8* %0) {
%2 = tail call i32 @ylsysfs_write_control_file(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}