xunge/DecIR huggingface dataset:
unsigned int hash_key(const void *key) {
  const char *str = (const char *)key;
  int c;
  unsigned int hash = 5381;
  while ((c = *str++) != 0)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1149 <hash_key+0x49>
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
add    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <hash_key+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_key+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_key+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_key(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 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 33
%11 = add i32 %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 i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *utf8_convert_utf8(const char *txt, size_t len) {
  char *ret;
  ret = malloc(len + 1);
  memcpy(ret, txt, len);
  ret[len] = 0;
  return ret;
}


x86 assembly (clang, -O0):
<utf8_convert_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_convert_utf8>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @utf8_convert_utf8(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
int ft_strlen(char *s) {
  int i;
  i = 0;
  while (s[i]) {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ft_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int compareUlong(const void *aptr, const void *bptr) {
  unsigned long a = *((unsigned long *)aptr), b = *((unsigned long *)bptr);
  return (a < b) ? -1 : ((a > b) ? 1 : 0);
}


x86 assembly (clang, -O0):
<compareUlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    113d <compareUlong+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <compareUlong+0x55>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareUlong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareUlong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = icmp ugt i64 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compareUlong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void matrix_pointer_free(void **m) {
  free(m);
  return;
}


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

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

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

LLVM IR (-O2):
define void @matrix_pointer_free(i8** nocapture %0) {
%2 = tail call i32 @free(i8** %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void mdelay(uint32_t delay) { usleep(delay * 1000); }


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @mdelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @mdelay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_create_Jacobian_evaluator(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc(148, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_create_Jacobian_evaluator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x94,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_create_Jacobian_evaluator>:
mov    $0x94,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_create_Jacobian_evaluator() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 148, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_create_Jacobian_evaluator() {
%1 = tail call i32 @_ada_use_c2phc(i32 148, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int, int, int);
int autohelperowl_attackpat14(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(-1, 1, move, transformation);
  return countlib(A) > 2;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x2,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat14>:
push   %rax
mov    %esi,%ecx
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <offset@plt>
mov    %eax,%edi
call   1040 <countlib@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat14(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 -1, i32 1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp sgt i32 %19, 2
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat14(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 1, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp sgt i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
size_t sbc_syn(int *, int, int, int *);
int sbc_dec(int x[], int n, int k, int *pmat, int syntab[]) {
  int bep = syntab[sbc_syn(x, n, k, pmat)];
  if (bep > -1)
    x[bep] ^= 0x1;
  return (bep);
}


x86 assembly (clang, -O0):
<sbc_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <sbc_syn@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jle    116d <sbc_dec+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbc_dec>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rdi,%rbx
call   1030 <sbc_syn@plt>
mov    (%r14,%rax,4),%eax
test   %eax,%eax
js     112b <sbc_dec+0x1b>
xorb   $0x1,(%rbx,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @sbc_dec(i32* %0, i32 %1, i32 %2, i32* %3, i32* nocapture %4) {
%6 = tail call i64 @sbc_syn(i32* %0, i32 %1, i32 %2, i32* %3)
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = zext i32 %8 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = xor i32 %13, 1
store i32 %14, i32* %12
br label %15
15: ; preds = %10, %5
ret i32 %8
}
int test_imm_C5uint32_mem(unsigned int *val) {
  return ((*val) & (0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xc5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C5uint32_mem>:
testb  $0xc5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C5uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 197
%6 = icmp ne i32 %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_C5uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 197
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int indice_in_vec(unsigned int *v, int j, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (v[i] == j)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<indice_in_vec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1154 <indice_in_vec+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1141 <indice_in_vec+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <indice_in_vec+0x5b>
jmp    1146 <indice_in_vec+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <indice_in_vec+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indice_in_vec>:
test   %edx,%edx
jle    111e <indice_in_vec+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %esi,(%rdi,%rcx,4)
je     1121 <indice_in_vec+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <indice_in_vec+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @indice_in_vec(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 = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
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 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

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


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

x86 assembly (clang, -O2):
<oc_exit>:
jmp    1030 <exit_impl@plt>

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

LLVM IR (-O2):
define void @oc_exit(i32 %0) {
%2 = tail call i32 @exit_impl(i32 %0)
ret void
}
/* Variables and functions */
int FP_Cmp(float, float);
int __gesf2(float a, float b) { return FP_Cmp(a, b); }


x86 assembly (clang, -O0):
<__gesf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <FP_Cmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gesf2>:
jmp    1030 <FP_Cmp@plt>

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

LLVM IR (-O2):
define i32 @__gesf2(float %0, float %1) {
%3 = tail call i32 @FP_Cmp(float %0, float %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ setLength(char *, int);
int strlen(char *);
int stuff(char *source, char *dest) {
  int a = strlen(source);
  memcpy(dest + 2, source, a);
  setLength(dest, a);
  return a + 2;
}


x86 assembly (clang, -O0):
<stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <setLength@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stuff>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0x2(%r14),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <setLength@plt>
add    $0x2,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @stuff(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = getelementptr inbounds i8, i8* %1, i64 2
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
%6 = tail call i32 @setLength(i8* %1, i32 %3)
%7 = add nsw i32 %3, 2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void clc() { db(0xF8); }


x86 assembly (clang, -O0):
<clc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clc>:
mov    $0xf8,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @clc() {
%1 = call i32 @db(i32 248)
ret void
}

LLVM IR (-O2):
define void @clc() {
%1 = tail call i32 @db(i32 248)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_ATTACH;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/);
int ptrace_attach(pid_t pid) { return ptrace(PTRACE_ATTACH, pid, NULL, 0); }


x86 assembly (clang, -O0):
<ptrace_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_attach>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_ATTACH = global i32 0
define i32 @ptrace_attach(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_ATTACH
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32* null, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@PTRACE_ATTACH = global i32 0
define i32 @ptrace_attach(i32 %0) {
%2 = load i32, i32* @PTRACE_ATTACH
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
ret i32 %3
}
int test_imm_DFint8_reg(signed char val) {
  return ((val) & (0xDF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DFint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xdf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_DFint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 223
%6 = icmp ne i32 %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_DFint8_reg(i8 signext %0) {
%2 = and i8 %0, -33
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int remove(char const *);
int nftw_remove_callback(const char *path, const struct stat *stat, int type,
                         struct FTW *ftw) {
  return remove(path);
}


x86 assembly (clang, -O0):
<nftw_remove_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nftw_remove_callback>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @nftw_remove_callback(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @nftw_remove_callback(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
ret i32 %5
}
/* Variables and functions */
int RE_Manipulate(char);
int RE_Add() { return (RE_Manipulate('a')); }


x86 assembly (clang, -O0):
<RE_Add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <RE_Manipulate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RE_Add>:
mov    $0x61,%edi
jmp    1030 <RE_Manipulate@plt>

LLVM IR (-O0):
define i32 @RE_Add() {
%1 = call i32 @RE_Manipulate(i8 signext 97)
ret i32 %1
}

LLVM IR (-O2):
define i32 @RE_Add() {
%1 = tail call i32 @RE_Manipulate(i8 signext 97)
ret i32 %1
}
int XDisplayWidthMM() {}


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

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

LLVM IR (-O0):
define i32 @XDisplayWidthMM() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDisplayWidthMM() {
ret i32 undef
}
/* Variables and functions */
long DIV_ROUND_CLOSEST(int, int);
long celsius_to_kelvin(long t) { return t - DIV_ROUND_CLOSEST(-273150, 1000); }


x86 assembly (clang, -O0):
<celsius_to_kelvin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0xfffbd502,%edi
mov    $0x3e8,%esi
call   1030 <DIV_ROUND_CLOSEST@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_kelvin>:
push   %rbx
mov    %rdi,%rbx
mov    $0xfffbd502,%edi
mov    $0x3e8,%esi
call   1030 <DIV_ROUND_CLOSEST@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @celsius_to_kelvin(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @DIV_ROUND_CLOSEST(i32 -273150, i32 1000)
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @celsius_to_kelvin(i64 %0) {
%2 = tail call i64 @DIV_ROUND_CLOSEST(i32 -273150, i32 1000)
%3 = sub nsw i64 %0, %2
ret i64 %3
}
int Unary(int op) {
  int unary;
  switch (op) {
  case -4:
  case '~':
  case -7:
  case -8:
    unary = 1;
    break;
  default:
    unary = 0;
  }
  return unary;
}


x86 assembly (clang, -O0):
<Unary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0x8,%eax
sub    $0x2,%eax
jb     1140 <Unary+0x40>
jmp    111e <Unary+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xfffffffc,%eax
je     1140 <Unary+0x40>
jmp    112f <Unary+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x7e,%eax
jne    114c <Unary+0x4c>
jmp    1140 <Unary+0x40>
movl   $0x1,-0x8(%rbp)
jmp    1153 <Unary+0x53>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unary>:
mov    $0x1,%eax
lea    0x8(%rdi),%ecx
cmp    $0x4,%ecx
ja     1117 <Unary+0x17>
mov    $0x13,%edx
bt     %ecx,%edx
jb     111c <Unary+0x1c>
cmp    $0x7e,%edi
jne    111d <Unary+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Unary(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 -4, label %5
i32 126, label %5
i32 -7, label %5
i32 -8, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %3
br label %7
6: ; preds = %1
store i32 0, i32* %3
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @Unary(i32 %0) {
switch i32 %0, label %2 [
i32 -4, label %3
i32 126, label %3
i32 -7, label %3
i32 -8, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thr_fn1(void *arg) {
  printf("thread 1 returning\n");
  return (void *)1;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"thread 1 returning\0A\00"
define i8* @thr_fn1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@str = [19 x i8] c"thread 1 returning\00"
define i8* @thr_fn1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ info(char *);
int /*<<< orphan*/ menu();
void dummy1(void) {
  info("Appel de la fonction 1");
  menu();
}


x86 assembly (clang, -O0):
<dummy1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <info@plt>
mov    $0x0,%al
call   1030 <menu@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <menu@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Appel de la fonction 1\00"
define void @dummy1() {
%1 = call i32 @info(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @menu()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Appel de la fonction 1\00"
define void @dummy1() {
%1 = tail call i32 @info(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @menu()
ret void
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_b_output(int bit) {
  gpio_mode((struct gpio *)0x40010C00, bit, 3 | 0);
}


x86 assembly (clang, -O0):
<gpio_b_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x40010c00,%edi
mov    $0x3,%edx
call   1030 <gpio_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_b_output>:
mov    %edi,%esi
mov    $0x40010c00,%edi
mov    $0x3,%edx
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_b_output(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 %3, i32 3)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_b_output(i32 %0) {
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073810432 to %struct.gpio*), i32 %0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
int /*<<< orphan*/ spiWriteRegister(int, int);
void rfmSetRX(void) {
  spiWriteRegister(0x05, 0x02);
  spiWriteRegister(0x07, (0x04 | 0x01));
  delayMicroseconds(200);
}


x86 assembly (clang, -O0):
<rfmSetRX>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <spiWriteRegister@plt>
mov    $0x7,%edi
mov    $0x5,%esi
call   1030 <spiWriteRegister@plt>
mov    $0xc8,%edi
call   1040 <delayMicroseconds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfmSetRX>:
push   %rax
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <spiWriteRegister@plt>
mov    $0x7,%edi
mov    $0x5,%esi
call   1030 <spiWriteRegister@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1040 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @rfmSetRX() {
%1 = call i32 @spiWriteRegister(i32 5, i32 2)
%2 = call i32 @spiWriteRegister(i32 7, i32 5)
%3 = call i32 @delayMicroseconds(i32 200)
ret void
}

LLVM IR (-O2):
define void @rfmSetRX() {
%1 = tail call i32 @spiWriteRegister(i32 5, i32 2)
%2 = tail call i32 @spiWriteRegister(i32 7, i32 5)
%3 = tail call i32 @delayMicroseconds(i32 200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, int);
void __ErrorMsg(char *msg, char *file, int line) {
  char mess[512];
  sprintf(mess, "%s\nin File %s at line %d\n", msg, file, line);
  assert(0);
}


x86 assembly (clang, -O0):
<__ErrorMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb0(%rip),%rsi
call   1040 <sprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ErrorMsg>:
sub    $0x208,%rsp
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec9(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
xor    %edi,%edi
add    $0x208,%rsp
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%s\0Ain File %s at line %d\0A\00"
define void @__ErrorMsg(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11)
%13 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s\0Ain File %s at line %d\0A\00"
define void @__ErrorMsg(i8* %0, i8* %1, i32 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_socket_is_local() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_socket_is_local"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_iochannel_socket_is_local\0A\00"
define i32 @pa_iochannel_socket_is_local() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_iochannel_socket_is_local\00"
define i32 @pa_iochannel_socket_is_local() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
double randomNumberFunc(void) { return rand() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<randomNumberFunc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumberFunc>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randomNumberFunc() {
%1 = call float (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
%5 = fpext float %4 to double
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randomNumberFunc() {
%1 = tail call float (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t number, size_t size) {
  void *ret;
  ret = malloc(number * size);
  if (ret != 0)
    memset(ret, 0, number * size);
  return ret;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int do_smbus_write_byte(int, unsigned int, unsigned int, unsigned char);
int smbus_write_byte(unsigned device, unsigned address, unsigned char val) {
  return do_smbus_write_byte(0x8D0, device, address, val);
}


x86 assembly (clang, -O0):
<smbus_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x8d0,%edi
movzbl -0x9(%rbp),%ecx
call   1030 <do_smbus_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_write_byte>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x8d0,%edi
jmp    1030 <do_smbus_write_byte@plt>

LLVM IR (-O0):
define i32 @smbus_write_byte(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @do_smbus_write_byte(i32 2256, i32 %7, i32 %8, i8 zeroext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @smbus_write_byte(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @do_smbus_write_byte(i32 2256, i32 %0, i32 %1, i8 zeroext %2)
ret i32 %4
}
void board_startdatawrite(void) {}


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

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

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

LLVM IR (-O2):
define void @board_startdatawrite() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int extension3(char *input, int inputLen, char *output, int outputLen) {
  if (0 == (inputLen % 2)) {
    sprintf(output, "extension3 succeeds");
    return 1;
  }
  sprintf(output, "extension3 fails");
  return -1;
}


x86 assembly (clang, -O0):
<extension3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1157 <extension3+0x47>
mov    -0x20(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <sprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116e <extension3+0x5e>
mov    -0x20(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <sprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension3>:
test   $0x1,%sil
jne    111d <extension3+0x1d>
movups 0xef3(%rip),%xmm0
movups %xmm0,(%rdx)
movl   $0x736465,0x10(%rdx)
mov    $0x1,%eax
ret
movups 0xef0(%rip),%xmm0
movups %xmm0,(%rdx)
movb   $0x0,0x10(%rdx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"extension3 succeeds\00"
@.str.1 = [17 x i8] c"extension3 fails\00"
define i32 @extension3(i8* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2, i32 %3) {
%5 = and i32 %1, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(20) %2, i8* align 1 dereferenceable(20) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 20, i1 false)
br label %9
8: ; preds = %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(17) %2, i8* align 1 dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 17, i1 false)
br label %9
9: ; preds = %8, %7
%10 = phi i32 [ 1, %7 ], [ -1, %8 ]
ret i32 %10
}
/* Variables and functions */
double exponential(double, double);
double exp1(double x) { return exponential(2.71828182845905, x); }


x86 assembly (clang, -O0):
<exp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
call   1030 <exponential@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp1>:
movaps %xmm0,%xmm1
movsd  0xee5(%rip),%xmm0
jmp    1030 <exponential@plt>

LLVM IR (-O0):
define double @exp1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exponential(double 0x4005BF0A8B145774, double %3)
ret double %4
}

LLVM IR (-O2):
define double @exp1(double %0) {
%2 = tail call double @exponential(double 0x4005BF0A8B145774, double %0)
ret double %2
}
int noswap(left, right)
int left, right;
{
  int tmp = left;
  left = right;
  right = tmp;
  output(right == left);
  if (right == left)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<noswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115d <noswap+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <noswap+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noswap>:
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
sete   %bl
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <output@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @noswap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %6
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @noswap(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %4)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ferror(int /*<<< orphan*/ *);
int file___NativeFile_ferror___impl(FILE *self) { return ferror(self); }


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

x86 assembly (clang, -O2):
<file___NativeFile_ferror___impl>:
jmp    1030 <ferror@plt>

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

LLVM IR (-O2):
define i32 @file___NativeFile_ferror___impl(i32* nocapture %0) {
%2 = tail call i32 @ferror(i32* %0)
ret i32 %2
}
unsigned BE32(unsigned _val) {
  return (_val << 24) | ((_val & 0xff00) << 8) | ((_val & 0xff0000) >> 8) |
         (_val >> 24);
}


x86 assembly (clang, -O0):
<BE32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BE32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 16711680
%11 = lshr i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = lshr i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @BE32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}