xunge/DecIR huggingface dataset:
int contains(char *board, char x, char y) { return *(board + y) & (1 << x); }


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl -0xa(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
mov    %esi,%ecx
movslq %edx,%rax
movsbl (%rdi,%rax,1),%edx
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @contains(i8* %0, i8 signext %1, i8 signext %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 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = shl i32 1, %15
%17 = and i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @contains(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = sext i8 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = zext i8 %1 to i32
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %7
ret i32 %10
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *nulldup(char *s) {
  char *dup = NULL;
  if (s != NULL) {
    dup = (char *)malloc(strlen(s) + 1);
    if (dup != NULL)
      strcpy(dup, s);
  }
  return dup;
}


x86 assembly (clang, -O0):
<nulldup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1185 <nulldup+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1180 <nulldup+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1185 <nulldup+0x55>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nulldup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <nulldup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <nulldup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <nulldup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @nulldup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ %7, %9 ], [ null, %3 ], [ null, %1 ]
ret i8* %12
}
int alint_cleanup() { return 1; }


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

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

LLVM IR (-O0):
define i32 @alint_cleanup() {
ret i32 1
}

LLVM IR (-O2):
define i32 @alint_cleanup() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int);
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (4096 >> 0); i++)
    binary_search(8);
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1189 <main+0x49>
mov    $0x8,%edi
call   1060 <binary_search@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
mov    $0x1000,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x8,%edi
call   1060 <binary_search@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialise_board()
%4 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4096
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 @binary_search(i32 8)
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
%14 = call i32 (...) @stop_trigger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @binary_search(i32 8)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 4096
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 (...) @stop_trigger()
ret i32 0
}
int g(double aaa, double bbb) {
  int xa = __builtin_isunordered(aaa, bbb);
  int xb = __builtin_isunordered(bbb, bbb);
  return xa | xb;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @g(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp uno double %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load double, double* %4
%12 = load double, double* %4
%13 = fcmp uno double %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = or i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @g(double %0, double %1) {
%3 = fcmp uno double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int fputc(int c, FILE *stream) {
  fwrite(&c, 1, 1, stream);
  return c;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
jmp    1100 <fputc>

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

LLVM IR (-O2):
define i32 @fputc(i32 returned %0, i32* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ read(int /*<<< orphan*/, char **, int);
void nothing() {
  char *buf0[50];
  read(STDIN_FILENO, buf0, 450);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    -0x190(%rbp),%rsi
mov    $0x1c2,%edx
call   1030 <read@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
sub    $0x198,%rsp
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x1c2,%edx
call   1030 <read@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = load i32, i32* @STDIN_FILENO
%3 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%4 = call i32 @read(i32 %2, i8** %3, i32 450)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%5 = call i32 @read(i32 %3, i8** %4, i32 450)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _halt_error(char const *message, int ret) {
  fputs("halt"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_halt_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_halt_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"halt: \00"
@stderr = global i32 0
define i32 @_halt_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int SPI_NO_CS;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_enableCS(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode & ~SPI_NO_CS);
}


x86 assembly (clang, -O0):
<SPI_enableCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_enableCS+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <SPI_enableCS+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_enableCS>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     1143 <SPI_enableCS+0x23>
mov    0x2ead(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SPI_NO_CS = global i32 0
define i32 @SPI_enableCS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @SPI_getMode(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* @SPI_NO_CS
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 @SPI_setMode(i32 %11, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@SPI_NO_CS = global i32 0
define i32 @SPI_enableCS(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_NO_CS
%6 = xor i32 %5, -1
%7 = and i32 %2, %6
%8 = tail call i32 @SPI_setMode(i32 %0, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ io_wait();
int /*<<< orphan*/ outb(int, int);
void pic_init(void) {
  outb(0x20, 0x10 | 0x01);
  outb(0xA0, 0x10 | 0x01);
  io_wait();
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  io_wait();
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  io_wait();
  outb(0x21, 0x01 | 0x04);
  outb(0xA1, 0x01);
  io_wait();
}


x86 assembly (clang, -O0):
<pic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x5,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <io_wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_init>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <io_wait@plt>
mov    $0x21,%edi
mov    $0x5,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_wait@plt>

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 (...) @io_wait()
%4 = call i32 @outb(i32 33, i32 32)
%5 = call i32 @outb(i32 161, i32 40)
%6 = call i32 (...) @io_wait()
%7 = call i32 @outb(i32 33, i32 4)
%8 = call i32 @outb(i32 161, i32 2)
%9 = call i32 (...) @io_wait()
%10 = call i32 @outb(i32 33, i32 5)
%11 = call i32 @outb(i32 161, i32 1)
%12 = call i32 (...) @io_wait()
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 (...) @io_wait()
%4 = tail call i32 @outb(i32 33, i32 32)
%5 = tail call i32 @outb(i32 161, i32 40)
%6 = tail call i32 (...) @io_wait()
%7 = tail call i32 @outb(i32 33, i32 4)
%8 = tail call i32 @outb(i32 161, i32 2)
%9 = tail call i32 (...) @io_wait()
%10 = tail call i32 @outb(i32 33, i32 5)
%11 = tail call i32 @outb(i32 161, i32 1)
%12 = tail call i32 (...) @io_wait()
ret void
}
extern void ftg_free_console(void) {}


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

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

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

LLVM IR (-O2):
define void @ftg_free_console() {
ret void
}
int zbase64_encode_get_min_len(int in_len, int mime_flag) {
  int ret;
  ret = in_len * 4 / 3 + 4;
  if (mime_flag) {
    ret += ((in_len / (76 * 3 / 4)) + 1) * 2 + 2;
  }
  ret += 1;
  return ret;
}


x86 assembly (clang, -O0):
<zbase64_encode_get_min_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1142 <zbase64_encode_get_min_len+0x42>
mov    -0x4(%rbp),%eax
mov    $0x39,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
shl    $0x1,%eax
add    $0x2,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbase64_encode_get_min_len>:
lea    0x0(,%rdi,4),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x4,%eax
test   %esi,%esi
je     1144 <zbase64_encode_get_min_len+0x44>
movslq %edi,%rcx
imul   $0xffffffff8fb823ef,%rcx,%rcx
shr    $0x20,%rcx
add    %edi,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
lea    (%rax,%rcx,2),%eax
add    $0x4,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @zbase64_encode_get_min_len(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 2
%4 = sdiv i32 %3, 3
%5 = add nsw i32 %4, 4
%6 = icmp eq i32 %1, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = sdiv i32 %0, 57
%9 = shl nsw i32 %8, 1
%10 = add nsw i32 %9, 4
%11 = add nsw i32 %10, %5
br label %12
12: ; preds = %7, %2
%13 = phi i32 [ %11, %7 ], [ %5, %2 ]
%14 = add nsw i32 %13, 1
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_if_valid(char *id __attribute__((unused)), void *p) {
  if (p == NULL)
    return;
  free(p);
  ;
  ;
}


x86 assembly (clang, -O0):
<free_if_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <free_if_valid+0x20>
jmp    1139 <free_if_valid+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_if_valid>:
test   %rsi,%rsi
je     111d <free_if_valid+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_if_valid(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @free_if_valid(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configure_serial_baud_rate(unsigned short, unsigned short);
int /*<<< orphan*/ configure_serial_buffer(unsigned short);
int /*<<< orphan*/ configure_serial_line(unsigned short);
int /*<<< orphan*/ configure_serial_modem(unsigned short);
void configure_serial(unsigned short com, unsigned short divisor) {
  configure_serial_baud_rate(com, divisor);
  configure_serial_line(com);
  configure_serial_buffer(com);
  configure_serial_modem(com);
}


x86 assembly (clang, -O0):
<configure_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <configure_serial_baud_rate@plt>
movzwl -0x2(%rbp),%edi
call   1050 <configure_serial_line@plt>
movzwl -0x2(%rbp),%edi
call   1040 <configure_serial_buffer@plt>
movzwl -0x2(%rbp),%edi
call   1060 <configure_serial_modem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_serial>:
push   %rbx
mov    %edi,%ebx
call   1030 <configure_serial_baud_rate@plt>
mov    %ebx,%edi
call   1050 <configure_serial_line@plt>
mov    %ebx,%edi
call   1040 <configure_serial_buffer@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <configure_serial_modem@plt>

LLVM IR (-O0):
define void @configure_serial(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 @configure_serial_baud_rate(i16 zeroext %5, i16 zeroext %6)
%8 = load i16, i16* %3
%9 = call i32 @configure_serial_line(i16 zeroext %8)
%10 = load i16, i16* %3
%11 = call i32 @configure_serial_buffer(i16 zeroext %10)
%12 = load i16, i16* %3
%13 = call i32 @configure_serial_modem(i16 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @configure_serial(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @configure_serial_baud_rate(i16 zeroext %0, i16 zeroext %1)
%4 = tail call i32 @configure_serial_line(i16 zeroext %0)
%5 = tail call i32 @configure_serial_buffer(i16 zeroext %0)
%6 = tail call i32 @configure_serial_modem(i16 zeroext %0)
ret void
}
void generate_job_log() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int lseek(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int i_lseek(int fd, off_t size, int position) {
  if (-1 == lseek(fd, size, position)) {
    perror("seek error");
    exit(1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<i_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <lseek@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1174 <i_lseek+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_lseek>:
push   %rax
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
je     113f <i_lseek+0xf>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"seek error\00"
define i32 @i_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @lseek(i32 %7, i32 %8, i32 %9)
%11 = icmp eq i32 -1, %10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"seek error\00"
define i32 @i_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void emit_cdq(void) { Emit1(0x99); }


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

x86 assembly (clang, -O2):
<emit_cdq>:
mov    $0x99,%edi
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @emit_cdq() {
%1 = call i32 @Emit1(i32 153)
ret void
}

LLVM IR (-O2):
define void @emit_cdq() {
%1 = tail call i32 @Emit1(i32 153)
ret void
}
unsigned uDivTest14(unsigned X, unsigned Y) { return X / (X == Y, 2, 4); }


x86 assembly (clang, -O0):
<uDivTest14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest14>:
mov    %edi,%eax
shr    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @uDivTest14(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = udiv i32 %5, 4
ret i32 %10
}

LLVM IR (-O2):
define i32 @uDivTest14(i32 %0, i32 %1) {
%3 = lshr i32 %0, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printargs(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++)
    printf("%2d: %s\n", i, argv[i]);
}


x86 assembly (clang, -O0):
<printargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <printargs+0x4b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <printargs+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printargs>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <printargs+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printargs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%2d: %s\0A\00"
define void @printargs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
int foo() {
  int i;
  int a = 2;
  while (a) {
    a *= 3;
    for (i = 0; i < 100; i++)
      a += 4;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <foo+0x49>
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1144 <foo+0x44>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <foo+0x23>
jmp    110b <foo+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void fun(FILE *fp1, FILE *fp2) {
  char x;
  while ((x = fgetc(fp1)) != EOF) {
    fputc(x, fp2);
  }
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2ea2(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1165 <fun+0x45>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
jmp    1130 <fun+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%al
je     1158 <fun+0x38>
nopl   0x0(%rax)
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%al
jne    1140 <fun+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @fun(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %13, %2
%7 = load i32*, i32** %3
%8 = call signext i8 @fgetc(i32* %7)
store i8 %8, i8* %5
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8, i8* %5
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i8 signext %14, i32* %15)
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @fun(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @fputc(i8 signext %7, i32* %1)
%9 = tail call signext i8 @fgetc(i32* %0)
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg4_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int,
                             int /*<<< orphan*/);
void MC_avg_xy_8_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_avg4_8(height, dest, ref, stride, 0);
}


x86 assembly (clang, -O0):
<MC_avg_xy_8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <MC_avg4_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_xy_8_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
xor    %r8d,%r8d
jmp    1030 <MC_avg4_8@plt>

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

LLVM IR (-O2):
define void @MC_avg_xy_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg4_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
void testMessage(char *msg) {
  printf("%c[0;32;40m%s%c[0m\n", 27, (msg), 27);
  ;
}


x86 assembly (clang, -O0):
<testMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0x1b,%ecx
mov    %ecx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMessage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1b,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%c[0;32;40m%s%c[0m\0A\00"
define void @testMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 27, i8* %3, i32 27)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%c[0;32;40m%s%c[0m\0A\00"
define void @testMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 27, i8* %0, i32 27)
ret void
}
int proc_comm_batt_get_temperature(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @proc_comm_batt_get_temperature() {
ret i32 0
}

LLVM IR (-O2):
define i32 @proc_comm_batt_get_temperature() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(long);
main() {
  if (f(100030L) != 30)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x186be,%edi
call   1040 <f@plt>
cmp    $0x1e,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x186be,%edi
call   1040 <f@plt>
cmp    $0x1e,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i64 100030)
%3 = icmp ne i32 %2, 30
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i64 100030)
%2 = icmp eq i32 %1, 30
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_self();
pthread_t xthr_self(void) { return pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @xthr_self() {
%1 = call i32 (...) @pthread_self()
ret i32 %1
}

LLVM IR (-O2):
define i32 @xthr_self() {
%1 = tail call i32 (...) @pthread_self()
ret i32 %1
}
/* Variables and functions */
int board_flash_erase_datafs_common();
int board_flash_erase_datafs() { return board_flash_erase_datafs_common(); }


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

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

LLVM IR (-O0):
define i32 @board_flash_erase_datafs() {
%1 = call i32 (...) @board_flash_erase_datafs_common()
ret i32 %1
}

LLVM IR (-O2):
define i32 @board_flash_erase_datafs() {
%1 = tail call i32 (...) @board_flash_erase_datafs_common()
ret i32 %1
}
int is_it_VorZ(unsigned int dtype) {
  int yes_or_no = 0;
  if (dtype & ((1 << 14) | (1 << 12) | (1 << 13) | (1 << 9))) {
    yes_or_no = 1;
  }
  return (yes_or_no);
}


x86 assembly (clang, -O0):
<is_it_VorZ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7200,%eax
cmp    $0x0,%eax
je     1126 <is_it_VorZ+0x26>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_it_VorZ>:
xor    %eax,%eax
test   $0x7200,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_it_VorZ(i32 %0) {
%2 = and i32 %0, 29184
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t100_4mul(signed __int128 x) {
  unsigned __int128 y = (0);
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%r8
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    %rdx,-0x70(%rbp)
mov    %rsi,%rdi
sar    $0x3f,%rdi
add    %rdi,%r8
mov    %rsi,%rax
adc    %rdi,%rax
xor    %rdi,%r8
mov    %r8,-0x68(%rbp)
xor    %rdi,%rax
test   %rax,%rax
setne  %r8b
test   %rdx,%rdx
setne  %dl
and    %dl,%r8b
mul    %rcx
mov    -0x68(%rbp),%rdx
mov    %rax,%rdi
mov    -0x70(%rbp),%rax
seto   %r9b
or     %r9b,%r8b
mul    %rdx
mov    %rax,%rdx
mov    -0x68(%rbp),%rax
seto   %r9b
or     %r9b,%r8b
mov    %r8b,-0x59(%rbp)
add    %rdx,%rdi
mul    %rcx
mov    %rax,%rcx
mov    -0x59(%rbp),%al
mov    %rcx,-0x58(%rbp)
mov    %rdx,%rcx
mov    -0x58(%rbp),%rdx
add    %rdi,%rcx
setb   %dil
or     %dil,%al
mov    %rdx,%rdi
or     %rcx,%rdi
setne  %dil
xor    %r9d,%r9d
mov    %rdx,%r8
neg    %r8
sbb    %rcx,%r9
test   %rsi,%rsi
sets   %sil
cmovs  %r9,%rcx
cmovs  %r8,%rdx
and    %dil,%sil
or     %sil,%al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    1209 <t100_4mul+0xf9>
jmp    1210 <t100_4mul+0x100>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @t100_4mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = icmp slt i128 %12, 0
%15 = sub i128 0, %12
%16 = select i1 %14, i128 %15, i128 %12
%17 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %16, i128 %13)
%18 = extractvalue { i128, i1 } %17, 1
%19 = extractvalue { i128, i1 } %17, 0
%20 = icmp ne i128 %19, 0
%21 = and i1 %14, %20
%22 = or i1 %18, %21
%23 = sub i128 0, %19
%24 = select i1 %14, i128 %23, i128 %19
store i128 %24, i128* %7
br i1 %22, label %25, label %27
25: ; preds = %2
%26 = call i32 (...) @bar()
br label %27
27: ; preds = %25, %2
%28 = load i128, i128* %7
store i128 %28, i128* %3
%29 = bitcast i128* %3 to { i64, i64 }*
%30 = load { i64, i64 }, { i64, i64 }* %29
ret { i64, i64 } %30
}

LLVM IR (-O2):
define { i64, i64 } @t100_4mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
int AddMod(int a, int b) { return (a + b) > 25 ? (a + b) - 26 : a + b; }


x86 assembly (clang, -O0):
<AddMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x19,%eax
jle    112a <AddMod+0x2a>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1a,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <AddMod+0x33>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddMod>:
lea    (%rsi,%rdi,1),%ecx
cmp    $0x1a,%ecx
lea    -0x1a(%rsi,%rdi,1),%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @AddMod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = icmp sgt i32 %7, 25
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = sub nsw i32 %12, 26
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %13, %9 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @AddMod(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp sgt i32 %3, 25
%5 = add nsw i32 %3, -26
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
void test(void) { int i, j; }


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

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

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
ret void
}

LLVM IR (-O2):
define void @test() {
ret void
}
int test_imm_DEuint32_mem(unsigned int *val) {
  return ((*val) & (0xDE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DEuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 222
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int clone_child(void *arg) {
  (void)arg;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @clone_child(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_lc898122_sharp(unsigned short, unsigned char *);
int /*<<< orphan*/ RegWriteA_lc898122_sharp(unsigned short, unsigned char);
void BsyWit_lc898122_sharp(unsigned short UsTrgAdr, unsigned char UcTrgDat) {
  unsigned char UcFlgVal;
  RegWriteA_lc898122_sharp(UsTrgAdr, UcTrgDat);
  UcFlgVal = 1;
  while (UcFlgVal) {
    RegReadA_lc898122_sharp(UsTrgAdr, &UcFlgVal);
    UcFlgVal &= (UcTrgDat & 0x0F);
  };
}


x86 assembly (clang, -O0):
<BsyWit_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
movb   $0x1,-0x4(%rbp)
cmpb   $0x0,-0x4(%rbp)
je     1175 <BsyWit_lc898122_sharp+0x55>
lea    -0x4(%rbp),%rsi
movzwl -0x2(%rbp),%edi
call   1040 <RegReadA_lc898122_sharp@plt>
movzbl -0x3(%rbp),%ecx
and    $0xf,%ecx
movzbl -0x4(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x4(%rbp)
jmp    1149 <BsyWit_lc898122_sharp+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BsyWit_lc898122_sharp>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <RegWriteA_lc898122_sharp@plt>
movb   $0x1,0xf(%rsp)
and    $0xf,%bl
movzwl %bp,%ebp
lea    0xf(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <RegReadA_lc898122_sharp@plt>
and    %bl,0xf(%rsp)
jne    1150 <BsyWit_lc898122_sharp+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @BsyWit_lc898122_sharp(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%6 = load i16, i16* %3
%7 = load i8, i8* %4
%8 = call i32 @RegWriteA_lc898122_sharp(i16 zeroext %6, i8 zeroext %7)
store i8 1, i8* %5
br label %9
9: ; preds = %12, %2
%10 = load i8, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i16, i16* %3
%14 = call i32 @RegReadA_lc898122_sharp(i16 zeroext %13, i8* %5)
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = and i32 %16, 15
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = and i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @BsyWit_lc898122_sharp(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = tail call i32 @RegWriteA_lc898122_sharp(i16 zeroext %0, i8 zeroext %1)
store i8 1, i8* %3
%5 = and i8 %1, 15
br label %6
6: ; preds = %2, %6
%7 = call i32 @RegReadA_lc898122_sharp(i16 zeroext %0, i8* %3)
%8 = load i8, i8* %3
%9 = and i8 %5, %8
store i8 %9, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
unsigned int *init_task(unsigned int *stack, void (*start)(void)) {
  stack += 1024 - 16;
  stack[0] = 0x10;
  stack[1] = (unsigned int)start;
  return stack;
}


x86 assembly (clang, -O0):
<init_task>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfc0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x10,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_task>:
lea    0xfc0(%rdi),%rax
movl   $0x10,0xfc0(%rdi)
mov    %esi,0xfc4(%rdi)
ret

LLVM IR (-O0):
define i32* @init_task(i32* %0, void ()* %1) {
%3 = alloca i32*
%4 = alloca void ()*
store i32* %0, i32** %3
store void ()* %1, void ()** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1008
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 16, i32* %8
%9 = load void ()*, void ()** %4
%10 = ptrtoint void ()* %9 to i32
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
define i32* @init_task(i32* writeonly %0, void ()* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1008
store i32 16, i32* %3
%4 = ptrtoint void ()* %1 to i64
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds i32, i32* %0, i64 1009
store i32 %5, i32* %6
ret i32* %3
}