xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int member_0;
  int /*<<< orphan*/ member_1;
};
struct event_base {
  int dummy;
};
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ event_base_loopexit(struct event_base *, struct timeval *);
int /*<<< orphan*/ printf(char *);
void signal_cb(evutil_socket_t sig, short events, void *user_data) {
  struct event_base *base = user_data;
  struct timeval delay = {2, 0};
  printf("Caught an interrupt signal; exiting cleanly in two seconds.\n");
  event_base_loopexit(base, &delay);
}


x86 assembly (clang, -O0):
<signal_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <event_base_loopexit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_cb>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movq   $0x2,0x8(%rsp)
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <event_base_loopexit@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.event_base = type { i32 }
@__const.signal_cb.delay = %struct.timeval { i32 2, i32 0 }
@.str = [61 x i8] c"Caught an interrupt signal; exiting cleanly in two seconds.\0A\00"
define void @signal_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event_base*
%8 = alloca %struct.timeval
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to %struct.event_base*
store %struct.event_base* %10, %struct.event_base** %7
%11 = bitcast %struct.timeval* %8 to i8*
%12 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%13 = load %struct.event_base*, %struct.event_base** %7
%14 = call i32 @event_base_loopexit(%struct.event_base* %13, %struct.timeval* %8)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.event_base = type { i32 }
@str = [60 x i8] c"Caught an interrupt signal; exiting cleanly in two seconds.\00"
define void @signal_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to %struct.timeval*
%6 = bitcast i8* %2 to %struct.event_base*
%7 = bitcast i64* %4 to i8*
store i64 2, i64* %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%9 = call i32 @event_base_loopexit(%struct.event_base* %6, %struct.timeval* %5)
ret void
}
unsigned int bitwisehash(char *word, int tsize, unsigned int seed) {
  char c;
  unsigned int h;
  h = seed;
  for (; (c = *word) != '\0'; word++) {
    h ^= ((h << 5) + c + (h >> 2));
  }
  return ((unsigned int)((h & 0x7fffffff) % tsize));
}


