xunge/DecIR huggingface dataset:
int is_pointer_type(const char *type_name) {
  int i;
  if (!type_name) {
    return 0;
  }
  for (i = 0; type_name[i]; i++) {
    if (type_name[i] == '*') {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_pointer_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <is_pointer_type+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1173 <is_pointer_type+0x73>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116c <is_pointer_type+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1159 <is_pointer_type+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1173 <is_pointer_type+0x73>
jmp    115e <is_pointer_type+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <is_pointer_type+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pointer_type>:
xor    %eax,%eax
test   %rdi,%rdi
je     1127 <is_pointer_type+0x27>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1127 <is_pointer_type+0x27>
cmp    $0x2a,%cl
je     1122 <is_pointer_type+0x22>
add    $0x1,%rdi
jmp    1110 <is_pointer_type+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_pointer_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i64 [ %8, %7 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %10
i8 42, label %9
]
7: ; preds = %3
%8 = add nuw i64 %4, 1
br label %3
9: ; preds = %3
br label %10
10: ; preds = %3, %9, %1
%11 = phi i32 [ 0, %1 ], [ 1, %9 ], [ 0, %3 ]
ret i32 %11
}
void USBEndpointDataToggleClear(unsigned long ulBase, unsigned long ulEndpoint,
                                unsigned long ulFlags) {
  ;

  ;
  if (ulFlags & (0x00002000 | 0x00002000)) {
    (*((volatile unsigned char *)(ulBase + 0x00000112 +
                                  (ulEndpoint - 0x10)))) |= 0x00000040;
  } else {
    (*((volatile unsigned char *)(ulBase + 0x00000116 +
                                  (ulEndpoint - 0x10)))) |= 0x00000080;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDataToggleClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     1148 <USBEndpointDataToggleClear+0x48>
mov    -0x8(%rbp),%rax
add    $0x112,%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x40,%ecx
mov    %cl,(%rax)
jmp    116a <USBEndpointDataToggleClear+0x6a>
mov    -0x8(%rbp),%rax
add    $0x116,%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDataToggleClear>:
add    %rsi,%rdi
xor    %eax,%eax
test   $0x2000,%edx
mov    $0x80,%ecx
mov    $0x40,%edx
cmove  %ecx,%edx
sete   %al
or     %dl,0x102(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @USBEndpointDataToggleClear(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = and i64 %7, 8192
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i64, i64* %4
%12 = add i64 %11, 274
%13 = load i64, i64* %5
%14 = sub i64 %13, 16
%15 = add i64 %12, %14
%16 = inttoptr i64 %15 to i8*
%17 = load volatile i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, 64
%20 = trunc i32 %19 to i8
store volatile i8 %20, i8* %16
br label %32
21: ; preds = %3
%22 = load i64, i64* %4
%23 = add i64 %22, 278
%24 = load i64, i64* %5
%25 = sub i64 %24, 16
%26 = add i64 %23, %25
%27 = inttoptr i64 %26 to i8*
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i32
%30 = or i32 %29, 128
%31 = trunc i32 %30 to i8
store volatile i8 %31, i8* %27
br label %32
32: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDataToggleClear(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
%6 = add i64 %1, %0
%7 = select i1 %5, i64 262, i64 258
%8 = select i1 %5, i8 -128, i8 64
%9 = add i64 %6, %7
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = or i8 %11, %8
store volatile i8 %12, i8* %10
ret void
}
unsigned long int hashString(char *str) {
  unsigned long hash = 5381;
  unsigned long c;
  while ((c = (unsigned long)*str++) != 0)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114a <hashString+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashString+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <hashString+0x3d>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %rdx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq %cl,%rcx
shl    $0x5,%rax
add    %rdx,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %rax,%rdx
test   %cl,%cl
jne    1120 <hashString+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i64 %7, 33
%11 = add i64 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getppid();
pid_t c_getppid(void) { return getppid(); }


x86 assembly (clang, -O0):
<c_getppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getppid@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @c_getppid() {
%1 = call i32 (...) @getppid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_getppid() {
%1 = tail call i32 (...) @getppid()
ret i32 %1
}
char *my_strrfind(char *s1, char c) {
  char *r = ((void *)0);
  if (s1)
    for (; *s1; s1++)
      if (*s1 == c)
        r = s1;
  return r;
}


x86 assembly (clang, -O0):
<my_strrfind>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <my_strrfind+0x69>
jmp    1126 <my_strrfind+0x26>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <my_strrfind+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <my_strrfind+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1153 <my_strrfind+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1126 <my_strrfind+0x26>
jmp    1169 <my_strrfind+0x69>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strrfind>:
test   %rdi,%rdi
je     1124 <my_strrfind+0x24>
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <my_strrfind+0x23>
nopl   (%rax)
cmp    %sil,%cl
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_strrfind+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_strrfind(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %14, %7 ], [ %5, %4 ]
%9 = phi i8* [ %12, %7 ], [ null, %4 ]
%10 = phi i8* [ %13, %7 ], [ %0, %4 ]
%11 = icmp eq i8 %8, %1
%12 = select i1 %11, i8* %10, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %4, %2
%17 = phi i8* [ null, %2 ], [ null, %4 ], [ %12, %7 ]
ret i8* %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ rambo1clock(int /*<<< orphan*/);
void rambo1chrSetClock(uint16_t addr, uint8_t val) {
  (void)val;
  rambo1clock(addr);
}


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

x86 assembly (clang, -O2):
<rambo1chrSetClock>:
jmp    1030 <rambo1clock@plt>

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

LLVM IR (-O2):
define void @rambo1chrSetClock(i32 %0, i32 %1) {
%3 = tail call i32 @rambo1clock(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
void aff_stuff(char **av) {
  my_putstr("- -");
  my_putstr(av[1]);
  my_putstr("- -\n");
}


x86 assembly (clang, -O0):
<aff_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <my_putstr@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <my_putstr@plt>
lea    0xec8(%rip),%rdi
call   1030 <my_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aff_stuff>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <my_putstr@plt>
mov    0x8(%rbx),%rdi
call   1030 <my_putstr@plt>
lea    0xed4(%rip),%rdi
pop    %rbx
jmp    1030 <my_putstr@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"- -\00"
@.str.1 = [5 x i8] c"- -\0A\00"
define void @aff_stuff(i8** nocapture %0) {
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @my_putstr(i8* %4)
%6 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void reexec() {}


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

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

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

LLVM IR (-O2):
define void @reexec() {
ret void
}
unsigned addval_329(unsigned x) { return x + 3674262153U; }


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

x86 assembly (clang, -O2):
<addval_329>:
lea    -0x24ff3577(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_329(i32 %0) {
%2 = add i32 %0, -620705143
ret i32 %2
}
/* Variables and functions */
int get_sub4(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_sub4(int a, int b, int mask) {
  int f, r;
  f = get_sub4(a, b, &r);
  f &= mask;
  printf("sub"
         " 4"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_sub4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1040 <get_sub4@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sub4>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1040 <get_sub4@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sub 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_sub4(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"sub 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_sub4(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
/* Variables and functions */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char const *argv[]) {
  int array1[] = {1, 4};
  int array2[] = {2, 3};
  double result = findMedianSortedArrays(array1, 2, array2, 2);
  printf("result:%f \n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rdx
mov    $0x2,%ecx
mov    %ecx,%esi
call   1040 <findMedianSortedArrays@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x400000001,%rax
mov    %rax,0x10(%rsp)
movabs $0x300000002,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x2,%esi
mov    $0x2,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array1 = [2 x i32] [i32 1, i32 4]
@__const.main.array2 = [2 x i32] [i32 2, i32 3]
@.str = [12 x i8] c"result:%f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x i32]* %6 to i8*
%10 = bitcast [2 x i32]* %7 to i8*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = call double @findMedianSortedArrays(i32* %11, i32 2, i32* %12, i32 2)
store double %13, double* %8
%14 = load double, double* %8
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"result:%f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 17179869185, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 12884901890, i64* %4
%7 = bitcast i64* %3 to i32*
%8 = bitcast i64* %4 to i32*
%9 = call double @findMedianSortedArrays(i32* %7, i32 2, i32* %8, i32 2)
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
char *lmalloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *lstrdup(const char *s) {
  size_t l = strlen(s) + 1;
  char *p = lmalloc(l);
  memcpy(p, s, l);
  return p;
}


x86 assembly (clang, -O0):
<lstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <lmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @lstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @lmalloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @lstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @lmalloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sendmail(char *, char *, char *, char *);
int main() { sendmail("413977243@qq.com", "1111", "22222222222", "mail.h"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xeed(%rip),%rdx
lea    0xef2(%rip),%rcx
call   1030 <sendmail@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"413977243@qq.com\00"
@.str.1 = [5 x i8] c"1111\00"
@.str.2 = [12 x i8] c"22222222222\00"
@.str.3 = [7 x i8] c"mail.h\00"
define i32 @main() {
%1 = call i32 @sendmail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"413977243@qq.com\00"
@.str.1 = [5 x i8] c"1111\00"
@.str.2 = [12 x i8] c"22222222222\00"
@.str.3 = [7 x i8] c"mail.h\00"
define i32 @main() {
%1 = tail call i32 @sendmail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int read_devattr(char const *, char **);
int /*<<< orphan*/ sscanf(char *, char *, long long *);
int read_devattr_slonglong(const char *attr, long long *value) {
  char *buf;
  int ret;
  ret = read_devattr(attr, &buf);
  if (ret < 0)
    return ret;
  sscanf(buf, "%lli", value);
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<read_devattr_slonglong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <read_devattr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1165 <read_devattr_slonglong+0x35>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <read_devattr_slonglong+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1050 <sscanf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_devattr_slonglong>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <read_devattr@plt>
test   %eax,%eax
js     1166 <read_devattr_slonglong+0x36>
mov    0x8(%rsp),%rdi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1050 <sscanf@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lli\00"
define i32 @read_devattr_slonglong(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @read_devattr(i8* %0, i8** %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ 0, %7 ], [ %5, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ appaserver_parameter_file_get_appaserver_mount_point();
int /*<<< orphan*/ environ_set_environment(char *, int /*<<< orphan*/);
void environ_appaserver_home(void) {
  environ_set_environment(
      "APPASERVER_HOME",
      appaserver_parameter_file_get_appaserver_mount_point());
}


x86 assembly (clang, -O0):
<environ_appaserver_home>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <appaserver_parameter_file_get_appaserver_mount_point@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <environ_set_environment@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<environ_appaserver_home>:
push   %rax
xor    %eax,%eax
call   1040 <appaserver_parameter_file_get_appaserver_mount_point@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <environ_set_environment@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"APPASERVER_HOME\00"
define void @environ_appaserver_home() {
%1 = call i32 (...) @appaserver_parameter_file_get_appaserver_mount_point()
%2 = call i32 @environ_set_environment(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"APPASERVER_HOME\00"
define void @environ_appaserver_home() {
%1 = tail call i32 (...) @appaserver_parameter_file_get_appaserver_mount_point()
%2 = tail call i32 @environ_set_environment(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putPT(int /*<<< orphan*/);
void ET2_putPT_BLK(unsigned char *bufp, unsigned ct) {
  while (ct) {
    putPT(*(bufp++));
    --ct;
  }
}


x86 assembly (clang, -O0):
<ET2_putPT_BLK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <ET2_putPT_BLK+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <putPT@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <ET2_putPT_BLK+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ET2_putPT_BLK>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <ET2_putPT_BLK+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <putPT@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <ET2_putPT_BLK+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ET2_putPT_BLK(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 @putPT(i32 %9)
%11 = add i32 %5, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ beval;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void knot_wire_write_u32(uint8_t *pos, uint32_t data) {
  assert(pos);
  uint32_t beval = htobe32(data);
  memcpy(pos, &beval, sizeof(beval));
}


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

x86 assembly (clang, -O2):
<knot_wire_write_u32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %ebp,%edi
call   1050 <htobe32@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @knot_wire_write_u32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @assert(i32* %6)
%8 = load i32, i32* %4
%9 = call i32 @htobe32(i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %3
%11 = call i32 @memcpy(i32* %10, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @knot_wire_write_u32(i32* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @assert(i32* %0)
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @htobe32(i32 %1)
store i32 %6, i32* %3
%7 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int encoderLeft();
int encoderRight();
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int odo_left, odo_right;
  init();
  while (1) {
    odo_right = encoderRight();
    odo_left = encoderLeft();
    printf("encoder = %d %d\n", odo_right, odo_left);
    sleep(1);
  }
}


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    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1070 <encoderRight@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <encoderLeft@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    116d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
lea    0xe9f(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <encoderRight@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <encoderLeft@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
@.str = [17 x i8] c"encoder = %d %d\0A\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 = call i32 (...) @init()
br label %9
9: ; preds = %2, %9
%10 = call i32 (...) @encoderRight()
store i32 %10, i32* %7
%11 = call i32 (...) @encoderLeft()
store i32 %11, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = call i32 @sleep(i32 1)
br label %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"encoder = %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @encoderRight()
%6 = tail call i32 (...) @encoderLeft()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @sleep(i32 1)
br label %4
}
const char *cli_get_version(void) { return "0.1.0"; }


x86 assembly (clang, -O0):
<cli_get_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_get_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.1.0\00"
define i8* @cli_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.1.0\00"
define i8* @cli_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long __raw_local_save_flags();
int raw_irqs_disabled_flags(unsigned long);
int raw_irqs_disabled(void) {
  unsigned long flags = __raw_local_save_flags();
  return raw_irqs_disabled_flags(flags);
}


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

x86 assembly (clang, -O2):
<raw_irqs_disabled>:
push   %rax
xor    %eax,%eax
call   1030 <__raw_local_save_flags@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <raw_irqs_disabled_flags@plt>

LLVM IR (-O0):
define i32 @raw_irqs_disabled() {
%1 = alloca i64
%2 = call i64 (...) @__raw_local_save_flags()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @raw_irqs_disabled_flags(i64 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @raw_irqs_disabled() {
%1 = tail call i64 (...) @__raw_local_save_flags()
%2 = tail call i32 @raw_irqs_disabled_flags(i64 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/repstd/modified_vlc/refs/heads/master/"
             "bin/.libs/lt-vlc-static.c",
             332, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x14c,%esi
lea    0xf43(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf5e(%rip),%rdx
mov    $0x14c,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/repstd/modified_vlc/refs/heads/master/bin/.libs/lt-vlc-static.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/repstd/modified_vlc/refs/heads/master/bin/.libs/lt-vlc-static.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
unsigned long inl(int);
int /*<<< orphan*/ outl(unsigned int const, int);
void setup_coherent_ht_domain(void) {
  static const unsigned int register_values[] = {
      ((((0) & 0xFF) << 16) | (((0x18) & 0x1f) << 11) | (((0) & 0x07) << 8) |
       ((0x40) & 0xFF)),
      0xfff0f0f0,
      0x00010101,
  };
  unsigned long reg;
  reg = inl(0xFC);
  reg &= register_values[1];
  reg |= register_values[2] & ~register_values[1];
  outl(register_values[0], 0xF8);
  outl(reg, 0xFC);
}


x86 assembly (clang, -O0):
<setup_coherent_ht_domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfc,%edi
call   1040 <inl@plt>
mov    %rax,-0x8(%rbp)
mov    0xec8(%rip),%eax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    0xebe(%rip),%eax
mov    0xeb4(%rip),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,%eax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    0xe9b(%rip),%edi
mov    $0xf8,%esi
call   1030 <outl@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    $0xfc,%esi
call   1030 <outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_coherent_ht_domain>:
push   %rbx
mov    $0xfc,%edi
call   1040 <inl@plt>
mov    %rax,%rbx
mov    $0xc040,%edi
mov    $0xf8,%esi
call   1030 <outl@plt>
and    $0xfff0f0f0,%ebx
or     $0x10101,%ebx
mov    %ebx,%edi
mov    $0xfc,%esi
pop    %rbx
jmp    1030 <outl@plt>

LLVM IR (-O0):
@setup_coherent_ht_domain.register_values = internal constant [3 x i32] [i32 49216, i32 -986896, i32 65793]
define void @setup_coherent_ht_domain() {
%1 = alloca i64
%2 = call i64 @inl(i32 252)
store i64 %2, i64* %1
%3 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @setup_coherent_ht_domain.register_values, i64 0, i64 1)
%4 = zext i32 %3 to i64
%5 = load i64, i64* %1
%6 = and i64 %5, %4
store i64 %6, i64* %1
%7 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @setup_coherent_ht_domain.register_values, i64 0, i64 2)
%8 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @setup_coherent_ht_domain.register_values, i64 0, i64 1)
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = zext i32 %10 to i64
%12 = load i64, i64* %1
%13 = or i64 %12, %11
store i64 %13, i64* %1
%14 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @setup_coherent_ht_domain.register_values, i64 0, i64 0)
%15 = call i32 @outl(i32 %14, i32 248)
%16 = load i64, i64* %1
%17 = trunc i64 %16 to i32
%18 = call i32 @outl(i32 %17, i32 252)
ret void
}

LLVM IR (-O2):
define void @setup_coherent_ht_domain() {
%1 = tail call i64 @inl(i32 252)
%2 = tail call i32 @outl(i32 49216, i32 248)
%3 = trunc i64 %1 to i32
%4 = and i32 %3, -986896
%5 = or i32 %4, 65793
%6 = tail call i32 @outl(i32 %5, i32 252)
ret void
}
int test_imm_AEuint32_reg(unsigned int val) {
  return ((val) & (0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEuint32_reg(i32 %0) {
%2 = and i32 %0, 174
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int pathComponentCount(char *source) {
  int count = 0;
  while (*source) {
    if (*source++ == '/') {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<pathComponentCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <pathComponentCount+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <pathComponentCount+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <pathComponentCount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathComponentCount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <pathComponentCount+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x2f,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <pathComponentCount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pathComponentCount(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ dflush();
int /*<<< orphan*/ errprintf(char *, double, char const *, int);
scalar_t__ gs_debug_c(char);
double orig_sqrt(double);
double gs_sqrt(double x, const char *file, int line) {
  if (gs_debug_c('~')) {
    errprintf("[~]sqrt(%g) at %s:%d\n", x, (const char *)file, line);
    dflush();
  }
  return orig_sqrt(x);
}


x86 assembly (clang, -O0):
<gs_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x7e,%edi
call   1040 <gs_debug_c@plt>
cmp    $0x0,%rax
je     1187 <gs_sqrt+0x47>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe85(%rip),%rdi
call   1060 <errprintf@plt>
mov    $0x0,%al
call   1050 <dflush@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <orig_sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_sqrt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
mov    $0x7e,%edi
call   1040 <gs_debug_c@plt>
test   %rax,%rax
je     1179 <gs_sqrt+0x39>
lea    0xe9d(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %rbx,%rsi
mov    %ebp,%edx
call   1060 <errprintf@plt>
xor    %eax,%eax
call   1050 <dflush@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <orig_sqrt@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"[~]sqrt(%g) at %s:%d\0A\00"
define double @gs_sqrt(double %0, i8* %1, i32 %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i32
store double %0, double* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i64 @gs_debug_c(i8 signext 126)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load double, double* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @errprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10, i8* %11, i32 %12)
%14 = call i32 (...) @dflush()
br label %15
15: ; preds = %9, %3
%16 = load double, double* %4
%17 = call double @orig_sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"[~]sqrt(%g) at %s:%d\0A\00"
define double @gs_sqrt(double %0, i8* %1, i32 %2) {
%4 = tail call i64 @gs_debug_c(i8 signext 126)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @errprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %0, i8* %1, i32 %2)
%8 = tail call i32 (...) @dflush()
br label %9
9: ; preds = %6, %3
%10 = tail call double @orig_sqrt(double %0)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
__u16 hea_set_u16_bits(__u16 oval, __u16 nval, int start, int end) {
  return hea_set_u64_bits(oval, nval, start + 48, end + 48);
}


x86 assembly (clang, -O0):
<hea_set_u16_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x30,%edx
mov    -0x10(%rbp),%ecx
add    $0x30,%ecx
call   1030 <hea_set_u64_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_set_u16_bits>:
add    $0x30,%edx
add    $0x30,%ecx
jmp    1030 <hea_set_u64_bits@plt>

LLVM IR (-O0):
define i32 @hea_set_u16_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 48
%13 = load i32, i32* %8
%14 = add nsw i32 %13, 48
%15 = call i32 @hea_set_u64_bits(i32 %9, i32 %10, i32 %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @hea_set_u16_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 48
%6 = add nsw i32 %3, 48
%7 = tail call i32 @hea_set_u64_bits(i32 %0, i32 %1, i32 %5, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glResumeTransformFeedback();
int /*<<< orphan*/ printGLError();
void glResumeTransformFeedback() {
  next_glResumeTransformFeedback();
  printGLError();
  debugPrint("glResumeTransformFeedback()\n");
}


x86 assembly (clang, -O0):
<glResumeTransformFeedback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_glResumeTransformFeedback@plt>
mov    $0x0,%al
call   1040 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glResumeTransformFeedback>:
push   %rax
xor    %eax,%eax
call   1030 <next_glResumeTransformFeedback@plt>
xor    %eax,%eax
call   1040 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"glResumeTransformFeedback()\0A\00"
define void @glResumeTransformFeedback() {
%1 = call i32 (...) @next_glResumeTransformFeedback()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"glResumeTransformFeedback()\0A\00"
define void @glResumeTransformFeedback() {
%1 = tail call i32 (...) @next_glResumeTransformFeedback()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
void glBlendEquationSeparate(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBlendEquationSeparate() {
ret void
}