xunge/DecIR huggingface dataset:
/* Variables and functions */
int test_and_clear_bit(int, void volatile *);
int sync_test_and_clear_bit(int nr, volatile void *addr) {
  return test_and_clear_bit(nr, addr);
}


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

x86 assembly (clang, -O2):
<sync_test_and_clear_bit>:
jmp    1030 <test_and_clear_bit@plt>

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

LLVM IR (-O2):
define i32 @sync_test_and_clear_bit(i32 %0, i8* %1) {
%3 = tail call i32 @test_and_clear_bit(i32 %0, i8* %1)
ret i32 %3
}
void dfn_ap(p) void *p;
{}


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

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

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

LLVM IR (-O2):
define void @dfn_ap(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ err;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *,
                      int *);
int BIO_sock_error(int sock) {
  socklen_t len;
  int err;
  len = sizeof(err);
  if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &len) != 0)
    return (1);
  return (err);
}


x86 assembly (clang, -O0):
<BIO_sock_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0xc(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
je     115a <BIO_sock_error+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1160 <BIO_sock_error+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_sock_error>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1148 <BIO_sock_error+0x38>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @BIO_sock_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_ERROR
%9 = call i64 @getsockopt(i32 %6, i32 %7, i32 %8, i32* %5, i32* %4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %5
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @BIO_sock_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %3, i32* %2)
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* %3
%11 = select i1 %9, i32 %10, i32 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printError(char *error) { printf("ERROR:  %s", error); }


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

x86 assembly (clang, -O2):
<printError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\00"
define void @printError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\00"
define void @printError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long long GetSubmission(long long playernum) { return 1000000000000000000LL; }


x86 assembly (clang, -O0):
<GetSubmission>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xde0b6b3a7640000,%rax
b6 e0 0d
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSubmission>:
movabs $0xde0b6b3a7640000,%rax
b6 e0 0d
ret

LLVM IR (-O0):
define i64 @GetSubmission(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i64 1000000000000000000
}

LLVM IR (-O2):
define i64 @GetSubmission(i64 %0) {
ret i64 1000000000000000000
}
double eval_horn_quart(const double *c, const double x) {
  return (((x * x + c[2]) * x + c[1]) * x + c[0]);
}


x86 assembly (clang, -O0):
<eval_horn_quart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_horn_quart>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rdi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @eval_horn_quart(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 2
%9 = load double, double* %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = load double, double* %4
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = call double @llvm.fmuladd.f64(double %10, double %11, double %14)
%16 = load double, double* %4
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
ret double %20
}

LLVM IR (-O2):
define double @eval_horn_quart(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = load double, double* %3
%5 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %4)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %1, double %7)
%9 = load double, double* %0
%10 = tail call double @llvm.fmuladd.f64(double %8, double %1, double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ norm2(double, double, double, double);
int /*<<< orphan*/ printf(char *, double);
double sqrt(int /*<<< orphan*/);
double norm(double x1, double y1, double x2, double y2) {
  printf("%f\n", sqrt(norm2(x1, y1, x2, y2)));
  return sqrt(norm2(x1, y1, x2, y2));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <norm2@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <norm2@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <norm2@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1030 <norm2@plt>
mov    %eax,%edi
add    $0x28,%rsp
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define double @norm(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @norm2(double %9, double %10, double %11, double %12)
%14 = call double @sqrt(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %14)
%16 = load double, double* %5
%17 = load double, double* %6
%18 = load double, double* %7
%19 = load double, double* %8
%20 = call i32 @norm2(double %16, double %17, double %18, double %19)
%21 = call double @sqrt(i32 %20)
ret double %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define double @norm(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @norm2(double %0, double %1, double %2, double %3)
%6 = tail call double @sqrt(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = tail call i32 @norm2(double %0, double %1, double %2, double %3)
%9 = tail call double @sqrt(i32 %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int sys_sbrk(int incr) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<sys_sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_sbrk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOMEM
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_sbrk(i32 %0) {
%2 = load i32, i32* @ENOMEM
store i32 %2, i32* @errno
ret i32 -1
}
void sys_print(int character) {
  asm volatile("int %0\n" : : "i"(52), "a"(character) : "cc", "memory");
}


x86 assembly (clang, -O0):
<sys_print>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x34
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_print>:
mov    %edi,%eax
int    $0x34
ret

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

LLVM IR (-O2):
define void @sys_print(i32 %0) {
tail call void asm sideeffect "int $0\0A", "i,{ax},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 52, i32 %0)
ret void
}
/* Variables and functions */
unsigned int fuzzMove(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int rseed = 22356;
  rseed = fuzzMove(rseed);
  for (int counter = 0; counter < 10; counter++) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5754,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <fuzzMove@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    115c <main+0x4c>
jmp    114e <main+0x3e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113f <main+0x2f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5754,%edi
call   1030 <fuzzMove@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fuzzMove(i32 22356)
ret i32 0
}
/* Type definitions */
struct vm_fault {
  int dummy;
};
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int drm_do_vm_shm_fault(struct vm_area_struct *, struct vm_fault *);
int drm_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) {
  return drm_do_vm_shm_fault(vma, vmf);
}


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

x86 assembly (clang, -O2):
<drm_vm_shm_fault>:
jmp    1030 <drm_do_vm_shm_fault@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_shm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca %struct.vm_fault*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store %struct.vm_fault* %1, %struct.vm_fault** %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load %struct.vm_fault*, %struct.vm_fault** %4
%7 = call i32 @drm_do_vm_shm_fault(%struct.vm_area_struct* %5, %struct.vm_fault* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
%struct.vm_fault = type { i32 }
define i32 @drm_vm_shm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1) {
%3 = tail call i32 @drm_do_vm_shm_fault(%struct.vm_area_struct* %0, %struct.vm_fault* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoTwoRGet(void) { InlineWords(2, 41, 41); }


x86 assembly (clang, -O0):
<DoTwoRGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x29,%edx
mov    %edx,%esi
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTwoRGet>:
mov    $0x2,%edi
mov    $0x29,%esi
mov    $0x29,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoTwoRGet() {
%1 = call i32 @InlineWords(i32 2, i32 41, i32 41)
ret void
}

LLVM IR (-O2):
define void @DoTwoRGet() {
%1 = tail call i32 @InlineWords(i32 2, i32 41, i32 41)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *s = strdup(str);
  if (!s)
    err(EXIT_FAILURE, ("error: strdup failed"));
  return s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <xstrdup+0x39>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xstrdup+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [21 x i8] c"error: strdup failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @err(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [21 x i8] c"error: strdup failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @err(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *strpbrk(char *, char *);
char *replacechrswith(char *strbuf, char *chrstorm, char chartorlcwith) {
  char *offset;
  offset = (char *)NULL;
  while (*strbuf) {
    offset = strpbrk(strbuf, chrstorm);
    if (offset) {
      *(offset) = chartorlcwith;
    } else
      break;
  }
  return strbuf;
}


x86 assembly (clang, -O0):
<replacechrswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <replacechrswith+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1164 <replacechrswith+0x54>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    1169 <replacechrswith+0x59>
jmp    116e <replacechrswith+0x5e>
jmp    112d <replacechrswith+0x1d>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replacechrswith>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1148 <replacechrswith+0x38>
mov    %edx,%r14d
mov    %rsi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1148 <replacechrswith+0x38>
mov    %r14b,(%rax)
cmpb   $0x0,(%rbx)
jne    1130 <replacechrswith+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @replacechrswith(i8* returned %0, i8* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %9
%7 = tail call i8* @strpbrk(i8* %0, i8* %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %6
store i8 %2, i8* %7
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %9, %6, %3
ret i8* %0
}
int test_imm_46int32_mem(int *val) {
  return ((*val) & (0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46int32_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, 70
%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_46int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 70
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct input_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ABS_MT_SLOT;
int /*<<< orphan*/ EV_ABS;
int /*<<< orphan*/ input_event(struct input_dev *, int /*<<< orphan*/,
                               int /*<<< orphan*/, int);
void input_mt_slot(struct input_dev *dev, int slot) {
  input_event(dev, EV_ABS, ABS_MT_SLOT, slot);
}


x86 assembly (clang, -O0):
<input_mt_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1030 <input_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_mt_slot>:
mov    %esi,%ecx
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
jmp    1030 <input_event@plt>

LLVM IR (-O0):
%struct.input_dev = type { i32 }
@EV_ABS = global i32 0
@ABS_MT_SLOT = global i32 0
define void @input_mt_slot(%struct.input_dev* %0, i32 %1) {
%3 = alloca %struct.input_dev*
%4 = alloca i32
store %struct.input_dev* %0, %struct.input_dev** %3
store i32 %1, i32* %4
%5 = load %struct.input_dev*, %struct.input_dev** %3
%6 = load i32, i32* @EV_ABS
%7 = load i32, i32* @ABS_MT_SLOT
%8 = load i32, i32* %4
%9 = call i32 @input_event(%struct.input_dev* %5, i32 %6, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.input_dev = type { i32 }
@EV_ABS = global i32 0
@ABS_MT_SLOT = global i32 0
define void @input_mt_slot(%struct.input_dev* %0, i32 %1) {
%3 = load i32, i32* @EV_ABS
%4 = load i32, i32* @ABS_MT_SLOT
%5 = tail call i32 @input_event(%struct.input_dev* %0, i32 %3, i32 %4, i32 %1)
ret void
}
void wx11py(xarray, yarray, npts) float xarray[], yarray[];
int *npts;
{ wx1112(xarray, yarray, npts); }


x86 assembly (clang, -O0):
<wx11py>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <wx1112@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wx11py(float* %0, float* %1, i32* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32*
store float* %0, float** %4
store float* %1, float** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i32*, i32** %6
%10 = call i32 (float*, float*, i32*, ...) bitcast (i32 (...)* @wx1112 to i32 (float*, float*, i32*, ...)*)(float* %7, float* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @wx11py(float* %0, float* %1, i32* %2) {
%4 = tail call i32 (float*, float*, i32*, ...) bitcast (i32 (...)* @wx1112 to i32 (float*, float*, i32*, ...)*)(float* %0, float* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cat_print();
int /*<<< orphan*/ world_print();
void game_draw(void) {
  world_print();
  cat_print();
}


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

x86 assembly (clang, -O2):
<game_draw>:
push   %rax
xor    %eax,%eax
call   1030 <world_print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cat_print@plt>

LLVM IR (-O0):
define void @game_draw() {
%1 = call i32 (...) @world_print()
%2 = call i32 (...) @cat_print()
ret void
}

LLVM IR (-O2):
define void @game_draw() {
%1 = tail call i32 (...) @world_print()
%2 = tail call i32 (...) @cat_print()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long error;
};
typedef TYPE_1__ ERR_STRING_DATA;

/* Variables and functions */
unsigned long ERR_GET_FUNC(unsigned long);
unsigned long ERR_GET_LIB(unsigned long);
unsigned long err_hash(const void *a_void) {
  unsigned long ret, l;
  l = ((const ERR_STRING_DATA *)a_void)->error;
  ret = l ^ ERR_GET_LIB(l) ^ ERR_GET_FUNC(l);
  return (ret ^ ret % 19 * 13);
}


x86 assembly (clang, -O0):
<err_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ERR_GET_LIB@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ERR_GET_FUNC@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x13,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
imul   $0xd,%rdx,%rcx
xor    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_hash>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <ERR_GET_LIB@plt>
mov    %rax,%r14
xor    %rbx,%r14
mov    %rbx,%rdi
call   1040 <ERR_GET_FUNC@plt>
mov    %rax,%rcx
xor    %r14,%rcx
movabs $0xd79435e50d79435f,%rdx
35 94 d7
mov    %rcx,%rax
mul    %rdx
shr    $0x4,%rdx
lea    (%rdx,%rdx,8),%rax
lea    (%rdx,%rax,2),%rax
mov    %rcx,%rdx
sub    %rax,%rdx
lea    (%rdx,%rdx,2),%rax
lea    (%rdx,%rax,4),%rax
xor    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @err_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to %struct.TYPE_2__*
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
%8 = load i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @ERR_GET_LIB(i64 %10)
%12 = xor i64 %9, %11
%13 = load i64, i64* %4
%14 = call i64 @ERR_GET_FUNC(i64 %13)
%15 = xor i64 %12, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = load i64, i64* %3
%18 = urem i64 %17, 19
%19 = mul i64 %18, 13
%20 = xor i64 %16, %19
ret i64 %20
}

LLVM IR (-O2):
define i64 @err_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i64 @ERR_GET_LIB(i64 %3)
%5 = xor i64 %4, %3
%6 = tail call i64 @ERR_GET_FUNC(i64 %3)
%7 = xor i64 %5, %6
%8 = urem i64 %7, 19
%9 = mul nuw nsw i64 %8, 13
%10 = xor i64 %9, %7
ret i64 %10
}
double Square(x)
double x;
{ return x * x; }


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

x86 assembly (clang, -O2):
<Square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @Square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @Square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hi\n"
         "\tMy name is\n"
         "Who?\n"
         "\tMy name is\n"
         "What?\n"
         "\tMy name is\n"
         "<chicky chicky chicky> Slim Shady!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [86 x i8] c"Hi\0A\09My name is\0AWho?\0A\09My name is\0AWhat?\0A\09My name is\0A<chicky chicky chicky> Slim Shady!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [85 x i8] c"Hi\0A\09My name is\0AWho?\0A\09My name is\0AWhat?\0A\09My name is\0A<chicky chicky chicky> Slim Shady!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo_s32(int a, int b) {
  if (a < -b)
    abort();
}


x86 assembly (clang, -O0):
<foo_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1135 <foo_s32+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_s32>:
neg    %esi
cmp    %edi,%esi
jg     1117 <foo_s32+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_s32(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 = sub nsw i32 0, %6
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo_s32(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = icmp sgt i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
char *swapw(cp, n)
char *cp;
long n;
{
  char *p = cp;
  return p;
}


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

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

LLVM IR (-O0):
define i8* @swapw(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
ret i8* %7
}

LLVM IR (-O2):
define i8* @swapw(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Type definitions */
struct ast_sockaddr {
  int dummy;
};

/* Variables and functions */
char *ast_sockaddr_stringify_fmt(struct ast_sockaddr const *, int);
char *ast_sockaddr_stringify_addr_remote(const struct ast_sockaddr *addr) {
  return ast_sockaddr_stringify_fmt(addr, ((1 << 0) | (1 << 3)));
}


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

x86 assembly (clang, -O2):
<ast_sockaddr_stringify_addr_remote>:
mov    $0x9,%esi
jmp    1030 <ast_sockaddr_stringify_fmt@plt>

LLVM IR (-O0):
%struct.ast_sockaddr = type { i32 }
define i8* @ast_sockaddr_stringify_addr_remote(%struct.ast_sockaddr* %0) {
%2 = alloca %struct.ast_sockaddr*
store %struct.ast_sockaddr* %0, %struct.ast_sockaddr** %2
%3 = load %struct.ast_sockaddr*, %struct.ast_sockaddr** %2
%4 = call i8* @ast_sockaddr_stringify_fmt(%struct.ast_sockaddr* %3, i32 9)
ret i8* %4
}

LLVM IR (-O2):
%struct.ast_sockaddr = type { i32 }
define i8* @ast_sockaddr_stringify_addr_remote(%struct.ast_sockaddr* %0) {
%2 = tail call i8* @ast_sockaddr_stringify_fmt(%struct.ast_sockaddr* %0, i32 9)
ret i8* %2
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmore_file(int);
int com_more(int p0, struct parameter *param) {
  (void)(param);
  pmore_file(p0);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.parameter = type { i32 }
define i32 @com_more(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca %struct.parameter*
store i32 %0, i32* %3
store %struct.parameter* %1, %struct.parameter** %4
%5 = load %struct.parameter*, %struct.parameter** %4
%6 = load i32, i32* %3
%7 = call i32 @pmore_file(i32 %6)
ret i32 0
}

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_more(i32 %0, %struct.parameter* nocapture readnone %1) {
%3 = tail call i32 @pmore_file(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
__attribute__((no)) void foo(short unsigned int *p1, short unsigned int *p2) {
  short unsigned int x1, x4;
  int x2, x3, x5, x6;
  unsigned int x7;
  x1 = *p1;
  x2 = (int)x1;
  x3 = x2 * 65536;
  x4 = *p2;
  x5 = (int)x4;
  x6 = x3 + x4;
  x7 = (unsigned int)x6;
  if (x7 <= 268435455U)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
movzwl -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0xfffffff,-0x28(%rbp)
ja     1183 <foo+0x63>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rax
movzwl (%rdi),%eax
cmp    $0xfff,%eax
ja     1132 <foo+0x12>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @foo(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i16
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i16* %0, i16** %3
store i16* %1, i16** %4
%12 = load i16*, i16** %3
%13 = load i16, i16* %12
store i16 %13, i16* %5
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = mul nsw i32 %16, 65536
store i32 %17, i32* %8
%18 = load i16*, i16** %4
%19 = load i16, i16* %18
store i16 %19, i16* %6
%20 = load i16, i16* %6
%21 = zext i16 %20 to i32
store i32 %21, i32* %9
%22 = load i32, i32* %8
%23 = load i16, i16* %6
%24 = zext i16 %23 to i32
%25 = add nsw i32 %22, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
store i32 %26, i32* %11
%27 = load i32, i32* %11
%28 = icmp ule i32 %27, 268435455
br i1 %28, label %29, label %31
29: ; preds = %2
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %2
%32 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo(i16* nocapture %0, i16* nocapture readnone %1) {
%3 = load i16, i16* %0
%4 = icmp ult i16 %3, 4096
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
}
unsigned short int f53(unsigned short int x, int y) {
  return (x << (8 * 2 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f53>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f53>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 16, %7
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = xor i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
unsigned rng(unsigned *r) { return *r = *r * 1103515245 + 12345; }


x86 assembly (clang, -O0):
<rng>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @rng(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 %4, 1103515245
%6 = add i32 %5, 12345
%7 = load i32*, i32** %2
store i32 %6, i32* %7
ret i32 %6
}

LLVM IR (-O2):
define i32 @rng(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1103515245
%4 = add i32 %3, 12345
store i32 %4, i32* %0
ret i32 %4
}
/* Variables and functions */
const char *strrchr(const char *s, int c) {
  char *result = NULL;
  int ch;
  while ((ch = *s) != 0) {
    if (ch == c) {
      result = (char *)s;
    }
    s++;
  }
  return result;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     114b <strrchr+0x4b>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113a <strrchr+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <strrchr+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i8* [ %11, %5 ], [ null, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %7, i8* %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
/* Variables and functions */
int power_2(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int cal = 1, i;
  for (i = 1; cal < 32768; i++) {
    cal = power_2(i);
    printf("%d는 2의 %d제곱입니다.\n", cal, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x8000,-0x8(%rbp)
jge    1175 <main+0x55>
mov    -0xc(%rbp),%edi
call   1040 <power_2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <power_2@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x8000,%ebp
jl     1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%d\EB\8A\94 2\EC\9D\98 %d\EC\A0\9C\EA\B3\B1\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 32768
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @power_2(i32 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"%d\EB\8A\94 2\EC\9D\98 %d\EC\A0\9C\EA\B3\B1\EC\9E\85\EB\8B\88\EB\8B\A4.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @power_2(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp slt i32 %3, 32768
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int rand();
int randomNumGen(int num) { return rand() % num; }


x86 assembly (clang, -O0):
<randomNumGen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumGen>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomNumGen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @randomNumGen(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
int f_blt_rr2(float a1, float a2) { return !(__builtin_isless(a1, a2)); }


x86 assembly (clang, -O0):
<f_blt_rr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blt_rr2>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_blt_rr2(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 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_blt_rr2(float %0, float %1) {
%3 = fcmp uge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x62() {
  Assert_real((ispunct(98) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              495, ("ispunct should be 0 for b"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x62>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1ef,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x62>:
push   %rax
mov    $0x62,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1ef,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for b\00"
define void @t_ispunct_0x62() {
%1 = call i64 @ispunct(i32 98)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for b\00"
define void @t_ispunct_0x62() {
%1 = tail call i64 @ispunct(i32 98)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access_uint(void *, unsigned int);
void *alloc_uint(unsigned int);
void nowarn_alloc_access_same_anti_range_uint(unsigned n) {
  if (n == 3)
    n = 4;
  void *p = alloc_uint(n);
  access_uint(p, n);
}


x86 assembly (clang, -O0):
<nowarn_alloc_access_same_anti_range_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113c <nowarn_alloc_access_same_anti_range_uint+0x1c>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_uint@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <access_uint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowarn_alloc_access_same_anti_range_uint>:
push   %rbx
cmp    $0x3,%edi
mov    $0x4,%ebx
cmovne %edi,%ebx
mov    %ebx,%edi
call   1030 <alloc_uint@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <access_uint@plt>

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

LLVM IR (-O2):
define void @nowarn_alloc_access_same_anti_range_uint(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = select i1 %2, i32 4, i32 %0
%4 = tail call i8* @alloc_uint(i32 %3)
%5 = tail call i32 @access_uint(i8* %4, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ smtp(int /*<<< orphan*/ *, char const *);
void smtp_handler(FILE *client, void *arg) { smtp(client, (const char *)arg); }


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

x86 assembly (clang, -O2):
<smtp_handler>:
jmp    1030 <smtp@plt>

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

LLVM IR (-O2):
define void @smtp_handler(i32* %0, i8* %1) {
%3 = tail call i32 @smtp(i32* %0, i8* %1)
ret void
}