xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void util_warn_(const char *file, int line, const char *func, const char *msg) {
  fprintf(stderr, "%s, %i (%s):\n%s\n", file, line, func, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<util_warn_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<util_warn_>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s, %i (%s):\0A%s\0A\00"
define void @util_warn_(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s, %i (%s):\0A%s\0A\00"
define void @util_warn_(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_set_copy(uint8_t *p_adts) { p_adts[3] |= 0x20; }


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

x86 assembly (clang, -O2):
<adts_set_copy>:
orb    $0x20,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @adts_set_copy(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = or i32 %3, 32
store i32 %4, i32* %2
ret void
}
int gcd(int number1, int number2) {
  while (number2 > 0) {
    int tmp = number2;
    number2 = number1 % number2;
    number1 = tmp;
  }
  return number1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ChebKernel_M2L(int, void *, int const *, int const, void **,
                                  void *);
void cheb_m2l_full(int level, void *targetCell, const int *neighborPosition,
                   const int size, void **sourceCell, void *userData) {
  ChebKernel_M2L(level, targetCell, neighborPosition, size, sourceCell,
                 userData);
}


x86 assembly (clang, -O0):
<cheb_m2l_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <ChebKernel_M2L@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheb_m2l_full>:
jmp    1030 <ChebKernel_M2L@plt>

LLVM IR (-O0):
define void @cheb_m2l_full(i32 %0, i8* %1, i32* %2, i32 %3, i8** %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i8*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i8**, i8*** %11
%18 = load i8*, i8** %12
%19 = call i32 @ChebKernel_M2L(i32 %13, i8* %14, i32* %15, i32 %16, i8** %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @cheb_m2l_full(i32 %0, i8* %1, i32* %2, i32 %3, i8** %4, i8* %5) {
%7 = tail call i32 @ChebKernel_M2L(i32 %0, i8* %1, i32* %2, i32 %3, i8** %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fisher(int, int, int, int, double *, double *, double *);
double fisher2(int a, int b, int c, int d) {
  double p_left = 0;
  double p_right = 0;
  double p_twotail = 0;
  fisher(a, b, c, d, &p_left, &p_right, &p_twotail);
  return p_twotail;
}


x86 assembly (clang, -O0):
<fisher2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <fisher@plt>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisher2>:
sub    $0x28,%rsp
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
lea    0x20(%rsp),%r8
lea    0x18(%rsp),%r9
call   1030 <fisher@plt>
movsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @fisher2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @fisher(i32 %12, i32 %13, i32 %14, i32 %15, double* %9, double* %10, double* %11)
%17 = load double, double* %11
ret double %17
}

LLVM IR (-O2):
define double @fisher2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%9 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%10 = bitcast double* %7 to i8*
store double 0.000000e+00, double* %7
%11 = call i32 @fisher(i32 %0, i32 %1, i32 %2, i32 %3, double* %5, double* %6, double* %7)
%12 = load double, double* %7
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x21() {
  Assert_real((isupper(33) == 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_isupper.c",
              170, ("isupper should be 0 for !"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x21>:
push   %rax
mov    $0x21,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xaa,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for !\00"
define void @t_isupper_0x21() {
%1 = call i64 @isupper(i32 33)
%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 170, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for !\00"
define void @t_isupper_0x21() {
%1 = tail call i64 @isupper(i32 33)
%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 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage(void) {
  (void)puts("Usage: fizzbuzz <inclusive positive limit>");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: fizzbuzz <inclusive positive limit>\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: fizzbuzz <inclusive positive limit>\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
unsigned long HibernateLowBatGet(void) {
  return ((*((volatile unsigned long *)(0x400FC010))) & 0xA0);
}


x86 assembly (clang, -O0):
<HibernateLowBatGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xa0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatGet>:
mov    0x400fc010,%rax
40
and    $0xa0,%eax
ret

LLVM IR (-O0):
define i64 @HibernateLowBatGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 160
ret i64 %2
}

LLVM IR (-O2):
define i64 @HibernateLowBatGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 160
ret i64 %2
}
indreg0reg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
ja     1133 <indreg0reg1+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <indreg0reg1+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0reg1>:
xor    %eax,%eax
cmp    %esi,(%r8)
setbe  %al
ret

LLVM IR (-O0):
define i32 @indreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32, i32* %14
%16 = load i32, i32* %9
%17 = icmp ule i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %20
19: ; preds = %6
store i32 0, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @indreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = icmp ule i32 %7, %1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int getBps(int, int, int);
int stepSizetoSec(int);
int getStepLength(int sampleRate, int stepSize, int bitLength,
                  int numberOfChannels) {
  int kbps = getBps(sampleRate, bitLength, numberOfChannels);
  int stepSizeinS = stepSizetoSec(stepSize);
  return kbps / stepSizeinS;
}


x86 assembly (clang, -O0):
<getStepLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <getBps@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <stepSizetoSec@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStepLength>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <getBps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <stepSizetoSec@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getStepLength(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* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @getBps(i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %6
%16 = call i32 @stepSizetoSec(i32 %15)
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = sdiv i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @getStepLength(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @getBps(i32 %0, i32 %2, i32 %3)
%6 = tail call i32 @stepSizetoSec(i32 %1)
%7 = sdiv i32 %5, %6
ret i32 %7
}
int get_sum(int a[], int end, int i, int step) {
  int sum = 0;
  while (i < end) {
    sum += a[i];
    i += step;
  }
  return sum;
}


x86 assembly (clang, -O0):
<get_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1143 <get_sum+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <get_sum+0x18>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sum>:
xor    %eax,%eax
cmp    %esi,%edx
jge    112b <get_sum+0x2b>
movslq %edx,%rdx
movslq %ecx,%rcx
movslq %esi,%rsi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    (%rdi,%rdx,4),%eax
add    %rcx,%rdx
cmp    %rsi,%rdx
jl     1120 <get_sum+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_sum(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %1
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = sext i32 %3 to i64
%9 = sext i32 %1 to i64
br label %10
10: ; preds = %6, %10
%11 = phi i64 [ %7, %6 ], [ %16, %10 ]
%12 = phi i32 [ 0, %6 ], [ %15, %10 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %11
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
%16 = add i64 %11, %8
%17 = icmp slt i64 %16, %9
br i1 %17, label %10, label %18
18: ; preds = %10, %4
%19 = phi i32 [ 0, %4 ], [ %15, %10 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void _map_assert(int x) {
  if (x) {
    ;
    assert(0);
  }
}


x86 assembly (clang, -O0):
<_map_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <_map_assert+0x1c>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_map_assert>:
test   %edi,%edi
je     111b <_map_assert+0xb>
xor    %edi,%edi
jmp    1030 <assert@plt>
ret

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

LLVM IR (-O2):
define void @_map_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @assert(i32 0)
br label %5
5: ; preds = %3, %1
ret void
}
void gtk_tool_button_set_use_underline() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_set_use_underline() {
ret void
}
short callback3_int_short_short(short (*f)(int)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_int_short_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_int_short_short>:
mov    %rdi,%rax
mov    $0x3,%edi
jmp    *%rax

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

LLVM IR (-O2):
define signext i16 @callback3_int_short_short(i16 (i32)* nocapture %0) {
%2 = tail call signext i16 %0(i32 3)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  switch (1) {
  case 0:
  default:
    break;
  case 1:;
    {
      printf("Success\n");
      exit(0);
    };
  }
  {
    printf("Error %d\n", (int)0);
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_message(char const *, char *);
void write_error(const char *message) { write_message(message, "[ERROR]"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"[ERROR]\00"
define void @write_error(i8* %0) {
%2 = tail call i32 @write_message(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_3Euint16_reg(unsigned short val) {
  return ((val) & (-0x3E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Euint16_reg>:
test   $0xffc2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -62
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ sleep(int);
void my_action(void *val) {
  printf("Action #%li\n", (long)val);
  sleep(5);
  printf("Action #%li terminated !\n", (long)val);
}


x86 assembly (clang, -O0):
<my_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_action>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Action #%li\0A\00"
@.str.1 = [26 x i8] c"Action #%li terminated !\0A\00"
define void @my_action(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = call i32 @sleep(i32 5)
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Action #%li\0A\00"
@.str.1 = [26 x i8] c"Action #%li terminated !\0A\00"
define void @my_action(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @sleep(i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
int main() {
  int number, digit;
  if (scanf("%d", &number) == 0) {
    printf("-1");
    return 0;
  }
  digit = is_prime(number);
  printf("%d", digit);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
jne    1173 <main+0x43>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1196 <main+0x66>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     1162 <main+0x32>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1170 <main+0x40>
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"-1\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @is_prime(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void win_sgr(int par) { fprintf(stderr, "\033[ %d m", par); }


x86 assembly (clang, -O0):
<win_sgr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win_sgr>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"\1B[ %d m\00"
define void @win_sgr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"\1B[ %d m\00"
define void @win_sgr(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, x = 10, y = 5, z = 6;
  a = x;
  x = y;
  y = z;
  z = a;
  printf("x:%d  y:%d  z:%d", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"x:%d y:%d z:%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
store i32 5, i32* %4
store i32 6, i32* %5
%6 = load i32, i32* %3
store i32 %6, i32* %2
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %2
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"x:%d y:%d z:%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5, i32 6, i32 10)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void pes_set_dataalignment(uint8_t *p_pes) { p_pes[6] |= 0x4; }


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

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

LLVM IR (-O0):
define void @pes_set_dataalignment(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, 4
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @pes_set_dataalignment(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = or i32 %3, 4
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int float_as_int(float);
float int_as_float(int);
float xor_fl(float x, int y) { return int_as_float(float_as_int(x) ^ y); }


x86 assembly (clang, -O0):
<xor_fl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <float_as_int@plt>
mov    %eax,%edi
xor    -0x8(%rbp),%edi
call   1040 <int_as_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_fl>:
push   %rbx
mov    %edi,%ebx
call   1030 <float_as_int@plt>
xor    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <int_as_float@plt>

LLVM IR (-O0):
define float @xor_fl(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = call i32 @float_as_int(float %5)
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = call float @int_as_float(i32 %8)
ret float %9
}

LLVM IR (-O2):
define float @xor_fl(float %0, i32 %1) {
%3 = tail call i32 @float_as_int(float %0)
%4 = xor i32 %3, %1
%5 = tail call float @int_as_float(i32 %4)
ret float %5
}
void foo(unsigned char *__seg_gs *pointer_gs) { pointer_gs[5] = 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,%gs:0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movq   $0x0,%gs:0x28(%rdi)
ret

LLVM IR (-O0):
define void @foo(i8* addrspace(256)* %0) {
%2 = alloca i8* addrspace(256)*
store i8* addrspace(256)* %0, i8* addrspace(256)** %2
%3 = load i8* addrspace(256)*, i8* addrspace(256)** %2
%4 = getelementptr inbounds i8*, i8* addrspace(256)* %3, i64 5
store i8* null, i8* addrspace(256)* %4
ret void
}

LLVM IR (-O2):
define void @foo(i8* addrspace(256)* nocapture writeonly %0) {
%2 = getelementptr inbounds i8*, i8* addrspace(256)* %0, i64 5
store i8* null, i8* addrspace(256)* %2
ret void
}
/* Variables and functions */
double mysinfp();
double bar(double x) { return mysinfp(); }


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

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

LLVM IR (-O0):
define double @bar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @mysinfp()
ret double %3
}

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double (...) @mysinfp()
ret double %2
}
int test_imm_0Duint16_reg(unsigned short val) {
  return ((val) & (0x0D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 13
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void freeClient(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               71, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<freeClient>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x47,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeClient>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x47,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.freeClient = [11 x i8] c"freeClient\00"
define void @freeClient() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.freeClient, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.freeClient = [11 x i8] c"freeClient\00"
define void @freeClient() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.freeClient, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
char *unixtostrf(char *buf, size_t len, long long ts, char *fmt) {
  struct tm tm_ts = *localtime((time_t *)&ts);
  strftime(buf, len, fmt, &tm_ts);
  return buf;
}


x86 assembly (clang, -O0):
<unixtostrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unixtostrf>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @unixtostrf(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca %struct.tm
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = bitcast i64* %7 to i32*
%11 = call %struct.tm* @localtime(i32* %10)
%12 = bitcast %struct.tm* %9 to i8*
%13 = bitcast %struct.tm* %11 to i8*
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i8*, i8** %8
%17 = call i32 @strftime(i8* %14, i64 %15, i8* %16, %struct.tm* %9)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @unixtostrf(i8* returned %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca %struct.tm
store i64 %2, i64* %5
%7 = bitcast %struct.tm* %6 to i8*
%8 = bitcast i64* %5 to i32*
%9 = call %struct.tm* @localtime(i32* %8)
%10 = getelementptr %struct.tm, %struct.tm* %9, i64 0, i32 0
%11 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%12 = load i32, i32* %10
store i32 %12, i32* %11
%13 = call i32 @strftime(i8* %0, i64 %1, i8* %3, %struct.tm* %6)
ret i8* %0
}
unsigned char rbits8(unsigned char w) {
  w = ((w >> 1) & 0x55) | ((w << 1) & 0xaa);
  w = ((w >> 2) & 0x33) | ((w << 2) & 0xcc);
  w = ((w >> 4) & 0x0f) | ((w << 4) & 0xf0);
  return w;
}


x86 assembly (clang, -O0):
<rbits8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
and    $0x55,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
and    $0xaa,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
and    $0x33,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x2,%ecx
and    $0xcc,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbits8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rbits8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 1
%6 = and i32 %5, 85
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = and i32 %9, 170
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = ashr i32 %14, 2
%16 = and i32 %15, 51
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 2
%20 = and i32 %19, 204
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 4
%26 = and i32 %25, 15
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 4
%30 = and i32 %29, 240
%31 = or i32 %26, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %2
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @rbits8(i8 zeroext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void main(void) { foo(400); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x190,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @foo(i32 400)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 400)
ret void
}
void binaryOperExpr() {}


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

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

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

LLVM IR (-O2):
define void @binaryOperExpr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wrtsac2(char const *, int, float const *, float const *);
void wrtsac2_(const char *name, int n, const float *x, const float *y) {
  wrtsac2(name, n, x, y);
}


x86 assembly (clang, -O0):
<wrtsac2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <wrtsac2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrtsac2_>:
jmp    1030 <wrtsac2@plt>

LLVM IR (-O0):
define void @wrtsac2_(i8* %0, i32 %1, float* %2, float* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
store i8* %0, i8** %5
store i32 %1, i32* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load float*, float** %7
%12 = load float*, float** %8
%13 = call i32 @wrtsac2(i8* %9, i32 %10, float* %11, float* %12)
ret void
}

LLVM IR (-O2):
define void @wrtsac2_(i8* %0, i32 %1, float* %2, float* %3) {
%5 = tail call i32 @wrtsac2(i8* %0, i32 %1, float* %2, float* %3)
ret void
}
/* Variables and functions */
scalar_t__ fabs(double);
double Table_Interp1d_nearest(double x, double x1, double y1, double x2,
                              double y2) {
  if (fabs(x - x1) < fabs(x - x2))
    return (y1);
  else
    return (y2);
}


x86 assembly (clang, -O0):
<Table_Interp1d_nearest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
jge    1172 <Table_Interp1d_nearest+0x62>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <Table_Interp1d_nearest+0x6c>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Table_Interp1d_nearest>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0x18(%rsp),%xmm0
cmp    %rax,%rbx
jl     1159 <Table_Interp1d_nearest+0x49>
movsd  (%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @Table_Interp1d_nearest(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = tail call i64 @fabs(double %6)
%8 = fsub double %0, %3
%9 = tail call i64 @fabs(double %8)
%10 = icmp slt i64 %7, %9
%11 = select i1 %10, double %2, double %4
ret double %11
}
int forty_two(void) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @forty_two() {
ret i32 42
}
/* Type definitions */
struct ts_eit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ts_eit_add_short_event_descriptor(struct ts_eit *, int, int,
                                                     int, int, char *, char *);
void ts_eit_test1(struct ts_eit *eit) {
  ts_eit_add_short_event_descriptor(
      eit, 4, 1, 1234567890, 3600,
      "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      "xxxxxxxxxxxxxxxxxxxxxxx",
      "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****");
}


x86 assembly (clang, -O0):
<ts_eit_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x499602d2,%ecx
mov    $0xe10,%r8d
lea    0xec4(%rip),%r9
lea    0xf1d(%rip),%rax
mov    %rax,(%rsp)
call   1030 <ts_eit_add_short_event_descriptor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_eit_test1>:
push   %rax
lea    0xf48(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%r9
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x499602d2,%ecx
mov    $0xe10,%r8d
call   1030 <ts_eit_add_short_event_descriptor@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.ts_eit = type { i32 }
@.str = [96 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00"
@.str.1 = [56 x i8] c"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****\00"
define void @ts_eit_test1(%struct.ts_eit* %0) {
%2 = alloca %struct.ts_eit*
store %struct.ts_eit* %0, %struct.ts_eit** %2
%3 = load %struct.ts_eit*, %struct.ts_eit** %2
%4 = call i32 @ts_eit_add_short_event_descriptor(%struct.ts_eit* %3, i32 4, i32 1, i32 1234567890, i32 3600, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ts_eit = type { i32 }
@.str = [96 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00"
@.str.1 = [56 x i8] c"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****\00"
define void @ts_eit_test1(%struct.ts_eit* %0) {
%2 = tail call i32 @ts_eit_add_short_event_descriptor(%struct.ts_eit* %0, i32 4, i32 1, i32 1234567890, i32 3600, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
ret void
}