xunge/DecIR huggingface dataset:
/* Variables and functions */
int find_packet_start(unsigned char buffer[], size_t length) {
  int i;
  for (i = 0; i < length; i++) {
    if ((1 & buffer[i] >> 7)) {
      return i;
    };
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_packet_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115a <find_packet_start+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1147 <find_packet_start+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <find_packet_start+0x61>
jmp    114c <find_packet_start+0x4c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <find_packet_start+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_packet_start>:
mov    $0xffffffff,%eax
test   %rsi,%rsi
je     111f <find_packet_start+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rcx,1)
js     1120 <find_packet_start+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find_packet_start+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_packet_start(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp sgt i8 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %14, label %4
12: ; preds = %4
%13 = trunc i64 %5 to i32
br label %14
14: ; preds = %9, %12, %2
%15 = phi i32 [ -1, %2 ], [ %13, %12 ], [ -1, %9 ]
ret i32 %15
}
/* Variables and functions */
float expf(float);
float cbuiltin_expf(float x) { return expf(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_expf>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @cbuiltin_expf(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void fini_1(void) { write(STDOUT_FILENO, "fini array 1\n", 13); }


x86 assembly (clang, -O0):
<fini_1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini_1>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0xd,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"fini array 1\0A\00"
define void @fini_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [14 x i8] c"fini array 1\0A\00"
define void @fini_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
double ATMtoMMHG(double ATM) {
  double MMHG = 760 * ATM;
  return MMHG;
}


x86 assembly (clang, -O0):
<ATMtoMMHG>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ATMtoMMHG(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 7.600000e+02, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @ATMtoMMHG(double %0) {
%2 = fmul double %0, 7.600000e+02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutPostRedisplay();
void glutPostRedisplay() { fn_glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @glutPostRedisplay() {
%1 = tail call i32 (...) @fn_glutPostRedisplay()
ret void
}
void to_sign_char_store_4(__float128 a, signed char *p) {
  p[4] = (signed char)a;
}


x86 assembly (clang, -O0):
<to_sign_char_store_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixtfsi>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_sign_char_store_4>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixtfsi>
mov    %al,0x4(%rbx)
pop    %rbx
ret
xchg   %ax,%ax

LLVM IR (-O0):
define void @to_sign_char_store_4(fp128 %0, i8* %1) {
%3 = alloca fp128
%4 = alloca i8*
store fp128 %0, fp128* %3
store i8* %1, i8** %4
%5 = load fp128, fp128* %3
%6 = fptosi fp128 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @to_sign_char_store_4(fp128 %0, i8* nocapture writeonly %1) {
%3 = fptosi fp128 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %3, i8* %4
ret void
}
char *WatchCurrentTimeStampString(void) { return "1000.999"; }


x86 assembly (clang, -O0):
<WatchCurrentTimeStampString>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"1000.999\00"
define i8* @WatchCurrentTimeStampString() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"1000.999\00"
define i8* @WatchCurrentTimeStampString() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *const a, const void *const b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

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

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfmats(int *);
void fgmvwrite_surfmats_(int matids[]) { gmvwrite_surfmats(matids); }


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

x86 assembly (clang, -O2):
<fgmvwrite_surfmats_>:
jmp    1030 <gmvwrite_surfmats@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_surfmats_(i32* %0) {
%2 = tail call i32 @gmvwrite_surfmats(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int _execve(char *name __attribute__((unused)),
            char **argv __attribute__((unused)),
            char **env __attribute__((unused))) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execve>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @ENOMEM
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int character) { return fputc(character, stdout); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
ret i32 %3
}
int is_odd(int n) {
  if (n % 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <is_odd+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_odd+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_odd(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
int main() {
  char *test = "\"\\\n\\t";
  if (test[0] != 34)
    return 1;
  if (test[1] != 92)
    return 2;
  if (test[2] != 10)
    return 3;
  if (test[3] != 92)
    return 4;
  if (test[4] != 116)
    return 5;
  if (test[5] != 0)
    return 6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1132 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    11be <main+0xbe>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5c,%eax
je     114f <main+0x4f>
movl   $0x2,-0x4(%rbp)
jmp    11be <main+0xbe>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0xa,%eax
je     116c <main+0x6c>
movl   $0x3,-0x4(%rbp)
jmp    11be <main+0xbe>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x5c,%eax
je     1189 <main+0x89>
movl   $0x4,-0x4(%rbp)
jmp    11be <main+0xbe>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x74,%eax
je     11a6 <main+0xa6>
movl   $0x5,-0x4(%rbp)
jmp    11be <main+0xbe>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x0,%eax
je     11be <main+0xbe>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"\22\\\0A\\t\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 34
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %44
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 92
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 2, i32* %1
br label %44
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 10
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 3, i32* %1
br label %44
23: ; preds = %16
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 92
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 4, i32* %1
br label %44
30: ; preds = %23
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 4
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 116
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 5, i32* %1
br label %44
37: ; preds = %30
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 5
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %37
store i32 6, i32* %1
br label %44
44: ; preds = %8, %15, %22, %29, %36, %43, %37
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wig_temp_init(int);
void wig_thread_temp_init(int max_two_j) { wig_temp_init(max_two_j); }


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

x86 assembly (clang, -O2):
<wig_thread_temp_init>:
jmp    1030 <wig_temp_init@plt>

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

LLVM IR (-O2):
define void @wig_thread_temp_init(i32 %0) {
%2 = tail call i32 @wig_temp_init(i32 %0)
ret void
}
void Host_HandlePrinterOutput() {}


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

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

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

LLVM IR (-O2):
define void @Host_HandlePrinterOutput() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void lang_check_failed() { abort(); }


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

x86 assembly (clang, -O2):
<lang_check_failed>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @lang_check_failed() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @lang_check_failed() {
%1 = tail call i32 (...) @abort()
unreachable
}
void S_AdpcmEncode(short indata[], char outdata[], int len,
                   struct adpcm_state *state) {}


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

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

LLVM IR (-O0):
%struct.adpcm_state = type opaque
define void @S_AdpcmEncode(i16* %0, i8* %1, i32 %2, %struct.adpcm_state* %3) {
%5 = alloca i16*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.adpcm_state*
store i16* %0, i16** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.adpcm_state* %3, %struct.adpcm_state** %8
ret void
}

LLVM IR (-O2):
%struct.adpcm_state = type opaque
define void @S_AdpcmEncode(i16* nocapture %0, i8* nocapture %1, i32 %2, %struct.adpcm_state* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x4a() {
  Assert_real((isalpha(74)),
              "/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",
              375, ("isalpha should be 1 for J"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x4a>:
push   %rax
mov    $0x4a,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x177,%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 J\00"
define void @t_isalpha_0x4a() {
%1 = call i32 @isalpha(i32 74)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 375, 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 J\00"
define void @t_isalpha_0x4a() {
%1 = tail call i32 @isalpha(i32 74)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ChristmasTree(int);
int /*<<< orphan*/ printf(char *);
int main() {
  ChristmasTree(4);
  ChristmasTree(7);
  ChristmasTree(11);
  printf("\x1b[0m"
         "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <ChristmasTree@plt>
mov    $0x7,%edi
call   1040 <ChristmasTree@plt>
mov    $0xb,%edi
call   1040 <ChristmasTree@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <ChristmasTree@plt>
mov    $0x7,%edi
call   1040 <ChristmasTree@plt>
mov    $0xb,%edi
call   1040 <ChristmasTree@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[0m\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ChristmasTree(i32 4)
%3 = call i32 @ChristmasTree(i32 7)
%4 = call i32 @ChristmasTree(i32 11)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"\1B[0m\00"
define i32 @main() {
%1 = tail call i32 @ChristmasTree(i32 4)
%2 = tail call i32 @ChristmasTree(i32 7)
%3 = tail call i32 @ChristmasTree(i32 11)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct wsgi_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uwsgi_log(char *);
void uwsgi_logit_lf_strftime(struct wsgi_request *wsgi_req) {
  uwsgi_log("lf strftime\n");
}


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

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

LLVM IR (-O0):
%struct.wsgi_request = type { i32 }
@.str = [13 x i8] c"lf strftime\0A\00"
define void @uwsgi_logit_lf_strftime(%struct.wsgi_request* %0) {
%2 = alloca %struct.wsgi_request*
store %struct.wsgi_request* %0, %struct.wsgi_request** %2
%3 = call i32 @uwsgi_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.wsgi_request = type { i32 }
@.str = [13 x i8] c"lf strftime\0A\00"
define void @uwsgi_logit_lf_strftime(%struct.wsgi_request* nocapture readnone %0) {
%2 = tail call i32 @uwsgi_log(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int new_label(void) {
  static int label = 0;
  return ++label;
}


x86 assembly (clang, -O0):
<new_label>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_label>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@new_label.label = internal global i32 0
define i32 @new_label() {
%1 = load i32, i32* @new_label.label
%2 = add nsw i32 %1, 1
store i32 %2, i32* @new_label.label
ret i32 %2
}

LLVM IR (-O2):
@new_label.label = internal unnamed_addr global i32 0
define i32 @new_label() {
%1 = load i32, i32* @new_label.label
%2 = add nsw i32 %1, 1
store i32 %2, i32* @new_label.label
ret i32 %2
}
float amin1(float a, float b) {
  if (a > b)
    return (b);
  else
    return (a);
}


x86 assembly (clang, -O0):
<amin1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <amin1+0x2c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <amin1+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<amin1>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @amin1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
int countBits(unsigned int v) {
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}


x86 assembly (clang, -O0):
<countBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @countBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul i32 %18, 16843009
%20 = lshr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @countBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int epoll_wait(int, struct epoll_event *, int, int);
int epoll_wait_portable(int epfd, struct epoll_event *events, int max,
                        int timeout) {
  return epoll_wait(epfd, events, max, timeout);
}


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

x86 assembly (clang, -O2):
<epoll_wait_portable>:
jmp    1030 <epoll_wait@plt>

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

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_wait_portable(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = tail call i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ RB_AUTOBOOT;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
void wd_sys_reboot() {
  sync();
  reboot(RB_AUTOBOOT);
}


x86 assembly (clang, -O0):
<wd_sys_reboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sync@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wd_sys_reboot>:
push   %rax
xor    %eax,%eax
call   1030 <sync@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <reboot@plt>

LLVM IR (-O0):
@RB_AUTOBOOT = global i32 0
define void @wd_sys_reboot() {
%1 = call i32 (...) @sync()
%2 = load i32, i32* @RB_AUTOBOOT
%3 = call i32 @reboot(i32 %2)
ret void
}

LLVM IR (-O2):
@RB_AUTOBOOT = global i32 0
define void @wd_sys_reboot() {
%1 = tail call i32 (...) @sync()
%2 = load i32, i32* @RB_AUTOBOOT
%3 = tail call i32 @reboot(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int glob(char *, int /*<<< orphan*/, int /*<<< orphan*/ *,
         int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int glob_devices(glob_t *globbuf) {
  int ret;
  ret = glob("/dev/hidraw*", 0, NULL, globbuf);
  if (ret != 0) {
    printf("DEBUG: glob() failed.\n");
  }
  return ret;
}


x86 assembly (clang, -O0):
<glob_devices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <glob@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <glob_devices+0x3b>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob_devices>:
push   %rbx
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <glob@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1146 <glob_devices+0x26>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/hidraw*\00"
@.str.1 = [23 x i8] c"DEBUG: glob() failed.\0A\00"
define i32 @glob_devices(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @glob(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32* null, i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/hidraw*\00"
@str = [22 x i8] c"DEBUG: glob() failed.\00"
define i32 @glob_devices(i32* %0) {
%2 = tail call i32 @glob(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32* null, i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
void baud_max() {
  while (!((*(volatile unsigned int *)((0x08) + 0x40040000)) & (1 << 3)))
    ;
  (*(volatile unsigned int *)(0x400740C0)) = 1;
  (*(volatile unsigned int *)(0x400740D0)) = 1;
  (*(volatile unsigned int *)((0x00) + 0x40040000)) = 0;
  (*(volatile unsigned int *)(0x40074128)) = 0xff;
  (*(volatile unsigned int *)((0x20) + 0x40040000)) = 1 - 1;
  (*(volatile unsigned int *)((0x00) + 0x40040000)) = (1 << 2) | (1 << 0);
}


x86 assembly (clang, -O0):
<baud_max>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <baud_max+0x9>
mov    $0x40040008,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <baud_max+0x28>
jmp    112d <baud_max+0x2d>
jmp    1109 <baud_max+0x9>
mov    $0x400740c0,%eax
movl   $0x1,(%rax)
mov    $0x400740d0,%eax
movl   $0x1,(%rax)
mov    $0x40040000,%eax
movl   $0x0,(%rax)
mov    $0x40074128,%eax
movl   $0xff,(%rax)
mov    $0x40040020,%eax
movl   $0x0,(%rax)
mov    $0x40040000,%eax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_max>:
testl  $0x8,0x40040008
je     1100 <baud_max>
movl   $0x1,0x400740c0
movl   $0x1,0x400740d0
movl   $0x0,0x40040000
movl   $0xff,0x40074128
movl   $0x0,0x40040020
movl   $0x5,0x40040000
ret

LLVM IR (-O0):
define void @baud_max() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1074003976 to i32*)
%3 = and i32 %2, 8
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
store volatile i32 1, i32* inttoptr (i64 1074217152 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074217168 to i32*)
store volatile i32 0, i32* inttoptr (i64 1074003968 to i32*)
store volatile i32 255, i32* inttoptr (i64 1074217256 to i32*)
store volatile i32 0, i32* inttoptr (i64 1074004000 to i32*)
store volatile i32 5, i32* inttoptr (i64 1074003968 to i32*)
ret void
}

LLVM IR (-O2):
define void @baud_max() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1074003976 to i32*)
%3 = and i32 %2, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
store volatile i32 1, i32* inttoptr (i64 1074217152 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074217168 to i32*)
store volatile i32 0, i32* inttoptr (i64 1074003968 to i32*)
store volatile i32 255, i32* inttoptr (i64 1074217256 to i32*)
store volatile i32 0, i32* inttoptr (i64 1074004000 to i32*)
store volatile i32 5, i32* inttoptr (i64 1074003968 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, size_t *, int);
void S_ST_SZT(void *a, size_t v) { memcpy(a, &v, sizeof(v)); }


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

x86 assembly (clang, -O2):
<S_ST_SZT>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @S_ST_SZT(i8* %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = call i32 @memcpy(i8* %0, i64* %3, i32 8)
ret void
}
/* Type definitions */
typedef double M_PI_2;

/* Variables and functions */
double atan(int);
int cos(double);
int sin(double);
double B(double phi) {
  double B = atan((2 + 4 * cos(phi)) / (4 * sin(phi))) - ((M_PI_2)-phi);
  return B;
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
shl    $0x2,%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <atan@plt>
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1050 <cos@plt>
lea    0x2(,%rax,4),%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
shl    $0x2,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <atan@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @B(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @cos(double %4)
%6 = mul nsw i32 4, %5
%7 = add nsw i32 2, %6
%8 = load double, double* %2
%9 = call i32 @sin(double %8)
%10 = mul nsw i32 4, %9
%11 = sdiv i32 %7, %10
%12 = call double @atan(i32 %11)
%13 = load double, double* %2
%14 = fneg double %13
%15 = fsub double %12, %14
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @B(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = shl nsw i32 %2, 2
%4 = or i32 %3, 2
%5 = tail call i32 @sin(double %0)
%6 = shl nsw i32 %5, 2
%7 = sdiv i32 %4, %6
%8 = tail call double @atan(i32 %7)
%9 = fadd double %8, %0
ret double %9
}
__attribute__((warn_unused_result)) int foo(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void VPMT_Free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @VPMT_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *s) {
  fprintf(stderr, "Usage: %s 0123456SsQqAaBbCcUu\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s 0123456SsQqAaBbCcUu\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s 0123456SsQqAaBbCcUu\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ADCDMADisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~0x00000100;
}


x86 assembly (clang, -O0):
<ADCDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDMADisable>:
andq   $0xfffffffffffffeff,0x8(%rdi)
ff
ret

LLVM IR (-O0):
define void @ADCDMADisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -257
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCDMADisable(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -257
store volatile i64 %5, i64* %3
ret void
}
void chomp(char *str) {
  while (*str) {
    if (*str == '\n' || *str == '\r') {
      *str = 0;
      return;
    }
    str++;
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <chomp+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1135 <chomp+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1141 <chomp+0x41>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1152 <chomp+0x52>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chomp+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <chomp+0x18>
cmp    $0xd,%al
je     1115 <chomp+0x15>
cmp    $0xa,%al
je     1115 <chomp+0x15>
add    $0x1,%rdi
jmp    1100 <chomp>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
char get_in_addr(struct sockaddr *sa) {
  if (sa->sa_family == AF_INET) {
    return (int)&(((struct sockaddr_in *)sa)->sin_addr);
  }
  return (int)&(((struct sockaddr_in6 *)sa)->sin6_addr);
}


x86 assembly (clang, -O0):
<get_in_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
jne    112b <get_in_addr+0x2b>
mov    -0x10(%rbp),%rax
mov    %al,-0x1(%rbp)
jmp    1132 <get_in_addr+0x32>
mov    -0x10(%rbp),%rax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@AF_INET = global i64 0
define signext i8 @get_in_addr(%struct.sockaddr* %0) {
%2 = alloca i8
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @AF_INET
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load %struct.sockaddr*, %struct.sockaddr** %3
%11 = bitcast %struct.sockaddr* %10 to %struct.sockaddr_in*
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%13 = ptrtoint i32* %12 to i32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %21
15: ; preds = %1
%16 = load %struct.sockaddr*, %struct.sockaddr** %3
%17 = bitcast %struct.sockaddr* %16 to %struct.sockaddr_in6*
%18 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %17, i32 0, i32 0
%19 = ptrtoint i32* %18 to i32
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %21
21: ; preds = %15, %9
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define signext i8 @get_in_addr(%struct.sockaddr* %0) {
%2 = ptrtoint %struct.sockaddr* %0 to i64
%3 = trunc i64 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ enginedb();
int sqlite3_last_insert_rowid(int /*<<< orphan*/);
int db_last_insert_rowid() { return sqlite3_last_insert_rowid(enginedb()); }


x86 assembly (clang, -O0):
<db_last_insert_rowid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <enginedb@plt>
mov    %eax,%edi
call   1040 <sqlite3_last_insert_rowid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_last_insert_rowid>:
push   %rax
xor    %eax,%eax
call   1030 <enginedb@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqlite3_last_insert_rowid@plt>

LLVM IR (-O0):
define i32 @db_last_insert_rowid() {
%1 = call i32 (...) @enginedb()
%2 = call i32 @sqlite3_last_insert_rowid(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @db_last_insert_rowid() {
%1 = tail call i32 (...) @enginedb()
%2 = tail call i32 @sqlite3_last_insert_rowid(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int);
void io_config(int data) { to_gps(0xf0, data); }


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

x86 assembly (clang, -O2):
<io_config>:
mov    %edi,%esi
mov    $0xf0,%edi
jmp    1030 <to_gps@plt>

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

LLVM IR (-O2):
define void @io_config(i32 %0) {
%2 = tail call i32 @to_gps(i32 240, i32 %0)
ret void
}
unsigned char rgb_to_index(unsigned char r, unsigned char g, unsigned char b) {
  r = (r & 0xc0);
  g = (g & 0xe0) >> 2;
  b = (b & 0xe0) >> 5;
  return r | g | b;
}


x86 assembly (clang, -O0):
<rgb_to_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xc0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xe0,%eax
sar    $0x2,%eax
mov    %al,-0x2(%rbp)
movzbl -0x3(%rbp),%eax
and    $0xe0,%eax
sar    $0x5,%eax
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_index>:
and    $0xc0,%dil
shr    $0x2,%sil
and    $0x38,%sil
lea    (%rsi,%rdi,1),%eax
shr    $0x5,%dl
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rgb_to_index(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %8, 192
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %12, 224
%14 = ashr i32 %13, 2
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = and i32 %17, 224
%19 = ashr i32 %18, 5
%20 = trunc i32 %19 to i8
store i8 %20, i8* %6
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = or i32 %25, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define zeroext i8 @rgb_to_index(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %0, -64
%5 = lshr i8 %1, 2
%6 = and i8 %5, 56
%7 = lshr i8 %2, 5
%8 = or i8 %6, %4
%9 = or i8 %8, %7
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void _console_cursor_hide(int fd) {
  write(fd, "\033[?25l", strlen("\033[?25l"));
}


x86 assembly (clang, -O0):
<_console_cursor_hide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec8(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xeb7(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_console_cursor_hide>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @_console_cursor_hide(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @write(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @_console_cursor_hide(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}