xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void mem_write(uint16_t addr, uint8_t val) {}


x86 assembly (clang, -O0):
<mem_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mem_write(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int input;
  scanf("%d", &input);
  int a = reverse(input);
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%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>
mov    0x4(%rsp),%edi
call   1030 <reverse@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @reverse(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _setline();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
_stop() {
  extern int _erlsym;
  _setline();
  printf("Break in %d\n", _erlsym);
  exit(0);
}


x86 assembly (clang, -O0):
<_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_setline@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_stop>:
push   %rax
xor    %eax,%eax
call   1040 <_setline@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Break in %d\0A\00"
@_erlsym = external global i32
define i32 @_stop() {
%1 = call i32 (...) @_setline()
%2 = load i32, i32* @_erlsym
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Break in %d\0A\00"
@_erlsym = external global i32
define i32 @_stop() {
%1 = tail call i32 (...) @_setline()
%2 = load i32, i32* @_erlsym
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void EVP_EncryptFinal_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_EncryptFinal_ex() {
ret void
}
char *k_utf8chp(const char *s) {
  for (;;) {
    s--;
    if ((*s & 0xC0) != 0x80)
      return (char *)s;
  }
}


x86 assembly (clang, -O0):
<k_utf8chp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1131 <k_utf8chp+0x31>
mov    -0x8(%rbp),%rax
pop    %rbp
ret
jmp    1108 <k_utf8chp+0x8>

x86 assembly (clang, -O2):
<k_utf8chp>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rax),%ecx
add    $0xffffffffffffffff,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <k_utf8chp+0x10>
ret

LLVM IR (-O0):
define i8* @k_utf8chp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %13, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 -1
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = and i32 %8, 192
%10 = icmp ne i32 %9, 128
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
13: ; preds = %3
br label %3
}

LLVM IR (-O2):
define i8* @k_utf8chp(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}
/* Variables and functions */
unsigned long long paravirt_read_msr(unsigned int, int *);
__attribute__((always_)) int rdmsrl_safe(unsigned msr, unsigned long long *p) {
  int err;
  *p = paravirt_read_msr(msr, &err);
  return err;
}


x86 assembly (clang, -O0):
<rdmsrl_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <paravirt_read_msr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdmsrl_safe>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1030 <paravirt_read_msr@plt>
mov    %rax,(%rbx)
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdmsrl_safe(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i32, i32* %3
%7 = call i64 @paravirt_read_msr(i32 %6, i32* %5)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @rdmsrl_safe(i32 %0, i64* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @paravirt_read_msr(i32 %0, i32* %3)
store i64 %5, i64* %1
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_eqep_base(uint8_t num) {
  uint32_t base = 0;
  if (num == 0)
    base = (0x01f09000);
  else if (num == 1)
    base = (0x01f0A000);
  return base;
}


x86 assembly (clang, -O0):
<get_eqep_base>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1124 <get_eqep_base+0x24>
movl   $0x1f09000,-0x8(%rbp)
jmp    113a <get_eqep_base+0x3a>
cmpl   $0x1,-0x4(%rbp)
jne    1135 <get_eqep_base+0x35>
movl   $0x1f0a000,-0x8(%rbp)
jmp    113a <get_eqep_base+0x3a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_eqep_base>:
xor    %eax,%eax
cmp    $0x1,%edi
mov    $0x1f0a000,%ecx
cmovne %eax,%ecx
test   %edi,%edi
mov    $0x1f09000,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_eqep_base(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 32546816, i32 0
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 32542720, i32 %3
ret i32 %5
}
/* Variables and functions */
double randCauchy(double, double);
double GenerateCauchyRandomNumber(double location, double scale) {
  return randCauchy(location, scale);
}


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

x86 assembly (clang, -O2):
<GenerateCauchyRandomNumber>:
jmp    1030 <randCauchy@plt>

LLVM IR (-O0):
define double @GenerateCauchyRandomNumber(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 = call double @randCauchy(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @GenerateCauchyRandomNumber(double %0, double %1) {
%3 = tail call double @randCauchy(double %0, double %1)
ret double %3
}
/* Variables and functions */
double diverr(char *, double, char const *, double);
double divinverr(const char *yexpr, double y) {
  return diverr("1.0", 1.0, yexpr, y);
}


x86 assembly (clang, -O0):
<divinverr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm1
lea    0xed7(%rip),%rdi
movsd  0xec7(%rip),%xmm0
call   1030 <diverr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divinverr>:
movaps %xmm0,%xmm1
mov    %rdi,%rsi
lea    0xeeb(%rip),%rdi
movsd  0xedb(%rip),%xmm0
jmp    1030 <diverr@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"1.0\00"
define double @divinverr(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = load double, double* %4
%7 = call double @diverr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, i8* %5, double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"1.0\00"
define double @divinverr(i8* %0, double %1) {
%3 = tail call double @diverr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, i8* %0, double %1)
ret double %3
}
/* Variables and functions */
int get_uint24(unsigned char *, int);
int /*<<< orphan*/ set_uint24(unsigned char *, int, int);
void inc_uint24(unsigned char *buf, int block) {
  int value;
  value = get_uint24(buf, block);
  set_uint24(buf, block, ++value);
}


x86 assembly (clang, -O0):
<inc_uint24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <get_uint24@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
call   1030 <set_uint24@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_uint24>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <get_uint24@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set_uint24@plt>

LLVM IR (-O0):
define void @inc_uint24(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @get_uint24(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = call i32 @set_uint24(i8* %9, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @inc_uint24(i8* %0, i32 %1) {
%3 = tail call i32 @get_uint24(i8* %0, i32 %1)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @set_uint24(i8* %0, i32 %1, i32 %4)
ret void
}
double add_double(double a, double b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_double>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add_double(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @add_double(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int kcm_is_token_comment(const char *token) { return '#' == *token; }


x86 assembly (clang, -O0):
<kcm_is_token_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x23,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcm_is_token_comment>:
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @kcm_is_token_comment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 35, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @kcm_is_token_comment(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned xrop3_90_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D ^ T;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_90_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB4_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB4_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRB4_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, int);
void forf_proc_lt(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b < a);
}


x86 assembly (clang, -O0):
<forf_proc_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_lt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
xor    %esi,%esi
cmp    %r14,%rax
setl   %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_lt(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = icmp slt i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @forf_push_num(%struct.forf_env* %9, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_lt(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = icmp slt i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @forf_push_num(%struct.forf_env* %0, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ getcwd(char *, int);
char *g_get_current_dir(char *dirname, int maxlen) {
  if (getcwd(dirname, maxlen) == 0) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<g_get_current_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
jne    113a <g_get_current_dir+0x2a>
jmp    113a <g_get_current_dir+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @g_get_current_dir(i8* %0, i32 %1) {
%3 = tail call i64 @getcwd(i8* %0, i32 %1)
ret i8* null
}
void ff_hevc_put_hevc_bi_pel_pixels64_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels64_10_avx2() {
ret void
}
int stbi__pnm_isdigit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<stbi__pnm_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <stbi__pnm_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__pnm_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @stbi__pnm_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int coefficient_of_variance(double *, int);
bool low_variance(double *vals, int len) {
  return (coefficient_of_variance(vals, len) < 1);
}


x86 assembly (clang, -O0):
<low_variance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <coefficient_of_variance@plt>
cmp    $0x1,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @low_variance(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @coefficient_of_variance(double* %5, i32 %6)
%8 = icmp slt i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @low_variance(double* %0, i32 %1) {
%3 = tail call i32 @coefficient_of_variance(double* %0, i32 %1)
%4 = icmp slt i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void __attribute__((noreturn)) Sys_ExitForOS(int exitCode) { exit(exitCode); }


x86 assembly (clang, -O0):
<Sys_ExitForOS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Sys_ExitForOS>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Sys_ExitForOS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @Sys_ExitForOS(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
print() {
  int a, b;
  printf("hello");
  a = b;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @print() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_serial(void *_p, unsigned long _v) {
  ((XButtonEvent *)_p)->serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XButtonEvent_serial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XButtonEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_long_sum_to_all(long *target, long *source, int nreduce,
                                  int PE_start, int logPE_stride, int PE_size,
                                  long *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_long_sum_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_long_sum_to_all(i64* %0, i64* %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64*
store i64* %0, i64** %9
store i64* %1, i64** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_long_sum_to_all(i64* nocapture readnone %0, i64* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int foo(int predicate) {
  int x = 0;
  switch (predicate) {
  case 0:
    return 111;
  case 1:
    x = x + 1;
  case 2:
    return (x + 3);
  case 3:
    break;
  default:
    return 222;
  }
  return 333;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     115b <foo+0x5b>
mov    -0x18(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x6f,-0x4(%rbp)
jmp    116e <foo+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <foo+0x6e>
jmp    1167 <foo+0x67>
movl   $0xde,-0x4(%rbp)
jmp    116e <foo+0x6e>
movl   $0x14d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x3,%edi
ja     1129 <foo+0x29>
mov    $0x3,%ecx
mov    $0x6f,%eax
mov    %edi,%edx
lea    0xee8(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x4,%ecx
mov    %ecx,%eax
ret
mov    $0xde,%eax
ret
mov    $0x14d,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %14 [
i32 0, label %6
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
6: ; preds = %1
store i32 111, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %1, %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 3
store i32 %12, i32* %2
br label %16
13: ; preds = %1
br label %15
14: ; preds = %1
store i32 222, i32* %2
br label %16
15: ; preds = %13
store i32 333, i32* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %7
i32 1, label %2
i32 2, label %3
i32 3, label %6
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 3, %1 ], [ 4, %2 ]
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %3
%8 = phi i32 [ 222, %5 ], [ 333, %6 ], [ %4, %3 ], [ 111, %1 ]
ret i32 %8
}
int test_imm_AFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xAF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AFuint16_mem>:
movzwl (%rdi),%eax
test   $0xff51,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -175
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void BusFault_Handler() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFault_Handler+0x9>
jmp    1109 <BusFault_Handler+0x9>

x86 assembly (clang, -O2):
<BusFault_Handler>:
jmp    1100 <BusFault_Handler>

LLVM IR (-O0):
define void @BusFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @BusFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x6f() {
  Assert_real((isxdigit(111) == 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_isxdigit.c",
              560, ("isxdigit should be 0 for o"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x230,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for o\00"
define void @t_isxdigit_0x6f() {
%1 = call i64 @isxdigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for o\00"
define void @t_isxdigit_0x6f() {
%1 = tail call i64 @isxdigit(i32 111)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_detect_fork() {
  printf("NOT IMPLEMENTED:"
         "pa_detect_fork"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_detect_fork\0A\00"
define i32 @pa_detect_fork() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_detect_fork\00"
define i32 @pa_detect_fork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  char flags;
  flags = 0;
  flags = flags | (1 << 4);
  if ((flags & (1 << 0)) != 0)
    printf("error flag is set\n");
  else
    printf("No error set\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
or     $0x10,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114e <main+0x3e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <main+0x4a>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"error flag is set\0A\00"
@.str.1 = [14 x i8] c"No error set\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"No error set\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ make_strings(char **, char **);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *s1, *s2;
  make_strings(&s1, &s2);
  printf("string 1 [%s] string 2 [%s] \n", s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <make_strings@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <make_strings@plt>
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"string 1 [%s] string 2 [%s] \0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = call i32 @make_strings(i8** %1, i8** %2)
%6 = load i8*, i8** %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}
/* Variables and functions */
int my_compare_double(double, double);
int compare_double_qsortInv(const void *a, const void *b) {
  double da = *(double *)a;
  double db = *(double *)b;
  return my_compare_double(db, da);
}


x86 assembly (clang, -O0):
<compare_double_qsortInv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <my_compare_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double_qsortInv>:
movsd  (%rdi),%xmm1
movsd  (%rsi),%xmm0
jmp    1030 <my_compare_double@plt>

LLVM IR (-O0):
define i32 @compare_double_qsortInv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %6
%14 = load double, double* %5
%15 = call i32 @my_compare_double(double %13, double %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_double_qsortInv(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = tail call i32 @my_compare_double(double %6, double %4)
ret i32 %7
}
/* Variables and functions */
int strcmp(void const *, void const *);
int default_compare(const void *a, const void *b) { return strcmp(a, b); }


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

x86 assembly (clang, -O2):
<default_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @default_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sw_printFooter(void) {
  printf("*****************************************************************\n");
}


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

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

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

LLVM IR (-O2):
@str = [66 x i8] c"*****************************************************************\00"
define void @sw_printFooter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_no_data(struct buffer *, int);
int add_seqreqd_avp(struct buffer *buf) { return add_no_data(buf, 39); }


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

x86 assembly (clang, -O2):
<add_seqreqd_avp>:
mov    $0x27,%esi
jmp    1030 <add_no_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_seqreqd_avp(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call i32 @add_no_data(%struct.buffer* %3, i32 39)
ret i32 %4
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_seqreqd_avp(%struct.buffer* %0) {
%2 = tail call i32 @add_no_data(%struct.buffer* %0, i32 39)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ escape_character(char *, char *, char);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *escape_dollar_sign(char *data) {
  char buffer[131072];
  strcpy(data, escape_character(buffer, data, '$'));
  return data;
}


x86 assembly (clang, -O0):
<escape_dollar_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20020,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20018(%rbp)
lea    -0x20010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x24,%edx
call   1040 <escape_character@plt>
mov    -0x20018(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_dollar_sign>:
push   %rbx
sub    $0x20000,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x24,%edx
call   1040 <escape_character@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x20000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @escape_dollar_sign(i8* %0) {
%2 = alloca i8*
%3 = alloca [131072 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @escape_character(i8* %5, i8* %6, i8 signext 36)
%8 = call i32 @strcpy(i8* %4, i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @escape_dollar_sign(i8* returned %0) {
%2 = alloca [131072 x i8]
%3 = getelementptr inbounds [131072 x i8], [131072 x i8]* %2, i64 0, i64 0
%4 = call i32 @escape_character(i8* %3, i8* %0, i8 signext 36)
%5 = call i32 @strcpy(i8* %0, i32 %4)
ret i8* %0
}
/* Variables and functions */
void *malloc(int);
void *xmalloc(int v) { return malloc(v); }


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

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int inb(int);
int idewait(int checkerr) {
  int r;
  while (((r = inb(0x1f7)) & (0x80 | 0x40)) != 0x40)
    ;
  if (checkerr && (r & (0x20 | 0x01)) != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<idewait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1f7,%edi
call   1030 <inb@plt>
mov    %eax,-0xc(%rbp)
and    $0xc0,%eax
cmp    $0x40,%eax
je     113b <idewait+0x2b>
jmp    111b <idewait+0xb>
cmpl   $0x0,-0x8(%rbp)
je     1160 <idewait+0x50>
mov    -0xc(%rbp),%eax
and    $0x21,%eax
cmp    $0x0,%eax
je     1160 <idewait+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <idewait+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idewait>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1f7,%edi
call   1030 <inb@plt>
mov    %eax,%ecx
and    $0xc0,%ecx
cmp    $0x40,%ecx
jne    1120 <idewait+0x10>
test   %ebx,%ebx
setne  %cl
test   $0x21,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @idewait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = call i32 @inb(i32 503)
store i32 %6, i32* %4
%7 = and i32 %6, 192
%8 = icmp ne i32 %7, 64
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %4
%15 = and i32 %14, 33
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -1, i32* %2
br label %19
18: ; preds = %13, %10
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @idewait(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @inb(i32 503)
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 64
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = icmp ne i32 %0, 0
%8 = and i32 %3, 33
%9 = icmp ne i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
%11 = sext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_buf(char **buf, int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    printf("%s, ", buf[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <print_buf+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <print_buf+0x1d>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_buf+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_buf+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s, \00"
define void @print_buf(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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %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
%14 = tail call i32 @putchar(i32 10)
ret void
}