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

/* Variables and functions */
int cli_help(struct cli_def *, char const *, char **, int);
int cli_int_help(struct cli_def *cli,
                 const char *command __attribute__((unused)),
                 char *argv[] __attribute__((unused)),
                 int argc __attribute__((unused))) {
  return cli_help(cli, command, argv, argc);
}


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

x86 assembly (clang, -O2):
<cli_int_help>:
jmp    1030 <cli_help@plt>

LLVM IR (-O0):
%struct.cli_def = type { i32 }
define i32 @cli_int_help(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %7
%12 = load i32, i32* %8
%13 = call i32 @cli_help(%struct.cli_def* %9, i8* %10, i8** %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
define i32 @cli_int_help(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 @cli_help(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct p7_timer_event {
  int dummy;
};
struct p7_minheap {
  int dummy;
};

/* Variables and functions */
scalar_t__ heap_extract_min(struct p7_minheap *);
struct p7_timer_event *timer_extract_earliest(struct p7_minheap *heap) {
  return (struct p7_timer_event *)heap_extract_min(heap);
}


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

x86 assembly (clang, -O2):
<timer_extract_earliest>:
jmp    1030 <heap_extract_min@plt>

LLVM IR (-O0):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define %struct.p7_timer_event* @timer_extract_earliest(%struct.p7_minheap* %0) {
%2 = alloca %struct.p7_minheap*
store %struct.p7_minheap* %0, %struct.p7_minheap** %2
%3 = load %struct.p7_minheap*, %struct.p7_minheap** %2
%4 = call i64 @heap_extract_min(%struct.p7_minheap* %3)
%5 = inttoptr i64 %4 to %struct.p7_timer_event*
ret %struct.p7_timer_event* %5
}

LLVM IR (-O2):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define %struct.p7_timer_event* @timer_extract_earliest(%struct.p7_minheap* %0) {
%2 = tail call i64 @heap_extract_min(%struct.p7_minheap* %0)
%3 = inttoptr i64 %2 to %struct.p7_timer_event*
ret %struct.p7_timer_event* %3
}
void omap_control_put(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @omap_control_put(%struct.device* nocapture %0) {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t __attribute__((const))
OF_BSWAP64_NONCONST(uint64_t i) {
  __asm__("bswap  %0" : "=r"(i) : "0"(i));
  return i;
}


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

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

LLVM IR (-O0):
define i8* @OF_BSWAP64_NONCONST(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @OF_BSWAP64_NONCONST(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
double sqrt(double);
double cog_math_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<cog_math_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <cog_math_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @cog_math_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
__attribute__((visibility("default"))) const float xfdimf(float x, float y) {
  float ret = x - y;
  if (ret < 0 || x == y)
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<xfdimf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     113f <xfdimf+0x3f>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1147 <xfdimf+0x47>
jp     1147 <xfdimf+0x47>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfdimf>:
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
cmpeqss %xmm1,%xmm0
xorps  %xmm1,%xmm1
maxss  %xmm2,%xmm1
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @xfdimf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fcmp oeq float %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %2
store float 0.000000e+00, float* %5
br label %16
16: ; preds = %15, %11
%17 = load float, float* %5
ret float %17
}

LLVM IR (-O2):
define float @xfdimf(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp olt float %3, 0.000000e+00
%5 = fcmp oeq float %0, %1
%6 = or i1 %5, %4
%7 = select i1 %6, float 0.000000e+00, float %3
ret float %7
}
int kern_write(unsigned long memaddr, void *buffaddr, unsigned int size) {
  return 0;
}


x86 assembly (clang, -O0):
<kern_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kern_write(i64 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int contains(long size, long *elements, long element) {
  long i;
  for (i = 0; i < size; i++) {
    if (element == elements[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115e <contains+0x5e>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    1148 <contains+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1165 <contains+0x65>
jmp    114d <contains+0x4d>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <contains+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %rdi,%rdi
jle    111f <contains+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %rdx,(%rsi,%rax,8)
je     1122 <contains+0x22>
add    $0x1,%rax
cmp    %rax,%rdi
jne    1110 <contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i64 %0, i64* nocapture %1, i64 %2) {
%4 = icmp sgt i64 %0, 0
br i1 %4, label %7, label %13
5: ; preds = %7
%6 = icmp eq i64 %12, %0
br i1 %6, label %13, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %12, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, %2
%12 = add nuw nsw i64 %8, 1
br i1 %11, label %13, label %5
13: ; preds = %7, %5, %3
%14 = phi i32 [ 0, %3 ], [ 0, %5 ], [ 1, %7 ]
ret i32 %14
}
/* Variables and functions */
int multiples_under(int, int);
int solve(int p) {
  return multiples_under(p, 3) + multiples_under(p, 5) - multiples_under(p, 15);
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <multiples_under@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <multiples_under@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1030 <multiples_under@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
call   1030 <multiples_under@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <multiples_under@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <multiples_under@plt>
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solve(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @multiples_under(i32 %3, i32 3)
%5 = load i32, i32* %2
%6 = call i32 @multiples_under(i32 %5, i32 5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @multiples_under(i32 %8, i32 15)
%10 = sub nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @solve(i32 %0) {
%2 = tail call i32 @multiples_under(i32 %0, i32 3)
%3 = tail call i32 @multiples_under(i32 %0, i32 5)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @multiples_under(i32 %0, i32 15)
%6 = sub i32 %4, %5
ret i32 %6
}
double eval_sub(double x, double y) { return x - y; }


x86 assembly (clang, -O0):
<eval_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_sub>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @eval_sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
void DMTimerReset(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= (0x00000001u);
  while ((0x00000001u) ==
         ((*((volatile unsigned int *)(baseAdd + (0x10)))) & (0x00000001u)))
    ;
}


x86 assembly (clang, -O0):
<DMTimerReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1135 <DMTimerReset+0x35>
jmp    1116 <DMTimerReset+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerReset>:
add    $0x10,%edi
orl    $0x1,(%rdi)
cs nopw 0x0(%rax,%rax,1)
mov    (%rdi),%eax
test   $0x1,%al
jne    1110 <DMTimerReset+0x10>
ret

LLVM IR (-O0):
define void @DMTimerReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %17, %1
%10 = load i32, i32* %2
%11 = add i32 %10, 16
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 1
%16 = icmp eq i32 1, %15
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @DMTimerReset(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
br label %7
7: ; preds = %7, %1
%8 = load volatile i32, i32* %4
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: showmount [-a | -d] [-e3] [host]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: showmount [-a | -d] [-e3] [host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: showmount [-a | -d] [-e3] [host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlyca(unsigned char a, unsigned char b) {
  unsigned char sum = a + b;
  if (sum < a)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlyca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1148 <pluscconlyca+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlyca>:
add    %sil,%dil
jb     1116 <pluscconlyca+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlyca(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlyca(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %0, -1
%4 = icmp ult i8 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int fsHashKey(int nHash, int iPg) { return (iPg % nHash); }


x86 assembly (clang, -O0):
<fsHashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsHashKey>:
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fsHashKey(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 = load i32, i32* %3
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fsHashKey(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
ret i32 %3
}
int main() {
  int i, chunk;
  float c[50];
  chunk = 5;
#pragma omp parallel for shared(c, chunk) schedule(dynamic, chunk)
  for (i = 0; i < 50; i++)
    c[i] = i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1147 <main+0x47>
cvtsi2ssl -0x8(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0xe0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <main+0x1d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x float]
store i32 0, i32* %1
store i32 5, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 %12
store float %10, float* %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ScaleAddRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
double *memory_alloc(long, char *, int);
void *adt_copy_double(const void *data) {
  double *data2;
  ((data2) = memory_alloc((long)sizeof *(data2),
                          "/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                          "Jianlong-Peng/myADT/refs/heads/master/src/mtools.c",
                          35));
  memcpy(data2, (double *)data, sizeof(double));
  return (void *)data2;
}


x86 assembly (clang, -O0):
<adt_copy_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
lea    0xec8(%rip),%rsi
mov    $0x23,%edx
call   1030 <memory_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adt_copy_double>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
mov    $0x8,%edi
mov    $0x23,%edx
call   1030 <memory_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Jianlong-Peng/myADT/refs/heads/master/src/mtools.c\00"
define i8* @adt_copy_double(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = call double* @memory_alloc(i64 8, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 35)
store double* %4, double** %3
%5 = load double*, double** %3
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to double*
%8 = call i32 @memcpy(double* %5, double* %7, i32 8)
%9 = load double*, double** %3
%10 = bitcast double* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Jianlong-Peng/myADT/refs/heads/master/src/mtools.c\00"
define i8* @adt_copy_double(i8* %0) {
%2 = tail call double* @memory_alloc(i64 8, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 35)
%3 = bitcast i8* %0 to double*
%4 = tail call i32 @memcpy(double* %2, double* %3, i32 8)
%5 = bitcast double* %2 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(
      stderr,
      "Need complex numbers, activate with '-DUSE_COMPLEX' (options.inc) \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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"Need complex numbers, activate with '-DUSE_COMPLEX' (options.inc) \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 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"Need complex numbers, activate with '-DUSE_COMPLEX' (options.inc) \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int exp(double);
double M(double r, double r0, double alpha) {
  return exp(-2. * alpha * (r - r0)) - 2. * exp(-alpha * (r - r0));
}


x86 assembly (clang, -O0):
<M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M>:
sub    $0x28,%rsp
movapd %xmm2,0x10(%rsp)
movapd %xmm0,%xmm3
movsd  0xeda(%rip),%xmm0
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rsp)
mulsd  %xmm3,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xeb9(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @M(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double -2.000000e+00, %7
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = fmul double %8, %11
%13 = call i32 @exp(double %12)
%14 = sitofp i32 %13 to double
%15 = load double, double* %6
%16 = fneg double %15
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fsub double %17, %18
%20 = fmul double %16, %19
%21 = call i32 @exp(double %20)
%22 = sitofp i32 %21 to double
%23 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %22, double %14)
ret double %23
}

LLVM IR (-O2):
define double @M(double %0, double %1, double %2) {
%4 = fmul double %2, -2.000000e+00
%5 = fsub double %0, %1
%6 = fmul double %5, %4
%7 = tail call i32 @exp(double %6)
%8 = sitofp i32 %7 to double
%9 = fneg double %2
%10 = fmul double %5, %9
%11 = tail call i32 @exp(double %10)
%12 = sitofp i32 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double -2.000000e+00, double %8)
ret double %13
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
char *stolower(char *str) {
  int k, len;
  char *p;
  p = str;
  len = strlen(str);
  for (k = 0; k < len; k++, p++)
    *p = tolower(*p);
  return str;
}


x86 assembly (clang, -O0):
<stolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1181 <stolower+0x61>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1147 <stolower+0x27>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stolower>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <stolower+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1140 <stolower+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @stolower(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %0, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = load i8, i8* %5
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %5
%9 = add nuw nsw i32 %6, 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = icmp eq i32 %9, %2
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
void wbinvd(void) { __asm__ __volatile__("wbinvd"); }


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

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

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

LLVM IR (-O2):
define void @wbinvd() {
tail call void asm sideeffect "wbinvd", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int wiringPiSPISetupMode(int, int, int /*<<< orphan*/);
int wiringPiSPISetup(int channel, int speed) {
  return wiringPiSPISetupMode(channel, speed, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @wiringPiSPISetup(i32 %0, i32 %1) {
%3 = tail call i32 @wiringPiSPISetupMode(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ work(int, int);
void wrong4(int n) {
#pragma omp parallel default(shared)
  {
    int i;
#pragma omp for
    for (i = 0; i < n; i++) {
      work(i, 0);
#pragma omp barrier
      work(i, 1);
    }
  }
}


x86 assembly (clang, -O0):
<wrong4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1153 <wrong4+0x43>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <work@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <work@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wrong4+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrong4>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    113c <wrong4+0x2c>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <work@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <work@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <wrong4+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @wrong4(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @work(i32 %4, i32 0)
%6 = tail call i32 @work(i32 %4, i32 1)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialDataBegin();
int /*<<< orphan*/ SerialDataEnd();
int /*<<< orphan*/ SerialSendBytes(unsigned long *, unsigned long);
void SerialSendData(unsigned long *data, unsigned long len) {
  SerialDataBegin();
  SerialSendBytes(data, len);
  SerialDataEnd();
}


x86 assembly (clang, -O0):
<SerialSendData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <SerialDataBegin@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <SerialSendBytes@plt>
mov    $0x0,%al
call   1030 <SerialDataEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialSendData>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <SerialDataBegin@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <SerialSendBytes@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <SerialDataEnd@plt>

LLVM IR (-O0):
define void @SerialSendData(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = call i32 (...) @SerialDataBegin()
%6 = load i64*, i64** %3
%7 = load i64, i64* %4
%8 = call i32 @SerialSendBytes(i64* %6, i64 %7)
%9 = call i32 (...) @SerialDataEnd()
ret void
}

LLVM IR (-O2):
define void @SerialSendData(i64* %0, i64 %1) {
%3 = tail call i32 (...) @SerialDataBegin()
%4 = tail call i32 @SerialSendBytes(i64* %0, i64 %1)
%5 = tail call i32 (...) @SerialDataEnd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basic_test();
int /*<<< orphan*/ random_test();
int main(void) {
  basic_test();
  random_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1040 <random_test@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @basic_test()
%2 = call i32 (...) @random_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_test()
%2 = tail call i32 (...) @random_test()
ret i32 0
}
/* Variables and functions */
int INT_MIN;
int mul5div8(int x) {
  x = (x << 2) + x;
  int sign = x & INT_MIN;
  sign && (x = x + (1 << 3) - 1);
  int result = x >> 3;
  return result;
}


x86 assembly (clang, -O0):
<mul5div8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecb(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1146 <mul5div8+0x46>
mov    -0x4(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul5div8>:
lea    (%rdi,%rdi,4),%ecx
mov    0x2ede(%rip),%rax
test   %ecx,(%rax)
lea    0x7(%rdi,%rdi,4),%eax
cmove  %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @mul5div8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 2
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* @INT_MIN
%11 = and i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 8
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %2
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %14, %1
%20 = phi i1 [ false, %1 ], [ %18, %14 ]
%21 = zext i1 %20 to i32
%22 = load i32, i32* %2
%23 = ashr i32 %22, 3
store i32 %23, i32* %4
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @mul5div8(i32 %0) {
%2 = mul i32 %0, 5
%3 = load i32, i32* @INT_MIN
%4 = and i32 %3, %2
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %2, 7
%7 = select i1 %5, i32 %2, i32 %6
%8 = ashr i32 %7, 3
ret i32 %8
}
void dummy_sysquotas_linux(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_sysquotas_linux() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("\tHola, mi nombre es Humberto :)\n");
  } else {
    printf("\tHola, mi nombre es %s :)\n", argv[1]);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     1143 <main+0x33>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\09Hola, mi nombre es Humberto :)\0A\00"
@.str.1 = [27 x i8] c"\09Hola, mi nombre es %s :)\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"\09Hola, mi nombre es %s :)\0A\00"
@str = [32 x i8] c"\09Hola, mi nombre es Humberto :)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printCash(int);
int cashOut(int value) { printCash(value); }


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

x86 assembly (clang, -O2):
<cashOut>:
jmp    1030 <printCash@plt>

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

LLVM IR (-O2):
define i32 @cashOut(i32 %0) {
%2 = tail call i32 @printCash(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int f(int a) {
  a = a + 1;
  a = a + a;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_udf(unsigned char *ptr, int n_len) {
  int n_loop = 0;
  if (n_len > 0) {
    for (n_loop = 0; n_loop < n_len; n_loop++) {
      printf("%c", (unsigned char)*(ptr + n_loop));
    }
  }
}


x86 assembly (clang, -O0):
<print_udf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116e <print_udf+0x5e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <print_udf+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeae(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <print_udf+0x27>
jmp    116e <print_udf+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_udf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_udf+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_udf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_udf(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int strtok_r_delimiter(char c, const char *delim) {
  while (delim && *delim) {
    if (*delim == c)
      return 1;
    delim++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strtok_r_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     112e <strtok_r_delimiter+0x2e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <strtok_r_delimiter+0x3e>
jmp    116e <strtok_r_delimiter+0x6e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    115d <strtok_r_delimiter+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1175 <strtok_r_delimiter+0x75>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strtok_r_delimiter+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtok_r_delimiter>:
xor    %eax,%eax
test   %rsi,%rsi
je     1130 <strtok_r_delimiter+0x30>
mov    (%rsi),%cl
test   %cl,%cl
je     1130 <strtok_r_delimiter+0x30>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %dil,%cl
je     1131 <strtok_r_delimiter+0x31>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strtok_r_delimiter+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strtok_r_delimiter(i8 signext %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %10
7: ; preds = %10
%8 = load i8, i8* %14
%9 = icmp eq i8 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %4, %7
%11 = phi i8 [ %8, %7 ], [ %5, %4 ]
%12 = phi i8* [ %14, %7 ], [ %1, %4 ]
%13 = icmp eq i8 %11, %0
%14 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %13, label %15, label %7
15: ; preds = %7, %10, %4, %2
%16 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_movelh_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_movelh_ps(__m128 A, __m128 B) { return _mm_movelh_ps(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_movelh_ps>:
jmp    1030 <_mm_movelh_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_movelh_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_movelh_ps(i32 %0, i32 %1)
ret i32 %3
}