xunge/DecIR huggingface dataset:
long gf_mult(long a, long b) {
  long result = 0;
  while (b) {
    if (b & 1)
      result ^= a;
    if (a & 128)
      a = (a << 1) ^ 283;
    else
      a <<= 1;
    b >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<gf_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1185 <gf_mult+0x85>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113d <gf_mult+0x3d>
mov    -0x8(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     1168 <gf_mult+0x68>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
xor    $0x11b,%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <gf_mult+0x74>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <gf_mult+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_mult>:
xor    %eax,%eax
test   %rsi,%rsi
je     1145 <gf_mult+0x45>
mov    %rsi,%r8
nopw   0x0(%rax,%rax,1)
mov    %esi,%edx
and    $0x1,%edx
neg    %rdx
and    %rdi,%rdx
xor    %rdx,%rax
mov    %rdi,%rcx
add    %rdi,%rcx
mov    %rcx,%rdx
xor    $0x11b,%rdx
test   $0x80,%dil
cmove  %rcx,%rdx
sar    %r8
mov    %rdx,%rdi
cmp    $0x1,%rsi
mov    %r8,%rsi
ja     1110 <gf_mult+0x10>
ret

LLVM IR (-O0):
define i64 @gf_mult(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %28, %2
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %6
%10 = load i64, i64* %4
%11 = and i64 %10, 1
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = xor i64 %15, %14
store i64 %16, i64* %5
br label %17
17: ; preds = %13, %9
%18 = load i64, i64* %3
%19 = and i64 %18, 128
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i64, i64* %3
%23 = shl i64 %22, 1
%24 = xor i64 %23, 283
store i64 %24, i64* %3
br label %28
25: ; preds = %17
%26 = load i64, i64* %3
%27 = shl i64 %26, 1
store i64 %27, i64* %3
br label %28
28: ; preds = %25, %21
%29 = load i64, i64* %4
%30 = ashr i64 %29, 1
store i64 %30, i64* %4
br label %6
31: ; preds = %6
%32 = load i64, i64* %5
ret i64 %32
}

LLVM IR (-O2):
define i64 @gf_mult(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = phi i64 [ %17, %4 ], [ %1, %2 ]
%7 = phi i64 [ %16, %4 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 0, i64 %7
%11 = xor i64 %10, %5
%12 = and i64 %7, 128
%13 = icmp eq i64 %12, 0
%14 = shl i64 %7, 1
%15 = xor i64 %14, 283
%16 = select i1 %13, i64 %14, i64 %15
%17 = ashr i64 %6, 1
%18 = icmp ult i64 %6, 2
br i1 %18, label %19, label %4
19: ; preds = %4, %2
%20 = phi i64 [ 0, %2 ], [ %11, %4 ]
ret i64 %20
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void write_u32_be(char *buf, uint32_t n) {
  buf[0] = n >> 24 & 0xff;
  buf[1] = n >> 16 & 0xff;
  buf[2] = n >> 8 & 0xff;
  buf[3] = n & 0xff;
}


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

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

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

LLVM IR (-O2):
define void @write_u32_be(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
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void cw_log_vfile(int level, const char *format, va_list args) {
  vprintf(format, args);
  printf("\n");
}


x86 assembly (clang, -O0):
<cw_log_vfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <vprintf@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cw_log_vfile>:
push   %rax
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <vprintf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @cw_log_vfile(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vprintf(i8* %1, i32 %2)
%5 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_48uint8_mem(unsigned char *val) {
  return ((*val) & (-0x48 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_48uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -72
%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_48uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -72
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned short CP5RGBA_0(unsigned short BGR) {
  unsigned short s;
  if (!BGR)
    return 0;
  s = ((((BGR << 11)) | ((BGR >> 9) & 0x3e) | ((BGR << 1) & 0x7c0))) | 1;
  if (s == 0x07ff)
    s = 1;
  return s;
}


x86 assembly (clang, -O0):
<CP5RGBA_0>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
cmpw   $0x0,-0x4(%rbp)
jne    1121 <CP5RGBA_0+0x21>
movw   $0x0,-0x2(%rbp)
jmp    1167 <CP5RGBA_0+0x67>
movzwl -0x4(%rbp),%eax
shl    $0xb,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x9,%ecx
and    $0x3e,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0x7c0,%ecx
or     %ecx,%eax
or     $0x1,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x7ff,%eax
jne    115f <CP5RGBA_0+0x5f>
movw   $0x1,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CP5RGBA_0>:
test   %edi,%edi
je     1130 <CP5RGBA_0+0x30>
mov    %edi,%eax
shl    $0xb,%eax
mov    %edi,%ecx
shr    $0x9,%ecx
and    $0x3e,%ecx
or     %eax,%ecx
and    $0x3e0,%edi
lea    (%rcx,%rdi,2),%ecx
add    $0x1,%ecx
movzwl %cx,%eax
cmp    $0x7ff,%eax
mov    $0x1,%eax
cmovne %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i16 @CP5RGBA_0(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = icmp ne i16 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i16 0, i16* %2
br label %30
8: ; preds = %1
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 9
%15 = and i32 %14, 62
%16 = or i32 %11, %15
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = shl i32 %18, 1
%20 = and i32 %19, 1984
%21 = or i32 %16, %20
%22 = or i32 %21, 1
%23 = trunc i32 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %4
%25 = zext i16 %24 to i32
%26 = icmp eq i32 %25, 2047
br i1 %26, label %27, label %28
27: ; preds = %8
store i16 1, i16* %4
br label %28
28: ; preds = %27, %8
%29 = load i16, i16* %4
store i16 %29, i16* %2
br label %30
30: ; preds = %28, %7
%31 = load i16, i16* %2
ret i16 %31
}

LLVM IR (-O2):
define zeroext i16 @CP5RGBA_0(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl i16 %0, 11
%5 = lshr i16 %0, 9
%6 = and i16 %5, 62
%7 = or i16 %6, %4
%8 = shl i16 %0, 1
%9 = and i16 %8, 1984
%10 = or i16 %7, %9
%11 = or i16 %10, 1
%12 = icmp eq i16 %11, 2047
%13 = select i1 %12, i16 1, i16 %11
br label %14
14: ; preds = %1, %3
%15 = phi i16 [ %13, %3 ], [ 0, %1 ]
ret i16 %15
}
int parray_len(char **array) {
  int x;
  for (x = 0; array[x]; ++x)
    ;
  return x;
}


x86 assembly (clang, -O0):
<parray_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <parray_len+0x35>
jmp    1127 <parray_len+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <parray_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parray_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <parray_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @parray_len(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LDByteWriteI2C(int, int, int);
void Setup_HMC5883L(void) {
  LDByteWriteI2C(0x1e, 1, 0x20);
  LDByteWriteI2C(0x1e, 2, 0x01);
}


x86 assembly (clang, -O0):
<Setup_HMC5883L>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <LDByteWriteI2C@plt>
mov    $0x1e,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <LDByteWriteI2C@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setup_HMC5883L>:
push   %rax
mov    $0x1e,%edi
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <LDByteWriteI2C@plt>
mov    $0x1e,%edi
mov    $0x2,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <LDByteWriteI2C@plt>

LLVM IR (-O0):
define void @Setup_HMC5883L() {
%1 = call i32 @LDByteWriteI2C(i32 30, i32 1, i32 32)
%2 = call i32 @LDByteWriteI2C(i32 30, i32 2, i32 1)
ret void
}

LLVM IR (-O2):
define void @Setup_HMC5883L() {
%1 = tail call i32 @LDByteWriteI2C(i32 30, i32 1, i32 32)
%2 = tail call i32 @LDByteWriteI2C(i32 30, i32 2, i32 1)
ret void
}
int gpr_function_in_set(int function_type, int *instruction_set,
                        int no_of_instructions) {
  int i;
  for (i = 0; i < no_of_instructions; i++) {
    if (instruction_set[i] == function_type) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<gpr_function_in_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <gpr_function_in_set+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <gpr_function_in_set+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <gpr_function_in_set+0x5b>
jmp    1146 <gpr_function_in_set+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <gpr_function_in_set+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpr_function_in_set>:
test   %edx,%edx
jle    111e <gpr_function_in_set+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <gpr_function_in_set+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <gpr_function_in_set+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @gpr_function_in_set(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void RTSemRWIsReadOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWIsReadOwner() {
ret void
}
void freeFrequencies(struct Freqs *f) {}


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

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

LLVM IR (-O0):
%struct.Freqs = type opaque
define void @freeFrequencies(%struct.Freqs* %0) {
%2 = alloca %struct.Freqs*
store %struct.Freqs* %0, %struct.Freqs** %2
ret void
}

LLVM IR (-O2):
%struct.Freqs = type opaque
define void @freeFrequencies(%struct.Freqs* nocapture %0) {
ret void
}
void b3Swap16(unsigned char *ptr) {
  unsigned char val;
  val = *(ptr);
  *(ptr) = *(ptr + 1);
  *(ptr + 1) = val;
}


x86 assembly (clang, -O0):
<b3Swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<b3Swap16>:
rolw   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @b3Swap16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *stradd(char *str1, char *str2) {
  char *result = malloc(strlen(str1) + strlen(str2) + 1);
  strcpy(result, str1);
  strcat(result, str2);
  return result;
}


x86 assembly (clang, -O0):
<stradd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stradd>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stradd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @stradd(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ hoc_pushx(int);
int /*<<< orphan*/ hoc_ret();
hoc_Graphmode() {
  hoc_ret();
  hoc_pushx(0.);
}


x86 assembly (clang, -O0):
<hoc_Graphmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <hoc_ret@plt>
xor    %edi,%edi
call   1040 <hoc_pushx@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoc_Graphmode>:
push   %rax
xor    %eax,%eax
call   1030 <hoc_ret@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <hoc_pushx@plt>

LLVM IR (-O0):
define i32 @hoc_Graphmode() {
%1 = alloca i32
%2 = call i32 (...) @hoc_ret()
%3 = call i32 @hoc_pushx(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @hoc_Graphmode() {
%1 = tail call i32 (...) @hoc_ret()
%2 = tail call i32 @hoc_pushx(i32 0)
ret i32 undef
}
int xmlUCSIsArabicPresentationFormsB(int code) {
  return (((code >= 0xFE70) && (code <= 0xFEFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsArabicPresentationFormsB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfe70,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsArabicPresentationFormsB+0x26>
cmpl   $0xfeff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsArabicPresentationFormsB>:
add    $0xffff0190,%edi
xor    %eax,%eax
cmp    $0x90,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsArabicPresentationFormsB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65136
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65279
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsArabicPresentationFormsB(i32 %0) {
%2 = add i32 %0, -65136
%3 = icmp ult i32 %2, 144
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_txa();
void e_txa_accu() { e_txa(); }


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

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

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

LLVM IR (-O2):
define void @e_txa_accu() {
%1 = tail call i32 (...) @e_txa()
ret void
}
void caller_2_2_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_1_2_1_2() {
ret void
}
/* Type definitions */
struct servent {
  int dummy;
};

/* Variables and functions */
int compat_getservbyname_r(const char *name, const char *proto,
                           struct servent *sp, char *buf, size_t buflen,
                           struct servent **spp) {
  return 0;
}


x86 assembly (clang, -O0):
<compat_getservbyname_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.servent = type { i32 }
define i32 @compat_getservbyname_r(i8* %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.servent*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca %struct.servent**
store i8* %0, i8** %7
store i8* %1, i8** %8
store %struct.servent* %2, %struct.servent** %9
store i8* %3, i8** %10
store i64 %4, i64* %11
store %struct.servent** %5, %struct.servent*** %12
ret i32 0
}

LLVM IR (-O2):
%struct.servent = type { i32 }
define i32 @compat_getservbyname_r(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.servent* nocapture readnone %2, i8* nocapture readnone %3, i64 %4, %struct.servent** nocapture readnone %5) {
ret i32 0
}
void swd_exit(struct ucl_swd *s) {}


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

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

LLVM IR (-O0):
%struct.ucl_swd = type opaque
define void @swd_exit(%struct.ucl_swd* %0) {
%2 = alloca %struct.ucl_swd*
store %struct.ucl_swd* %0, %struct.ucl_swd** %2
ret void
}

LLVM IR (-O2):
%struct.ucl_swd = type opaque
define void @swd_exit(%struct.ucl_swd* nocapture %0) {
ret void
}
int fun804() { return 804; }


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

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

LLVM IR (-O0):
define i32 @fun804() {
ret i32 804
}

LLVM IR (-O2):
define i32 @fun804() {
ret i32 804
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char const *, int, char const *);
void *do_nofail(void *ptr, const char *file, int line, const char *expr) {
  if (!ptr) {
    fatal("Memory allocation failure %s line %d: %s.\n", file, line, expr);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<do_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1149 <do_nofail+0x39>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xebc(%rip),%rdi
call   1030 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_nofail>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1125 <do_nofail+0x15>
lea    0xee0(%rip),%rdi
call   1030 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Memory allocation failure %s line %d: %s.\0A\00"
define i8* @do_nofail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = call i32 @fatal(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14)
br label %16
16: ; preds = %11, %4
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [43 x i8] c"Memory allocation failure %s line %d: %s.\0A\00"
define i8* @do_nofail(i8* readnone returned %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3)
br label %8
8: ; preds = %6, %4
ret i8* %0
}
int counta(char s[]) {}


x86 assembly (clang, -O0):
<counta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @counta(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
char *inet_ntoa(struct in_addr);
char *getHost(char *host) {
  struct hostent *h = gethostbyname(host);
  if (!h) {
    return NULL;
  }
  return inet_ntoa(*(struct in_addr *)h->h_addr);
}


x86 assembly (clang, -O0):
<getHost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <getHost+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1163 <getHost+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHost>:
push   %rax
call   1040 <gethostbyname@plt>
test   %rax,%rax
je     1136 <getHost+0x16>
mov    (%rax),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <inet_ntoa@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @getHost(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.hostent*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %4
%7 = load %struct.hostent*, %struct.hostent** %4
%8 = icmp ne %struct.hostent* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %18
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %4
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to %struct.in_addr*
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i8* @inet_ntoa(i32 %16)
store i8* %17, i8** %2
br label %18
18: ; preds = %10, %9
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @getHost(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.in_addr*
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i8* @inet_ntoa(i32 %9)
br label %11
11: ; preds = %1, %4
%12 = phi i8* [ %10, %4 ], [ null, %1 ]
ret i8* %12
}
__attribute__((__always___)) void sx_memory_read_barrier() {
  __sync_synchronize();
}


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

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

LLVM IR (-O0):
define void @sx_memory_read_barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @sx_memory_read_barrier() {
fence seq_cst
ret void
}
int main() {
  int a = (3, 5);
  int *p = (10, &a);
  if (a != 5)
    return 1;
  if (p != &a)
    return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1130 <main+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1145 <main+0x45>
lea    -0x8(%rbp),%rax
cmp    %rax,-0x10(%rbp)
je     1145 <main+0x45>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct Z {
  int dummy;
};
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ f2(struct Z *);
__attribute__((flatten)) void f1(struct S *s) { f2((struct Z *)s); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <f2@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
%struct.Z = type { i32 }
define void @f1(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = bitcast %struct.S* %3 to %struct.Z*
%5 = call i32 @f2(%struct.Z* %4)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
%struct.Z = type { i32 }
define void @f1(%struct.S* %0) {
%2 = bitcast %struct.S* %0 to %struct.Z*
%3 = tail call i32 @f2(%struct.Z* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello World");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double x_squared(double x) { return x * x; }


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

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

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

LLVM IR (-O2):
define double @x_squared(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_78K2(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_78K2() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  printf("Sleeping\n");
  fflush(stdout);
  sleep(30);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Sleeping\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @sleep(i32 30)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [9 x i8] c"Sleeping\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @sleep(i32 30)
ret i32 0
}
char bool_and(unsigned char a, char b) { return a && b; }


x86 assembly (clang, -O0):
<bool_and>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
je     112f <bool_and+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_and>:
test   %edi,%edi
setne  %cl
test   %sil,%sil
setne  %al
and    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @bool_and(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @bool_and(i8 zeroext %0, i8 signext %1) {
%3 = icmp ne i8 %0, 0
%4 = icmp ne i8 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Type definitions */
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_char(char *, struct char_data *);
void do_not_here(struct char_data *ch, char *argument, int cmd) {
  send_to_char("Sorry, but you cannot do that here!\n\r", ch);
}


x86 assembly (clang, -O0):
<do_not_here>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <send_to_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.char_data = type { i32 }
@.str = [38 x i8] c"Sorry, but you cannot do that here!\0A\0D\00"
define void @do_not_here(%struct.char_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.char_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.char_data* %0, %struct.char_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.char_data*, %struct.char_data** %4
%8 = call i32 @send_to_char(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), %struct.char_data* %7)
ret void
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
@.str = [38 x i8] c"Sorry, but you cannot do that here!\0A\0D\00"
define void @do_not_here(%struct.char_data* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @send_to_char(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), %struct.char_data* %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ rpcvers_t;
typedef int /*<<< orphan*/ rpcprog_t;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
CLIENT *clntudp_create(struct sockaddr_in *addr, rpcprog_t prognum,
                       rpcvers_t versnum, struct timeval wait, int *fdp) {
  CLIENT *rv;
  rv = (CLIENT *)NULL;
  return rv;
}


x86 assembly (clang, -O0):
<clntudp_create>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.timeval = type { i32 }
define i32* @clntudp_create(%struct.sockaddr_in* %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca %struct.timeval
%7 = alloca %struct.sockaddr_in*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
store i32 %3, i32* %12
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %4, i32** %10
store i32* null, i32** %11
%13 = load i32*, i32** %11
ret i32* %13
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define noalias i32* @clntudp_create(%struct.sockaddr_in* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4) {
ret i32* null
}
void Sys_ConfigureFPU(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_ConfigureFPU() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_help(int argc, char **argv) {
  (void)argc;
  printf("Usage: %s <in_file> <out_file> [key iv [encrypt]]\n"
         "\tkey and iv should be a hex string, 128 or 256 bit long\n"
         "\tencrypt: 1=encrypt, 0=decrypt\n"
         "Note: out_file will not be deleted before it gets over-written.\n",
         argv[0]);
  return -1;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [202 x i8] c"Usage: %s <in_file> <out_file> [key iv [encrypt]]\0A\09key and iv should be a hex string, 128 or 256 bit long\0A\09encrypt: 1=encrypt, 0=decrypt\0ANote: out_file will not be deleted before it gets over-written.\0A\00"
define i32 @print_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 -1
}

LLVM IR (-O2):
@.str = [202 x i8] c"Usage: %s <in_file> <out_file> [key iv [encrypt]]\0A\09key and iv should be a hex string, 128 or 256 bit long\0A\09encrypt: 1=encrypt, 0=decrypt\0ANote: out_file will not be deleted before it gets over-written.\0A\00"
define i32 @print_help(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x95() {
  Assert_real((isgraph(149) == 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_isgraph.c",
              750, ("isgraph should be 0 for 0x95"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x95\00"
define void @t_isgraph_0x95() {
%1 = tail call i64 @isgraph(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) int request_module(const char *name, ...) {
  return -38;
}


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

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

LLVM IR (-O0):
define i32 @request_module(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -38
}

LLVM IR (-O2):
define i32 @request_module(i8* nocapture readnone %0, ...) {
ret i32 -38
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  char buf[3];
  char *p;
  int i;
  p = buf;
  buf[0] = 'h';
  buf[1] = 'i';
  buf[2] = 0;
  puts(&buf[p - buf]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x3(%rbp),%rax
mov    %rax,-0x10(%rbp)
movb   $0x68,-0x3(%rbp)
movb   $0x69,-0x2(%rbp)
movb   $0x0,-0x1(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x3(%rbp),%rcx
sub    %rcx,%rax
lea    -0x3(%rbp),%rdi
add    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6968,0x5(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 104, i8* %5
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 105, i8* %6
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 0, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 %12
%14 = call i32 @puts(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 104, i8* %2
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 105, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = call i32 @puts(i8* %2)
ret i32 0
}
void touch_init(void) {}


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

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

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

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