xunge/DecIR huggingface dataset:
/* Type definitions */
struct iommu_group {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_group_for_each_dev(struct iommu_group *group, void *data,
                             int (*fn)(struct device *, void *)) {
  return -ENODEV;
}


x86 assembly (clang, -O0):
<iommu_group_for_each_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iommu_group_for_each_dev>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
%struct.device = type opaque
@ENODEV = global i32 0
define i32 @iommu_group_for_each_dev(%struct.iommu_group* %0, i8* %1, i32 (%struct.device*, i8*)* %2) {
%4 = alloca %struct.iommu_group*
%5 = alloca i8*
%6 = alloca i32 (%struct.device*, i8*)*
store %struct.iommu_group* %0, %struct.iommu_group** %4
store i8* %1, i8** %5
store i32 (%struct.device*, i8*)* %2, i32 (%struct.device*, i8*)** %6
%7 = load i32, i32* @ENODEV
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
%struct.device = type opaque
@ENODEV = global i32 0
define i32 @iommu_group_for_each_dev(%struct.iommu_group* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.device*, i8*)* nocapture readnone %2) {
%4 = load i32, i32* @ENODEV
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void get_shell(int sig) { system("sh"); }


x86 assembly (clang, -O0):
<get_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"sh\00"
define void @get_shell(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sh\00"
define void @get_shell(i32 %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveEnable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase - 0x40020800 + 0x40020000 +
                                0x00000020))) |= 0x00000020;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
sub    $0x40020800,%rax
mov    0x40020020(%rax),%rcx
or     $0x20,%rcx
mov    %rcx,0x40020020(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
orq    $0x20,-0x7e0(%rbx)
20
movq   $0x1,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CSlaveEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CSlaveBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = sub i64 %6, 1073874944
%8 = add i64 %7, 1073872896
%9 = add i64 %8, 32
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 32
store volatile i64 %12, i64* %10
%13 = load i64, i64* %2
%14 = add i64 %13, 4
%15 = inttoptr i64 %14 to i64*
store volatile i64 1, i64* %15
ret void
}

LLVM IR (-O2):
define void @I2CSlaveEnable(i64 %0) {
%2 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, -2016
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 32
store volatile i64 %7, i64* %5
%8 = add i64 %0, 4
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int);
void f_variadic_inp_unv(void) {
  int t = 5;
  int v;
  int *tp = &t;
  doStuff_variadic(tp, v);
}


x86 assembly (clang, -O0):
<f_variadic_inp_unv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <doStuff_variadic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_variadic_inp_unv>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f_variadic_inp_unv() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @doStuff_variadic(i32* %1, i32 undef)
ret void
}
void reportUsage() {}


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

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

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

LLVM IR (-O2):
define void @reportUsage() {
ret void
}
int somedllfunc() { return 42; }


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

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

LLVM IR (-O0):
define i32 @somedllfunc() {
ret i32 42
}

