xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
void ref_add_int16_t(int16_t arg1, int16_t arg2, int16_t *result) {
  *result = arg1 + arg2;
}


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

x86 assembly (clang, -O2):
<ref_add_int16_t>:
add    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @ref_add_int16_t(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @ref_add_int16_t(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = add nsw i64 %1, %0
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ sleep(double);
int blinkM() {
  int c = 0;
  while (c != 2) {
    blinkdash();
    c++;
  }
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     114e <blinkM+0x2e>
mov    $0x0,%al
call   1030 <blinkdash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <blinkM+0xf>
movsd  0xeaa(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkM>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdash@plt>
movsd  0xec9(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkM() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdash()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkM() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
int set_within_limits(int min, int val, int max) {
  if (val < min)
    return min;
  else if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<set_within_limits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <set_within_limits+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <set_within_limits+0x46>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <set_within_limits+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <set_within_limits+0x46>
jmp    1140 <set_within_limits+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_within_limits>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @set_within_limits(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
void *calloc(int, int);
void *speex_alloc(int size) { return calloc(size, 1); }


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

x86 assembly (clang, -O2):
<speex_alloc>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @speex_alloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
void __attribute__((weak)) EXTI6_Callback(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void indent(FILE *file, int level) {
  int i;
  for (i = 0; i < level; i++) {
    fprintf(file, "\t");
  }
}


x86 assembly (clang, -O0):
<indent>:
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    1150 <indent+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <indent+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define void @indent(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 9, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
void *xmemrchr_tiny(const void *s, int c, int n) {
  char chr = (char)c;
  const char *src = (const char *)s;
  for (int i = 0; i >= 0; i--) {
    if (src[i] == chr) {
      return (void *)((unsigned long)src + n);
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<xmemrchr_tiny>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     116c <xmemrchr_tiny+0x6c>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <xmemrchr_tiny+0x59>
mov    -0x28(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <xmemrchr_tiny+0x74>
jmp    115e <xmemrchr_tiny+0x5e>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1123 <xmemrchr_tiny+0x23>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemrchr_tiny>:
movsbl (%rdi),%ecx
movsbl %sil,%esi
movslq %edx,%rdx
add    %rdi,%rdx
xor    %eax,%eax
cmp    %ecx,%esi
cmove  %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @xmemrchr_tiny(i8* %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
%8 = icmp eq i32 %7, %5
%9 = ptrtoint i8* %0 to i64
%10 = sext i32 %2 to i64
%11 = add i64 %10, %9
%12 = inttoptr i64 %11 to i8*
%13 = select i1 %8, i8* %12, i8* null
ret i8* %13
}
/* Variables and functions */
unsigned int unpackLong(char const *);
unsigned int chunkIDAndLength(const void *data, unsigned int *chunkID) {
  if (!data)
    return 0;
  *chunkID = unpackLong(data);
  return unpackLong((const char *)data + 4);
}


x86 assembly (clang, -O0):
<chunkIDAndLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <chunkIDAndLength+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1158 <chunkIDAndLength+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <unpackLong@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <unpackLong@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunkIDAndLength>:
test   %rdi,%rdi
je     113a <chunkIDAndLength+0x2a>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <unpackLong@plt>
mov    %eax,(%r14)
add    $0x4,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <unpackLong@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @chunkIDAndLength(i8* %0, i32* nocapture writeonly %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @unpackLong(i8* %0)
store i32 %5, i32* %1
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = tail call i32 @unpackLong(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
void __gettexterror(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @__gettexterror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int __get_array_size(char *);
char *strupr(char *s) {
  int size1;
  size1 = __get_array_size(s);
  return s;
}


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

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__get_array_size@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
ret i8* %0
}
/* Type definitions */
struct llist_head {
  int dummy;
};

/* Variables and functions */
int packetqueue_empty(struct llist_head *queue) { return queue == NULL; }


x86 assembly (clang, -O0):
<packetqueue_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.llist_head = type { i32 }
define i32 @packetqueue_empty(%struct.llist_head* %0) {
%2 = alloca %struct.llist_head*
store %struct.llist_head* %0, %struct.llist_head** %2
%3 = load %struct.llist_head*, %struct.llist_head** %2
%4 = icmp eq %struct.llist_head* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.llist_head = type { i32 }
define i32 @packetqueue_empty(%struct.llist_head* readnone %0) {
%2 = icmp eq %struct.llist_head* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
char *corta_string(char *apuntador) {
  if (!apuntador) {
    return "ERROR no hay al menos un caracter";
  } else {
    apuntador = apuntador + 1;
    return apuntador;
  }
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <corta_string+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <corta_string+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
lea    0x1(%rdi),%rcx
test   %rdi,%rdi
lea    0xef2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"ERROR no hay al menos un caracter\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %3
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [34 x i8] c"ERROR no hay al menos un caracter\00"
define i8* @corta_string(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = select i1 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndExit(const char *progname, int status) {
  FILE *stream = stdout;
  if (status == EXIT_FAILURE)
    stream = stderr;
  fprintf(stream, "Usage: %s [shared-memory-id]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndExit+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndExit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eab(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndExit+0x1a>
mov    0x2ea8(%rip),%rax
jmp    1141 <helpAndExit+0x21>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@EXIT_FAILURE = global i32 0
@stderr = global i32* null
@.str = [30 x i8] c"Usage: %s [shared-memory-id]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stdout
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_FAILURE
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stderr
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stdout = global i32* null
@EXIT_FAILURE = global i32 0
@stderr = global i32* null
@.str = [30 x i8] c"Usage: %s [shared-memory-id]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stderr
%6 = load i32*, i32** @stdout
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
float f3(float x, char y) { return x * y; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
movss  %xmm0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movss  -0x4(%rbp),%xmm0
movsbl -0x5(%rbp),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f3(float %0, i8 signext %1) {
%3 = alloca float
%4 = alloca i8
store float %0, float* %3
store i8 %1, i8* %4
%5 = load float, float* %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @f3(float %0, i8 signext %1) {
%3 = sitofp i8 %1 to float
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void *t_fun(void *arg) {
  int *x;
  x = malloc(sizeof(int));
  *x = 3;
  (*x)++;
  free(x);
  return NULL;
}


x86 assembly (clang, -O0):
<t_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_fun>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movl   $0x4,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @t_fun(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
store i32 3, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t_fun(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 4, i32* %2
%3 = tail call i32 @free(i32* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
void alrm_handler(int s) {
  alarm(1);
  printf("Got SIGALRM\n");
  return;
}


x86 assembly (clang, -O0):
<alrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <alarm@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alrm_handler>:
push   %rax
mov    $0x1,%edi
call   1040 <alarm@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Got SIGALRM\0A\00"
define void @alrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @alarm(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Got SIGALRM\00"
define void @alrm_handler(i32 %0) {
%2 = tail call i32 @alarm(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void av_get_alt_sample_fmt() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @system_part2_init() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ button;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
unsigned get_XButtonReleasedEvent_button(void *_p) {
  return (unsigned)((XButtonReleasedEvent *)_p)->button;
}


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

x86 assembly (clang, -O2):
<get_XButtonReleasedEvent_button>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XButtonReleasedEvent_button(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XButtonReleasedEvent_button(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x8c() {
  Assert_real((isxdigit(140) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              705, ("isxdigit should be 0 for 0x8c"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x8c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8c,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2c1,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2c1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x8c\00"
define void @t_isxdigit_0x8c() {
%1 = call i64 @isxdigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x8c\00"
define void @t_isxdigit_0x8c() {
%1 = tail call i64 @isxdigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long __min_long(long x, long y) { return ((x) > (y) ? (y) : (x)); }


x86 assembly (clang, -O0):
<__min_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <__min_long+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__min_long+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__min_long>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @__min_long(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void MPURegionGet(unsigned long ulRegion, unsigned long *pulAddr,
                  unsigned long *pulFlags) {
  DEBUG_ASSERT(ulRegion < 8);
  DEBUG_ASSERT(pulAddr);
  DEBUG_ASSERT(pulFlags);
  (*((volatile unsigned long *)(0xE000ED98))) = ulRegion;
  *pulAddr = (*((volatile unsigned long *)(0xE000ED9C)));
  *pulFlags = (*((volatile unsigned long *)(0xE000EDA0)));
}


x86 assembly (clang, -O0):
<MPURegionGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x8,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <DEBUG_ASSERT@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0xe000ed98,%eax
mov    %rcx,(%rax)
mov    $0xe000ed9c,%eax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionGet>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x8,%rbx
setb   %dil
xor    %eax,%eax
call   1030 <DEBUG_ASSERT@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <DEBUG_ASSERT@plt>
mov    $0xe000ed98,%eax
mov    %rbx,(%rax)
mov    0x4(%rax),%rcx
mov    %rcx,(%r15)
mov    0x8(%rax),%rax
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @MPURegionGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = icmp ult i64 %7, 8
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %9)
%11 = load i64*, i64** %5
%12 = call i32 (i64*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i64*, ...)*)(i64* %11)
%13 = load i64*, i64** %6
%14 = call i32 (i64*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i64*, ...)*)(i64* %13)
%15 = load i64, i64* %4
store volatile i64 %15, i64* inttoptr (i64 3758157208 to i64*)
%16 = load volatile i64, i64* inttoptr (i64 3758157212 to i64*)
%17 = load i64*, i64** %5
store i64 %16, i64* %17
%18 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%19 = load i64*, i64** %6
store i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @MPURegionGet(i64 %0, i64* %1, i64* %2) {
%4 = icmp ult i64 %0, 8
%5 = zext i1 %4 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %5)
%7 = tail call i32 (i64*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i64*, ...)*)(i64* %1)
%8 = tail call i32 (i64*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i64*, ...)*)(i64* %2)
store volatile i64 %0, i64* inttoptr (i64 3758157208 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 3758157212 to i64*)
store i64 %9, i64* %1
%10 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
store i64 %10, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_isdcalc(int, char **);
int main(int argc, char *argv[]) {
  gmx_isdcalc(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_isdcalc(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int strlen(char const *);
int write(int /*<<< orphan*/, char const *, int);
int puts(const char *s) {
  char newline = '\n';
  write(STDOUT_FILENO, s, strlen(s));
  return write(STDOUT_FILENO, (char *)&newline, 1);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0xa,-0x9(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0xa,0xf(%rsp)
mov    0x2eb9(%rip),%r14
mov    (%r14),%ebp
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    (%r14),%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 10, i8* %3
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
%9 = load i32, i32* @STDOUT_FILENO
%10 = call i32 @write(i32 %9, i8* %3, i32 1)
ret i32 %10
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i8
store i8 10, i8* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @write(i32 %3, i8* %0, i32 %4)
%6 = load i32, i32* @STDOUT_FILENO
%7 = call i32 @write(i32 %6, i8* %2, i32 1)
ret i32 %7
}
int ocurrencesOf(char needle, char *hayStack) {
  char *iter = hayStack;
  int count = 0;
  while (*iter != 0) {
    if (*iter == needle) {
      count++;
    }
    iter++;
  }
  return count;
}


x86 assembly (clang, -O0):
<ocurrencesOf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <ocurrencesOf+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <ocurrencesOf+0x49>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <ocurrencesOf+0x1d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
pid_t getpgrp(void) { return syscall(65); }


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

x86 assembly (clang, -O2):
<getpgrp>:
mov    $0x41,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getpgrp() {
%1 = call i32 @syscall(i32 65)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpgrp() {
%1 = tail call i32 @syscall(i32 65)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nComputers, Computers everywhere\n");
  printf("as far as I can see\n");
  printf("I really, really like these things,");
  printf("\nOh joy, Oh joy for me!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0AComputers, Computers everywhere\0A\00"
@.str.1 = [21 x i8] c"as far as I can see\0A\00"
@.str.2 = [36 x i8] c"I really, really like these things,\00"
@.str.3 = [25 x i8] c"\0AOh joy, Oh joy for me!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [36 x i8] c"I really, really like these things,\00"
@str = [33 x i8] c"\0AComputers, Computers everywhere\00"
@str.4 = [20 x i8] c"as far as I can see\00"
@str.5 = [24 x i8] c"\0AOh joy, Oh joy for me!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return c + 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 97
%10 = sub nsw i32 %9, 65
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef size_t int64_t;
typedef size_t int32_t;

/* Variables and functions */
int64_t aeron_logbuffer_compute_position(int32_t active_term_id,
                                         int32_t term_offset,
                                         size_t position_bits_to_shift,
                                         int32_t initial_term_id) {
  int32_t term_count = active_term_id - initial_term_id;
  return (term_count << position_bits_to_shift) + term_offset;
}


x86 assembly (clang, -O0):
<aeron_logbuffer_compute_position>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    %cl,%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_logbuffer_compute_position>:
sub    %rcx,%rdi
mov    %edx,%ecx
shl    %cl,%rdi
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @aeron_logbuffer_compute_position(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %8
%12 = sub i64 %10, %11
store i64 %12, i64* %9
%13 = load i64, i64* %9
%14 = load i64, i64* %7
%15 = shl i64 %13, %14
%16 = load i64, i64* %6
%17 = add i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @aeron_logbuffer_compute_position(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %0, %3
%6 = shl i64 %5, %2
%7 = add i64 %6, %1
ret i64 %7
}
void xdInitHelp(void) { 0; }


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

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

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

LLVM IR (-O2):
define void @xdInitHelp() {
ret void
}
/* Variables and functions */
int factorial(int);
int printf(char *, ...);
int scanf(char *, int *);
int main(void) {
  int n;
  int i;
  i = printf("Enter the number: ");
  i = scanf("%d", &n);
  i = printf("The factorial of %d is %d\n", n, factorial(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @factorial(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
store i32 %9, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
void basStr() {
  char *string;
  string = popString();
  pushStringCopy(string);
  eFree(string);
}


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

x86 assembly (clang, -O2):
<basStr>:
push   %rbx
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <pushStringCopy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basStr() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @pushStringCopy(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @eFree(i8* %5)
ret void
}

LLVM IR (-O2):
define void @basStr() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @pushStringCopy(i8* %1)
%3 = tail call i32 @eFree(i8* %1)
ret void
}
int test_imm_C3uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C3uint16_mem>:
movzwl (%rdi),%eax
test   $0xff3d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -195
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int erase_flash_range_end() {}


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

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

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

LLVM IR (-O2):
define i32 @erase_flash_range_end() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pirntf(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello github\n");
  pirntf("develop\n");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello github\0A\00"
@.str.1 = [9 x i8] c"develop\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @pirntf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"develop\0A\00"
@str = [13 x i8] c"hello github\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @pirntf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int do_781() { return 781; }


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

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

LLVM IR (-O0):
define i32 @do_781() {
ret i32 781
}

LLVM IR (-O2):
define i32 @do_781() {
ret i32 781
}