xunge/DecIR huggingface dataset:
void populateRpn(char *ConRpn) {
  int i;
  for (i = 0; i < 20; i++) {
    ConRpn[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<populateRpn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1133 <populateRpn+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <populateRpn+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateRpn>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
movl   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @populateRpn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 20
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @populateRpn(i8* nocapture writeonly %0) {
ret void
}
int columns_to_next_tabstop(int cc) {
  int remainder = cc % 8;
  if (remainder == 0)
    return 0;
  else
    return (8 - remainder);
}


x86 assembly (clang, -O0):
<columns_to_next_tabstop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <columns_to_next_tabstop+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1136 <columns_to_next_tabstop+0x36>
mov    $0x8,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<columns_to_next_tabstop>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
sub    %eax,%edi
mov    $0x8,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @columns_to_next_tabstop(i32 %0) {
%2 = srem i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 8, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hosttobig(uint64_t n) {
  return (
      ((n & 0x00000000000000FFULL) << 56) |
      ((n & 0x000000000000FF00ULL) << 40) |
      ((n & 0x0000000000FF0000ULL) << 24) | ((n & 0x00000000FF000000ULL) << 8) |
      ((n & 0x000000FF00000000ULL) >> 8) | ((n & 0x0000FF0000000000ULL) >> 24) |
      ((n & 0x00FF000000000000ULL) >> 40) |
      ((n & 0xFF00000000000000ULL) >> 56));
}


x86 assembly (clang, -O0):
<hosttobig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
and    $0xff,%rax
shl    $0x38,%rax
movslq -0x4(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
shr    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
shr    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
shr    $0x38,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hosttobig>:
movslq %edi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i32 @hosttobig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 255
%6 = shl i64 %5, 56
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 65280
%10 = shl i64 %9, 40
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 16711680
%15 = shl i64 %14, 24
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = and i64 %18, 4278190080
%20 = shl i64 %19, 8
%21 = or i64 %16, %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = and i64 %23, 1095216660480
%25 = lshr i64 %24, 8
%26 = or i64 %21, %25
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = and i64 %28, 280375465082880
%30 = lshr i64 %29, 24
%31 = or i64 %26, %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = and i64 %33, 71776119061217280
%35 = lshr i64 %34, 40
%36 = or i64 %31, %35
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = and i64 %38, -72057594037927936
%40 = lshr i64 %39, 56
%41 = or i64 %36, %40
%42 = trunc i64 %41 to i32
ret i32 %42
}

LLVM IR (-O2):
define i32 @hosttobig(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void itoa(int key, char c[], int radix) {
  int bal, val = key;
  sprintf(c, "%d", key);
  return;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @itoa(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setPercussionFast(struct b_tonegen *, int);
void setPercDecayFromMIDI(void *d, unsigned char u) {
  struct b_tonegen *t = (struct b_tonegen *)d;
  setPercussionFast(t, u < 64 ? 0 : 1);
}


x86 assembly (clang, -O0):
<setPercDecayFromMIDI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movzbl -0x9(%rbp),%ecx
mov    $0x1,%esi
xor    %eax,%eax
cmp    $0x40,%ecx
cmovl  %eax,%esi
call   1030 <setPercussionFast@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPercDecayFromMIDI>:
xor    %eax,%eax
cmp    $0x40,%sil
setae  %al
mov    %eax,%esi
jmp    1030 <setPercussionFast@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setPercDecayFromMIDI(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca %struct.b_tonegen*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.b_tonegen*
store %struct.b_tonegen* %7, %struct.b_tonegen** %5
%8 = load %struct.b_tonegen*, %struct.b_tonegen** %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 64
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
%14 = call i32 @setPercussionFast(%struct.b_tonegen* %8, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setPercDecayFromMIDI(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = icmp ugt i8 %1, 63
%5 = zext i1 %4 to i32
%6 = tail call i32 @setPercussionFast(%struct.b_tonegen* %3, i32 %5)
ret void
}
void foo(void) {
  int a[9];
  a[-8] = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x50(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca [9 x i32]
%2 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 -8
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
double f4_cb_send_pre_double_double_long(double (*cb)(double, double, long)) {
  long r = 33;
  return cb(8.25, 9.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
call   *%rax
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_long>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
mov    $0x21,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_long(double (double, double, i64)* %0) {
%2 = alloca double (double, double, i64)*
%3 = alloca i64
store double (double, double, i64)* %0, double (double, double, i64)** %2
store i64 33, i64* %3
%4 = load double (double, double, i64)*, double (double, double, i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_long(double (double, double, i64)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
void rop3_24_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_24_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_24_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_24_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = xor i32 %16, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = and i32 %29, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = and i32 %40, %42
%44 = or i32 %37, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = load i8, i8* %6
%49 = zext i8 %48 to i32
%50 = and i32 %47, %49
%51 = or i32 %44, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_24_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_inode(char *);
int /*<<< orphan*/ printpathto(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int main() {
  printpathto(get_inode("."));
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <get_inode@plt>
mov    %eax,%edi
call   1050 <printpathto@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <get_inode@plt>
mov    %eax,%edi
call   1050 <printpathto@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @get_inode(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printpathto(i32 %2)
%4 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @get_inode(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printpathto(i32 %1)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
struct webidl_node {
  int dummy;
};
struct binding {
  int dummy;
};

/* Variables and functions */
int generate_function_spec(struct binding *, int /*<<< orphan*/);
int /*<<< orphan*/ webidl_node_gettext(struct webidl_node *);
int webidl_function_spec_implements_cb(struct webidl_node *node, void *ctx) {
  struct binding *binding = ctx;
  return generate_function_spec(binding, webidl_node_gettext(node));
}


x86 assembly (clang, -O0):
<webidl_function_spec_implements_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <webidl_node_gettext@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <generate_function_spec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<webidl_function_spec_implements_cb>:
push   %rbx
mov    %rsi,%rbx
call   1040 <webidl_node_gettext@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <generate_function_spec@plt>

LLVM IR (-O0):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_function_spec_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = alloca %struct.webidl_node*
%4 = alloca i8*
%5 = alloca %struct.binding*
store %struct.webidl_node* %0, %struct.webidl_node** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.binding*
store %struct.binding* %7, %struct.binding** %5
%8 = load %struct.binding*, %struct.binding** %5
%9 = load %struct.webidl_node*, %struct.webidl_node** %3
%10 = call i32 @webidl_node_gettext(%struct.webidl_node* %9)
%11 = call i32 @generate_function_spec(%struct.binding* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_function_spec_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.binding*
%4 = tail call i32 @webidl_node_gettext(%struct.webidl_node* %0)
%5 = tail call i32 @generate_function_spec(%struct.binding* %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @putchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_is_pair(struct item *);
int /*<<< orphan*/ item_free(struct item *);
int /*<<< orphan*/ pair_get_components(struct item *, struct item **,
                                       struct item **);
struct item *pair_get_second(struct item *pair) {
  struct item *first;
  struct item *second;
  check_is_pair(pair);
  pair_get_components(pair, &first, &second);
  item_free(first);
  return second;
}


x86 assembly (clang, -O0):
<pair_get_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <check_is_pair@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <pair_get_components@plt>
mov    -0x10(%rbp),%rdi
call   1040 <item_free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_get_second>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <check_is_pair@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1030 <pair_get_components@plt>
mov    0x8(%rsp),%rdi
call   1040 <item_free@plt>
mov    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.item = type { i32 }
define %struct.item* @pair_get_second(%struct.item* %0) {
%2 = alloca %struct.item*
%3 = alloca %struct.item*
%4 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%5 = load %struct.item*, %struct.item** %2
%6 = call i32 @check_is_pair(%struct.item* %5)
%7 = load %struct.item*, %struct.item** %2
%8 = call i32 @pair_get_components(%struct.item* %7, %struct.item** %3, %struct.item** %4)
%9 = load %struct.item*, %struct.item** %3
%10 = call i32 @item_free(%struct.item* %9)
%11 = load %struct.item*, %struct.item** %4
ret %struct.item* %11
}

LLVM IR (-O2):
%struct.item = type { i32 }
define %struct.item* @pair_get_second(%struct.item* %0) {
%2 = alloca %struct.item*
%3 = alloca %struct.item*
%4 = bitcast %struct.item** %2 to i8*
%5 = bitcast %struct.item** %3 to i8*
%6 = tail call i32 @check_is_pair(%struct.item* %0)
%7 = call i32 @pair_get_components(%struct.item* %0, %struct.item** %2, %struct.item** %3)
%8 = load %struct.item*, %struct.item** %2
%9 = call i32 @item_free(%struct.item* %8)
%10 = load %struct.item*, %struct.item** %3
ret %struct.item* %10
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%u\n", factorial(10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void WF_EintEnable() {
  if (((*(volatile unsigned *)(0xBF800000 + (0x60020)) >> 15) & 1) == 0) {
    *(volatile unsigned *)(0xBF800000 + (0x10048 + ((0) << 4))) = (1 << 4);
  }
  *(volatile unsigned *)(0xBF800000 + (0x100c8 + ((0) << 4))) = (1 << 4);
}


x86 assembly (clang, -O0):
<WF_EintEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf860020,%eax
mov    (%rax),%eax
shr    $0xf,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1125 <WF_EintEnable+0x25>
mov    $0xbf810048,%eax
movl   $0x10,(%rax)
mov    $0xbf8100c8,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF_EintEnable>:
mov    $0xbf810048,%eax
testl  $0x8000,0x4ffd8(%rax)
jne    1117 <WF_EintEnable+0x17>
movl   $0x10,(%rax)
movl   $0x10,0x80(%rax)
ret

LLVM IR (-O0):
define void @WF_EintEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3213230112 to i32*)
%2 = lshr i32 %1, 15
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store volatile i32 16, i32* inttoptr (i64 3212902472 to i32*)
br label %6
6: ; preds = %5, %0
store volatile i32 16, i32* inttoptr (i64 3212902600 to i32*)
ret void
}

LLVM IR (-O2):
define void @WF_EintEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3213230112 to i32*)
%2 = and i32 %1, 32768
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store volatile i32 16, i32* inttoptr (i64 3212902472 to i32*)
br label %5
5: ; preds = %4, %0
store volatile i32 16, i32* inttoptr (i64 3212902600 to i32*)
ret void
}
int calc_sum(char *str) {
  int sum = 0;
  while (*str != '\0') {
    sum += *str - '0';
    str++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<calc_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <calc_sum+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <calc_sum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <calc_sum+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calc_sum+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @calc_sum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @calc_sum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i32 %6, -48
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ Mem_free(void *, char *, int);
void vfree(const void *key, void **count, void *cl) {
  ((void)(Mem_free((*count),
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/wonghoifung/reviewing-c/"
                   "refs/heads/master/cii/test.c",
                   33),
          (*count) = 0));
}


x86 assembly (clang, -O0):
<vfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xece(%rip),%rsi
mov    $0x21,%edx
call   1030 <Mem_free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfree>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xee2(%rip),%rsi
mov    $0x21,%edx
call   1030 <Mem_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wonghoifung/reviewing-c/refs/heads/master/cii/test.c\00"
define void @vfree(i8* %0, i8** %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = call i64 @Mem_free(i8* %8, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 33)
%10 = load i8**, i8*** %5
store i8* null, i8** %10
ret void
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wonghoifung/reviewing-c/refs/heads/master/cii/test.c\00"
define void @vfree(i8* nocapture readnone %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i64 @Mem_free(i8* %4, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 33)
store i8* null, i8** %1
ret void
}
/* Variables and functions */
int foo(char *);
int bar(unsigned long x) {
  char a[x];
  return foo(a);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <foo@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rsp,%rax
add    $0xf,%rdi
and    $0xfffffffffffffff0,%rdi
sub    %rdi,%rax
mov    %rax,%rsp
mov    %rax,%rdi
call   1030 <foo@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %3
%7 = alloca i8, i64 %5
store i64 %5, i64* %4
%8 = call i32 @foo(i8* %7)
%9 = load i8*, i8** %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @bar(i64 %0) {
%2 = alloca i8, i64 %0
%3 = call i32 @foo(i8* %2)
ret i32 %3
}
int kcm_is_eol(char ch) { return ('\0' == ch) || ('\n' == ch) || ('\r' == ch); }


x86 assembly (clang, -O0):
<kcm_is_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1144 <kcm_is_eol+0x44>
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1144 <kcm_is_eol+0x44>
movsbl -0x1(%rbp),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcm_is_eol>:
mov    $0x1,%eax
test   %dil,%dil
je     1110 <kcm_is_eol+0x10>
cmp    $0xa,%dil
jne    1111 <kcm_is_eol+0x11>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @kcm_is_eol(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 0, %4
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 10, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 13, %12
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @kcm_is_eol(i8 signext %0) {
switch i8 %0, label %2 [
i8 10, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
uid_t geteuid(void) {
  if (getenv("LIBFAKE_EUID_ROOT") != NULL)
    return 0;
  else
    return 100;
}


x86 assembly (clang, -O0):
<geteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     113a <geteuid+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <geteuid+0x31>
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geteuid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x64,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"LIBFAKE_EUID_ROOT\00"
define i32 @geteuid() {
%1 = alloca i32
%2 = call i32* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 100, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"LIBFAKE_EUID_ROOT\00"
define i32 @geteuid() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i32 100, i32 0
ret i32 %3
}
int security_file_send_sigiotask(struct task_struct *tsk,
                                 struct fown_struct *fown, int sig) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
%struct.fown_struct = type opaque
define i32 @security_file_send_sigiotask(%struct.task_struct* %0, %struct.fown_struct* %1, i32 %2) {
%4 = alloca %struct.task_struct*
%5 = alloca %struct.fown_struct*
%6 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %4
store %struct.fown_struct* %1, %struct.fown_struct** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.fown_struct = type opaque
define i32 @security_file_send_sigiotask(%struct.task_struct* nocapture readnone %0, %struct.fown_struct* nocapture readnone %1, i32 %2) {
ret i32 0
}
int is_upper(int c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <is_upper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <is_upper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_upper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_upper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_upper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int jam_iscntrl(char ch) {
  return (((ch >= 0) && (ch <= 0x1f)) || (ch == 0x7f));
}


x86 assembly (clang, -O0):
<jam_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1129 <jam_iscntrl+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x1f,%ecx
mov    %al,-0x2(%rbp)
jle    1136 <jam_iscntrl+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_iscntrl>:
cmp    $0x20,%dil
setb   %al
cmp    $0x7f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @jam_iscntrl(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, 0
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, 31
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 127
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @jam_iscntrl(i8 signext %0) {
%2 = icmp ult i8 %0, 32
%3 = icmp eq i8 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_F6int16_reg(short val) {
  return ((val) & (-0xF6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F6int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -246
%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_F6int16_reg(i16 signext %0) {
%2 = and i16 %0, -246
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ioPostEvent(void) {}


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

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

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

LLVM IR (-O2):
define void @ioPostEvent() {
ret void
}
extern int f6(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f6() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Started the C program \n");
  loop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <loop@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Started the C program \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @loop()
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Started the C program \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @loop()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
struct nrf24l01 {
  int dummy;
};

/* Variables and functions */
int rf_command(struct nrf24l01 *, int, void *, size_t, int /*<<< orphan*/);
int rf_reg_writelong(struct nrf24l01 *dev, uint8_t addr, void *buf,
                     size_t len) {
  return rf_command(dev, 0b00100000 | addr, buf, len, 0);
}


x86 assembly (clang, -O0):
<rf_reg_writelong>:
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
or     $0x20,%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <rf_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_reg_writelong>:
or     $0x20,%esi
xor    %r8d,%r8d
jmp    1030 <rf_command@plt>

LLVM IR (-O0):
%struct.nrf24l01 = type { i32 }
define i32 @rf_reg_writelong(%struct.nrf24l01* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca %struct.nrf24l01*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store %struct.nrf24l01* %0, %struct.nrf24l01** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load %struct.nrf24l01*, %struct.nrf24l01** %5
%10 = load i32, i32* %6
%11 = or i32 32, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @rf_command(%struct.nrf24l01* %9, i32 %11, i8* %12, i64 %13, i32 0)
ret i32 %14
}

LLVM IR (-O2):
%struct.nrf24l01 = type { i32 }
define i32 @rf_reg_writelong(%struct.nrf24l01* %0, i32 %1, i8* %2, i64 %3) {
%5 = or i32 %1, 32
%6 = tail call i32 @rf_command(%struct.nrf24l01* %0, i32 %5, i8* %2, i64 %3, i32 0)
ret i32 %6
}
/* Variables and functions */
unsigned int _mm_crc32_u8(unsigned int, unsigned char);
unsigned int __attribute__((__target__("sse4.2")))
mm_crc32_u8_wrap(unsigned int c, unsigned char d) {
  return _mm_crc32_u8(c, d);
}


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

x86 assembly (clang, -O2):
<mm_crc32_u8_wrap>:
jmp    1030 <_mm_crc32_u8@plt>

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

LLVM IR (-O2):
define i32 @mm_crc32_u8_wrap(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @_mm_crc32_u8(i32 %0, i8 zeroext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage: mkres [options] <input file>\n"
         "Make a resource file from input file.\n\n");
  printf(
      "Options:\n"
      "    -n, --name <NAME>   Generate resource name, default is 'data'.\n"
      "    -z, --zero          Resource with zero terminated, useful with "
      "string resource.\n"
      "    -s, --static        Generate static variable, default is extern.\n"
      "    -h, --help          Show this usage information and leave.\n\n");
}


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

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Usage: mkres [options] <input file>\0AMake a resource file from input file.\0A\0A\00"
@.str.1 = [294 x i8] c"Options:\0A -n, --name <NAME> Generate resource name, default is 'data'.\0A -z, --zero Resource with zero terminated, useful with string resource.\0A -s, --static Generate static variable, default is extern.\0A -h, --help Show this usage information and leave.\0A\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c"Usage: mkres [options] <input file>\0AMake a resource file from input file.\0A\00"
@str.2 = [293 x i8] c"Options:\0A -n, --name <NAME> Generate resource name, default is 'data'.\0A -z, --zero Resource with zero terminated, useful with string resource.\0A -s, --static Generate static variable, default is extern.\0A -h, --help Show this usage information and leave.\0A\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([293 x i8], [293 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ isStringEmpty(char const *);
int /*<<< orphan*/ printf(char *, ...);
void alert(const char *str) {
  if (isStringEmpty(str)) {
    printf("ALERT:\n");
    return;
  }
  printf("ALERT: %s\n", str + sizeof(int32_t));
}


x86 assembly (clang, -O0):
<alert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isStringEmpty@plt>
cmp    $0x0,%rax
je     1152 <alert+0x32>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <alert+0x48>
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alert>:
push   %rbx
mov    %rdi,%rbx
call   1050 <isStringEmpty@plt>
test   %rax,%rax
je     114b <alert+0x1b>
lea    0xec6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
add    $0x4,%rbx
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [11 x i8] c"ALERT: %s\0A\00"
@str = [7 x i8] c"ALERT:\00"
define void @alert(i8* %0) {
%2 = tail call i64 @isStringEmpty(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %4
ret void
}
void A(int *x, int *y) {
  void add(int *a, int *b);
  void inc(int *z);
  add(x, y);
  inc(y);
}


x86 assembly (clang, -O0):
<A>:
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 <add@plt>
mov    -0x10(%rbp),%rdi
call   1040 <inc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
push   %rbx
mov    %rsi,%rbx
call   1030 <add@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <inc@plt>

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

LLVM IR (-O2):
define void @A(i32* %0, i32* %1) {
tail call void @add(i32* %0, i32* %1)
tail call void @inc(i32* %1)
ret void
}
/* Variables and functions */
int be_migrate_thread_to_cpu(int /*<<< orphan*/, int);
int be_migrate_to_cpu(int target_cpu) {
  return be_migrate_thread_to_cpu(0, target_cpu);
}


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

x86 assembly (clang, -O2):
<be_migrate_to_cpu>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <be_migrate_thread_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @be_migrate_to_cpu(i32 %0) {
%2 = tail call i32 @be_migrate_thread_to_cpu(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions(void) {
  printf("Enter your choice:\n"
         "   1 to add an item to the queue\n"
         "   2 to remove an item from the queue\n"
         "   3 to end\n");
}


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

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

LLVM IR (-O0):
@.str = [103 x i8] c"Enter your choice:\0A 1 to add an item to the queue\0A 2 to remove an item from the queue\0A 3 to end\0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [102 x i8] c"Enter your choice:\0A 1 to add an item to the queue\0A 2 to remove an item from the queue\0A 3 to end\00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _resetStream(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void resetErr() { _resetStream(stderr); }


x86 assembly (clang, -O0):
<resetErr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <_resetStream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetErr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_resetStream@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @resetErr() {
%1 = load i32, i32* @stderr
%2 = call i32 @_resetStream(i32 %1)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @resetErr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @_resetStream(i32 %1)
ret void
}
int tdefault_supports_stopped_by_sw_breakpoint(struct target_ops *self) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_supports_stopped_by_sw_breakpoint(%struct.target_ops* nocapture readnone %0) {
ret i32 0
}