xunge/DecIR huggingface dataset:
/* Variables and functions */
char *game(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int first = 0;
  while (1)
    printf("%s", game(first = !first));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
and    $0x1,%al
mov    %al,-0x9(%rbp)
movzbl %al,%edi
mov    %edi,-0x8(%rbp)
call   1040 <game@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
xor    $0x1,%ebx
mov    %ebx,%edi
call   1040 <game@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
%8 = call i8* @game(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = xor i32 %2, 1
%4 = tail call i8* @game(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %1
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1156 <RandomFunc+0x56>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
mov    -0x18(%rbp),%rcx
and    $0x2922a849,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = and i64 %21, %19
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 1
store i64 %24, i64* %6
br label %13
25: ; preds = %13
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = and i64 %27, 690137161
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 18915328
store i64 %5, i64* %1
ret void
}
const char *MergeOperatorName(void *arg) { return "TestMergeOperator"; }


x86 assembly (clang, -O0):
<MergeOperatorName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"TestMergeOperator\00"
define i8* @MergeOperatorName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"TestMergeOperator\00"
define i8* @MergeOperatorName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 0;
  for (int i = 0; i < 10000; i++) {
    printf("Mayank Johri\n");
    x += 1;
  }
  printf("%d", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    115f <main+0x4f>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2710,%ebp
lea    0xed4(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
lea    0xebc(%rip),%rdi
mov    $0x2710,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [13 x i8] c"Mayank Johri\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 10000)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ mutter();
char *find_unused_loop_device(void) {
  mutter();
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @find_unused_loop_device() {
%1 = call i32 (...) @mutter()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @find_unused_loop_device() {
%1 = tail call i32 (...) @mutter()
ret i8* null
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1159 <RandomFunc+0x59>
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%edx
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%ecx
add    %edx,%ecx
mov    %cx,-0x12(%rbp,%rax,2)
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
add    $0x3039b4b2,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xffffbff7,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %18, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load i16, i16* %6
%20 = zext i16 %19 to i64
%21 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %20
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = load i16, i16* %6
%25 = zext i16 %24 to i64
%26 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %25
%27 = load i16, i16* %26
%28 = zext i16 %27 to i32
%29 = add nsw i32 %28, %23
%30 = trunc i32 %29 to i16
store i16 %30, i16* %26
%31 = load i16, i16* %6
%32 = zext i16 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i16
store i16 %34, i16* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%37 = load i16, i16* %36
%38 = zext i16 %37 to i64
%39 = add i64 %38, 809088178
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, -16393
store i16 %4, i16* %1
ret void
}
void toUpper(char *c) { *c &= ~0x20; }


x86 assembly (clang, -O0):
<toUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpper>:
andb   $0xdf,(%rdi)
ret

LLVM IR (-O0):
define void @toUpper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -33
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @toUpper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -33
store i8 %3, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcspbrk(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninivar_wcspbrk(void) {
  wchar_t *cs;
  wchar_t *ct;
  (void)wcspbrk(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninivar_wcspbrk>:
jmp    1030 <wcspbrk@plt>

LLVM IR (-O0):
define void @uninivar_wcspbrk() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcspbrk(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcspbrk() {
%1 = tail call i32 @wcspbrk(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void StampaGiorno(int val) {
  if (val <= 0 || val > 31)
    return;
  printf("giorno: %d\n", val);
}


x86 assembly (clang, -O0):
<StampaGiorno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <StampaGiorno+0x1f>
cmpl   $0x1f,-0x4(%rbp)
jle    1134 <StampaGiorno+0x24>
jmp    1143 <StampaGiorno+0x33>
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StampaGiorno>:
mov    %edi,%esi
lea    -0x20(%rsi),%eax
cmp    $0xffffffe1,%eax
jae    111b <StampaGiorno+0xb>
ret
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"giorno: %d\0A\00"
define void @StampaGiorno(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, -31
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
ret void
}
int end(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @end(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_dobldobl_cascade_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(178, a, b, c);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @create_dobldobl_cascade_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 178, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
char *gnu_get_libc_version();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", gnu_get_libc_version());
  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    $0x0,%al
call   1040 <gnu_get_libc_version@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gnu_get_libc_version@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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 = call i8* (...) @gnu_get_libc_version()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @gnu_get_libc_version()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
double redshift(double a) { return (1.0 / a - 1.0); }


x86 assembly (clang, -O0):
<redshift>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<redshift>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @redshift(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fsub double %4, 1.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @redshift(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fadd double %2, -1.000000e+00
ret double %3
}
void i2d_ASN1_PRINTABLESTRING(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_PRINTABLESTRING() {
ret void
}
/* Type definitions */
struct olist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __olist_add(struct olist_head *, int /*<<< orphan*/,
                               struct olist_head *);
int /*<<< orphan*/ olist_oprev(struct olist_head *);
void olist_add_tail(struct olist_head *new, struct olist_head *head) {
  __olist_add(new, olist_oprev(head), head);
}


x86 assembly (clang, -O0):
<olist_add_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <olist_oprev@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <__olist_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<olist_add_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <olist_oprev@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__olist_add@plt>

LLVM IR (-O0):
%struct.olist_head = type { i32 }
define void @olist_add_tail(%struct.olist_head* %0, %struct.olist_head* %1) {
%3 = alloca %struct.olist_head*
%4 = alloca %struct.olist_head*
store %struct.olist_head* %0, %struct.olist_head** %3
store %struct.olist_head* %1, %struct.olist_head** %4
%5 = load %struct.olist_head*, %struct.olist_head** %3
%6 = load %struct.olist_head*, %struct.olist_head** %4
%7 = call i32 @olist_oprev(%struct.olist_head* %6)
%8 = load %struct.olist_head*, %struct.olist_head** %4
%9 = call i32 @__olist_add(%struct.olist_head* %5, i32 %7, %struct.olist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.olist_head = type { i32 }
define void @olist_add_tail(%struct.olist_head* %0, %struct.olist_head* %1) {
%3 = tail call i32 @olist_oprev(%struct.olist_head* %1)
%4 = tail call i32 @__olist_add(%struct.olist_head* %0, i32 %3, %struct.olist_head* %1)
ret void
}
/* Variables and functions */
scalar_t__ random_in_range(int /*<<< orphan*/, int);
float next_layer(float prev_num) {
  if (random_in_range(0, 2) == 0)
    return prev_num + 0.5;
  else
    return prev_num - 0.5;
}


x86 assembly (clang, -O0):
<next_layer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <random_in_range@plt>
cmp    $0x0,%rax
jne    1156 <next_layer+0x46>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1174 <next_layer+0x64>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_layer>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <random_in_range@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    0xece(%rip),%rax
movss  0x4(%rsp),%xmm0
addss  (%rax,%rcx,4),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @next_layer(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = call i64 @random_in_range(i32 0, i32 2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %16
11: ; preds = %1
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fsub double %13, 5.000000e-01
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %16
16: ; preds = %11, %6
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @next_layer(float %0) {
%2 = tail call i64 @random_in_range(i32 0, i32 2)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, float 5.000000e-01, float -5.000000e-01
%5 = fadd float %4, %0
ret float %5
}
float R4(unsigned char *p) {
  unsigned char b[4];
  b[0] = p[3];
  b[1] = p[2];
  b[2] = p[1];
  b[3] = p[0];
  return *(float *)b;
}


x86 assembly (clang, -O0):
<R4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<R4>:
mov    (%rdi),%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @R4(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%21 = bitcast i8* %20 to float*
%22 = load float, float* %21
ret float %22
}

LLVM IR (-O2):
define float @R4(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
%19 = bitcast i32 %18 to float
ret float %19
}
/* Variables and functions */
char GetEngineColor(int);
int /*<<< orphan*/ SetIcon(int, int, int);
void SetEngineColorIcon(int which) {
  char color = GetEngineColor(which);
  int nicon = 0;
  if (color == 'b')
    nicon = 1;
  else if (color == 'w')
    nicon = 2;
  else
    nicon = 3;
  SetIcon(which, 1, nicon);
}


x86 assembly (clang, -O0):
<SetEngineColorIcon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetEngineColor@plt>
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1156 <SetEngineColorIcon+0x36>
movl   $0x1,-0xc(%rbp)
jmp    117b <SetEngineColorIcon+0x5b>
movsbl -0x5(%rbp),%eax
cmp    $0x77,%eax
jne    116f <SetEngineColorIcon+0x4f>
movl   $0x2,-0xc(%rbp)
jmp    1176 <SetEngineColorIcon+0x56>
movl   $0x3,-0xc(%rbp)
jmp    117b <SetEngineColorIcon+0x5b>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <SetIcon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetEngineColorIcon>:
push   %rbx
mov    %edi,%ebx
call   1030 <GetEngineColor@plt>
xor    %edx,%edx
cmp    $0x77,%al
sete   %dl
xor    $0x3,%edx
cmp    $0x62,%al
mov    $0x1,%eax
cmove  %eax,%edx
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <SetIcon@plt>

LLVM IR (-O0):
define void @SetEngineColorIcon(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call signext i8 @GetEngineColor(i32 %5)
store i8 %6, i8* %3
store i32 0, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 98
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %4
br label %18
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 119
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 2, i32* %4
br label %17
16: ; preds = %11
store i32 3, i32* %4
br label %17
17: ; preds = %16, %15
br label %18
18: ; preds = %17, %10
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = call i32 @SetIcon(i32 %19, i32 1, i32 %20)
ret void
}

LLVM IR (-O2):
define void @SetEngineColorIcon(i32 %0) {
%2 = tail call signext i8 @GetEngineColor(i32 %0)
%3 = icmp eq i8 %2, 119
%4 = select i1 %3, i32 2, i32 3
%5 = icmp eq i8 %2, 98
%6 = select i1 %5, i32 1, i32 %4
%7 = tail call i32 @SetIcon(i32 %0, i32 1, i32 %6)
ret void
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
void component_time_katcp(struct timeval *result, unsigned int ms) {
  result->tv_sec = ms / 1000;
  result->tv_usec = (ms % 1000) * 1000;
}


x86 assembly (clang, -O0):
<component_time_katcp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3e8,%edx,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_time_katcp>:
mov    %esi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rdi)
imul   $0x3e8,%eax,%eax
sub    %eax,%esi
imul   $0x3e8,%esi,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @component_time_katcp(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = udiv i32 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = urem i32 %9, 1000
%11 = mul i32 %10, 1000
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @component_time_katcp(%struct.timeval* nocapture writeonly %0, i32 %1) {
%3 = udiv i32 %1, 1000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = urem i32 %1, 1000
%6 = mul nuw nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_free(void *opaque, void *mem) {
  (void)opaque;
  free(mem);
}


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

x86 assembly (clang, -O2):
<default_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @default_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main(int argc, char const *argv[]) {
  double a, b;
  scanf("%lf %lf", &a, &b);
  printf("MEDIA = %.5lf\n", ((a * 3.5) + (b * 7.5)) / 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedb(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xea4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %6, double* %7)
%9 = load double, double* %6
%10 = load double, double* %7
%11 = fmul double %10, 7.500000e+00
%12 = call double @llvm.fmuladd.f64(double %9, double 3.500000e+00, double %11)
%13 = fdiv double %12, 1.100000e+01
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fmul double %9, 7.500000e+00
%11 = call double @llvm.fmuladd.f64(double %8, double 3.500000e+00, double %10)
%12 = fdiv double %11, 1.100000e+01
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void spi_devdesel() { *(volatile uint32_t *)0x1400000 &= 0x0f; }


x86 assembly (clang, -O0):
<spi_devdesel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1400000,%eax
mov    (%rax),%ecx
and    $0xf,%ecx
mov    $0x1400000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_devdesel>:
andl   $0xf,0x1400000
0f
ret

LLVM IR (-O0):
define void @spi_devdesel() {
%1 = load volatile i32, i32* inttoptr (i64 20971520 to i32*)
%2 = and i32 %1, 15
store volatile i32 %2, i32* inttoptr (i64 20971520 to i32*)
ret void
}

LLVM IR (-O2):
define void @spi_devdesel() {
%1 = load volatile i32, i32* inttoptr (i64 20971520 to i32*)
%2 = and i32 %1, 15
store volatile i32 %2, i32* inttoptr (i64 20971520 to i32*)
ret void
}
/* Type definitions */
struct j_state {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ i_instr_rm(struct j_state *, int /*<<< orphan*/, int,
                              int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                              int);
void i_load_a(struct j_state *s, int reg, int base, int64_t off) {
  i_instr_rm(s, 0, 0x8d, 0, reg, base, off, 8);
}


x86 assembly (clang, -O0):
<i_load_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
mov    $0x8d,%edx
mov    %ecx,%esi
mov    %eax,(%rsp)
movl   $0x8,0x8(%rsp)
call   1030 <i_instr_rm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_load_a>:
push   %rax
mov    %ecx,%eax
mov    %edx,%r9d
mov    %esi,%r8d
xor    %esi,%esi
mov    $0x8d,%edx
xor    %ecx,%ecx
push   $0x8
push   %rax
call   1030 <i_instr_rm@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.j_state = type { i32 }
define void @i_load_a(%struct.j_state* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.j_state*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.j_state* %0, %struct.j_state** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.j_state*, %struct.j_state** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @i_instr_rm(%struct.j_state* %9, i32 0, i32 141, i32 0, i32 %10, i32 %11, i32 %12, i32 8)
ret void
}

LLVM IR (-O2):
%struct.j_state = type { i32 }
define void @i_load_a(%struct.j_state* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @i_instr_rm(%struct.j_state* %0, i32 0, i32 141, i32 0, i32 %1, i32 %2, i32 %3, i32 8)
ret void
}
main() {
  char s;
  int i;
  s -= i;
  int *p;
  ++p;
  p += s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%ecx
movsbl -0x1(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32*
%4 = load i32, i32* %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, %4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %3
%11 = load i8, i8* %1
%12 = sext i8 %11 to i32
%13 = load i32*, i32** %3
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i32, i32* %13, i64 %14
store i32* %15, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void CAN_Enable(int canid) {}


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

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

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

LLVM IR (-O2):
define void @CAN_Enable(i32 %0) {
ret void
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *memset_caller(void *dst, int c, size_t n) { return memset(dst, c, n); }


x86 assembly (clang, -O0):
<memset_caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_caller>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @memset_caller(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @memset_caller(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_10389() {
  Assert_real((isqrt(10389) == 101),
              "/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/stdlib/isqrt.c",
              1495, ("Integer square root of 10389 should be 101"));
}


x86 assembly (clang, -O0):
<t_sqrt_10389>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2895,%edi
call   1030 <isqrt@plt>
cmp    $0x65,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5d7,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_10389>:
push   %rax
mov    $0x2895,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x65,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5d7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 10389 should be 101\00"
define void @t_sqrt_10389() {
%1 = call i32 @isqrt(i32 10389)
%2 = icmp eq i32 %1, 101
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1495, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 10389 should be 101\00"
define void @t_sqrt_10389() {
%1 = tail call i32 @isqrt(i32 10389)
%2 = icmp eq i32 %1, 101
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1495, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *path_transform_to_nix(char *path) { return path; }


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

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

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

LLVM IR (-O2):
define i8* @path_transform_to_nix(i8* readnone returned %0) {
ret i8* %0
}
char GetEncoding11() { return 0x3e; }


x86 assembly (clang, -O0):
<GetEncoding11>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding11>:
mov    $0x3e,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding11() {
ret i8 62
}

LLVM IR (-O2):
define signext i8 @GetEncoding11() {
ret i8 62
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
void *realloc(void *, size_t);
void *reallocarray(void *ptr, size_t m, size_t n) {
  if (n && m > -1 / n) {
    errno = ENOMEM;
    return 0;
  }
  return realloc(ptr, m * n);
}


x86 assembly (clang, -O0):
<reallocarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1175 <reallocarray+0x65>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1175 <reallocarray+0x65>
mov    0x2e83(%rip),%rax
mov    (%rax),%ecx
mov    0x2e72(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    118b <reallocarray+0x7b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocarray>:
mov    %rdx,%rcx
test   %rdx,%rdx
je     1135 <reallocarray+0x25>
mov    %rcx,%rax
mul    %rsi
jno    1135 <reallocarray+0x25>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    0x2ea8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret
imul   %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @reallocarray(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = udiv i64 -1, %12
%14 = icmp ugt i64 %11, %13
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* @ENOMEM
store i32 %16, i32* @errno
store i8* null, i8** %4
br label %23
17: ; preds = %10, %3
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = mul i64 %19, %20
%22 = call i8* @realloc(i8* %18, i64 %21)
store i8* %22, i8** %4
br label %23
23: ; preds = %17, %15
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define noalias i8* @reallocarray(i8* nocapture %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %2, i64 %1)
%7 = extractvalue { i64, i1 } %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* @ENOMEM
store i32 %9, i32* @errno
br label %13
10: ; preds = %5, %3
%11 = mul i64 %2, %1
%12 = tail call i8* @realloc(i8* %0, i64 %11)
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ null, %8 ], [ %12, %10 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char **argv) {
  time_t t = time(0);
  struct tm tmbuf;
  gmtime_r(&t, &tmbuf);
  char buf[16];
  strftime(buf, sizeof(buf), "%d", &tmbuf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gmtime_r@plt>
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
lea    0xe9a(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <gmtime_r@plt>
lea    0xea7(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    $0x10,%esi
mov    %rbx,%rcx
call   1050 <strftime@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca %struct.tm
%7 = alloca [16 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = call i32 @time(i32 0)
store i32 %8, i32* %5
%9 = call i32 @gmtime_r(i32* %5, %struct.tm* %6)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = call i32 @strftime(i8* %10, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = alloca [16 x i8]
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @time(i32 0)
store i32 %7, i32* %3
%8 = bitcast %struct.tm* %4 to i8*
%9 = call i32 @gmtime_r(i32* %3, %struct.tm* %4)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = call i32 @strftime(i8* %10, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i32 0
}
void ADC_SAR_1_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_1_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fizz() { printf("Fizz\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Fizz\00"
define void @fizz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reset_motor_encoders();
int /*<<< orphan*/ set_ir_angle(int, int /*<<< orphan*/);
void initialize_robot() {
  printf("initializing\n");
  set_ir_angle(0, 0);
  set_ir_angle(1, 0);
  reset_motor_encoders();
}


x86 assembly (clang, -O0):
<initialize_robot>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <set_ir_angle@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <set_ir_angle@plt>
mov    $0x0,%al
call   1040 <reset_motor_encoders@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_robot>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <set_ir_angle@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <set_ir_angle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <reset_motor_encoders@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"initializing\0A\00"
define void @initialize_robot() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @set_ir_angle(i32 0, i32 0)
%3 = call i32 @set_ir_angle(i32 1, i32 0)
%4 = call i32 (...) @reset_motor_encoders()
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"initializing\00"
define void @initialize_robot() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @set_ir_angle(i32 0, i32 0)
%3 = tail call i32 @set_ir_angle(i32 1, i32 0)
%4 = tail call i32 (...) @reset_motor_encoders()
ret void
}