xunge/DecIR huggingface dataset:
const char *get_version(void) { return "(unknown)"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"(unknown)\00"
define i8* @get_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void ScaleCols_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleCols_16_C() {
ret void
}
int test_imm_76int16_reg(short val) {
  return ((val) & (0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 118
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_76int16_reg(i16 signext %0) {
%2 = and i16 %0, 118
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long long carried_add_lahf(unsigned long long carry,
                                    unsigned long long *res,
                                    unsigned long long *a1,
                                    unsigned long long *a2) {
  asm("xor  %%rax,   %%rax;"
      "adc  (%%rbx),   %%rdx;"
      "lahf;"
      "mov  %%ah,    %%al;"
      "adc  (%%rcx),   %%rdx;"
      "lahf;"
      "or   %%ah,    %%al;"
      "and  $0x0001, %%rax;"
      : "=a"(carry), "=d"(*res)
      : "b"(a1), "c"(a2), "d"(carry));
  return carry;
}


x86 assembly (clang, -O0):
<carried_add_lahf>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rbx
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rdx
xor    %rax,%rax
adc    (%rbx),%rdx
lahf
mov    %ah,%al
adc    (%rcx),%rdx
lahf
or     %ah,%al
and    $0x1,%rax
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,-0x10(%rbp)
mov    %rdx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<carried_add_lahf>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rdx
xor    %rax,%rax
adc    (%rbx),%rdx
lahf
mov    %ah,%al
adc    (%rcx),%rdx
lahf
or     %ah,%al
and    $0x1,%rax
mov    %rdx,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define i64 @carried_add_lahf(i64 %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i64 %0, i64* %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64*, i64** %6
%10 = load i64*, i64** %7
%11 = load i64*, i64** %8
%12 = load i64, i64* %5
%13 = call { i64, i64 } asm "xor %rax, %rax;adc (%rbx), %rdx;lahf;mov %ah, %al;adc (%rcx), %rdx;lahf;or %ah, %al;and $$0x0001, %rax;", "={ax},={dx},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64* %10, i64* %11, i64 %12)
%14 = extractvalue { i64, i64 } %13, 0
%15 = extractvalue { i64, i64 } %13, 1
store i64 %14, i64* %5
store i64 %15, i64* %9
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @carried_add_lahf(i64 %0, i64* nocapture writeonly %1, i64* %2, i64* %3) {
%5 = tail call { i64, i64 } asm "xor %rax, %rax;adc (%rbx), %rdx;lahf;mov %ah, %al;adc (%rcx), %rdx;lahf;or %ah, %al;and $$0x0001, %rax;", "={ax},={dx},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64* %2, i64* %3, i64 %0)
%6 = extractvalue { i64, i64 } %5, 0
%7 = extractvalue { i64, i64 } %5, 1
store i64 %7, i64* %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void crash(const char *msg) {
  printf("%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @crash(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int my_function() {
  int my_var = 0xbaba;
  return my_var;
}


x86 assembly (clang, -O0):
<my_function>:
push   %rbp
mov    %rsp,%rbp
movl   $0xbaba,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_function() {
%1 = alloca i32
store i32 47802, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @my_function() {
ret i32 47802
}
int test_hall() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_hall() {
ret i32 0
}
/* Variables and functions */
int Cyc_BansheeIf_constraint_eq(void *, void *);
int Cyc_BansheeIf_constraint_cmp(void *c1, void *c2) {
  int _T0;
  int _T1;
  _T0 = Cyc_BansheeIf_constraint_eq(c1, c2);
  _T1 = !_T0;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_BansheeIf_constraint_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_BansheeIf_constraint_eq@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_BansheeIf_constraint_cmp>:
push   %rax
call   1030 <Cyc_BansheeIf_constraint_eq@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cyc_BansheeIf_constraint_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @Cyc_BansheeIf_constraint_eq(i8* %7, i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @Cyc_BansheeIf_constraint_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_BansheeIf_constraint_eq(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(2 < 1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void spaces(int indent) {
  int i;
  for (i = 0; i < indent; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <spaces+0x36>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <spaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %rbx
test   %edi,%edi
jle    112f <spaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @spaces(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 32)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @spaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand_range(double min, double max) {
  double scaled = (double)rand() / RAND_MAX;
  return scaled * (max - min) + min;
}


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_range(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fsub double %11, %12
%14 = load double, double* %3
%15 = call double @llvm.fmuladd.f64(double %10, double %13, double %14)
ret double %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_range(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
int equal(int x, int y) { return !(x ^ y); }


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @equal(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 = xor i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equal(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int sync_sbf(unsigned char *buff, unsigned char data) {
  buff[0] = buff[1];
  buff[1] = data;
  return buff[0] == 0x24 && buff[1] == 0x40;
}


x86 assembly (clang, -O0):
<sync_sbf>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x24,%ecx
mov    %al,-0xa(%rbp)
jne    114b <sync_sbf+0x4b>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x40,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_sbf>:
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
mov    %sil,0x1(%rdi)
xor    $0x24,%cl
xor    $0x40,%sil
xor    %eax,%eax
or     %cl,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @sync_sbf(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8, i8* %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 36
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %22, 64
br label %24
24: ; preds = %18, %2
%25 = phi i1 [ false, %2 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @sync_sbf(i8* nocapture %0, i8 zeroext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %1, i8* %3
%5 = icmp eq i8 %4, 36
%6 = icmp eq i8 %1, 64
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
struct yaffs_dev *yaffsfs_FindDevice(char const *, char **);
void *yaffs_getdev(const char *path) {
  struct yaffs_dev *dev = (0);
  char *dummy;
  dev = yaffsfs_FindDevice(path, &dummy);
  return (void *)dev;
}


x86 assembly (clang, -O0):
<yaffs_getdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <yaffsfs_FindDevice@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_getdev>:
push   %rax
mov    %rsp,%rsi
call   1030 <yaffsfs_FindDevice@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i8* @yaffs_getdev(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.yaffs_dev*
%4 = alloca i8*
store i8* %0, i8** %2
store %struct.yaffs_dev* null, %struct.yaffs_dev** %3
%5 = load i8*, i8** %2
%6 = call %struct.yaffs_dev* @yaffsfs_FindDevice(i8* %5, i8** %4)
store %struct.yaffs_dev* %6, %struct.yaffs_dev** %3
%7 = load %struct.yaffs_dev*, %struct.yaffs_dev** %3
%8 = bitcast %struct.yaffs_dev* %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i8* @yaffs_getdev(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call %struct.yaffs_dev* @yaffsfs_FindDevice(i8* %0, i8** %2)
%5 = bitcast %struct.yaffs_dev* %4 to i8*
ret i8* %5
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ____rb_erase_color(struct rb_node *, struct rb_root *,
                                      void (*)(struct rb_node *,
                                               struct rb_node *));
void __rb_erase_color(struct rb_node *parent, struct rb_root *root,
                      void (*augment_rotate)(struct rb_node *old,
                                             struct rb_node *new)) {
  ____rb_erase_color(parent, root, augment_rotate);
}


x86 assembly (clang, -O0):
<__rb_erase_color>:
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 <____rb_erase_color@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rb_erase_color>:
jmp    1030 <____rb_erase_color@plt>

LLVM IR (-O0):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @__rb_erase_color(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2) {
%4 = alloca %struct.rb_node*
%5 = alloca %struct.rb_root*
%6 = alloca void (%struct.rb_node*, %struct.rb_node*)*
store %struct.rb_node* %0, %struct.rb_node** %4
store %struct.rb_root* %1, %struct.rb_root** %5
store void (%struct.rb_node*, %struct.rb_node*)* %2, void (%struct.rb_node*, %struct.rb_node*)** %6
%7 = load %struct.rb_node*, %struct.rb_node** %4
%8 = load %struct.rb_root*, %struct.rb_root** %5
%9 = load void (%struct.rb_node*, %struct.rb_node*)*, void (%struct.rb_node*, %struct.rb_node*)** %6
%10 = call i32 @____rb_erase_color(%struct.rb_node* %7, %struct.rb_root* %8, void (%struct.rb_node*, %struct.rb_node*)* %9)
ret void
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @__rb_erase_color(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2) {
%4 = tail call i32 @____rb_erase_color(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unknown();
int test7() { unknown(); }


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test7() {
%1 = alloca i32
%2 = call i32 (...) @unknown()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test7() {
%1 = tail call i32 (...) @unknown()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
__m128i test_mm_srli_si128_2(__m128i A) { return _mm_srli_si128(A, 17); }


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

x86 assembly (clang, -O2):
<test_mm_srli_si128_2>:
mov    $0x11,%esi
jmp    1030 <_mm_srli_si128@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_si128_2(i32 %0) {
%2 = tail call i32 @_mm_srli_si128(i32 %0, i32 17)
ret i32 %2
}
int absVal(int x) {
  int signSeq = (x >> 31);
  int negOne = ~signSeq + 1;
  int absX = (x ^ signSeq) + negOne;
  return absX;
}


x86 assembly (clang, -O0):
<absVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absVal>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
shr    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @absVal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = xor i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @absVal(i32 %0) {
%2 = lshr i32 %0, 31
%3 = ashr i32 %0, 31
%4 = xor i32 %3, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
int LER_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LER_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ normend();
int /*<<< orphan*/ rspeak(int);
void dwarfend() {
  rspeak(136);
  normend();
  return;
}


x86 assembly (clang, -O0):
<dwarfend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x88,%edi
call   1030 <rspeak@plt>
mov    $0x0,%al
call   1040 <normend@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwarfend>:
push   %rax
mov    $0x88,%edi
call   1030 <rspeak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <normend@plt>

LLVM IR (-O0):
define void @dwarfend() {
%1 = call i32 @rspeak(i32 136)
%2 = call i32 (...) @normend()
ret void
}

LLVM IR (-O2):
define void @dwarfend() {
%1 = tail call i32 @rspeak(i32 136)
%2 = tail call i32 (...) @normend()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int AT_EXP_CONNECT(const unsigned char *RESP) {
  if (RESP == NULL) {
    return (0);
  }
  if (strstr((char *)RESP, "2000") != NULL) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<AT_EXP_CONNECT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <AT_EXP_CONNECT+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <AT_EXP_CONNECT+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1159 <AT_EXP_CONNECT+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <AT_EXP_CONNECT+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_EXP_CONNECT>:
test   %rdi,%rdi
je     1132 <AT_EXP_CONNECT+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2000\00"
define i32 @AT_EXP_CONNECT(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32* @strstr(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"2000\00"
define i32 @AT_EXP_CONNECT(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
unsigned FcGetBaseColorMax() { return 16; }


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

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

LLVM IR (-O0):
define i32 @FcGetBaseColorMax() {
ret i32 16
}

LLVM IR (-O2):
define i32 @FcGetBaseColorMax() {
ret i32 16
}
void ResetMatrix(char matrix[8][8]) {
  for (int row = 0; row < 8; row++) {
    for (int col = 0; col < 8; col++) {
      matrix[row][col] = 'A';
    }
  }
}


x86 assembly (clang, -O0):
<ResetMatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1162 <ResetMatrix+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    114f <ResetMatrix+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x41,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <ResetMatrix+0x20>
jmp    1154 <ResetMatrix+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ResetMatrix+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetMatrix>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ResetMatrix([8 x i8]* nocapture writeonly %0) {
%2 = getelementptr [8 x i8], [8 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outl_local(unsigned int, int);
void(outl)(unsigned int value, int port) {
  {
    outl_local(value, port);
    return;
  }
}


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

x86 assembly (clang, -O2):
<outl>:
jmp    1030 <outl_local@plt>

LLVM IR (-O0):
define void @outl(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 = call i32 @outl_local(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i32 %1) {
%3 = tail call i32 @outl_local(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
sigset_t sig_unblock(sigset_t new) {
  sigset_t old;
  sigemptyset(&old);
  sigprocmask(SIG_UNBLOCK, &new, &old);
  return old;
}


x86 assembly (clang, -O0):
<sig_unblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_unblock>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <sigprocmask@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define i32 @sig_unblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* @SIG_UNBLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %2, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @sig_unblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* @SIG_UNBLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* %3)
%8 = load i32, i32* %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_218() {
  Assert_real((isqrt(218) == 14),
              "/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/stdlib/isqrt.c",
              1095, ("Integer square root of 218 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_218>:
push   %rbp
mov    %rsp,%rbp
mov    $0xda,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x447,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_218>:
push   %rax
mov    $0xda,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 218 should be 14\00"
define void @t_sqrt_218() {
%1 = call i32 @isqrt(i32 218)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 218 should be 14\00"
define void @t_sqrt_218() {
%1 = tail call i32 @isqrt(i32 218)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v24_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello, world!\n");
  printf("\n");
  return;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ clob1(int);
int clobber(char **argv) {
  int times;
  if (argv[0] == 0)
    times = 1;
  else
    times = (atoi(argv[0]) + 511) / 512;
  clob1(times);
  return (0);
}


x86 assembly (clang, -O0):
<clobber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1146 <clobber+0x26>
movl   $0x1,-0xc(%rbp)
jmp    1162 <clobber+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <atoi@plt>
add    $0x1ff,%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <clob1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clobber>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1146 <clobber+0x26>
call   1040 <atoi@plt>
mov    %eax,%edi
lea    0x1ff(%rdi),%eax
add    $0x3fe,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x9,%edi
jmp    114b <clobber+0x2b>
mov    $0x1,%edi
call   1030 <clob1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clobber(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %16
9: ; preds = %1
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = add nsw i32 %13, 511
%15 = sdiv i32 %14, 512
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
%18 = call i32 @clob1(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @clobber(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
%6 = add nsw i32 %5, 511
%7 = sdiv i32 %6, 512
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
%10 = tail call i32 @clob1(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void str_copy(char *strDestination, const char *strSource) {
  strcpy(strDestination, strSource);
}


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

x86 assembly (clang, -O2):
<str_copy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @str_copy(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convert_cltos(int /*<<< orphan*/);
int /*<<< orphan*/ convert_itocl(int, int);
int my_puts(int /*<<< orphan*/);
scalar_t__ verify_inf_size(int, int);
int my_putnbr_base(int i, int b) {
  if (verify_inf_size(b, 37) != 0) {
    return -1;
  }
  return my_puts(convert_cltos(convert_itocl(i, b)));
}


x86 assembly (clang, -O0):
<my_putnbr_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x25,%esi
call   1040 <verify_inf_size@plt>
cmp    $0x0,%rax
je     1171 <my_putnbr_base+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <my_putnbr_base+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <convert_itocl@plt>
mov    %eax,%edi
call   1060 <convert_cltos@plt>
mov    %eax,%edi
call   1030 <my_puts@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnbr_base>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x25,%esi
call   1040 <verify_inf_size@plt>
test   %rax,%rax
je     1164 <my_putnbr_base+0x24>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <convert_itocl@plt>
mov    %eax,%edi
call   1060 <convert_cltos@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <my_puts@plt>

LLVM IR (-O0):
define i32 @my_putnbr_base(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i64 @verify_inf_size(i32 %6, i32 37)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @convert_itocl(i32 %11, i32 %12)
%14 = call i32 @convert_cltos(i32 %13)
%15 = call i32 @my_puts(i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @my_putnbr_base(i32 %0, i32 %1) {
%3 = tail call i64 @verify_inf_size(i32 %1, i32 37)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @convert_itocl(i32 %0, i32 %1)
%7 = tail call i32 @convert_cltos(i32 %6)
%8 = tail call i32 @my_puts(i32 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pci_read_cfgw(int, int, int);
uint32_t pci_read_config_word(uint8_t bus, uint8_t dev_fn, uint8_t reg) {
  return pci_read_cfgw((0xb1 << 8) | 0x09, (bus << 8) | dev_fn, reg);
}


x86 assembly (clang, -O0):
<pci_read_config_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x8,%esi
or     -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xb109,%edi
call   1030 <pci_read_cfgw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_read_config_word>:
shl    $0x8,%edi
or     %edi,%esi
mov    $0xb109,%edi
jmp    1030 <pci_read_cfgw@plt>

LLVM IR (-O0):
define i32 @pci_read_config_word(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 8
%9 = load i32, i32* %5
%10 = or i32 %8, %9
%11 = load i32, i32* %6
%12 = call i32 @pci_read_cfgw(i32 45321, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @pci_read_config_word(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = or i32 %4, %1
%6 = tail call i32 @pci_read_cfgw(i32 45321, i32 %5, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _rdpkru(int);
int /*<<< orphan*/ expected_pk_fault(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ pkey_access_deny(int /*<<< orphan*/);
int read_ptr(int *);
int /*<<< orphan*/ sigsafe_printf(char *, int, ...);
void test_read_of_access_disabled_region(int *ptr, uint16_t pkey) {
  int ptr_contents;
  do {
    if (1 <= 0)
      sigsafe_printf("disabling access to PKEY[%02d], doing read @ %p\n", pkey,
                     ptr);
    fflush(NULL);
  } while (0);
  _rdpkru(1143);
  pkey_access_deny(pkey);
  ptr_contents = read_ptr(ptr);
  do {
    if (1 <= 0)
      sigsafe_printf("*ptr: %d\n", ptr_contents);
    fflush(NULL);
  } while (0);
  expected_pk_fault(pkey);
}


x86 assembly (clang, -O0):
<test_read_of_access_disabled_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    $0x477,%edi
call   1070 <_rdpkru@plt>
mov    -0xc(%rbp),%edi
call   1050 <pkey_access_deny@plt>
mov    -0x8(%rbp),%rdi
call   1030 <read_ptr@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1060 <expected_pk_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_read_of_access_disabled_region>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <fflush@plt>
mov    $0x477,%edi
call   1070 <_rdpkru@plt>
mov    %ebx,%edi
call   1050 <pkey_access_deny@plt>
mov    %r14,%rdi
call   1030 <read_ptr@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <expected_pk_fault@plt>

LLVM IR (-O0):
define void @test_read_of_access_disabled_region(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2
%7 = call i32 @fflush(i32* null)
br label %8
8: ; preds = %6
%9 = call i32 @_rdpkru(i32 1143)
%10 = load i32, i32* %4
%11 = call i32 @pkey_access_deny(i32 %10)
%12 = load i32*, i32** %3
%13 = call i32 @read_ptr(i32* %12)
store i32 %13, i32* %5
br label %14
14: ; preds = %8
%15 = call i32 @fflush(i32* null)
br label %16
16: ; preds = %14
%17 = load i32, i32* %4
%18 = call i32 @expected_pk_fault(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test_read_of_access_disabled_region(i32* %0, i32 %1) {
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @_rdpkru(i32 1143)
%5 = tail call i32 @pkey_access_deny(i32 %1)
%6 = tail call i32 @read_ptr(i32* %0)
%7 = tail call i32 @fflush(i32* null)
%8 = tail call i32 @expected_pk_fault(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DestroyV4l2Context(void *v4l2ctx) {
  if (!v4l2ctx)
    return;
  free(v4l2ctx);
  v4l2ctx = NULL;
}


x86 assembly (clang, -O0):
<DestroyV4l2Context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <DestroyV4l2Context+0x1c>
jmp    113d <DestroyV4l2Context+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyV4l2Context>:
test   %rdi,%rdi
je     111a <DestroyV4l2Context+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @DestroyV4l2Context(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
store i8* null, i8** %2
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @DestroyV4l2Context(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int compTwoConv(unsigned int byte) {
  byte &= 255;
  if (byte > 127)
    return byte - 256;
  else
    return byte;
}


x86 assembly (clang, -O0):
<compTwoConv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jbe    112c <compTwoConv+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <compTwoConv+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compTwoConv>:
movzbl %dil,%eax
xor    %ecx,%ecx
cmp    $0x80,%eax
setb   %cl
shl    $0x8,%ecx
add    %ecx,%eax
add    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @compTwoConv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 255
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ugt i32 %6, 127
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 %9, 256
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @compTwoConv(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ugt i32 %2, 127
%4 = select i1 %3, i32 -256, i32 0
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int seteuid(int /*<<< orphan*/);
int setuid(int);
int main() {
  int status = 0;
  setuid(1);
  if (seteuid(0) != -1 || setuid(0) != -1)
    status = 1;
  exit(status);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
call   1050 <seteuid@plt>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
xor    %edi,%edi
call   1040 <setuid@plt>
cmp    $0xffffffff,%eax
je     1177 <main+0x47>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <setuid@plt>
xor    %ebx,%ebx
xor    %edi,%edi
call   1050 <seteuid@plt>
cmp    $0xffffffff,%eax
jne    1155 <main+0x25>
xor    %edi,%edi
call   1040 <setuid@plt>
cmp    $0xffffffff,%eax
je     115a <main+0x2a>
mov    $0x1,%ebx
mov    %ebx,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @setuid(i32 1)
%2 = tail call i32 @seteuid(i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @setuid(i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %8, label %7
7: ; preds = %4, %0
br label %8
8: ; preds = %7, %4
%9 = phi i32 [ 1, %7 ], [ 0, %4 ]
%10 = tail call i32 @exit(i32 %9)
unreachable
}