xunge/DecIR huggingface dataset:
void reverseString(char *s, int start, int end) {
  char t;
  while (start < end) {
    t = s[start];
    s[start] = s[end];
    s[end] = t;
    start += 1;
    end -= 1;
  }
}


x86 assembly (clang, -O0):
<reverseString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverseString+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverseString+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseString>:
cmp    %edx,%esi
jge    1131 <reverseString+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverseString+0x10>
ret

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

LLVM IR (-O2):
define void @reverseString(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
int test_imm_DEuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xDE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DEuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 222
%6 = icmp ne i64 %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_DEuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 222
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int config_LEDSUPPORT(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_LEDSUPPORT() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_LEDSUPPORT() {
ret i32 0
}
/* Variables and functions */
int strncmp(void const *, void const *, size_t const);
int cmp_cache_len(const void *p1, const void *p2, const size_t len) {
  return strncmp(p1, p2, len);
}


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

x86 assembly (clang, -O2):
<cmp_cache_len>:
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @cmp_cache_len(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmp_cache_len(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t make_mask32(uint32_t x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return x;
}


x86 assembly (clang, -O0):
<make_mask32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_mask32>:
mov    %edi,%eax
sar    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @make_mask32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @make_mask32(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 8
%9 = or i32 %8, %7
%10 = ashr i32 %9, 16
%11 = or i32 %10, %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int SIGN_EXTEND_L_B(int reg) {
  addbyte(0x0f);
  addbyte(0xbe);
  addbyte(0xc0 | reg | (reg << 3));
  return reg;
}


x86 assembly (clang, -O0):
<SIGN_EXTEND_L_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbe,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGN_EXTEND_L_B>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbe,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%edi
or     %ebx,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SIGN_EXTEND_L_B(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 15)
%4 = call i32 @addbyte(i32 190)
%5 = load i32, i32* %2
%6 = or i32 192, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 3
%9 = or i32 %6, %8
%10 = call i32 @addbyte(i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @SIGN_EXTEND_L_B(i32 returned %0) {
%2 = tail call i32 @addbyte(i32 15)
%3 = tail call i32 @addbyte(i32 190)
%4 = shl i32 %0, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @addbyte(i32 %6)
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void crc32_res(uint32_t *crc) { *crc = ~(*crc); }


x86 assembly (clang, -O0):
<crc32_res>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_res>:
notl   (%rdi)
ret

LLVM IR (-O0):
define void @crc32_res(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = xor i32 %4, -1
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @crc32_res(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = xor i32 %2, -1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ pushDynArr(struct DynArr *, int /*<<< orphan*/);
double topDynArr(struct DynArr *);
void power(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  double j = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, pow(j, i));
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <pow@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1060 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @power(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call double @topDynArr(%struct.DynArr* %5)
store double %6, double* %3
%7 = load %struct.DynArr*, %struct.DynArr** %2
%8 = call i32 @popDynArr(%struct.DynArr* %7)
%9 = load %struct.DynArr*, %struct.DynArr** %2
%10 = call double @topDynArr(%struct.DynArr* %9)
store double %10, double* %4
%11 = load %struct.DynArr*, %struct.DynArr** %2
%12 = call i32 @popDynArr(%struct.DynArr* %11)
%13 = load %struct.DynArr*, %struct.DynArr** %2
%14 = load double, double* %4
%15 = load double, double* %3
%16 = call i32 @pow(double %14, double %15)
%17 = call i32 @pushDynArr(%struct.DynArr* %13, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @power(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call double @topDynArr(%struct.DynArr* %0)
%5 = tail call i32 @popDynArr(%struct.DynArr* %0)
%6 = tail call i32 @pow(double %4, double %2)
%7 = tail call i32 @pushDynArr(%struct.DynArr* %0, i32 %6)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t pack_a16(unsigned int a16) { return (uint64_t)a16 << 48; }


x86 assembly (clang, -O0):
<pack_a16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
shl    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pack_a16(i32 %0) {
ret i32 poison
}
char *returnChar(char **charPtr) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @returnChar(i8** nocapture readnone %0) {
ret i8* null
}
void computeVariables(double voi, double *states, double *rates,
                      double *variables) {
  variables[0] = 1000.0 * rates[0] + 1000.0 * rates[0];
  variables[1] = 1000.0 * 0.001 * rates[0] + 1000.0 * 0.001 * rates[0];
}


x86 assembly (clang, -O0):
<computeVariables>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0xedf(%rip),%xmm1
mulsd  (%rax),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0xea7(%rip),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeVariables>:
movsd  (%rsi),%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rdx)
movsd  (%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @computeVariables(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %7
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %7
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fmul double 1.000000e+03, %14
%16 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %11, double %15)
%17 = load double*, double** %8
%18 = getelementptr inbounds double, double* %17, i64 0
store double %16, double* %18
%19 = load double*, double** %7
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %7
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fmul double 1.000000e+00, %24
%26 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %21, double %25)
%27 = load double*, double** %8
%28 = getelementptr inbounds double, double* %27, i64 1
store double %26, double* %28
ret void
}

LLVM IR (-O2):
define void @computeVariables(double %0, double* nocapture readnone %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = load double, double* %2
%6 = fmul double %5, 1.000000e+03
%7 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = fadd double %8, %8
%10 = getelementptr inbounds double, double* %3, i64 1
store double %9, double* %10
ret void
}
int test_imm_82int64_highword_reg(long long val) {
  return ((val >> 32) & (0x82 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_82int64_highword_reg>:
movabs $0x8200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_82int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 130
%6 = icmp ne i64 %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_82int64_highword_reg(i64 %0) {
%2 = and i64 %0, 558345748480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float floor(float);
float fract(float x) { return x - floor(x); }


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

x86 assembly (clang, -O2):
<fract>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fract(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @floor(float %4)
%6 = fsub float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @fract(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
%3 = fsub float %0, %2
ret float %3
}
int C_Utils_max_int(const int item1, const int item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <C_Utils_max_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <C_Utils_max_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @C_Utils_max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double bow_random_double(double, double);
double bow_random_01() {
  double r;
  while ((r = bow_random_double(0.0, 1.0)) <= 0.0 || r >= 1.0)
    ;
  return r;
}


x86 assembly (clang, -O0):
<bow_random_01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
call   1030 <bow_random_double@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbp)
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jae    1159 <bow_random_01+0x49>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1169 <bow_random_01+0x59>
jmp    116e <bow_random_01+0x5e>
jmp    1118 <bow_random_01+0x8>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bow_random_01>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <bow_random_double@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1120 <bow_random_01+0x10>
ucomisd 0xebd(%rip),%xmm0
jae    1120 <bow_random_01+0x10>
pop    %rax
ret

LLVM IR (-O0):
define double @bow_random_01() {
%1 = alloca double
br label %2
2: ; preds = %10, %0
%3 = call double @bow_random_double(double 0.000000e+00, double 1.000000e+00)
store double %3, double* %1
%4 = fcmp ole double %3, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load double, double* %1
%7 = fcmp oge double %6, 1.000000e+00
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ true, %2 ], [ %7, %5 ]
br i1 %9, label %10, label %11
10: ; preds = %8
br label %2
11: ; preds = %8
%12 = load double, double* %1
ret double %12
}

LLVM IR (-O2):
define double @bow_random_01() {
br label %1
1: ; preds = %1, %0
%2 = tail call double @bow_random_double(double 0.000000e+00, double 1.000000e+00)
%3 = fcmp ole double %2, 0.000000e+00
%4 = fcmp oge double %2, 1.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %1, label %6
6: ; preds = %1
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE0(int);
int /*<<< orphan*/ STZ16(int /*<<< orphan*/, int);
void Op74E0M0(void) { STZ16(DirectIndexedXE0(2), 0xFFFF); }


x86 assembly (clang, -O0):
<Op74E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <STZ16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op74E0M0>:
push   %rax
mov    $0x2,%edi
call   1040 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <STZ16@plt>

LLVM IR (-O0):
define void @Op74E0M0() {
%1 = call i32 @DirectIndexedXE0(i32 2)
%2 = call i32 @STZ16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op74E0M0() {
%1 = tail call i32 @DirectIndexedXE0(i32 2)
%2 = tail call i32 @STZ16(i32 %1, i32 65535)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGPGRP;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
pid_t tcgetpgrp(int fd) {
  int pgrp;
  if (ioctl(fd, TIOCGPGRP, &pgrp) < 0)
    return -1;
  return pgrp;
}


x86 assembly (clang, -O0):
<tcgetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <tcgetpgrp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <tcgetpgrp+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetpgrp>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <tcgetpgrp+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @TIOCGPGRP
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCGPGRP
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *cpystr(const char *s) {
  char *p;
  if (s == 0)
    return 0;
  p = (char *)malloc(sizeof(char) * (strlen(s) + 1));
  return strcpy(p, s);
}


x86 assembly (clang, -O0):
<cpystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <cpystr+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <cpystr+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpystr>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <cpystr+0x29>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115c <cpystr+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cpystr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = call i8* @strcpy(i8* %17, i8* %18)
store i8* %19, i8** %2
br label %20
20: ; preds = %8, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @cpystr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
void assert2(void) {
  ((1 == 2) ? ((void)0)
            : (__assert(__func__,
                        "/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/"
                        "assert/refs/heads/master/test/test_multi_include.c",
                        8, "1 == 2")));
}


x86 assembly (clang, -O0):
<assert2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x8,%edx
lea    0xf70(%rip),%rcx
mov    $0x0,%al
call   1030 <__assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert2>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xf79(%rip),%rcx
mov    $0x8,%edx
xor    %eax,%eax
jmp    1030 <__assert@plt>

LLVM IR (-O0):
@__func__.assert2 = [8 x i8] c"assert2\00"
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/assert/refs/heads/master/test/test_multi_include.c\00"
@.str.1 = [7 x i8] c"1 == 2\00"
define void @assert2() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.assert2, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.assert2 = [8 x i8] c"assert2\00"
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/DeidaraC/assert/refs/heads/master/test/test_multi_include.c\00"
@.str.1 = [7 x i8] c"1 == 2\00"
define void @assert2() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.assert2, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_EDuint8_mem(unsigned char *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EDuint8_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, 237
%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_EDuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -19
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ send_msg(int, char *);
void send_help(int socket_fd) { send_msg(socket_fd, "lol?"); }


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

x86 assembly (clang, -O2):
<send_help>:
lea    0xee9(%rip),%rsi
jmp    1030 <send_msg@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lol?\00"
define void @send_help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_msg(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lol?\00"
define void @send_help(i32 %0) {
%2 = tail call i32 @send_msg(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int chmod(const char __attribute__((unused)) * path,
          mode_t __attribute__((unused)) mode) {
  return 0;
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int movswl_2(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movw $0x9999, %%ax\n\t"
                       "movswl %%ax,%%eax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movswl_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x9999,%ax
movswl %ax,%eax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movswl_2>:
mov    $0x12345678,%eax
mov    $0x9999,%ax
movswl %ax,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movswl_2() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movw $$0x9999, %ax\0A\09movswl %ax,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movswl_2() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movw $$0x9999, %ax\0A\09movswl %ax,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int inet_aton(char *, struct in_addr *);
unsigned int ntohl(int /*<<< orphan*/);
unsigned int str2ip(char *ip) {
  struct in_addr ia;
  int r;
  r = inet_aton(ip, &ia);
  if (r)
    return ntohl(ia.s_addr);
  return 0;
}


x86 assembly (clang, -O0):
<str2ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1156 <str2ip+0x36>
mov    -0x18(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <str2ip+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2ip>:
push   %rax
mov    %rsp,%rsi
call   1030 <inet_aton@plt>
test   %eax,%eax
je     1137 <str2ip+0x17>
mov    (%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @str2ip(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @inet_aton(i8* %6, %struct.in_addr* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @ntohl(i32 %12)
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @str2ip(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @ntohl(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
next_btl_prf(loc, Base_btl_prf, loc_0, Base_btl_prf_0) int *loc,
    *Base_btl_prf, loc_0, Base_btl_prf_0;
{ btl_prf_NEXT_FNC_OBJ(loc, Base_btl_prf, loc_0, Base_btl_prf_0); }


x86 assembly (clang, -O0):
<next_btl_prf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    $0x0,%al
call   1030 <btl_prf_NEXT_FNC_OBJ@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @next_btl_prf(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @btl_prf_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %0, i32* %1, i32 %2, i32 %3)
ret i32 undef
}
/* Variables and functions */
double *calloc(int, int);
int /*<<< orphan*/ printf(char *);
double *ej1(int num) {
  int i;
  double *v;
  v = calloc(num, sizeof(double));
  if (v == NULL) {
    printf("ERROR al reservar la memoria.\n");
  }
  return v;
}


x86 assembly (clang, -O0):
<ej1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <ej1+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ej1>:
push   %rbx
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <ej1+0x1f>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"ERROR al reservar la memoria.\0A\00"
define double* @ej1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call double* @calloc(i32 %5, i32 8)
store double* %6, double** %4
%7 = load double*, double** %4
%8 = icmp eq double* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load double*, double** %4
ret double* %12
}

LLVM IR (-O2):
@str = [30 x i8] c"ERROR al reservar la memoria.\00"
define noalias double* @ej1(i32 %0) {
%2 = tail call double* @calloc(i32 %0, i32 8)
%3 = icmp eq double* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printPointerValue(int *a) { printf("%d\n", *a); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printPointerValue(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void free_votes(int *votes[], int seq_len) {
  int i;
  for (i = 0; i < seq_len; i++) {
    free(votes[i]);
  }
  free(votes);
}


x86 assembly (clang, -O0):
<free_votes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_votes+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_votes+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_votes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_votes+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_votes+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_votes(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
int bbb(void) { return 0x55; }


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

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

LLVM IR (-O0):
define i32 @bbb() {
ret i32 85
}

LLVM IR (-O2):
define i32 @bbb() {
ret i32 85
}
adr0adrreg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<adr0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrreg1_set>:
mov    0x10f444(%r9),%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 277777
%16 = load i32, i32* %15
store i32 %16, i32* inttoptr (i64 10000000 to i32*)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adr0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
store i32 %8, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sleep_us(int);
void delay(void) { sleep_us(500); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f4,%edi
call   1030 <sleep_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    $0x1f4,%edi
jmp    1030 <sleep_us@plt>

LLVM IR (-O0):
define void @delay() {
%1 = call i32 @sleep_us(i32 500)
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 @sleep_us(i32 500)
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("uid=%d euid=%d\n", (int)getuid(), (int)geteuid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"uid=%d euid=%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getuid()
%2 = trunc i64 %1 to i32
%3 = tail call i64 (...) @geteuid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shm_unlink(char *);
void IP2Location_DB_del_shm() { shm_unlink("/IP2location_Shm"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"/IP2location_Shm\00"
define void @IP2Location_DB_del_shm() {
%1 = call i32 @shm_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/IP2location_Shm\00"
define void @IP2Location_DB_del_shm() {
%1 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int ands_si_test1(int a, int b, int c) {
  int d = a & b;
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<ands_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     112e <ands_si_test1+0x2e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <ands_si_test1+0x3a>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ands_si_test1>:
mov    %esi,%ecx
and    %edi,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmovle %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ands_si_test1(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = and i32 %9, %10
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
store i32 %17, i32* %4
br label %24
18: ; preds = %3
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %18, %14
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @ands_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp slt i32 %4, 1
%6 = add nsw i32 %4, %1
%7 = select i1 %5, i32 %0, i32 %6
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ expectation_passed();
int /*<<< orphan*/ refute_null_failed(void *, char const *, int);
void _refute_null(void *act, const char *file, int line) {
  if ((act) == NULL)
    refute_null_failed(act, file, line);
  else
    expectation_passed();
}


x86 assembly (clang, -O0):
<_refute_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <_refute_null+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <refute_null_failed@plt>
jmp    115a <_refute_null+0x3a>
mov    $0x0,%al
call   1030 <expectation_passed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_refute_null>:
test   %rdi,%rdi
je     112c <_refute_null+0xc>
xor    %eax,%eax
jmp    1030 <expectation_passed@plt>
xor    %edi,%edi
jmp    1040 <refute_null_failed@plt>

LLVM IR (-O0):
define void @_refute_null(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @refute_null_failed(i8* %10, i8* %11, i32 %12)
br label %16
14: ; preds = %3
%15 = call i32 (...) @expectation_passed()
br label %16
16: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
define void @_refute_null(i8* readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @refute_null_failed(i8* null, i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @expectation_passed()
br label %9
9: ; preds = %7, %5
ret void
}