xunge/DecIR huggingface dataset:
/* Variables and functions */
float RandomValue();
int FakeSilenceSample() {
  float x = RandomValue();
  if (x > 0.8)
    return 1;
  if (x < 0.2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<FakeSilenceSample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RandomValue@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <FakeSilenceSample+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1179 <FakeSilenceSample+0x69>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1172 <FakeSilenceSample+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <FakeSilenceSample+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FakeSilenceSample>:
push   %rax
xor    %eax,%eax
call   1030 <RandomValue@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd 0xed1(%rip),%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FakeSilenceSample() {
%1 = alloca i32
%2 = alloca float
%3 = call float (...) @RandomValue()
store float %3, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 8.000000e-01
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %14
8: ; preds = %0
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 2.000000e-01
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %1
br label %14
13: ; preds = %8
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @FakeSilenceSample() {
%1 = tail call float (...) @RandomValue()
%2 = fpext float %1 to double
%3 = fcmp ogt double %2, 8.000000e-01
%4 = fcmp olt double %2, 2.000000e-01
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
unsigned int getlen(FILE *f) {
  unsigned int len;
  fseek(f, 0, SEEK_END);
  len = ftell(f);
  fseek(f, 0, SEEK_SET);
  return len;
}


x86 assembly (clang, -O0):
<getlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @getlen(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @getlen(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ net_emit_uint8(int /*<<< orphan*/, int /*<<< orphan*/);
void net_emit_char(uint32_t temp_conn, char c) {
  net_emit_uint8(temp_conn, *(uint8_t *)&c);
}


x86 assembly (clang, -O0):
<net_emit_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%esi
call   1030 <net_emit_uint8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_emit_char>:
movzbl %sil,%esi
jmp    1030 <net_emit_uint8@plt>

LLVM IR (-O0):
define void @net_emit_char(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = bitcast i8* %4 to i32*
%7 = load i32, i32* %6
%8 = call i32 @net_emit_uint8(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @net_emit_char(i32 %0, i8 signext %1) {
%3 = zext i8 %1 to i32
%4 = tail call i32 @net_emit_uint8(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
void adjust(char **s) {
  char *tmp = *s;
  char *result = (char *)calloc(strlen(tmp) + 1, sizeof(char));
  memcpy(result, tmp, strlen(tmp));
  free(tmp);
  *s = result;
}


x86 assembly (clang, -O0):
<adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1060 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1060 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @adjust(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i64 @calloc(i64 %9, i32 1)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = load i8*, i8** %3
%15 = call i64 @strlen(i8* %14)
%16 = call i32 @memcpy(i8* %12, i8* %13, i64 %15)
%17 = load i8*, i8** %3
%18 = call i32 @free(i8* %17)
%19 = load i8*, i8** %4
%20 = load i8**, i8*** %2
store i8* %19, i8** %20
ret void
}

LLVM IR (-O2):
define void @adjust(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @calloc(i64 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%8 = tail call i32 @memcpy(i8* %6, i8* %2, i64 %7)
%9 = tail call i32 @free(i8* %2)
store i8* %6, i8** %0
ret void
}
/* Variables and functions */
scalar_t__ sha256_crypt(char *, char *);
int /*<<< orphan*/ strlcpy(char *, scalar_t__, int);
void do_crypt(char *s, char *d, int size) {
  strlcpy(d, sha256_crypt(s, "$5$") + 4, size);
}


x86 assembly (clang, -O0):
<do_crypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <sha256_crypt@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
add    $0x4,%rsi
mov    -0x14(%rbp),%edx
call   1040 <strlcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_crypt>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
lea    0xed1(%rip),%rsi
call   1030 <sha256_crypt@plt>
lea    0x4(%rax),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strlcpy@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"$5$\00"
define void @do_crypt(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @sha256_crypt(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = add nsw i64 %9, 4
%11 = load i32, i32* %6
%12 = call i32 @strlcpy(i8* %7, i64 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"$5$\00"
define void @do_crypt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @sha256_crypt(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i64 %4, 4
%6 = tail call i32 @strlcpy(i8* %1, i64 %5, i32 %2)
ret void
}
int f4(const void *p, unsigned n) { return __builtin_bcmp(p, p, n); }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%edx
call   1030 <bcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i32 @bcmp(i8* %5, i8* %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @f4(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x4d() {
  Assert_real((isxdigit(77) == 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_isxdigit.c",
              390, ("isxdigit should be 0 for M"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x186,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for M\00"
define void @t_isxdigit_0x4d() {
%1 = call i64 @isxdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for M\00"
define void @t_isxdigit_0x4d() {
%1 = tail call i64 @isxdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int get_unsigned_bit_size(unsigned long v) {
  int i = 0;
  while (v != 0) {
    v = v / 2;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_unsigned_bit_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <get_unsigned_bit_size+0x34>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_unsigned_bit_size+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unsigned_bit_size>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <get_unsigned_bit_size+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <get_unsigned_bit_size+0x10>
ret

LLVM IR (-O0):
define i32 @get_unsigned_bit_size(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = udiv i64 %8, 2
store i64 %9, i64* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_unsigned_bit_size(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ errnoThrow(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char const *);
int /*<<< orphan*/ rename(char const *, char const *);
void Sys_FileRen(const char *old, const char *new) {
  printf("renaming %s to %s\n", old, new);
  errnoThrow(rename(old, new));
}


x86 assembly (clang, -O0):
<Sys_FileRen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rename@plt>
mov    %eax,%edi
call   1050 <errnoThrow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FileRen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <rename@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <errnoThrow@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"renaming %s to %s\0A\00"
define void @Sys_FileRen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @rename(i8* %8, i8* %9)
%11 = call i32 @errnoThrow(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"renaming %s to %s\0A\00"
define void @Sys_FileRen(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @rename(i8* %0, i8* %1)
%5 = tail call i32 @errnoThrow(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buffer_free();
int /*<<< orphan*/ video_close();
int /*<<< orphan*/ video_streamoff();
void video_quit() {
  video_streamoff();
  video_close();
  buffer_free();
}


x86 assembly (clang, -O0):
<video_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <video_streamoff@plt>
mov    $0x0,%al
call   1050 <video_close@plt>
mov    $0x0,%al
call   1030 <buffer_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_quit>:
push   %rax
xor    %eax,%eax
call   1040 <video_streamoff@plt>
xor    %eax,%eax
call   1050 <video_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <buffer_free@plt>

LLVM IR (-O0):
define void @video_quit() {
%1 = call i32 (...) @video_streamoff()
%2 = call i32 (...) @video_close()
%3 = call i32 (...) @buffer_free()
ret void
}

LLVM IR (-O2):
define void @video_quit() {
%1 = tail call i32 (...) @video_streamoff()
%2 = tail call i32 (...) @video_close()
%3 = tail call i32 (...) @buffer_free()
ret void
}
void mem_put_be32_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (unsigned char)((val >> 24) & 0xff);
  mem[1] = (unsigned char)((val >> 16) & 0xff);
  mem[2] = (unsigned char)((val >> 8) & 0xff);
  mem[3] = (unsigned char)((val >> 0) & 0xff);
}


x86 assembly (clang, -O0):
<mem_put_be32_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_be32_as_int>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_be32_as_int(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 i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 16
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 %22, i8* %24
%25 = load i32, i32* %4
%26 = ashr i32 %25, 0
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @mem_put_be32_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_numbers(void) {
  test("511", "main(){printf(\"%d\", 0777);}");
  test("255 255", "main(){printf(\"%d %d\", 0xff, 0XFF);}");
  test("7 7", "main(){printf(\"%d %d\", 0b111, 0B111);}");
}


x86 assembly (clang, -O0):
<TEST_numbers>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <test@plt>
lea    0xef2(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <test@plt>
lea    0xf0c(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_numbers>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <test@plt>
lea    0xef5(%rip),%rdi
lea    0xef6(%rip),%rsi
call   1030 <test@plt>
lea    0xf0f(%rip),%rdi
lea    0xf0c(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"511\00"
@.str.1 = [28 x i8] c"main(){printf(\22%d\22, 0777);}\00"
@.str.2 = [8 x i8] c"255 255\00"
@.str.3 = [37 x i8] c"main(){printf(\22%d %d\22, 0xff, 0XFF);}\00"
@.str.4 = [4 x i8] c"7 7\00"
@.str.5 = [39 x i8] c"main(){printf(\22%d %d\22, 0b111, 0B111);}\00"
define void @TEST_numbers() {
%1 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"511\00"
@.str.1 = [28 x i8] c"main(){printf(\22%d\22, 0777);}\00"
@.str.2 = [8 x i8] c"255 255\00"
@.str.3 = [37 x i8] c"main(){printf(\22%d %d\22, 0xff, 0XFF);}\00"
@.str.4 = [4 x i8] c"7 7\00"
@.str.5 = [39 x i8] c"main(){printf(\22%d %d\22, 0b111, 0B111);}\00"
define void @TEST_numbers() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dr_os_close();
void my_save_exit() { dr_os_close(); }


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

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

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

LLVM IR (-O2):
define void @my_save_exit() {
%1 = tail call i32 (...) @dr_os_close()
ret void
}
/* Type definitions */
struct pollset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pollset *);
void pollset_destroy(struct pollset *ps) { free(ps); }


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

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

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

LLVM IR (-O2):
%struct.pollset = type { i32 }
define void @pollset_destroy(%struct.pollset* nocapture %0) {
%2 = tail call i32 @free(%struct.pollset* %0)
ret void
}
int test_imm_7Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x7B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Buint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x7b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 528280977408
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void baz() {
  int *foo = (int *)-1;
  printf("%d\n", *foo);
}


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

x86 assembly (clang, -O2):
<baz>:
mov    0xffffffffffffffff,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @baz() {
%1 = load i32, i32* inttoptr (i64 -1 to i32*)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
unsigned char char_to_byte(int c) {
  if ('a' <= c && c <= 'f') {
    return c - 'a' + 10;
  } else if ('A' <= c && c <= 'F') {
    return c - 'A' + 10;
  } else {
    return c - '0';
  }
}


x86 assembly (clang, -O0):
<char_to_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1130 <char_to_byte+0x30>
cmpl   $0x66,-0x8(%rbp)
jg     1130 <char_to_byte+0x30>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1162 <char_to_byte+0x62>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1159 <char_to_byte+0x59>
cmpl   $0x46,-0x8(%rbp)
jg     1159 <char_to_byte+0x59>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1162 <char_to_byte+0x62>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_byte>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x5,%ecx
ja     110d <char_to_byte+0xd>
add    $0xa9,%al
ret
lea    -0x41(%rax),%ecx
cmp    $0x5,%ecx
ja     1118 <char_to_byte+0x18>
add    $0xc9,%al
ret
add    $0xd0,%al
ret

LLVM IR (-O0):
define zeroext i8 @char_to_byte(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 102
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 10
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %29
14: ; preds = %6, %1
%15 = load i32, i32* %3
%16 = icmp sle i32 65, %15
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sub nsw i32 %21, 65
%23 = add nsw i32 %22, 10
%24 = trunc i32 %23 to i8
store i8 %24, i8* %2
br label %29
25: ; preds = %17, %14
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 48
%28 = trunc i32 %27 to i8
store i8 %28, i8* %2
br label %29
29: ; preds = %25, %20, %9
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
define zeroext i8 @char_to_byte(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i32 %0 to i8
%6 = add nsw i8 %5, -87
br label %15
7: ; preds = %1
%8 = add i32 %0, -65
%9 = icmp ult i32 %8, 6
%10 = trunc i32 %0 to i8
br i1 %9, label %11, label %13
11: ; preds = %7
%12 = add nsw i8 %10, -55
br label %15
13: ; preds = %7
%14 = add i8 %10, -48
br label %15
15: ; preds = %13, %11, %4
%16 = phi i8 [ %6, %4 ], [ %12, %11 ], [ %14, %13 ]
ret i8 %16
}
unsigned xrop3_77_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk2 = S ^ T;
  stk3 = D ^ S;
  stk2 = stk2 | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_77_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_77_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
xor    %ecx,%edx
mov    %ecx,%eax
xor    $0xff,%eax
or     %edx,%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_77_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %9
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = xor i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = xor i32 %35, -1
store i32 %36, i32* %8
%37 = load i32, i32* %8
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_77_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %4, 255
%9 = or i32 %7, %8
%10 = xor i32 %4, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stars() {
  int i;
  for (i = 0; i < 10; i++) {
    printf("*");
  }
}


x86 assembly (clang, -O0):
<stars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <stars+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <stars+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stars>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @stars() {
%1 = tail call i32 @putchar(i32 42)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @putchar(i32 42)
ret void
}
/* Variables and functions */
void *calloc(size_t const, size_t const);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, size_t const);
void *xcalloc(register const size_t count, register const size_t eltsize) {
  register void *value = calloc(count, eltsize);
  if (!value)
    error(3, errno, "can't allocate %zi bytes of memory!", count * eltsize);
  return value;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <xcalloc+0x4f>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    $0x3,%edi
lea    0xe96(%rip),%rdx
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <xcalloc+0x39>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
imul   %r15,%r14
lea    0xeb4(%rip),%rdx
mov    $0x3,%edi
mov    %r14,%rcx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [36 x i8] c"can't allocate %zi bytes of memory!\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = mul i64 %13, %14
%16 = call i32 @error(i32 3, i32 %12, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %15)
br label %17
17: ; preds = %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [36 x i8] c"can't allocate %zi bytes of memory!\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = mul i64 %1, %0
%8 = tail call i32 @error(i32 3, i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
void fork_bomb() {
  while (1) {
    fork();
  }
}


x86 assembly (clang, -O0):
<fork_bomb>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <fork_bomb+0x9>
mov    $0x0,%al
call   1030 <fork@plt>
jmp    1119 <fork_bomb+0x9>

x86 assembly (clang, -O2):
<fork_bomb>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
jmp    1120 <fork_bomb+0x10>

LLVM IR (-O0):
define void @fork_bomb() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @fork()
br label %1
}

LLVM IR (-O2):
define void @fork_bomb() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @fork()
br label %1
}
int test_imm_40uint16_reg(unsigned short val) {
  return ((val) & (-0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffc0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_40uint16_reg>:
cmp    $0x40,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_40uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -64
%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_40uint16_reg(i16 zeroext %0) {
%2 = icmp ult i16 %0, 64
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
uint32_t in6_teredo_prefix(const struct in6_addr *ip6) {
  uint32_t prefix;
  memcpy(&prefix, ip6->s6_addr, 4);
  return prefix;
}


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

x86 assembly (clang, -O2):
<in6_teredo_prefix>:
push   %rax
mov    (%rdi),%esi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @in6_teredo_prefix(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @memcpy(i32* %3, i32 %6, i32 4)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @in6_teredo_prefix(%struct.in6_addr* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @memcpy(i32* %2, i32 %5, i32 4)
%7 = load i32, i32* %2
ret i32 %7
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i > 0 && i < 50) {
    if (i < 20) {
      i = i - 1;
    }
    if (i > 10) {
      i = i + 1;
    }
    if (30 <= i && i <= 40) {
      i = i - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1142 <main+0x32>
cmpl   $0x32,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <main+0x42>
jmp    119e <main+0x8e>
cmpl   $0x14,-0x8(%rbp)
jge    1165 <main+0x55>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1178 <main+0x68>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1e,%eax
cmp    -0x8(%rbp),%eax
jg     1199 <main+0x89>
cmpl   $0x28,-0x8(%rbp)
jg     1199 <main+0x89>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %33, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 50
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %34
12: ; preds = %10
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* %2
%26 = icmp sle i32 30, %25
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 40
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %2
br label %33
33: ; preds = %30, %27, %24
br label %4
34: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void swap1(int *x, int *y) {
  int z;
  z = *x;
  *x = *y;
  *y = z;
}


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

x86 assembly (clang, -O2):
<swap1>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap1(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
const char *ajTaxinTypeGetQlinks(void) { return "|"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i8* @ajTaxinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int quadraFac(int);
int main() {
  printf("%d\n", quadraFac(3));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <quadraFac@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @quadraFac(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double test2(double x, double y, double ddj, int b) {
  double tmp1, tmp2, sum;
  sum = 0.0;
  if (b)
    sum = 1.0;
  tmp1 = sum / ddj;
  tmp2 = x / ddj;
  return tmp1 + y + tmp2;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1135 <test2+0x35>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xorpd  %xmm3,%xmm3
test   %edi,%edi
je     1110 <test2+0x10>
movsd  0xef0(%rip),%xmm3
unpcklpd %xmm3,%xmm0
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @test2(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
store double 0.000000e+00, double* %11
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store double 1.000000e+00, double* %11
br label %15
15: ; preds = %14, %4
%16 = load double, double* %11
%17 = load double, double* %7
%18 = fdiv double %16, %17
store double %18, double* %9
%19 = load double, double* %5
%20 = load double, double* %7
%21 = fdiv double %19, %20
store double %21, double* %10
%22 = load double, double* %9
%23 = load double, double* %6
%24 = fadd double %22, %23
%25 = load double, double* %10
%26 = fadd double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @test2(double %0, double %1, double %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, double 0.000000e+00, double 1.000000e+00
%7 = insertelement <2 x double> poison, double %0, i64 0
%8 = insertelement <2 x double> %7, double %6, i64 1
%9 = insertelement <2 x double> poison, double %2, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
%11 = fdiv <2 x double> %8, %10
%12 = extractelement <2 x double> %11, i64 1
%13 = fadd double %12, %1
%14 = extractelement <2 x double> %11, i64 0
%15 = fadd double %14, %13
ret double %15
}
white(c) char c;
{
  if (c == '\t' || c == ' ' || c == '\n')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<white>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1131 <white+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1131 <white+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    113d <white+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <white+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<white>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0x9000000,%edi
je     1122 <white+0x22>
cmp    $0xa000000,%edi
je     1122 <white+0x22>
cmp    $0x20000000,%edi
je     1122 <white+0x22>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @white(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 536870912, label %4
i32 167772160, label %4
i32 150994944, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}