xunge/DecIR huggingface dataset:
int test_00(volatile char *x, unsigned int y) { return x[y]; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%eax
movsbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @test_00(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load volatile i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_00(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load volatile i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0xFFFF803C))) =
      (ui32IntFlags & 0x00070000) >> 16;
}


x86 assembly (clang, -O0):
<DESIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x70000,%ecx
sar    $0x10,%ecx
mov    -0x4(%rbp),%eax
add    $0xffff803c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntClear>:
shr    $0x10,%esi
and    $0x7,%esi
add    $0xffff803c,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DESIntClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = load i32, i32* %3
%9 = add i32 %8, -32708
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @DESIntClear(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = add i32 %0, -32708
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_fs();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ spin(char *);
void task_fs() {
  printf("Task FS begins.\n");
  init_fs();
  spin("FS");
}


x86 assembly (clang, -O0):
<task_fs>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <init_fs@plt>
lea    0xec3(%rip),%rdi
call   1050 <spin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_fs>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <init_fs@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1050 <spin@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Task FS begins.\0A\00"
@.str.1 = [3 x i8] c"FS\00"
define void @task_fs() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @init_fs()
%3 = call i32 @spin(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"FS\00"
@str = [16 x i8] c"Task FS begins.\00"
define void @task_fs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @init_fs()
%3 = tail call i32 @spin(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct vlc_h2_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ping();
struct vlc_h2_frame *retype(int /*<<< orphan*/, int);
struct vlc_h2_frame *unknown(void) {
  return retype(ping(), 200);
}


x86 assembly (clang, -O0):
<unknown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ping@plt>
mov    %eax,%edi
mov    $0xc8,%esi
call   1040 <retype@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown>:
push   %rax
xor    %eax,%eax
call   1030 <ping@plt>
mov    %eax,%edi
mov    $0xc8,%esi
pop    %rax
jmp    1040 <retype@plt>

LLVM IR (-O0):
%struct.vlc_h2_frame = type { i32 }
define %struct.vlc_h2_frame* @unknown() {
%1 = call i32 (...) @ping()
%2 = call %struct.vlc_h2_frame* @retype(i32 %1, i32 200)
ret %struct.vlc_h2_frame* %2
}

LLVM IR (-O2):
%struct.vlc_h2_frame = type { i32 }
define %struct.vlc_h2_frame* @unknown() {
%1 = tail call i32 (...) @ping()
%2 = tail call %struct.vlc_h2_frame* @retype(i32 %1, i32 200)
ret %struct.vlc_h2_frame* %2
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateDisable(void) {
  (*((volatile unsigned long *)(0x400FC010))) &= ~0x00000040;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffbf,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateDisable>:
andq   $0xffffffffffffffbf,0x400fc010
40 bf
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -65
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -65
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int stm_ui32_comp_desc(const void *p1, const void *p2) {
  const uint32_t pp1 = *(const uint32_t *)p1;
  const uint32_t pp2 = *(const uint32_t *)p2;
  if (pp1 > pp2)
    return -1;
  if (pp1 < pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<stm_ui32_comp_desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <stm_ui32_comp_desc+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <stm_ui32_comp_desc+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <stm_ui32_comp_desc+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <stm_ui32_comp_desc+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stm_ui32_comp_desc>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @stm_ui32_comp_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int nvram_commit();
int nvram_default();
int nvram_factory(void) {
  int stat = 1;
  stat = nvram_default();
  stat = nvram_commit();
  return stat;
}


x86 assembly (clang, -O0):
<nvram_factory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1040 <nvram_default@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nvram_commit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_factory>:
push   %rax
xor    %eax,%eax
call   1040 <nvram_default@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nvram_commit@plt>

LLVM IR (-O0):
define i32 @nvram_factory() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (...) @nvram_default()
store i32 %2, i32* %1
%3 = call i32 (...) @nvram_commit()
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @nvram_factory() {
%1 = tail call i32 (...) @nvram_default()
%2 = tail call i32 (...) @nvram_commit()
ret i32 %2
}
double distance(int p1[], int p2[]) {}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @distance(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret double undef
}
/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int open_without_mode(const char *s, int flags) { return open(s, flags, 0); }


x86 assembly (clang, -O0):
<open_without_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_without_mode>:
xor    %edx,%edx
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @open_without_mode(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __xstat(int, char const *, struct stat *);
int stat(const char *path, struct stat *buf) { return __xstat(1, path, buf); }


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

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <__xstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @__xstat(i32 1, i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @__xstat(i32 1, i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(int);
void *xalloc(int size) {
  void *p = malloc(size);
  if (p == NULL)
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
double kincaid(int syllables, int words, int sentences) {
  return 11.8 * (((double)syllables) / words) +
         0.39 * (((double)words) / sentences) - 15.59;
}


x86 assembly (clang, -O0):
<kincaid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm2
movsd  0xedf(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kincaid>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
cvtsi2sd %edx,%xmm2
divsd  %xmm2,%xmm1
mulsd  0xee4(%rip),%xmm1
mulsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kincaid(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 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = fmul double 3.900000e-01, %16
%18 = call double @llvm.fmuladd.f64(double 1.180000e+01, double %11, double %17)
%19 = fsub double %18, 1.559000e+01
ret double %19
}

LLVM IR (-O2):
define double @kincaid(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = sitofp i32 %2 to double
%8 = fdiv double %5, %7
%9 = fmul double %8, 3.900000e-01
%10 = tail call double @llvm.fmuladd.f64(double %6, double 1.180000e+01, double %9)
%11 = fadd double %10, -1.559000e+01
ret double %11
}
unsigned int CalculateDivisibilitySum(unsigned short num, unsigned short cnt) {
  unsigned int divisibility_sum = 0;
  divisibility_sum = num * (cnt * (cnt + 1)) / 2;
  return divisibility_sum;
}


x86 assembly (clang, -O0):
<CalculateDivisibilitySum>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
movzwl -0x4(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateDivisibilitySum>:
lea    0x1(%rsi),%eax
imul   %esi,%edi
imul   %edi,%eax
shr    %eax
ret

LLVM IR (-O0):
define i32 @CalculateDivisibilitySum(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
store i32 0, i32* %5
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %9, %12
%14 = mul nsw i32 %7, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @CalculateDivisibilitySum(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = add nuw nsw i32 %4, 1
%6 = mul nuw i32 %4, %3
%7 = mul i32 %6, %5
%8 = lshr i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int preWriteCleanup(char *path) {
  char keysPath[150];
  sprintf(keysPath, "%s/keys", path);
  return remove(keysPath);
}


x86 assembly (clang, -O0):
<preWriteCleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <remove@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preWriteCleanup>:
push   %rbx
sub    $0xa0,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s/keys\00"
define i32 @preWriteCleanup(i8* %0) {
%2 = alloca i8*
%3 = alloca [150 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [150 x i8], [150 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [150 x i8], [150 x i8]* %3, i64 0, i64 0
%8 = call i32 @remove(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s/keys\00"
define i32 @preWriteCleanup(i8* %0) {
%2 = alloca [150 x i8]
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @remove(i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ RES(int);
int /*<<< orphan*/ usleep(int);
void Reset_SSD1339(void) {
  RES(0);
  usleep(100000);
  RES(1);
}


x86 assembly (clang, -O0):
<Reset_SSD1339>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <RES@plt>
mov    $0x186a0,%edi
call   1040 <usleep@plt>
mov    $0x1,%edi
call   1030 <RES@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reset_SSD1339>:
push   %rax
xor    %edi,%edi
call   1030 <RES@plt>
mov    $0x186a0,%edi
call   1040 <usleep@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <RES@plt>

LLVM IR (-O0):
define void @Reset_SSD1339() {
%1 = call i32 @RES(i32 0)
%2 = call i32 @usleep(i32 100000)
%3 = call i32 @RES(i32 1)
ret void
}

LLVM IR (-O2):
define void @Reset_SSD1339() {
%1 = tail call i32 @RES(i32 0)
%2 = tail call i32 @usleep(i32 100000)
%3 = tail call i32 @RES(i32 1)
ret void
}
long extract_li(unsigned long insn, int *invalid) {
  if ((insn & 0x2000000) != 0)
    return (insn & 0x3fffffc) - 0x4000000;
  else
    return insn & 0x3fffffc;
}


x86 assembly (clang, -O0):
<extract_li>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x2000000,%rax
cmp    $0x0,%rax
je     1139 <extract_li+0x39>
mov    -0x10(%rbp),%rax
and    $0x3fffffc,%rax
sub    $0x4000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <extract_li+0x47>
mov    -0x10(%rbp),%rax
and    $0x3fffffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_li>:
mov    %edi,%ecx
and    $0x3fffffc,%ecx
lea    -0x4000000(%rcx),%rax
test   $0x2000000,%edi
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @extract_li(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = and i64 %6, 33554432
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = and i64 %10, 67108860
%12 = sub i64 %11, 67108864
store i64 %12, i64* %3
br label %16
13: ; preds = %2
%14 = load i64, i64* %4
%15 = and i64 %14, 67108860
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %9
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @extract_li(i64 %0, i32* nocapture readnone %1) {
%3 = and i64 %0, 33554432
%4 = icmp eq i64 %3, 0
%5 = and i64 %0, 67108860
%6 = or i64 %5, -67108864
%7 = select i1 %4, i64 %5, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ DISPLAY(char *, char const *);
void UNSUPPORTED(const char *pszMsg) { DISPLAY("UNSUPPORTED", pszMsg); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @UNSUPPORTED(i8* %0) {
%2 = tail call i32 @DISPLAY(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((no, noclone)) int k0(int A, int B) {
  int C = A & B;
  int D = A ^ B;
  return C | ~D;
}


x86 assembly (clang, -O0):
<k0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k0>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @k0(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
uint32_t get32le(FILE *f) {
  int a, b, c, d;
  a = getc(f);
  b = getc(f);
  c = getc(f);
  d = getc(f);
  return (a | (b << 8) | (c << 16) | (d << 24));
}


x86 assembly (clang, -O0):
<get32le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32le>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%ebp
or     %r14d,%ebp
shl    $0x10,%r15d
shl    $0x18,%eax
or     %r15d,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get32le(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i32 @getc(i32* %0)
%5 = tail call i32 @getc(i32* %0)
%6 = shl i32 %3, 8
%7 = or i32 %6, %2
%8 = shl i32 %4, 16
%9 = or i32 %7, %8
%10 = shl i32 %5, 24
%11 = or i32 %9, %10
ret i32 %11
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_timeval(const struct timeval *t) {
  printf("%ld", (long int)t->tv_sec * 1000 + (long int)t->tv_usec / 1000);
}


x86 assembly (clang, -O0):
<print_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,0x8(%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timeval>:
imul   $0x3e8,0x8(%rdi),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  (%rdi)
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x7,%rdx
add    %rdx,%rsi
add    %rcx,%rsi
lea    0xec3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [4 x i8] c"%ld\00"
define void @print_timeval(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 1000
%11 = add nsw i64 %6, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [4 x i8] c"%ld\00"
define void @print_timeval(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 1000
%8 = add nsw i64 %7, %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %8)
ret void
}
/* Variables and functions */
float sin(float);
float sinxy_squared(float x, float y) { return sin(x * y) * sin(x * y); }


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

x86 assembly (clang, -O2):
<sinxy_squared>:
push   %rax
mulss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
call   1030 <sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinxy_squared(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = call float @sin(float %7)
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = call float @sin(float %11)
%13 = fmul float %8, %12
ret float %13
}

LLVM IR (-O2):
define float @sinxy_squared(float %0, float %1) {
%3 = fmul float %0, %1
%4 = tail call float @sin(float %3)
%5 = tail call float @sin(float %3)
%6 = fmul float %4, %5
ret float %6
}
/* Variables and functions */
int no_of_bits(int);
int /*<<< orphan*/ printf(char *, int, int);
void test(int n) { printf("there are %d 1's in 0x%x", no_of_bits(n), n); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <no_of_bits@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1040 <no_of_bits@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"there are %d 1's in 0x%x\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @no_of_bits(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"there are %d 1's in 0x%x\00"
define void @test(i32 %0) {
%2 = tail call i32 @no_of_bits(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int msgget(key_t key, int msgflg) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<msgget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgget>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @msgget(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @msgget(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int qq_noavx() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @qq_noavx() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
int *main() {
  int *foo;
  foo = "Hello World!";
  while (*foo != 0) {
    write(1, foo, 4);
    foo = foo + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1154 <main+0x44>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1123 <main+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
lea    0xed6(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
lea    0xec4(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
pop    %rax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define noalias i32* @main() {
%1 = tail call i32 @write(i32 1, i32* bitcast ([13 x i8]* @.str to i32*), i32 4)
%2 = tail call i32 @write(i32 1, i32* bitcast (i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 4) to i32*), i32 4)
%3 = tail call i32 @write(i32 1, i32* bitcast (i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 8) to i32*), i32 4)
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_title(void) {
  printf("name\tpassword\tuser id\tgroup id\treal name\thome directory\tshell "
         "program\n");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"name\09password\09user id\09group id\09real name\09home directory\09shell program\0A\00"
define void @print_title() {
%1 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [70 x i8] c"name\09password\09user id\09group id\09real name\09home directory\09shell program\00"
define void @print_title() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *malloc(int);
void mallocFailedOrNotLeak() {
  int *p = malloc(12);
  if (p == 0)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<mallocFailedOrNotLeak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1136 <mallocFailedOrNotLeak+0x26>
jmp    113b <mallocFailedOrNotLeak+0x2b>
jmp    113b <mallocFailedOrNotLeak+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocFailedOrNotLeak>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @mallocFailedOrNotLeak() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @mallocFailedOrNotLeak() {
%1 = tail call i32* @malloc(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scrprintf(char *, int);
void attrsetfg(int fg) { scrprintf("\033[%dm", fg + 30); }


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

x86 assembly (clang, -O2):
<attrsetfg>:
lea    0x1e(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <scrprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
define void @attrsetfg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 30
%5 = call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define void @attrsetfg(i32 %0) {
%2 = add nsw i32 %0, 30
%3 = tail call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int checkOverlapping(int *set1, int *set2, int len1, int len2) {
  int i;
  for (i = 0; i < len2; i++) {
    if (set1[i] != set2[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkOverlapping>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1160 <checkOverlapping+0x60>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114d <checkOverlapping+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <checkOverlapping+0x67>
jmp    1152 <checkOverlapping+0x52>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1119 <checkOverlapping+0x19>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkOverlapping>:
mov    $0x1,%eax
test   %ecx,%ecx
jle    1121 <checkOverlapping+0x21>
mov    %ecx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <checkOverlapping+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <checkOverlapping+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @checkOverlapping(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %10
8: ; preds = %10
%9 = icmp eq i64 %17, %7
br i1 %9, label %18, label %10
10: ; preds = %6, %8
%11 = phi i64 [ 0, %6 ], [ %17, %8 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %13, %15
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %8, label %18
18: ; preds = %10, %8, %4
%19 = phi i32 [ 1, %4 ], [ 1, %8 ], [ 0, %10 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ print_func(char *);
int func(void) {
  print_func("local string");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"local string\00"
define i32 @func() {
%1 = call i32 @print_func(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"local string\00"
define i32 @func() {
%1 = tail call i32 @print_func(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void _write_byte(int p, unsigned char b) { printf("%d ", b); }


x86 assembly (clang, -O0):
<_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @_write_byte(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
__attribute__((always_)) void SCB_CleanDCache_by_Addr(uint32_t *addr,
                                                      int32_t dsize) {}


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

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

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

LLVM IR (-O2):
define void @SCB_CleanDCache_by_Addr(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xcf() {
  Assert_real((isgraph(207) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1040, ("isgraph should be 0 for 0xcf"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xcf\00"
define void @t_isgraph_0xcf() {
%1 = tail call i64 @isgraph(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *scan_configfile(char *);
char *get_printserver(void) { return (scan_configfile("printserver")); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"printserver\00"
define i8* @get_printserver() {
%1 = call i8* @scan_configfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"printserver\00"
define i8* @get_printserver() {
%1 = tail call i8* @scan_configfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
double r1(void *x) { return *(double *)(x + 32767); }


x86 assembly (clang, -O0):
<r1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x7fff(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r1>:
movsd  0x7fff(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32767
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r1(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32767
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_add_pd(__m128d A, __m128d B) { return _mm_add_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_add_pd>:
jmp    1030 <_mm_add_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_add_pd(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 @_mm_add_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_add_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void timer_timeout_int_en(uint32_t *timer) { timer[0x018 / 4] |= 1; }


x86 assembly (clang, -O0):
<timer_timeout_int_en>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
or     $0x1,%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_timeout_int_en>:
orb    $0x1,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @timer_timeout_int_en(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = or i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_Stat1401(int fh) { return ioctl(fh, _IO(0xce, 6)); }


x86 assembly (clang, -O0):
<CED_Stat1401>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x6,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_Stat1401>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x6,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_Stat1401(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 6)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_Stat1401(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 6)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}