xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ aes_decrypt(unsigned char const *, int const,
                               unsigned char *, unsigned char const *,
                               unsigned char const *, int);
void aes_128_decrypt(const unsigned char *ciphertext, const int ciphertext_len,
                     unsigned char plaintext[], void *iv,
                     const unsigned char *key) {
  aes_decrypt(ciphertext, ciphertext_len, plaintext, (const unsigned char *)iv,
              key, 16);
}


x86 assembly (clang, -O0):
<aes_128_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x10,%r9d
call   1030 <aes_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_128_decrypt>:
mov    $0x10,%r9d
jmp    1030 <aes_decrypt@plt>

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

LLVM IR (-O2):
define void @aes_128_decrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @aes_decrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long double nexttowardl(long double ld, long double td) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
fldz
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttowardl>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call i32 @assert(i32 0)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i32 @assert(i32 0)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
scalar_t__ strncmp(void *, void *, size_t);
int _default_cmp_fn(void *k1, size_t sz1, void *k2, size_t sz2) {
  if (sz1 != sz2)
    return 0;
  return strncmp(k1, k2, sz1) == 0;
}


x86 assembly (clang, -O0):
<_default_cmp_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1142 <_default_cmp_fn+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1162 <_default_cmp_fn+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_default_cmp_fn>:
xor    %eax,%eax
cmp    %rcx,%rsi
jne    1135 <_default_cmp_fn+0x25>
push   %rax
mov    %rsi,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @_default_cmp_fn(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @strncmp(i8* %0, i8* %2, i64 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6
%11 = phi i32 [ %9, %6 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int strlen(char const *);
unsigned int GetTagValueSize(const char *tag) {
  unsigned int size = 0;
  if (tag != NULL) {
    size = strlen(tag) + 1;
    if (size >= 0xff) {
      size = 0xff;
    }
  }
  return size;
}


x86 assembly (clang, -O0):
<GetTagValueSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <GetTagValueSize+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jb     1151 <GetTagValueSize+0x41>
movl   $0xff,-0xc(%rbp)
jmp    1156 <GetTagValueSize+0x46>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTagValueSize>:
test   %rdi,%rdi
je     1133 <GetTagValueSize+0x23>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @GetTagValueSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp uge i32 %10, 255
br i1 %11, label %12, label %13
12: ; preds = %6
store i32 255, i32* %3
br label %13
13: ; preds = %12, %6
br label %14
14: ; preds = %13, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @GetTagValueSize(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = icmp ult i32 %5, 255
%7 = select i1 %6, i32 %5, i32 255
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main(void) {
  const int x = 10;
  *((int *)&x) = 30;
  printf("%d\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%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
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 30, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int PAPI_start_counters(int *, int);
void PAPIF_START_COUNTERS(int *events, int *array_len, int *check) {
  *check = PAPI_start_counters(events, *array_len);
}


x86 assembly (clang, -O0):
<PAPIF_START_COUNTERS>:
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),%rax
mov    (%rax),%esi
call   1030 <PAPI_start_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_START_COUNTERS>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_start_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_START_COUNTERS(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_start_counters(i32* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
short _largest_pfaktor(short, int);
short largest_pfaktor(short n) { return _largest_pfaktor(n, 2); }


x86 assembly (clang, -O0):
<largest_pfaktor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x2,%esi
movswl -0x2(%rbp),%edi
call   1030 <_largest_pfaktor@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largest_pfaktor>:
mov    $0x2,%esi
jmp    1030 <_largest_pfaktor@plt>

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

LLVM IR (-O2):
define signext i16 @largest_pfaktor(i16 signext %0) {
%2 = tail call signext i16 @_largest_pfaktor(i16 signext %0, i32 2)
ret i16 %2
}
int hash(char *id) {
  int h = 0;
  int i = 0;
  for (i = 0; id[i] != '\0'; i++) {
    h = ((h << 4) + id[i]) % 10;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <hash+0x5f>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <hash+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <hash+0x41>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x4,%eax
add    %ecx,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl nsw i32 %7, 4
%10 = add nsw i32 %9, %8
%11 = srem i32 %10, 10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say() { printf("Student {id, name}\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Student {id, name}\0A\00"
define void @say() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Student {id, name}\00"
define void @say() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_8Fuint16_reg(unsigned short val) {
  return ((val) & (0x8F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Fuint16_reg>:
test   $0x8f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Fuint16_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, 143
%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_8Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 143
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OutputGetActualSpeed(unsigned char, char *);
char MotorPower(unsigned char Output) {
  char Result = 0;
  OutputGetActualSpeed(Output, &Result);
  return Result;
}


x86 assembly (clang, -O0):
<MotorPower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
movzbl -0x1(%rbp),%edi
call   1030 <OutputGetActualSpeed@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MotorPower>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
call   1030 <OutputGetActualSpeed@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @MotorPower(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i32 @OutputGetActualSpeed(i8 zeroext %4, i8* %3)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @MotorPower(i8 zeroext %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @OutputGetActualSpeed(i8 zeroext %0, i8* %2)
%4 = load i8, i8* %2
ret i8 %4
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBinaryFuncConstR_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
void BrzBinaryFuncConstRPush_reqdown(struct comp *comp, int port) {
  struct BrzBinaryFuncConstR_ *c = (struct BrzBinaryFuncConstR_ *)comp;
  SEND_REQDOWN_DELAYED(0, 0);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstRPush_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_REQDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstRPush_reqdown>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <SEND_REQDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBinaryFuncConstR_ = type { i32 }
define void @BrzBinaryFuncConstRPush_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBinaryFuncConstR_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBinaryFuncConstR_*
store %struct.BrzBinaryFuncConstR_* %7, %struct.BrzBinaryFuncConstR_** %5
%8 = call i32 @SEND_REQDOWN_DELAYED(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBinaryFuncConstRPush_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN_DELAYED(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void close_svg(int fd) {
  char *close_line = "</svg>\n";
  write(fd, close_line, strlen(close_line));
}


x86 assembly (clang, -O0):
<close_svg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"</svg>\0A\00"
define void @close_svg(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"</svg>\0A\00"
define void @close_svg(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int ld_lt_rm1(long double a1, long double *a2) { return (((a1) < (*a2))); }


x86 assembly (clang, -O0):
<ld_lt_rm1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_rm1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_lt_rm1(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp olt x86_fp80 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_lt_rm1(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ogt x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ verify();
int main() {
  verify();
  puts("All OK");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <verify@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"All OK\00"
define i32 @main() {
%1 = call i32 (...) @verify()
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"All OK\00"
define i32 @main() {
%1 = tail call i32 (...) @verify()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1(void) {
  static int i = 0;
  i++;
  return i;
}


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

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

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

LLVM IR (-O2):
@fun1.i = internal unnamed_addr global i32 0
define i32 @fun1() {
%1 = load i32, i32* @fun1.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @fun1.i
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char GCMGetRegionCode(FILE *ifile) {
  if (!ifile) {
    return 0;
  }
  fseek(ifile, 0x0000 + 0x0003, SEEK_SET);
  return fgetc(ifile);
}


x86 assembly (clang, -O0):
<GCMGetRegionCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <GCMGetRegionCode+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1163 <GCMGetRegionCode+0x43>
mov    -0x10(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCMGetRegionCode>:
test   %rdi,%rdi
je     1145 <GCMGetRegionCode+0x25>
push   %rbx
mov    %rdi,%rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fgetc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define signext i8 @GCMGetRegionCode(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %2
br label %13
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @fseek(i32* %8, i32 3, i32 %9)
%11 = load i32*, i32** %3
%12 = call signext i8 @fgetc(i32* %11)
store i8 %12, i8* %2
br label %13
13: ; preds = %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define signext i8 @GCMGetRegionCode(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 3, i32 %4)
%6 = tail call signext i8 @fgetc(i32* %0)
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 0, %1 ]
ret i8 %8
}
int test_imm_2Euint16_mem(unsigned short *val) {
  return ((*val) & (0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 46
%7 = icmp ne i32 %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_2Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 46
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *uw_init_client_data() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @uw_init_client_data() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @uw_init_client_data() {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ bcf_dec_int1(int const *, int const, int **);
int64_t bcf_dec_typed_int1(const uint8_t *p, uint8_t **q) {
  return bcf_dec_int1(p + 1, *p & 0xf, q);
}


x86 assembly (clang, -O0):
<bcf_dec_typed_int1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
and    $0xf,%esi
mov    -0x10(%rbp),%rdx
call   1030 <bcf_dec_int1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcf_dec_typed_int1>:
mov    %rsi,%rdx
mov    (%rdi),%esi
add    $0x4,%rdi
and    $0xf,%esi
jmp    1030 <bcf_dec_int1@plt>

LLVM IR (-O0):
define i32 @bcf_dec_typed_int1(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = and i32 %8, 15
%10 = load i32**, i32*** %4
%11 = call i32 @bcf_dec_int1(i32* %6, i32 %9, i32** %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @bcf_dec_typed_int1(i32* %0, i32** %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = and i32 %4, 15
%6 = tail call i32 @bcf_dec_int1(i32* %3, i32 %5, i32** %1)
ret i32 %6
}
/* Type definitions */
struct vink_xmpp_state {
  int dummy;
};
struct vink_message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ email_message(struct vink_message *);
void xmpp_message(struct vink_xmpp_state *state, struct vink_message *message) {
  email_message(message);
}


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

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

LLVM IR (-O0):
%struct.vink_xmpp_state = type { i32 }
%struct.vink_message = type { i32 }
define void @xmpp_message(%struct.vink_xmpp_state* %0, %struct.vink_message* %1) {
%3 = alloca %struct.vink_xmpp_state*
%4 = alloca %struct.vink_message*
store %struct.vink_xmpp_state* %0, %struct.vink_xmpp_state** %3
store %struct.vink_message* %1, %struct.vink_message** %4
%5 = load %struct.vink_message*, %struct.vink_message** %4
%6 = call i32 @email_message(%struct.vink_message* %5)
ret void
}

LLVM IR (-O2):
%struct.vink_xmpp_state = type { i32 }
%struct.vink_message = type { i32 }
define void @xmpp_message(%struct.vink_xmpp_state* nocapture readnone %0, %struct.vink_message* %1) {
%3 = tail call i32 @email_message(%struct.vink_message* %1)
ret void
}
long c() {}


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

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

LLVM IR (-O0):
define i64 @c() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @c() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ connect_to_server(int);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run_server(int);
int main() {
  printf("1. Run as server\n"
         "2. Connect to server\n"
         "Option: ");
  char option = getchar();
  getchar();
  switch (option) {
  case '1':
    run_server(8088);
    break;
  case '2':
    connect_to_server(8088);
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
mov    %al,-0xd(%rbp)
call   1060 <getchar@plt>
mov    %al,%cl
mov    -0xd(%rbp),%al
mov    %cl,-0x5(%rbp)
call   1060 <getchar@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x31,%eax
je     1198 <main+0x58>
jmp    1187 <main+0x47>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
je     11a7 <main+0x67>
jmp    11b1 <main+0x71>
mov    $0x1f98,%edi
call   1040 <run_server@plt>
jmp    11b1 <main+0x71>
mov    $0x1f98,%edi
call   1030 <connect_to_server@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <getchar@plt>
movsbl %bl,%eax
cmp    $0x32,%eax
je     1176 <main+0x36>
cmp    $0x31,%eax
jne    1180 <main+0x40>
mov    $0x1f98,%edi
call   1040 <run_server@plt>
jmp    1180 <main+0x40>
mov    $0x1f98,%edi
call   1030 <connect_to_server@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"1. Run as server\0A2. Connect to server\0AOption: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = call signext i8 (...) @getchar()
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
switch i32 %7, label %12 [
i32 49, label %8
i32 50, label %10
]
8: ; preds = %0
%9 = call i32 @run_server(i32 8088)
br label %12
10: ; preds = %0
%11 = call i32 @connect_to_server(i32 8088)
br label %12
12: ; preds = %0, %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [47 x i8] c"1. Run as server\0A2. Connect to server\0AOption: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call signext i8 (...) @getchar()
%4 = sext i8 %2 to i32
switch i32 %4, label %9 [
i32 49, label %5
i32 50, label %7
]
5: ; preds = %0
%6 = tail call i32 @run_server(i32 8088)
br label %9
7: ; preds = %0
%8 = tail call i32 @connect_to_server(i32 8088)
br label %9
9: ; preds = %0, %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MDString(char *);
int main() {
  MDString("");
  MDString("a");
  MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define i32 @main() {
%1 = tail call i32 @MDString(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @MDString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @MDString(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int eq(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ hash(char *);
int is_anagram(char w1[], char w2[]) { return eq(hash(w1), hash(w2)); }


x86 assembly (clang, -O0):
<is_anagram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hash@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <eq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_anagram>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <hash@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <hash@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <eq@plt>

LLVM IR (-O0):
define i32 @is_anagram(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 = call i32 @hash(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @hash(i8* %7)
%9 = call i32 @eq(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_anagram(i8* %0, i8* %1) {
%3 = tail call i32 @hash(i8* %0)
%4 = tail call i32 @hash(i8* %1)
%5 = tail call i32 @eq(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int SEEK_CUR;
int scalanative_libc_seek_cur() { return SEEK_CUR; }


x86 assembly (clang, -O0):
<scalanative_libc_seek_cur>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_seek_cur>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @scalanative_libc_seek_cur() {
%1 = load i32, i32* @SEEK_CUR
ret i32 %1
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @scalanative_libc_seek_cur() {
%1 = load i32, i32* @SEEK_CUR
ret i32 %1
}
/* Variables and functions */
char *strdup(char *);
char *sspm_strdup(char *str) {
  char *s;
  s = strdup(str);
  return s;
}


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

x86 assembly (clang, -O2):
<sspm_strdup>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @sspm_strdup(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
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @sspm_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ myfunc2();
void myfunc(int ncalls) {
  if (ncalls > 1)
    myfunc(ncalls - 1);
  else
    myfunc2();
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1145 <myfunc+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <myfunc@plt>
jmp    114c <myfunc+0x2c>
mov    $0x0,%al
call   1030 <myfunc2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @myfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
br label %10
8: ; preds = %1
%9 = call i32 (...) @myfunc2()
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @myfunc(i32 %0) {
%2 = tail call i32 (...) @myfunc2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test(int *i) {
  int j;
  int *p;
  p = &j;
  printf("main = %p, test = %p \n", i, p);
  if (p < i) {
    printf("Growing downard \n");
  } else {
    printf("Growing upward\n");
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    115b <test+0x4b>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <test+0x59>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r14
lea    0xedc(%rip),%rax
lea    0xec6(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"main = %p, test = %p \0A\00"
@.str.1 = [18 x i8] c"Growing downard \0A\00"
@.str.2 = [16 x i8] c"Growing upward\0A\00"
define void @test(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
store i32* %3, i32** %4
%5 = load i32*, i32** %2
%6 = load i32*, i32** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = load i32*, i32** %4
%9 = load i32*, i32** %2
%10 = icmp ult i32* %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"main = %p, test = %p \0A\00"
@str = [15 x i8] c"Growing upward\00"
@str.3 = [17 x i8] c"Growing downard \00"
define void @test(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %2)
%5 = icmp ult i32* %2, %0
%6 = select i1 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "MSW - Max Size Writer - Writes stdin to file, unless it "
                  "exceeds specified size\n");
  fprintf(stderr, "Usage: msw -f <target file> [-m <max size in bytes>] "
                  "(Default max size 5GB)\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf17(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf21(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"MSW - Max Size Writer - Writes stdin to file, unless it exceeds specified size\0A\00"
@.str.1 = [77 x i8] c"Usage: msw -f <target file> [-m <max size in bytes>] (Default max size 5GB)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"MSW - Max Size Writer - Writes stdin to file, unless it exceeds specified size\0A\00"
@.str.1 = [77 x i8] c"Usage: msw -f <target file> [-m <max size in bytes>] (Default max size 5GB)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ASMAtomicCmpXchgExU64(void) {}


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

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

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

LLVM IR (-O2):
define void @ASMAtomicCmpXchgExU64() {
ret void
}
float Sleef_powf_u10(float x, float y) {
  return (float)__builtin_pow((double)x, (double)y);
}


x86 assembly (clang, -O0):
<Sleef_powf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_powf_u10>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Sleef_powf_u10(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 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call double @pow(double %6, double %8)
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @Sleef_powf_u10(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call double @pow(double %3, double %4)
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_separator(const char *s, void *p) {
  p = p;
  printf("%s", s);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_separator(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void(outl_local)(unsigned int value, int port) {
  {
    ;
    return;
  }
}


x86 assembly (clang, -O0):
<outl_local>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @outl_local(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @outl_local(i32 %0, i32 %1) {
ret void
}
unsigned xrop3_77_1_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 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_77_1_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
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_77_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
and    $0xffffff00,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_77_1_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
%38 = load i32, i32* %6
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_77_1_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 = or i32 %6, %4
%8 = or i32 %7, 255
%9 = xor i32 %8, -1
%10 = or i32 %9, %3
ret i32 %10
}
void INT_Excep_MTU4_TGIV4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU4_TGIV4() {
ret void
}