LLVM IR (-O2):
define i32 @somedllfunc() {
ret i32 42
}
void foo600(int p) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @foo600(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo600(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t align_down(size_t x, size_t align) {
  assert(0 == (align & (align - 1)));
  return x - (x & (align - 1));
}


x86 assembly (clang, -O0):
<align_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
and    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
and    %rdx,%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_down>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    -0x1(%rsi),%rax
xor    %edi,%edi
test   %rax,%rsi
sete   %dil
call   1030 <assert@plt>
neg    %rbx
and    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @align_down(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = and i64 %5, %7
%9 = icmp eq i64 0, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = sub i64 %14, 1
%16 = and i64 %13, %15
%17 = sub i64 %12, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @align_down(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.ctpop.i64(i64 %1)
%4 = icmp ult i64 %3, 2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = sub i64 0, %1
%8 = and i64 %7, %0
ret i64 %8
}
struct FILE *main() {
  return (struct FILE *)0;
}


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

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

LLVM IR (-O0):
%struct.FILE = type opaque
define %struct.FILE* @main() {
ret %struct.FILE* null
}

LLVM IR (-O2):
%struct.FILE = type opaque
define noalias %struct.FILE* @main() {
ret %struct.FILE* null
}
int test_imm_ABuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ABuint64_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, 171
%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_ABuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 171
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned xrop3_179_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_179_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_179_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
double cos(double);
double sin(double);
void glmGenerateRotationMatrix2dRad(double m[4], double angle) {
  m[0] = cos(angle);
  m[2] = -sin(angle);
  m[1] = sin(angle);
  m[3] = cos(angle);
}


x86 assembly (clang, -O0):
<glmGenerateRotationMatrix2dRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateRotationMatrix2dRad>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
xorps  0xeb7(%rip),%xmm0
movlps %xmm0,0x10(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x18(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @glmGenerateRotationMatrix2dRad(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @cos(double %5)
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 0
store double %6, double* %8
%9 = load double, double* %4
%10 = call double @sin(double %9)
%11 = fneg double %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 2
store double %11, double* %13
%14 = load double, double* %4
%15 = call double @sin(double %14)
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
%18 = load double, double* %4
%19 = call double @cos(double %18)
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 3
store double %19, double* %21
ret void
}

LLVM IR (-O2):
define void @glmGenerateRotationMatrix2dRad(double* nocapture writeonly %0, double %1) {
%3 = tail call double @cos(double %1)
store double %3, double* %0
%4 = tail call double @sin(double %1)
%5 = fneg double %4
%6 = getelementptr inbounds double, double* %0, i64 2
store double %5, double* %6
%7 = tail call double @sin(double %1)
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = tail call double @cos(double %1)
%10 = getelementptr inbounds double, double* %0, i64 3
store double %9, double* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  char test[15] = "test";
  puts(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0xf(%rsp)
movq   $0x74736574,0x8(%rsp)
73 74
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.test = [15 x i8] c"test\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [15 x i8] c"test\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void recover(int i, void *v) { endwin(); }


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

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

LLVM IR (-O0):
define void @recover(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @recover(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void die(const char *message) {
  syslog(LOG_ERR, "%s (fatal error)", message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [17 x i8] c"%s (fatal error)\00"
define void @die(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fgetxattr(int fd, const char *name, void *value, size_t size) { return 0; }


x86 assembly (clang, -O0):
<fgetxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fgetxattr(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @fgetxattr(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i32 0
}
unsigned int I2CMasterErr(unsigned int baseAdd) {
  unsigned int err;
  err = (*((volatile unsigned int *)(baseAdd + (0x24)))) &
        ((0x00000001u) | (0x00000080u) | (0x00000002u) | (0x00000800u));
  return err;
}


x86 assembly (clang, -O0):
<I2CMasterErr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x883,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterErr>:
add    $0x24,%edi
mov    $0x883,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterErr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 36
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 2179
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @I2CMasterErr(i32 %0) {
%2 = add i32 %0, 36
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2179
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ PF_LOCAL;
int /*<<< orphan*/ SOCK_STREAM;
int _unix_connect(int, char const *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int unix_connect_t(const char *sockfile, int blocking) {
  int sock = socket(PF_LOCAL, SOCK_STREAM, 0);
  if (sock < 0) {
    return -1;
  }
  return _unix_connect(sock, sockfile, blocking);
}


x86 assembly (clang, -O0):
<unix_connect_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1161 <unix_connect_t+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <unix_connect_t+0x53>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_unix_connect@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_connect_t>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
test   %eax,%eax
js     1157 <unix_connect_t+0x37>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_unix_connect@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PF_LOCAL = global i32 0
@SOCK_STREAM = global i32 0
define i32 @unix_connect_t(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* @PF_LOCAL
%8 = load i32, i32* @SOCK_STREAM
%9 = call i32 @socket(i32 %7, i32 %8, i32 0)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 @_unix_connect(i32 %14, i8* %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@PF_LOCAL = global i32 0
@SOCK_STREAM = global i32 0
define i32 @unix_connect_t(i8* %0, i32 %1) {
%3 = load i32, i32* @PF_LOCAL
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i32 @socket(i32 %3, i32 %4, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @_unix_connect(i32 %5, i8* %0, i32 %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ alpha(char);
scalar_t__ num(char);
int alphanum(char c) { return alpha(c) || num(c); }


x86 assembly (clang, -O0):
<alphanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <alphanum+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <num@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphanum>:
push   %rbx
mov    %edi,%ebx
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <alphanum+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <num@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphanum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @alpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @num(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @alphanum(i8 signext %0) {
%2 = tail call i64 @alpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @num(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_augeas_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("augeas", " (*comment*)"),
                            "comment", "(*comment*)");
}


x86 assembly (clang, -O0):
<test_augeas_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed4(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_augeas_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed9(%rip),%rsi
lea    0xec6(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"augeas\00"
@.str.1 = [13 x i8] c" (*comment*)\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"(*comment*)\00"
define void @test_augeas_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"augeas\00"
@.str.1 = [13 x i8] c" (*comment*)\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"(*comment*)\00"
define void @test_augeas_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_TENBIT;
int ioctl(int, int /*<<< orphan*/, int);
int I2C_enable10BitAddressing(int i2c_fd) {
  int ret;
  ret = ioctl(i2c_fd, I2C_TENBIT, 1);
  if (ret < 0)
    return ret;
  return 0;
}


x86 assembly (clang, -O0):
<I2C_enable10BitAddressing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1149 <I2C_enable10BitAddressing+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <I2C_enable10BitAddressing+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_enable10BitAddressing>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@I2C_TENBIT = global i32 0
define i32 @I2C_enable10BitAddressing(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* @I2C_TENBIT
%7 = call i32 @ioctl(i32 %5, i32 %6, i32 1)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@I2C_TENBIT = global i32 0
define i32 @I2C_enable10BitAddressing(i32 %0) {
%2 = load i32, i32* @I2C_TENBIT
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 1)
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  fun(1);
  printf("RETURNED\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"RETURNED\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fun(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void parray(int *array, int b, char *name) {
  for (int j = 0; j < b; ++j) {
    printf("%s[ %d ] = %d\n", name, j, array[j]);
  }
}


x86 assembly (clang, -O0):
<parray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <parray+0x52>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <parray+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parray>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    114a <parray+0x3a>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r12
nop
mov    (%r15,%rbx,4),%ecx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <parray+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s[ %d ] = %d\0A\00"
define void @parray(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s[ %d ] = %d\0A\00"
define void @parray(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %14, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = trunc i64 %9 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %12, i32 %11)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void secondone() { printf("Hello again\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello again\00"
define void @secondone() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void _sys_hash(int key, char *string) {
  for (int i = 0; i < strlen(string); i++) {
    string[i] ^= key;
  }
}


x86 assembly (clang, -O0):
<_sys_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1164 <_sys_hash+0x54>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <_sys_hash+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_hash>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1147 <_sys_hash+0x37>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %r14b,(%rbx,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1130 <_sys_hash+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @_sys_hash(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i32, i32* %3
%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
%18 = sext i8 %17 to i32
%19 = xor i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
br label %21
21: ; preds = %11
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_sys_hash(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = trunc i32 %0 to i8
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = xor i8 %11, %6
store i8 %12, i8* %10
%13 = add nuw nsw i64 %9, 1
%14 = tail call i32 @strlen(i8* %1)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %7
}
void Counter_4_RestoreConfig(void) {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @fakeArCleanup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_thread_fence;
typedef int /*<<< orphan*/ atomic_signal_fence;

/* Variables and functions */
int /*<<< orphan*/ memory_order_acq_rel;
int /*<<< orphan*/ memory_order_acquire;
int /*<<< orphan*/ memory_order_consume;
int /*<<< orphan*/ memory_order_relaxed;
int /*<<< orphan*/ memory_order_release;
int /*<<< orphan*/ memory_order_seq_cst;
int main() {
  (atomic_thread_fence)(memory_order_relaxed);
  (atomic_thread_fence)(memory_order_consume);
  (atomic_thread_fence)(memory_order_acquire);
  (atomic_thread_fence)(memory_order_release);
  (atomic_thread_fence)(memory_order_acq_rel);
  (atomic_thread_fence)(memory_order_seq_cst);
  (atomic_signal_fence)(memory_order_relaxed);
  (atomic_signal_fence)(memory_order_consume);
  (atomic_signal_fence)(memory_order_acquire);
  (atomic_signal_fence)(memory_order_release);
  (atomic_signal_fence)(memory_order_acq_rel);
  (atomic_signal_fence)(memory_order_seq_cst);
  return 0;
}


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

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

LLVM IR (-O0):
@memory_order_relaxed = global i32 0
@memory_order_consume = global i32 0
@memory_order_acquire = global i32 0
@memory_order_release = global i32 0
@memory_order_acq_rel = global i32 0
@memory_order_seq_cst = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @memory_order_relaxed
%3 = load i32, i32* @memory_order_consume
%4 = load i32, i32* @memory_order_acquire
%5 = load i32, i32* @memory_order_release
%6 = load i32, i32* @memory_order_acq_rel
%7 = load i32, i32* @memory_order_seq_cst
%8 = load i32, i32* @memory_order_relaxed
%9 = load i32, i32* @memory_order_consume
%10 = load i32, i32* @memory_order_acquire
%11 = load i32, i32* @memory_order_release
%12 = load i32, i32* @memory_order_acq_rel
%13 = load i32, i32* @memory_order_seq_cst
ret i32 0
}

LLVM IR (-O2):
@memory_order_relaxed = global i32 0
@memory_order_consume = global i32 0
@memory_order_acquire = global i32 0
@memory_order_release = global i32 0
@memory_order_acq_rel = global i32 0
@memory_order_seq_cst = global i32 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *GetLastErrorString();
int /*<<< orphan*/ NET_SetErrorString(char *, char const *, ...);
void NET_SetErrorStringFromLastError(const char *function) {
  const char *errorstring = GetLastErrorString();
  if (function) {
    NET_SetErrorString("%s: %s", function, errorstring);
  } else {
    NET_SetErrorString("%s", errorstring);
  }
}


x86 assembly (clang, -O0):
<NET_SetErrorStringFromLastError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GetLastErrorString@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <NET_SetErrorStringFromLastError+0x3d>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <NET_SetErrorString@plt>
jmp    116f <NET_SetErrorStringFromLastError+0x4f>
mov    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <NET_SetErrorString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NET_SetErrorStringFromLastError>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GetLastErrorString@plt>
test   %rbx,%rbx
je     1145 <NET_SetErrorStringFromLastError+0x25>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <NET_SetErrorString@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <NET_SetErrorString@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@.str.1 = [3 x i8] c"%s\00"
define void @NET_SetErrorStringFromLastError(i8* %0) {
%2 = tail call i8* (...) @GetLastErrorString()
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) @NET_SetErrorString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) @NET_SetErrorString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
int xmlUCSIsSupplementalMathematicalOperators(int code) {
  return (((code >= 0x2A00) && (code <= 0x2AFF)));
}


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

x86 assembly (clang, -O2):
<xmlUCSIsSupplementalMathematicalOperators>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x2a00,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsSupplementalMathematicalOperators(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 10752
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
DispenserManager_check_dispenser_is_dirty(int total_day_diff) {
  perror(
      "[DispenserManager] - Still not calculating if a dispenser is dirty\n");
}


x86 assembly (clang, -O0):
<DispenserManager_check_dispenser_is_dirty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [68 x i8] c"[DispenserManager] - Still not calculating if a dispenser is dirty\0A\00"
define i32 @DispenserManager_check_dispenser_is_dirty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @perror(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [68 x i8] c"[DispenserManager] - Still not calculating if a dispenser is dirty\0A\00"
define i32 @DispenserManager_check_dispenser_is_dirty(i32 %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ IOwrite_to_LM1972_LOADSHIFT_L();
void IOwrite_to_LM1972_LOADSHIFT_pwrsave() { IOwrite_to_LM1972_LOADSHIFT_L(); }


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

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

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

LLVM IR (-O2):
define void @IOwrite_to_LM1972_LOADSHIFT_pwrsave() {
%1 = tail call i32 (...) @IOwrite_to_LM1972_LOADSHIFT_L()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "kill"
        " -s signal_name pid...\n       "
        "kill"
        " -l [exit_status]\n  -l	Write all signal values supported\n  "
        "-s	Specify the signal to send\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [135 x i8] c"Usage: kill -s signal_name pid...\0A kill -l [exit_status]\0A -l\09Write all signal values supported\0A -s\09Specify the signal to send\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [135 x i8] c"Usage: kill -s signal_name pid...\0A kill -l [exit_status]\0A -l\09Write all signal values supported\0A -s\09Specify the signal to send\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
void basename(char *name, char *path) {
  char *slash = strrchr(path, '/');
  if (slash)
    strcpy(name, slash + 1);
  else
    strcpy(name, path);
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1163 <basename+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
jmp    1170 <basename+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1148 <basename+0x28>
add    $0x1,%rax
mov    %r14,%rdi
mov    %rax,%rsi
jmp    114e <basename+0x2e>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @basename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i32 @strcpy(i8* %11, i8* %13)
br label %19
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %16, i8* %17)
br label %19
19: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
define void @basename(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 47)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @strcpy(i8* %0, i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %10
10: ; preds = %8, %5
ret void
}
int test_07(const char *s1) {
  return __builtin_strncmp(__builtin_assume_aligned(s1, 4), "abcdabcd", 8);
}


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

x86 assembly (clang, -O2):
<test_07>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"abcdabcd\00"
define i32 @test_07(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8)
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"abcdabcd\00"
define i32 @test_07(i8* %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8)
ret i32 %2
}