x86 assembly (clang, -O0):
<bitwisehash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1154 <bitwisehash+0x54>
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
movsbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <bitwisehash+0x14>
mov    -0x18(%rbp),%eax
and    $0x7fffffff,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwisehash>:
mov    %edx,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1130 <bitwisehash+0x30>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%r8d
mov    %eax,%edx
shl    $0x5,%edx
mov    %eax,%ecx
shr    $0x2,%ecx
add    %edx,%ecx
add    %r8d,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <bitwisehash+0x10>
and    $0x7fffffff,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bitwisehash(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %17, %6 ], [ %4, %3 ]
%8 = phi i32 [ %15, %6 ], [ %2, %3 ]
%9 = phi i8* [ %16, %6 ], [ %0, %3 ]
%10 = sext i8 %7 to i32
%11 = shl i32 %8, 5
%12 = lshr i32 %8, 2
%13 = add i32 %12, %11
%14 = add i32 %13, %10
%15 = xor i32 %14, %8
%16 = getelementptr inbounds i8, i8* %9, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %6, %3
%20 = phi i32 [ %2, %3 ], [ %15, %6 ]
%21 = and i32 %20, 2147483647
%22 = urem i32 %21, %1
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ret = 0;
  fun(1);
  printf("RETURNED %d\n", ret);
  if (ret != 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%edi
call   1030 <fun@plt>
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
je     116c <main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <main+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"RETURNED %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fun(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ puts(char *);
void printArray(double *array, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%f ", array[i]);
  }
  puts("");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <printArray+0x16>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [1 x i8] zeroinitializer
define void @printArray(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
define void @printArray(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void gdk_display_get_pointer() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_pointer() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XColormapEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XColormapEvent(void) {
  XColormapEvent *_p = (XColormapEvent *)malloc(sizeof(XColormapEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XColormapEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XColormapEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XColormapEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XColormapEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XColormapEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XColormapEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *cmd) {
  printf("%s\n", cmd);
  char *base = basename(cmd);
  fprintf(stderr, "Usage: %s infile [outfile]\n", base);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <basename@plt>
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%edi
lea    0xea9(%rip),%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"Usage: %s infile [outfile]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @basename(i8* %6)
store i8* %7, i8** %3
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"Usage: %s infile [outfile]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @basename(i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int bb_serial_read_close(int pi, unsigned user_gpio) {
  return pigpio_command(pi, 44, user_gpio, 0, 1);
}


x86 assembly (clang, -O0):
<bb_serial_read_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x2c,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_serial_read_close>:
mov    %esi,%edx
mov    $0x2c,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @bb_serial_read_close(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 @pigpio_command(i32 %5, i32 44, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bb_serial_read_close(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 44, i32 %1, i32 0, i32 1)
ret i32 %3
}
float _COM_CONVdf(double a) { return a; }


x86 assembly (clang, -O0):
<_COM_CONVdf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CONVdf>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @_COM_CONVdf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @_COM_CONVdf(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
main() {
  goto a;
  {
  b:
    goto c;
  }
d:
  return 0;
c:
  goto d;
  {
  a:
    goto b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    111e <main+0x1e>
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret
jmp    1115 <main+0x15>
jmp    1110 <main+0x10>

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int is_pkeys_supported(void) {
  if (!cpu_has_pkeys()) {
    do {
      if (1 <= 0)
        sigsafe_printf("SKIP: %s: no CPU support\n", __func__);
    } while (0);
    return 0;
  }
  if (!kernel_has_pkeys()) {
    do {
      if (1 <= 0)
        sigsafe_printf("SKIP: %s: no kernel support\n", __func__);
    } while (0);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_pkeys_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <cpu_has_pkeys@plt>
cmp    $0x0,%eax
jne    114e <is_pkeys_supported+0x2e>
jmp    113d <is_pkeys_supported+0x1d>
jmp    1142 <is_pkeys_supported+0x22>
movl   $0x0,-0x4(%rbp)
jmp    117b <is_pkeys_supported+0x5b>
mov    $0x0,%al
call   1030 <kernel_has_pkeys@plt>
cmp    $0x0,%eax
jne    1174 <is_pkeys_supported+0x54>
jmp    1163 <is_pkeys_supported+0x43>
jmp    1168 <is_pkeys_supported+0x48>
movl   $0x0,-0x4(%rbp)
jmp    117b <is_pkeys_supported+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pkeys_supported>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cpu_has_pkeys@plt>
test   %eax,%eax
je     113c <is_pkeys_supported+0x1c>
xor    %eax,%eax
call   1030 <kernel_has_pkeys@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_pkeys_supported() {
%1 = tail call i32 (...) @cpu_has_pkeys()
%2 = icmp eq i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @kernel_has_pkeys()
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct dev_policy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pol_dedup(struct dev_policy *);
int /*<<< orphan*/ pol_new(struct dev_policy **, char *, char *, char *);
int /*<<< orphan*/ pol_sort(struct dev_policy **);
void pol_add(struct dev_policy **pol, char *name, char *val, char *metadata) {
  pol_new(pol, name, val, metadata);
  pol_sort(pol);
  pol_dedup(*pol);
}


x86 assembly (clang, -O0):
<pol_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <pol_new@plt>
mov    -0x8(%rbp),%rdi
call   1050 <pol_sort@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <pol_dedup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pol_add>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pol_new@plt>
mov    %rbx,%rdi
call   1050 <pol_sort@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <pol_dedup@plt>

LLVM IR (-O0):
%struct.dev_policy = type { i32 }
define void @pol_add(%struct.dev_policy** %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.dev_policy**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.dev_policy** %0, %struct.dev_policy*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.dev_policy**, %struct.dev_policy*** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @pol_new(%struct.dev_policy** %9, i8* %10, i8* %11, i8* %12)
%14 = load %struct.dev_policy**, %struct.dev_policy*** %5
%15 = call i32 @pol_sort(%struct.dev_policy** %14)
%16 = load %struct.dev_policy**, %struct.dev_policy*** %5
%17 = load %struct.dev_policy*, %struct.dev_policy** %16
%18 = call i32 @pol_dedup(%struct.dev_policy* %17)
ret void
}

LLVM IR (-O2):
%struct.dev_policy = type { i32 }
define void @pol_add(%struct.dev_policy** %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pol_new(%struct.dev_policy** %0, i8* %1, i8* %2, i8* %3)
%6 = tail call i32 @pol_sort(%struct.dev_policy** %0)
%7 = load %struct.dev_policy*, %struct.dev_policy** %0
%8 = tail call i32 @pol_dedup(%struct.dev_policy* %7)
ret void
}
/* Variables and functions */
unsigned strhash(const char *x) {
  unsigned h = 0;
  while (*x)
    h = h * 13 + *(x++);
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <strhash+0x3c>
imul   $0xd,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strhash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(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* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 13
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%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
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test27(__m64 a, __m64 b) { return _mm_avg_pu16(a, b); }


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

x86 assembly (clang, -O2):
<test27>:
jmp    1030 <_mm_avg_pu16@plt>

LLVM IR (-O0):
define i32 @test27(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 @_mm_avg_pu16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test27(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_pu16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double log(double);
double ambient_ad2c(unsigned int ad) {
  double r;
  r = 3.0 / (4096.0 / (double)ad - 1.0);
  return 25.0 - 45.0 * (log(r / 3.0) / 2.0529692213);
}


x86 assembly (clang, -O0):
<ambient_ad2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xefd(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xee9(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ambient_ad2c>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xedc(%rip),%xmm1
movsd  0xedc(%rip),%xmm2
movapd %xmm2,%xmm0
divsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1030 <log@plt>
divsd  0xecb(%rip),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ambient_ad2c(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = fdiv double 4.096000e+03, %5
%7 = fsub double %6, 1.000000e+00
%8 = fdiv double 3.000000e+00, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = fdiv double %9, 3.000000e+00
%11 = call double @log(double %10)
%12 = fdiv double %11, 0x40006C7B20896CB9
%13 = call double @llvm.fmuladd.f64(double -4.500000e+01, double %12, double 2.500000e+01)
ret double %13
}

LLVM IR (-O2):
define double @ambient_ad2c(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fdiv double 4.096000e+03, %2
%4 = fadd double %3, -1.000000e+00
%5 = fdiv double 3.000000e+00, %4
%6 = fdiv double %5, 3.000000e+00
%7 = tail call double @log(double %6)
%8 = fdiv double %7, 0x40006C7B20896CB9
%9 = tail call double @llvm.fmuladd.f64(double %8, double -4.500000e+01, double 2.500000e+01)
ret double %9
}
/* Variables and functions */
int bar();
int main(void) { return bar(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
void rule_dgp_cond_update(const struct XCSF *xcsf, const struct Cl *c,
                          const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_cond_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_cond_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
float ddgl_degrees(float radians) {
  return radians * (180.0f / 3.1415926535898f);
}


x86 assembly (clang, -O0):
<ddgl_degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddgl_degrees>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @ddgl_degrees(float %0) {
%2 = fmul float %0, 0x404CA5DC00000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ test2();
int main1(int argc, char **argv) {
  int i;
  int p = 0;
  const char v = 'c';
  void *pp;
  pp = malloc(1000);
  i = 9;
  p = i + 10;
  test2();
  free(pp);
  fclose(0);
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x63,-0x19(%rbp)
mov    $0x3e8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x9,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <test2@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
push   %rbx
mov    $0x3e8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <test2@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main1(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
store i8 99, i8* %7
%9 = call i8* @malloc(i32 1000)
store i8* %9, i8** %8
store i32 9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 10
store i32 %11, i32* %6
%12 = call i32 (...) @test2()
%13 = load i8*, i8** %8
%14 = call i32 @free(i8* %13)
%15 = call i32 @fclose(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main1(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(1000) i8* @malloc(i32 1000)
%4 = tail call i32 (...) @test2()
%5 = tail call i32 @free(i8* %3)
%6 = tail call i32 @fclose(i32 0)
ret i32 0
}
void olpc_mic_bias(struct snd_ac97 *ac97, int on) {}


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

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

LLVM IR (-O0):
%struct.snd_ac97 = type opaque
define void @olpc_mic_bias(%struct.snd_ac97* %0, i32 %1) {
%3 = alloca %struct.snd_ac97*
%4 = alloca i32
store %struct.snd_ac97* %0, %struct.snd_ac97** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.snd_ac97 = type opaque
define void @olpc_mic_bias(%struct.snd_ac97* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(char *, long, size_t);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *__strdup(char *source) {
  size_t size = strlen(source) + 1;
  char *dest = (char *)malloc(size);
  memset(dest, 0L, size);
  strcpy(dest, source);
  return dest;
}


x86 assembly (clang, -O0):
<__strdup>:
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   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @__strdup(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 i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @memset(i8* %12, i64 0, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @__strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memset(i8* %6, i64 0, i64 %4)
%8 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
/* Variables and functions */
int mq_unlink(char *);
int unlinkMsgQueue(char *pcQueueName) { return mq_unlink(pcQueueName); }


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

x86 assembly (clang, -O2):
<unlinkMsgQueue>:
jmp    1030 <mq_unlink@plt>

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

LLVM IR (-O2):
define i32 @unlinkMsgQueue(i8* %0) {
%2 = tail call i32 @mq_unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void send_rule_to_proc() { printf("TODO: send_rule_to_procn\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"TODO: send_rule_to_procn\00"
define void @send_rule_to_proc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int getRandomNumber(int max) { return rand() % max; }


x86 assembly (clang, -O0):
<getRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRandomNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRandomNumber(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
int issetTTyMode(void *sg, const char *mode) { return -1; }


x86 assembly (clang, -O0):
<issetTTyMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @issetTTyMode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @issetTTyMode(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
int equal(int *a, int *b, int dim) {
  int j;
  for (j = 0; j < dim; j++) {
    if (a[j] != b[j])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <equal+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <equal+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <equal+0x64>
jmp    114f <equal+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <equal+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <equal+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <equal+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <equal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @equal(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ CopyPositionProc();
void CopyFENToClipboard() { CopyPositionProc(); }


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

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

LLVM IR (-O0):
define void @CopyFENToClipboard() {
%1 = call i32 (...) @CopyPositionProc()
ret void
}

LLVM IR (-O2):
define void @CopyFENToClipboard() {
%1 = tail call i32 (...) @CopyPositionProc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void about() {
  printf("This tool was developped by M3nth0le.\n"
         "The project began the Friday, 15 August.\n"
         "GitHub : https://github.com/M3nth0le/ShellcodeTools/\n"
         "Ascii Art : http://patorjk.com/software/taag/\n"
         "\nVersion: 0.1\n");
}


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

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

LLVM IR (-O0):
@.str = [193 x i8] c"This tool was developped by M3nth0le.\0AThe project began the Friday, 15 August.\0AGitHub : https://github.com/M3nth0le/ShellcodeTools/\0AAscii Art : http://patorjk.com/software/taag/\0A\0AVersion: 0.1\0A\00"
define void @about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [192 x i8] c"This tool was developped by M3nth0le.\0AThe project began the Friday, 15 August.\0AGitHub : https://github.com/M3nth0le/ShellcodeTools/\0AAscii Art : http://patorjk.com/software/taag/\0A\0AVersion: 0.1\00"
define void @about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n",
                "usage: tset  [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m "
                "mapping] [terminal]",
                "       reset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m "
                "mapping] [terminal]");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xf0f(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf12(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [74 x i8] c"usage: tset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\00"
@.str.2 = [74 x i8] c" reset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [74 x i8] c"usage: tset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\00"
@.str.2 = [74 x i8] c" reset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_binding_set_activate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_binding_set_activate() {
ret void
}
/* Variables and functions */
scalar_t__ MP_sema(int);
int /*<<< orphan*/ MP_semaset(int, scalar_t__);
void MP_p3wait5(void) {
  MP_semaset(1, MP_sema(1) + 1);
  while (MP_sema(1) != 0)
    ;
}


x86 assembly (clang, -O0):
<MP_p3wait5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <MP_sema@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x1,%edi
call   1030 <MP_semaset@plt>
mov    $0x1,%edi
call   1040 <MP_sema@plt>
cmp    $0x0,%rax
je     1158 <MP_p3wait5+0x38>
jmp    113f <MP_p3wait5+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MP_p3wait5>:
push   %rax
mov    $0x1,%edi
call   1040 <MP_sema@plt>
lea    0x1(%rax),%rsi
mov    $0x1,%edi
call   1030 <MP_semaset@plt>
nopl   0x0(%rax)
mov    $0x1,%edi
call   1040 <MP_sema@plt>
test   %rax,%rax
jne    1140 <MP_p3wait5+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @MP_p3wait5() {
%1 = call i64 @MP_sema(i32 1)
%2 = add nsw i64 %1, 1
%3 = call i32 @MP_semaset(i32 1, i64 %2)
br label %4
4: ; preds = %7, %0
%5 = call i64 @MP_sema(i32 1)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
br label %4
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @MP_p3wait5() {
%1 = tail call i64 @MP_sema(i32 1)
%2 = add nsw i64 %1, 1
%3 = tail call i32 @MP_semaset(i32 1, i64 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call i64 @MP_sema(i32 1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
int test_imm_1Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x1f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fuint64_midword_reg>:
test   $0x1f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2031616
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
struct foo *returnF(struct foo *f, long *blah) {
  return f;
}


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

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

LLVM IR (-O0):
%struct.foo = type opaque
define %struct.foo* @returnF(%struct.foo* %0, i64* %1) {
%3 = alloca %struct.foo*
%4 = alloca i64*
store %struct.foo* %0, %struct.foo** %3
store i64* %1, i64** %4
%5 = load %struct.foo*, %struct.foo** %3
ret %struct.foo* %5
}

LLVM IR (-O2):
%struct.foo = type opaque
define %struct.foo* @returnF(%struct.foo* readnone returned %0, i64* nocapture readnone %1) {
ret %struct.foo* %0
}
/* Type definitions */
struct A {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ take(char const *);
int f(const void *p) {
  struct A *a = p;
  struct A *b = (struct A *)p;
  (void)a;
  (void)b;
  const char c = 5;
  take(&c);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x5,-0x21(%rbp)
lea    -0x21(%rbp),%rdi
call   1030 <take@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movb   $0x5,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <take@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.A = type { i32 }
define i32 @f(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.A*
%5 = alloca %struct.A*
%6 = alloca i8
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.A*
store %struct.A* %8, %struct.A** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to %struct.A*
store %struct.A* %10, %struct.A** %5
%11 = load %struct.A*, %struct.A** %4
%12 = load %struct.A*, %struct.A** %5
store i8 5, i8* %6
%13 = call i32 @take(i8* %6)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i8* nocapture readnone %0) {
%2 = alloca i8
store i8 5, i8* %2
%3 = call i32 @take(i8* %2)
ret i32 undef
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int INET_ECN_is_ce(__u8 dsfield) { return (dsfield & 3) == 3; }


x86 assembly (clang, -O0):
<INET_ECN_is_ce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INET_ECN_is_ce>:
not    %edi
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @INET_ECN_is_ce(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @INET_ECN_is_ce(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
int DeleteFile_test() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DeleteFile_test() {
ret i32 0
}