xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ printk(char *);
void int_Break_point(void) {
  color(0xff0000);
  printk("Break point!!!");
  io_hlt();
}


x86 assembly (clang, -O0):
<int_Break_point>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_Break_point>:
push   %rax
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebe(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_hlt@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Break point!!!\00"
define void @int_Break_point() {
%1 = call i32 @color(i32 16711680)
%2 = call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @io_hlt()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Break point!!!\00"
define void @int_Break_point() {
%1 = tail call i32 @color(i32 16711680)
%2 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @io_hlt()
ret void
}
unsigned int BWTFileSizeInWord(const unsigned int numChar) {
  return (numChar + 16 - 1) / 16;
}


x86 assembly (clang, -O0):
<BWTFileSizeInWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
sub    $0x1,%eax
shr    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BWTFileSizeInWord>:
lea    0xf(%rdi),%eax
shr    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @BWTFileSizeInWord(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = sub i32 %4, 1
%6 = udiv i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @BWTFileSizeInWord(i32 %0) {
%2 = add i32 %0, 15
%3 = lshr i32 %2, 4
ret i32 %3
}
int isBitISet(unsigned char c, int i) {
  unsigned char mask = 1 << i;
  return mask & c;
}


x86 assembly (clang, -O0):
<isBitISet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBitISet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @isBitISet(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @isBitISet(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = zext i8 %0 to i32
%5 = and i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cgau4(double *, int, double *, double *, int, int);
void cgau4_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau4(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau4_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau4_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau4@plt>

LLVM IR (-O0):
define void @cgau4_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @cgau4(double* %11, i32 %12, double* %13, double* %17, i32 %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @cgau4_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau4(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
void VerifyHeap(void) {}


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

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

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

LLVM IR (-O2):
define void @VerifyHeap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/ETCalibrator/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"cd /mnt/user/code/ETCalibrator/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"cd /mnt/user/code/ETCalibrator/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void set_edge(uint8_t *bits, uint64_t index) {
  bits[index / 8] |= 1 << (index % 8);
}


x86 assembly (clang, -O0):
<set_edge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_edge>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @set_edge(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 = srem i32 %5, 8
%7 = shl i32 1, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %7
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @set_edge(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %4
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void god_mode_finish() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<god_mode_finish>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @god_mode_finish() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @god_mode_finish() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXVendorPrivateWithReply(int /*<<< orphan*/ *);
void glXVendorPrivateWithReply() {
  { mock_push(pack_glXVendorPrivateWithReply(NULL)); };
}


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

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

LLVM IR (-O0):
define void @glXVendorPrivateWithReply() {
%1 = call i32 @pack_glXVendorPrivateWithReply(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXVendorPrivateWithReply() {
%1 = tail call i32 @pack_glXVendorPrivateWithReply(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ drawable;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
unsigned long get_XNoExposeEvent_drawable(void *_p) {
  return (unsigned long)((XNoExposeEvent *)_p)->drawable;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XNoExposeEvent_drawable(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeaderWithFactorial() {
  printf("Number\tFactorial\tApproximation1\t\tApproximation2\n");
  printf("-------------------------------------------------------"
         "--------\n");
}


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

x86 assembly (clang, -O2):
<printHeaderWithFactorial>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Number\09Factorial\09Approximation1\09\09Approximation2\0A\00"
@.str.1 = [65 x i8] c"---------------------------------------------------------------\0A\00"
define void @printHeaderWithFactorial() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"Number\09Factorial\09Approximation1\09\09Approximation2\00"
@str.2 = [64 x i8] c"---------------------------------------------------------------\00"
define void @printHeaderWithFactorial() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  printf("%s", "Enter a character: ");
  scanf("%c", &c);
  printf("ASCII value of %c = %d", c, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%edx
lea    0xec7(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Enter a character: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [23 x i8] c"ASCII value of %c = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Enter a character: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [23 x i8] c"ASCII value of %c = %d\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
/* Variables and functions */
int pipe(int *);
int txc_libc_pipe(int filedes[2]) { return pipe(filedes); }


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

x86 assembly (clang, -O2):
<txc_libc_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @txc_libc_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ tommy_hash_u32(int /*<<< orphan*/, void *, int);
void *tommy_hashlin_remove(void *, void *, void *, int /*<<< orphan*/);
void *search_remove_elem_hash_table(void *ht, void *key, int key_len,
                                    void *compare) {
  return tommy_hashlin_remove(ht, compare, key,
                              tommy_hash_u32(0, key, key_len));
}


x86 assembly (clang, -O0):
<search_remove_elem_hash_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %edi,%edi
call   1040 <tommy_hash_u32@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
call   1030 <tommy_hashlin_remove@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_remove_elem_hash_table>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
call   1040 <tommy_hash_u32@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <tommy_hashlin_remove@plt>

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

LLVM IR (-O2):
define i8* @search_remove_elem_hash_table(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @tommy_hash_u32(i32 0, i8* %1, i32 %2)
%6 = tail call i8* @tommy_hashlin_remove(i8* %0, i8* %3, i8* %1, i32 %5)
ret i8* %6
}
int test_fun(int x, int y) {
  int c = 0;
  if (x <= 0 || y <= 0) {
    return x + y;
  }
  while (!(x == 0)) {
    if (x > y) {
      x = y;
    } else {
      x = x - 1;
    }
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1125 <test_fun+0x25>
cmpl   $0x0,-0xc(%rbp)
jg     1133 <test_fun+0x33>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <test_fun+0x82>
jmp    1138 <test_fun+0x38>
cmpl   $0x0,-0x8(%rbp)
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    114e <test_fun+0x4e>
jmp    117c <test_fun+0x7c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1165 <test_fun+0x65>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116e <test_fun+0x6e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <test_fun+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
test   %edi,%edi
jle    1122 <test_fun+0x22>
test   %esi,%esi
jle    1122 <test_fun+0x22>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %esi,%edi
lea    -0x1(%rdi),%ecx
cmovg  %esi,%ecx
add    $0x1,%eax
mov    %ecx,%edi
test   %ecx,%ecx
jne    1110 <test_fun+0x10>
ret
add    %edi,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
store i32 %15, i32* %3
br label %35
16: ; preds = %9
br label %17
17: ; preds = %30, %16
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
%20 = xor i1 %19, true
br i1 %20, label %21, label %33
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = icmp sgt i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %5
store i32 %26, i32* %4
br label %30
27: ; preds = %21
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %4
br label %30
30: ; preds = %27, %25
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %17
33: ; preds = %17
%34 = load i32, i32* %6
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %12
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = add nsw i32 %1, %0
br label %16
8: ; preds = %2, %8
%9 = phi i32 [ %14, %8 ], [ 0, %2 ]
%10 = phi i32 [ %13, %8 ], [ %0, %2 ]
%11 = icmp sgt i32 %10, %1
%12 = add nsw i32 %10, -1
%13 = select i1 %11, i32 %1, i32 %12
%14 = add nuw nsw i32 %9, 1
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %6
%17 = phi i32 [ %7, %6 ], [ %14, %8 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i, j;
  for (i = 0, j = 5; i<10, j> 0; i++, j--)
    printf("%d %d\n", i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1160 <main+0x50>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4, i32 1)
ret i32 0
}
double value_map_size(char *seq, long gen_number) {
  int x = gen_number % 5;
  if (x == 0)
    return 0.01;
  else if (x == 1)
    return 0.03;
  else if (x == 2)
    return 0.05;
  else if (x == 3)
    return 0.07;
  else
    return 0.1;
}


x86 assembly (clang, -O0):
<value_map_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    113b <value_map_size+0x3b>
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <value_map_size+0x9c>
cmpl   $0x1,-0x1c(%rbp)
jne    1157 <value_map_size+0x57>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <value_map_size+0x9c>
cmpl   $0x2,-0x1c(%rbp)
jne    1173 <value_map_size+0x73>
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <value_map_size+0x9c>
cmpl   $0x3,-0x1c(%rbp)
jne    118f <value_map_size+0x8f>
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <value_map_size+0x9c>
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_map_size>:
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
test   $0xfffffffc,%esi
je     1135 <value_map_size+0x35>
movsd  0xecc(%rip),%xmm0
ret
lea    0xecc(%rip),%rax
movsd  (%rax,%rsi,8),%xmm0
ret

LLVM IR (-O0):
define double @value_map_size(i8* %0, i64 %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = srem i64 %7, 5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store double 1.000000e-02, double* %3
br label %26
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store double 3.000000e-02, double* %3
br label %26
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %21
20: ; preds = %17
store double 5.000000e-02, double* %3
br label %26
21: ; preds = %17
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %21
store double 7.000000e-02, double* %3
br label %26
25: ; preds = %21
store double 1.000000e-01, double* %3
br label %26
26: ; preds = %25, %24, %20, %16, %12
%27 = load double, double* %3
ret double %27
}

LLVM IR (-O2):
@switch.table.value_map_size = [4 x double] [double 1.000000e-02, double 3.000000e-02, double 5.000000e-02, double 7.000000e-02]
define double @value_map_size(i8* nocapture readnone %0, i64 %1) {
%3 = srem i64 %1, 5
%4 = and i64 %3, 4294967292
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds [4 x double], [4 x double]* @switch.table.value_map_size, i64 0, i64 %3
%8 = load double, double* %7
br label %9
9: ; preds = %2, %6
%10 = phi double [ %8, %6 ], [ 1.000000e-01, %2 ]
ret double %10
}
int test_imm_44uint32_mem(unsigned int *val) {
  return ((*val) & (0x44 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_44uint32_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, 68
%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_44uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 68
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_text(char const);
char *skip_text(const char *s, int sz) {
  while (sz > 0 && is_text(*s)) {
    s++;
    sz--;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1144 <skip_text+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_text@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <skip_text+0x44>
jmp    116e <skip_text+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skip_text+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_text>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1139 <skip_text+0x29>
mov    %esi,%ebp
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <is_text@plt>
test   %rax,%rax
je     1139 <skip_text+0x29>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1120 <skip_text+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @skip_text(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %15, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @is_text(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_text(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %12, %10 ], [ %1, %2 ]
%6 = phi i8* [ %11, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @is_text(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %5, -1
%13 = icmp sgt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
void window_water_emptysub() {}


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

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

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

LLVM IR (-O2):
define void @window_water_emptysub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char);
int strlen(char *);
char *(strrev(char input_string[25])) {
  int str_len = strlen(input_string);
  char new_str[25];
  for (int i = str_len - 1; i >= 0; i--) {
    strcat(new_str, input_string[i]);
  }
  return new_str;
}


x86 assembly (clang, -O0):
<strrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     116e <strrev+0x4e>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1040 <strcat@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1141 <strrev+0x21>
lea    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrev>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    115a <strrev+0x3a>
mov    %eax,%ebx
add    $0x1,%rbx
mov    %rsp,%r14
xchg   %ax,%ax
lea    -0x2(%rbx),%eax
movsbl (%r15,%rax,1),%esi
mov    %r14,%rdi
call   1040 <strcat@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <strrev+0x20>
mov    %rsp,%rax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strrev(i8* %0) {
%2 = alloca [25 x i8]
%3 = tail call i32 @strlen(i8* %0)
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = zext i32 %3 to i64
br label %9
8: ; preds = %9, %1
ret i8* %4
9: ; preds = %6, %9
%10 = phi i64 [ %7, %6 ], [ %11, %9 ]
%11 = add nsw i64 %10, -1
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @strcat(i8* %4, i8 signext %14)
%16 = icmp ugt i64 %10, 1
br i1 %16, label %9, label %8
}
/* Type definitions */
struct latch {
  int dummy;
};

/* Variables and functions */
int latch_lock_timeout(struct latch *, int /*<<< orphan*/);
int latch_trylock(struct latch *l) { return latch_lock_timeout(l, 0); }


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

x86 assembly (clang, -O2):
<latch_trylock>:
xor    %esi,%esi
jmp    1030 <latch_lock_timeout@plt>

LLVM IR (-O0):
%struct.latch = type { i32 }
define i32 @latch_trylock(%struct.latch* %0) {
%2 = alloca %struct.latch*
store %struct.latch* %0, %struct.latch** %2
%3 = load %struct.latch*, %struct.latch** %2
%4 = call i32 @latch_lock_timeout(%struct.latch* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.latch = type { i32 }
define i32 @latch_trylock(%struct.latch* %0) {
%2 = tail call i32 @latch_lock_timeout(%struct.latch* %0, i32 0)
ret i32 %2
}
int char_in(char c, const char *str) {
  for (int i = 0; str[i]; ++i)
    if (str[i] == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<char_in>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <char_in+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <char_in+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1165 <char_in+0x65>
jmp    1150 <char_in+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <char_in+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_in>:
movzbl (%rsi),%ecx
test   %cl,%cl
je     1110 <char_in+0x10>
add    $0x1,%rsi
cmp    %dil,%cl
jne    1100 <char_in>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @char_in(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = xor i1 %7, true
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *s, const char *delim) {
  static char *olds;
  return strtok_r(s, delim, &olds);
}


x86 assembly (clang, -O0):
<strtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f01(%rip),%rdx
call   1030 <strtok_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.olds = internal global i8* null
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.olds)
ret i8* %7
}

LLVM IR (-O2):
@strtok.olds = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.olds)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar();
int baz();
int foo(int, int);
int main() {
  if (foo(22, 23) != 45)
    abort();
  if (bar() != 100)
    abort();
  if (baz() != 36)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x16,%edi
mov    $0x17,%esi
call   1060 <foo@plt>
cmp    $0x2d,%eax
je     116e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <bar@plt>
cmp    $0x64,%eax
je     1185 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <baz@plt>
cmp    $0x24,%eax
je     119c <main+0x5c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x16,%edi
mov    $0x17,%esi
call   1060 <foo@plt>
cmp    $0x2d,%eax
jne    1171 <main+0x31>
xor    %eax,%eax
call   1050 <bar@plt>
cmp    $0x64,%eax
jne    1171 <main+0x31>
xor    %eax,%eax
call   1040 <baz@plt>
cmp    $0x24,%eax
jne    1171 <main+0x31>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 22, i32 23)
%3 = icmp ne i32 %2, 45
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 (...) @bar()
%8 = icmp ne i32 %7, 100
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 (...) @baz()
%13 = icmp ne i32 %12, 36
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 22, i32 23)
%2 = icmp eq i32 %1, 45
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @bar()
%7 = icmp eq i32 %6, 100
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 (...) @baz()
%12 = icmp eq i32 %11, 36
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}
/* Variables and functions */
int biaseRandom();
int t5_1_3() {
  int j1 = 0, j2 = 0;
  while (1) {
    j1 = biaseRandom();
    j2 = biaseRandom();
    if (j1 + j2 != 1) {
      continue;
    }
    if (j1 == 1)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<t5_1_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <biaseRandom@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <biaseRandom@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x1,%eax
je     114e <t5_1_3+0x3e>
jmp    1126 <t5_1_3+0x16>
cmpl   $0x1,-0x8(%rbp)
jne    1164 <t5_1_3+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <t5_1_3+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t5_1_3>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <biaseRandom@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <biaseRandom@plt>
add    %ebx,%eax
cmp    $0x1,%eax
jne    1120 <t5_1_3+0x10>
xor    %eax,%eax
cmp    $0x1,%ebx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @t5_1_3() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @biaseRandom()
%3 = tail call i32 (...) @biaseRandom()
%4 = add nsw i32 %3, %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = icmp eq i32 %2, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
void replace_dots(char *s) {
  while (*s) {
    if (*s == '.')
      *s = '_';
    s++;
  }
}


x86 assembly (clang, -O0):
<replace_dots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <replace_dots+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    112c <replace_dots+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <replace_dots+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_dots>:
jmp    1117 <replace_dots+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2e,%al
je     1110 <replace_dots+0x10>
test   %al,%al
jne    1113 <replace_dots+0x13>
ret

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

LLVM IR (-O2):
define void @replace_dots(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 46, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int atoi(char *);
char *strrchr(char *, char);
int mongo_server_hash_to_pid(char *hash) {
  char *ptr;
  ptr = strrchr(hash, ';');
  return atoi(ptr + 1);
}


x86 assembly (clang, -O0):
<mongo_server_hash_to_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3b,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mongo_server_hash_to_pid>:
push   %rax
mov    $0x3b,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @mongo_server_hash_to_pid(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 59)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mongo_server_hash_to_pid(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 59)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i32 @atoi(i8* %3)
ret i32 %4
}
int mdberr(int const rc) { return rc <= 0 ? rc : -rc; }


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

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

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

LLVM IR (-O2):
define i32 @mdberr(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = sub i32 0, %2
ret i32 %3
}
/* Variables and functions */
float add3(float, float, float);
float add2(float n, float m) { return add3(n + 1, m, n - 1); }


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xebf(%rip),%xmm3
subss  %xmm3,%xmm2
call   1030 <add3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
movaps %xmm0,%xmm2
movss  0xee5(%rip),%xmm0
addss  %xmm2,%xmm0
addss  0xedd(%rip),%xmm2
jmp    1030 <add3@plt>

LLVM IR (-O0):
define float @add2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fadd float %5, 1.000000e+00
%7 = load float, float* %4
%8 = load float, float* %3
%9 = fsub float %8, 1.000000e+00
%10 = call float @add3(float %6, float %7, float %9)
ret float %10
}

LLVM IR (-O2):
define float @add2(float %0, float %1) {
%3 = fadd float %0, 1.000000e+00
%4 = fadd float %0, -1.000000e+00
%5 = tail call float @add3(float %3, float %1, float %4)
ret float %5
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
void *memdup(const void *mem, int nbytes) {
  void *p = malloc(nbytes);
  memcpy(p, mem, nbytes);
  return p;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %3
}