xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_mult(void) { IF_fct_2('*'); }


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

x86 assembly (clang, -O2):
<IF_mult>:
mov    $0x2a,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_mult() {
%1 = call i32 @IF_fct_2(i8 signext 42)
ret void
}

LLVM IR (-O2):
define void @IF_mult() {
%1 = tail call i32 @IF_fct_2(i8 signext 42)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void display(int *a, unsigned n) {
  unsigned i;
  for (i = 0; i < n; ++i)
    printf("%3d", a[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<display>:
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
jae    1166 <display+0x46>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <display+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%3d\00"
define void @display(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 @putchar(i8 signext 10)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ addsegmentfull(struct game *, struct seg *,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
void addsegment(struct game *gm, struct seg *seg) {
  addsegmentfull(gm, seg, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<addsegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <addsegmentfull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addsegment>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <addsegmentfull@plt>

LLVM IR (-O0):
%struct.game = type { i32 }
%struct.seg = type { i32 }
define void @addsegment(%struct.game* %0, %struct.seg* %1) {
%3 = alloca %struct.game*
%4 = alloca %struct.seg*
store %struct.game* %0, %struct.game** %3
store %struct.seg* %1, %struct.seg** %4
%5 = load %struct.game*, %struct.game** %3
%6 = load %struct.seg*, %struct.seg** %4
%7 = call i32 @addsegmentfull(%struct.game* %5, %struct.seg* %6, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.game = type { i32 }
%struct.seg = type { i32 }
define void @addsegment(%struct.game* %0, %struct.seg* %1) {
%3 = tail call i32 @addsegmentfull(%struct.game* %0, %struct.seg* %1, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
size_t MultiplicationPrincipleR(int /*<<< orphan*/, int **, int *, size_t *,
                                size_t, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(size_t);
size_t MultiplicationPrinciple(int **val, size_t *num_choices, size_t n) {
  size_t count;
  int *sol = (int *)malloc(n * sizeof(int));
  count = MultiplicationPrincipleR(0, val, sol, num_choices, n, 0);
  free(sol);
  return (count);
}


x86 assembly (clang, -O0):
<MultiplicationPrinciple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %r9d,%r9d
mov    %r9d,%edi
call   1040 <MultiplicationPrincipleR@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MultiplicationPrinciple>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rdx,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %r14,%rcx
mov    %r12,%r8
xor    %r9d,%r9d
call   1040 <MultiplicationPrincipleR@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @MultiplicationPrinciple(i32** %0, i64* %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i32** %0, i32*** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = mul i64 %9, 4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32**, i32*** %4
%14 = load i32*, i32** %8
%15 = load i64*, i64** %5
%16 = load i64, i64* %6
%17 = call i64 @MultiplicationPrincipleR(i32 0, i32** %13, i32* %14, i64* %15, i64 %16, i32 0)
store i64 %17, i64* %7
%18 = load i32*, i32** %8
%19 = call i32 @free(i32* %18)
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @MultiplicationPrinciple(i32** %0, i64* %1, i64 %2) {
%4 = shl i64 %2, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i64 @MultiplicationPrincipleR(i32 0, i32** %0, i32* %6, i64* %1, i64 %2, i32 0)
%8 = tail call i32 @free(i32* %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EEPROMBlockHide(unsigned long ulBlock) {
  DEBUG_ASSERT(!ulBlock);
  DEBUG_ASSERT(
      ulBlock <
      ((((*((volatile unsigned long *)(0x400AF000)))) & 0x07FF0000) >> 16));
  (*((volatile unsigned long *)(0x400AF050))) = (1 << ulBlock);
}


x86 assembly (clang, -O0):
<EEPROMBlockHide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    $0x400af000,%ecx
mov    (%rcx),%rcx
and    $0x7ff0000,%rcx
shr    $0x10,%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400af050,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockHide>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x400af000,%rax
40
shr    $0x10,%eax
and    $0x7ff,%eax
xor    %edi,%edi
cmp    %rbx,%rax
seta   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,0x400af050
40
pop    %rbx
ret

LLVM IR (-O0):
define void @EEPROMBlockHide(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %2
%9 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%10 = and i64 %9, 134152192
%11 = lshr i64 %10, 16
%12 = icmp ult i64 %8, %11
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %2
%16 = trunc i64 %15 to i32
%17 = shl i32 1, %16
%18 = sext i32 %17 to i64
store volatile i64 %18, i64* inttoptr (i64 1074458704 to i64*)
ret void
}

LLVM IR (-O2):
define void @EEPROMBlockHide(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%6 = lshr i64 %5, 16
%7 = and i64 %6, 2047
%8 = icmp ugt i64 %7, %0
%9 = zext i1 %8 to i32
%10 = tail call i32 @DEBUG_ASSERT(i32 %9)
%11 = trunc i64 %0 to i32
%12 = shl nuw i32 1, %11
%13 = sext i32 %12 to i64
store volatile i64 %13, i64* inttoptr (i64 1074458704 to i64*)
ret void
}
void g_key_file_get_boolean_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_boolean_list() {
ret void
}
int main() {
  int i;
  for (i = -960; i < -950; i++) {
  }
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffc40,-0x8(%rbp)
cmpl   $0xfffffc4a,-0x8(%rbp)
jge    1132 <main+0x32>
jmp    1124 <main+0x24>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -960, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, -950
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int iabs(int x) { return ((x) < 0) ? -(x) : (x); }


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <iabs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <iabs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int, int /*<<< orphan*/,
                          int /*<<< orphan*/);
ssize_t send(int fd, const void *buf, size_t len, int flags) {
  return sendto(fd, buf, len, flags, 0, 0);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @sendto(i32 %9, i8* %10, i64 %11, i32 %12, i32 0, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, i32 0, i32 0)
ret i32 %5
}
void wifi_evt_https_button(const struct wifi_msg_https_button_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_https_button_evt_t = type opaque
define void @wifi_evt_https_button(%struct.wifi_msg_https_button_evt_t* %0) {
%2 = alloca %struct.wifi_msg_https_button_evt_t*
store %struct.wifi_msg_https_button_evt_t* %0, %struct.wifi_msg_https_button_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_https_button_evt_t = type opaque
define void @wifi_evt_https_button(%struct.wifi_msg_https_button_evt_t* nocapture %0) {
ret void
}
void unit2option() {}


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

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

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

LLVM IR (-O2):
define void @unit2option() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void bail_out(const char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<bail_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail_out>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @bail_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @bail_out(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int time(int /*<<< orphan*/ *);
int utilGetClock() { return time(NULL); }


x86 assembly (clang, -O0):
<utilGetClock>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilGetClock>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @utilGetClock() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @utilGetClock() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
void serializeUnsignedChar(void **buffer, unsigned char value) {
  *(unsigned char *)*buffer = value;
  *buffer += sizeof(unsigned char);
}


x86 assembly (clang, -O0):
<serializeUnsignedChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializeUnsignedChar>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @serializeUnsignedChar(i8** %0, i8 zeroext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr i8, i8* %9, i64 1
store i8* %10, i8** %8
ret void
}

LLVM IR (-O2):
define void @serializeUnsignedChar(i8** nocapture %0, i8 zeroext %1) {
%3 = load i8*, i8** %0
store i8 %1, i8* %3
%4 = load i8*, i8** %0
%5 = getelementptr i8, i8* %4, i64 1
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(int, char *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *dup_mem(void *b, size_t c) {
  void *ans = malloc(c);
  if (!ans)
    fatal(2, "memory error!");
  memcpy(ans, b, c);
  return ans;
}


x86 assembly (clang, -O0):
<dup_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <dup_mem+0x39>
mov    $0x2,%edi
lea    0xe9c(%rip),%rsi
call   1050 <fatal@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_mem>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <dup_mem+0x2c>
lea    0xeae(%rip),%rsi
mov    $0x2,%edi
call   1050 <fatal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"memory error!\00"
define i8* @dup_mem(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 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @fatal(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"memory error!\00"
define i8* @dup_mem(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
struct Evolution {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Evolution *);
int destroy_evolution(struct Evolution *evol) {
  int destroyed = 0;
  if (evol != NULL) {
    free(evol);
    destroyed = 1;
  }
  return destroyed;
}


x86 assembly (clang, -O0):
<destroy_evolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <destroy_evolution+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_evolution>:
test   %rdi,%rdi
je     1125 <destroy_evolution+0x15>
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Evolution = type { i32 }
define i32 @destroy_evolution(%struct.Evolution* %0) {
%2 = alloca %struct.Evolution*
%3 = alloca i32
store %struct.Evolution* %0, %struct.Evolution** %2
store i32 0, i32* %3
%4 = load %struct.Evolution*, %struct.Evolution** %2
%5 = icmp ne %struct.Evolution* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.Evolution*, %struct.Evolution** %2
%8 = call i32 @free(%struct.Evolution* %7)
store i32 1, i32* %3
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.Evolution = type { i32 }
define i32 @destroy_evolution(%struct.Evolution* %0) {
%2 = icmp eq %struct.Evolution* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.Evolution* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_high_nibble(uint8_t data) { return (data & 0xf0) >> 4; }


x86 assembly (clang, -O0):
<get_high_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_high_nibble>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @get_high_nibble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_high_nibble(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ps(float *);
__m128 test_mm_load_ps(float *y) { return _mm_load_ps(y); }


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

x86 assembly (clang, -O2):
<test_mm_load_ps>:
jmp    1030 <_mm_load_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_load_ps(float* %0) {
%2 = tail call i32 @_mm_load_ps(float* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x6b() {
  Assert_real((isalpha(107)),
              "/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_isalpha.c",
              540, ("isalpha should be 1 for k"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x6b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x21c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x21c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for k\00"
define void @t_isalpha_0x6b() {
%1 = call i32 @isalpha(i32 107)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for k\00"
define void @t_isalpha_0x6b() {
%1 = tail call i32 @isalpha(i32 107)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t msGetBitArraySize(int numbits) { return ((numbits + 32 - 1) / 32); }


x86 assembly (clang, -O0):
<msGetBitArraySize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
sub    $0x1,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<msGetBitArraySize>:
lea    0x1f(%rdi),%eax
add    $0x3e,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x5,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @msGetBitArraySize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 32
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 32
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @msGetBitArraySize(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = sdiv i32 %2, 32
%4 = sext i32 %3 to i64
ret i64 %4
}
int function_bar() { return 6; }


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

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

LLVM IR (-O0):
define i32 @function_bar() {
ret i32 6
}

LLVM IR (-O2):
define i32 @function_bar() {
ret i32 6
}
void gtk_toggle_button_set_inconsistent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_set_inconsistent() {
ret void
}
int isPowOfTwo(int a) {
  if (a == 1)
    return 1;
  while (a != 1) {
    if (a % 2 != 0)
      return 0;
    a = a / 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPowOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <isPowOfTwo+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <isPowOfTwo+0x66>
jmp    1122 <isPowOfTwo+0x22>
cmpl   $0x1,-0x8(%rbp)
je     115f <isPowOfTwo+0x5f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114c <isPowOfTwo+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isPowOfTwo+0x66>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1122 <isPowOfTwo+0x22>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowOfTwo>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1129 <isPowOfTwo+0x29>
nopw   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    112a <isPowOfTwo+0x2a>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
and    $0xfffffffe,%edi
cmp    $0x2,%edi
mov    %ecx,%edi
jne    1110 <isPowOfTwo+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isPowOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sdiv i32 %4, 2
%9 = and i32 %4, -2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int sqd_distance(int *, int *, int);
scalar_t__ sqrt(int);
int int_distance(int *p1, int *p2, int k) {
  int ret = sqd_distance(p1, p2, k);
  return (int)sqrt(ret);
}


x86 assembly (clang, -O0):
<int_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sqd_distance@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_distance>:
push   %rax
call   1030 <sqd_distance@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define i32 @int_distance(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @sqd_distance(i32* %8, i32* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i64 @sqrt(i32 %12)
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @int_distance(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @sqd_distance(i32* %0, i32* %1, i32 %2)
%5 = tail call i64 @sqrt(i32 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int lib_hash(unsigned char *, unsigned int, unsigned char *, unsigned int);
int sec_hash(unsigned char *data_buf, unsigned int data_len,
             unsigned char *hash_buf, unsigned int hash_len) {
  return lib_hash(data_buf, data_len, hash_buf, hash_len);
}


x86 assembly (clang, -O0):
<sec_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <lib_hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_hash>:
jmp    1030 <lib_hash@plt>

LLVM IR (-O0):
define i32 @sec_hash(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @lib_hash(i8* %9, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @sec_hash(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @lib_hash(i8* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
float my_rand(long long idum) {
  long long k;
  float answer;
  idum ^= 123459876;
  k = idum / 127773;
  idum = 16807 * (idum - k * 127773) - 2836 * k;
  idum ^= 123459876;
  if (idum < 0)
    idum += 2147483647;
  answer = (1.0 / 2147483647) * idum;
  return answer;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x75bd924,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x1f31d,-0x10(%rbp),%rcx
sub    %rcx,%rax
imul   $0x41a7,%rax,%rax
imul   $0xb14,-0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x75bd924,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1174 <my_rand+0x74>
mov    -0x8(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
xor    $0x75bd924,%rdi
movabs $0x41a705af1fe3fb79,%rcx
05 a7 41
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0xfffffffffffe0ce3,%rdx,%rax
add    %rdi,%rax
imul   $0x41a7,%rax,%rax
imul   $0xfffffffffffff4ec,%rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
xor    $0x75bd924,%rax
lea    0x7fffffff(%rax),%rdx
test   %rcx,%rcx
cmovns %rax,%rdx
cvtsi2sd %rdx,%xmm0
mulsd  0xe9c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @my_rand(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca float
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = xor i64 %5, 123459876
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = sdiv i64 %7, 127773
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 127773
%12 = sub nsw i64 %9, %11
%13 = mul nsw i64 16807, %12
%14 = load i64, i64* %3
%15 = mul nsw i64 2836, %14
%16 = sub nsw i64 %13, %15
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = xor i64 %17, 123459876
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load i64, i64* %2
%23 = add nsw i64 %22, 2147483647
store i64 %23, i64* %2
br label %24
24: ; preds = %21, %1
%25 = load i64, i64* %2
%26 = sitofp i64 %25 to double
%27 = fmul double 0x3E00000000200000, %26
%28 = fptrunc double %27 to float
store float %28, float* %4
%29 = load float, float* %4
ret float %29
}

LLVM IR (-O2):
define float @my_rand(i64 %0) {
%2 = xor i64 %0, 123459876
%3 = sdiv i64 %2, 127773
%4 = mul nsw i64 %3, -127773
%5 = add i64 %4, %2
%6 = mul nsw i64 %5, 16807
%7 = mul nsw i64 %3, -2836
%8 = add i64 %6, %7
%9 = xor i64 %8, 123459876
%10 = icmp slt i64 %8, 0
%11 = add nsw i64 %9, 2147483647
%12 = select i1 %10, i64 %11, i64 %9
%13 = sitofp i64 %12 to double
%14 = fmul double %13, 0x3E00000000200000
%15 = fptrunc double %14 to float
ret float %15
}
int is_prime(int x) {
  if (x < 2)
    return 0;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1163 <is_prime+0x63>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <is_prime+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
jmp    1155 <is_prime+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     113c <is_prime+0x3c>
mov    $0x1,%eax
cmp    $0x4,%edi
jb     113c <is_prime+0x3c>
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1135 <is_prime+0x35>
add    $0x1,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1120 <is_prime+0x20>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
%10 = mul nsw i32 %9, %9
%11 = icmp sgt i32 %10, %0
%12 = select i1 %8, i1 true, i1 %11
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = xor i1 %8, true
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %3, %13, %1
%17 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ union_m128_1_x();
int main() {
  union_m128_1_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <union_m128_1_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <union_m128_1_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @union_m128_1_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void term_attr_set(char *str) {
  fputs("\033[0;", stdout);
  fputs(str, stdout);
  fputs("m", stdout);
}


x86 assembly (clang, -O0):
<term_attr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_attr_set>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%esi
lea    0xed8(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
lea    0xec3(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0;\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"m\00"
define void @term_attr_set(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* %0, i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int sock_accept(int fd) {
  int new_fd;
  new_fd = accept(fd, (struct sockaddr *)NULL, NULL);
  return new_fd;
}


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

x86 assembly (clang, -O2):
<sock_accept>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @sock_accept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @accept(i32 %4, %struct.sockaddr* null, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @sock_accept(i32 %0) {
%2 = tail call i32 @accept(i32 %0, %struct.sockaddr* null, i32* null)
ret i32 %2
}
/* Variables and functions */
size_t foo(int n) { return n * sizeof(int); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edi,%rax
shl    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
ret i64 %5
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl nsw i64 %2, 2
ret i64 %3
}
/* Variables and functions */
int read(int, void *, int);
int readTTY(int fd, void *buf, int N) {
  int n = read(fd, buf, N);
  return n;
}


x86 assembly (clang, -O0):
<readTTY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTTY>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @readTTY(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
double absDif(double a, double b) {
  if (a > b) {
    return a - b;
  } else {
    return b - a;
  }
}


x86 assembly (clang, -O0):
<absDif>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1132 <absDif+0x32>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1141 <absDif+0x41>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absDif>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @absDif(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fsub double %10, %11
store double %12, double* %3
br label %17
13: ; preds = %2
%14 = load double, double* %5
%15 = load double, double* %4
%16 = fsub double %14, %15
store double %16, double* %3
br label %17
17: ; preds = %13, %9
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @absDif(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = fsub double %0, %1
%5 = fsub double %1, %0
%6 = select i1 %3, double %4, double %5
ret double %6
}
/* Variables and functions */
scalar_t__ isdigit(char);
int isnum_float(char c) { return ((isdigit(c) || (c == '.') || (c == '-'))); }


x86 assembly (clang, -O0):
<isnum_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <isnum_float+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     1158 <isnum_float+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnum_float>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
lea    -0x2d(%rbx),%ecx
cmp    $0x2,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isnum_float(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isnum_float(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -45
%5 = icmp ult i8 %4, 2
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void tgdb_command_print(void *item) { fprintf(stderr, "unimplemented\n"); }


x86 assembly (clang, -O0):
<tgdb_command_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgdb_command_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"unimplemented\0A\00"
define void @tgdb_command_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"unimplemented\0A\00"
define void @tgdb_command_print(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f390(int *);
int f391(int *p) { return f390(p); }


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

x86 assembly (clang, -O2):
<f391>:
jmp    1030 <f390@plt>

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

LLVM IR (-O2):
define i32 @f391(i32* %0) {
%2 = tail call i32 @f390(i32* %0)
ret i32 %2
}
/* Variables and functions */
void barInDylib();
void bazInDylib() { return barInDylib(); }


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

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

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

LLVM IR (-O2):
define void @bazInDylib() {
tail call void (...) @barInDylib()
ret void
}