xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;
struct pcg_state_setseq_128 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_128_xsl_rr_64_random_r(struct pcg_state_setseq_128 *);
uint64_t
pcg_setseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_setseq_128 *rng,
                                       uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_setseq_128_xsl_rr_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_128_xsl_rr_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_128_xsl_rr_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_128_xsl_rr_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_128_xsl_rr_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_128_xsl_rr_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_128_xsl_rr_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_128_xsl_rr_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_128 = type { i32 }
define i32 @pcg_setseq_128_xsl_rr_64_boundedrand_r(%struct.pcg_state_setseq_128* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_128*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_128* %0, %struct.pcg_state_setseq_128** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_128*, %struct.pcg_state_setseq_128** %3
%13 = call i32 @pcg_setseq_128_xsl_rr_64_random_r(%struct.pcg_state_setseq_128* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_128 = type { i32 }
define i32 @pcg_setseq_128_xsl_rr_64_boundedrand_r(%struct.pcg_state_setseq_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_128_xsl_rr_64_random_r(%struct.pcg_state_setseq_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
int main() {
  int x;
  int y;
  x = 1;
  y = 1;
  x = y = 0;
  if (x != 0)
    return 1;
  if (y != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    115a <main+0x5a>
cmpl   $0x0,-0xc(%rbp)
je     1153 <main+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <main+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *mallocEscapeRet() {
  int *p = malloc(12);
  return p;
}


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

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

LLVM IR (-O0):
define i32* @mallocEscapeRet() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @mallocEscapeRet() {
%1 = tail call i32* @malloc(i32 12)
ret i32* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ None;
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XWarpPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int, int);
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
void MoveCursorPos(int x, int y) {
  Display *dpy;
  dpy = XOpenDisplay(0);
  assert(dpy);
  XWarpPointer(dpy, None, None, 0, 0, 0, 0, x, y);
  XFlush(dpy);
}


x86 assembly (clang, -O0):
<MoveCursorPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%r10d
mov    -0x8(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <XWarpPointer@plt>
mov    -0x10(%rbp),%rdi
call   1060 <XFlush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MoveCursorPos>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %edi,%r14d
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    %edx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r15
push   %r14
push   $0x0
call   1030 <XWarpPointer@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <XFlush@plt>

LLVM IR (-O0):
@None = global i32 0
define void @MoveCursorPos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32* @XOpenDisplay(i32 0)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %5
%10 = load i32, i32* @None
%11 = load i32, i32* @None
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @XWarpPointer(i32* %9, i32 %10, i32 %11, i32 0, i32 0, i32 0, i32 0, i32 %12, i32 %13)
%15 = load i32*, i32** %5
%16 = call i32 @XFlush(i32* %15)
ret void
}

LLVM IR (-O2):
@None = global i32 0
define void @MoveCursorPos(i32 %0, i32 %1) {
%3 = tail call i32* @XOpenDisplay(i32 0)
%4 = tail call i32 @assert(i32* %3)
%5 = load i32, i32* @None
%6 = tail call i32 @XWarpPointer(i32* %3, i32 %5, i32 %5, i32 0, i32 0, i32 0, i32 0, i32 %0, i32 %1)
%7 = tail call i32 @XFlush(i32* %3)
ret void
}
/* Variables and functions */
unsigned short iscntrl(char c) { return (c >= 0x00 && c <= 0x1F) || c == 0x7F; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1129 <iscntrl+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x1f,%ecx
mov    %al,-0x2(%rbp)
jle    1136 <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
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @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
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @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 i16
ret i16 %5
}
unsigned char deserializeUnsignedChar(void **buffer) {
  unsigned char r = *(unsigned char *)*buffer;
  *buffer += sizeof(unsigned char);
  return r;
}


x86 assembly (clang, -O0):
<deserializeUnsignedChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserializeUnsignedChar>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i8 @deserializeUnsignedChar(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr i8, i8* %8, i64 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @deserializeUnsignedChar(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ entry();
int /*<<< orphan*/ free(struct node *);
struct node *l_h_node(int /*<<< orphan*/);
int /*<<< orphan*/ pprint(struct node *);
int main(int argc, char *argv[]) {
  struct node *nd = l_h_node(entry());
  pprint(nd);
  free(nd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <entry@plt>
mov    %eax,%edi
call   1050 <l_h_node@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <pprint@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <entry@plt>
mov    %eax,%edi
call   1050 <l_h_node@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <pprint@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.node*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @entry()
%8 = call %struct.node* @l_h_node(i32 %7)
store %struct.node* %8, %struct.node** %6
%9 = load %struct.node*, %struct.node** %6
%10 = call i32 @pprint(%struct.node* %9)
%11 = load %struct.node*, %struct.node** %6
%12 = call i32 @free(%struct.node* %11)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @entry()
%4 = tail call %struct.node* @l_h_node(i32 %3)
%5 = tail call i32 @pprint(%struct.node* %4)
%6 = tail call i32 @free(%struct.node* %4)
ret i32 0
}
/* Type definitions */
struct _CSSOM_DequeItem_Int {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CSSOM_free(struct _CSSOM_DequeItem_Int *);
void DequeItem_Int_free(struct _CSSOM_DequeItem_Int *item) { CSSOM_free(item); }


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

x86 assembly (clang, -O2):
<DequeItem_Int_free>:
jmp    1030 <CSSOM_free@plt>

LLVM IR (-O0):
%struct._CSSOM_DequeItem_Int = type { i32 }
define void @DequeItem_Int_free(%struct._CSSOM_DequeItem_Int* %0) {
%2 = alloca %struct._CSSOM_DequeItem_Int*
store %struct._CSSOM_DequeItem_Int* %0, %struct._CSSOM_DequeItem_Int** %2
%3 = load %struct._CSSOM_DequeItem_Int*, %struct._CSSOM_DequeItem_Int** %2
%4 = call i32 @CSSOM_free(%struct._CSSOM_DequeItem_Int* %3)
ret void
}

LLVM IR (-O2):
%struct._CSSOM_DequeItem_Int = type { i32 }
define void @DequeItem_Int_free(%struct._CSSOM_DequeItem_Int* %0) {
%2 = tail call i32 @CSSOM_free(%struct._CSSOM_DequeItem_Int* %0)
ret void
}
void test_103(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 4; }


x86 assembly (clang, -O0):
<test_103>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0x4,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_103>:
movzwl 0x2(%rdi),%eax
shr    $0x4,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_103(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 4
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_103(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 4
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
__attribute__((always_)) void __rcu_read_lock(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<__rcu_read_lock>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__rcu_read_lock+0x9>
jmp    110e <__rcu_read_lock+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__rcu_read_lock() {
ret void
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *
get_group_classifier_in_SecAltIDGrp(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_SecAltIDGrp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_SecAltIDGrp(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Variables and functions */
int /*<<< orphan*/ test_single(int, int, int);
void test_each(int max) {
  int round = 1;
test_1:
  test_single(max, round, 10);
  round++;
  if (round < max)
    goto test_1;
}


x86 assembly (clang, -O0):
<test_each>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xa,%edx
call   1030 <test_single@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114c <test_each+0x3c>
jmp    1122 <test_each+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_each>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
cmp    $0x3,%edi
mov    $0x2,%ebx
cmovge %edi,%ebx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebp,%esi
mov    $0xa,%edx
call   1030 <test_single@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <test_each+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @test_each(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 2)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 1, %1 ], [ %6, %3 ]
%5 = tail call i32 @test_single(i32 %0, i32 %4, i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %2
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bits(int, int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned short);
void cc2400_syncl(unsigned short v) {
  char description[64];
  sprintf(description, "0x%04X", v);
  bits(15, 0, "SYNCWORD_LOWER", "RW", description);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec6(%rip),%rsi
movzwl -0x2(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0xf,%edi
xor    %esi,%esi
lea    0xeb2(%rip),%rdx
lea    0xeba(%rip),%rcx
call   1030 <bits@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x40,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec7(%rip),%rdx
lea    0xecf(%rip),%rcx
mov    $0xf,%edi
xor    %esi,%esi
mov    %rbx,%r8
call   1030 <bits@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"0x%04X\00"
@.str.1 = [15 x i8] c"SYNCWORD_LOWER\00"
@.str.2 = [3 x i8] c"RW\00"
define void @cc2400_syncl(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [64 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i16, i16* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @bits(i32 15, i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"0x%04X\00"
@.str.1 = [15 x i8] c"SYNCWORD_LOWER\00"
@.str.2 = [3 x i8] c"RW\00"
define void @cc2400_syncl(i16 zeroext %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 zeroext %0)
%5 = call i32 @bits(i32 15, i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}
int absi(int x) { return (x > 0) ? x : -x; }


x86 assembly (clang, -O0):
<absi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <absi+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absi+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absi>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absi(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
float correction(float xinput) {
  if (xinput > 2.625)
    return (0);
  else if (xinput < 1)
    return (-0.375 * xinput + 0.6825);
  else
    return (-0.1875 * xinput + 0.5);
}


x86 assembly (clang, -O0):
<correction>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1131 <correction+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119c <correction+0x9c>
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1172 <correction+0x72>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119c <correction+0x9c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<correction>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss 0xef3(%rip),%xmm1
ja     1149 <correction+0x49>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movss  0xee6(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1135 <correction+0x35>
mulsd  0xeed(%rip),%xmm0
addsd  0xeed(%rip),%xmm0
jmp    1145 <correction+0x45>
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @correction(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 2.625000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %21
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp olt float %9, 1.000000e+00
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = call double @llvm.fmuladd.f64(double -3.750000e-01, double %13, double 6.825000e-01)
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %21
16: ; preds = %8
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = call double @llvm.fmuladd.f64(double -1.875000e-01, double %18, double 5.000000e-01)
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %21
21: ; preds = %16, %11, %7
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @correction(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt float %0, 2.625000e+00
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = fcmp olt float %0, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call double @llvm.fmuladd.f64(double %2, double -3.750000e-01, double 6.825000e-01)
%8 = fptrunc double %7 to float
br label %12
9: ; preds = %4
%10 = tail call double @llvm.fmuladd.f64(double %2, double -1.875000e-01, double 5.000000e-01)
%11 = fptrunc double %10 to float
br label %12
12: ; preds = %1, %9, %6
%13 = phi float [ %8, %6 ], [ %11, %9 ], [ 0.000000e+00, %1 ]
ret float %13
}
char *f1(void) { return "Just a test..."; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Just a test...\00"
define i8* @f1() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Just a test...\00"
define i8* @f1() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
void ff_hevc_put_hevc_bi_epel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: rundsp prog\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: rundsp prog\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int sqlite3_config(int);
int goSqlite3ConfigThreadMode(int mode) { return sqlite3_config(mode); }


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

x86 assembly (clang, -O2):
<goSqlite3ConfigThreadMode>:
jmp    1030 <sqlite3_config@plt>

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

LLVM IR (-O2):
define i32 @goSqlite3ConfigThreadMode(i32 %0) {
%2 = tail call i32 @sqlite3_config(i32 %0)
ret i32 %2
}
/* Variables and functions */
int abs(int);
double ceil(double);
double fabs(double);
double floor(double);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%.2f\n", floor(6.3));
  printf("%.2f\n", ceil(6.3));
  printf("%.2f\n", fabs(-6.3));
  printf("%.2i\n", abs(-6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
movsd  0xeb9(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe99(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
@.str.1 = [6 x i8] c"%.2i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @llvm.floor.f64(double 6.300000e+00)
%3 = fptosi double %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call double @llvm.ceil.f64(double 6.300000e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call double @llvm.fabs.f64(double -6.300000e+00)
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @abs(i32 -6)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
@.str.1 = [6 x i8] c"%.2i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
char *piece_shift_left(char *, char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void test_piece_shift_left() {
  char str[100];
  strcpy(str, "zero,one,two,three,four");
  printf("should be one,two,three,four,zero: is = %s\n",
         piece_shift_left(str, ','));
}


x86 assembly (clang, -O0):
<test_piece_shift_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <piece_shift_left@plt>
mov    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_piece_shift_left>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <piece_shift_left@plt>
lea    0xebd(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"zero,one,two,three,four\00"
@.str.1 = [44 x i8] c"should be one,two,three,four,zero: is = %s\0A\00"
define void @test_piece_shift_left() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i8* @piece_shift_left(i8* %4, i8 signext 44)
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"zero,one,two,three,four\00"
@.str.1 = [44 x i8] c"should be one,two,three,four,zero: is = %s\0A\00"
define void @test_piece_shift_left() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @piece_shift_left(i8* %2, i8 signext 44)
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
int isprint(int ch) {
  ch &= 0x7f;
  return (ch >= 32 && ch < 127);
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1129 <isprint+0x29>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
and    $0x7f,%edi
cmp    $0x20,%edi
setae  %al
cmp    $0x7f,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 127
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ false, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ugt i32 %2, 31
%4 = icmp ne i32 %2, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void spool_write_script(int jobid) {
  printf("sleeping... %d\n", 1 + (jobid % 2));
  sleep(1 + (jobid % 2));
}


x86 assembly (clang, -O0):
<spool_write_script>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spool_write_script>:
push   %rbx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
neg    %eax
lea    (%rdi,%rax,1),%ebx
add    $0x1,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"sleeping... %d\0A\00"
define void @spool_write_script(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = add nsw i32 1, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = srem i32 %7, 2
%9 = add nsw i32 1, %8
%10 = call i32 @sleep(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"sleeping... %d\0A\00"
define void @spool_write_script(i32 %0) {
%2 = srem i32 %0, 2
%3 = add nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 %3)
ret void
}
/* Variables and functions */
int get8();
int get16(void) {
  int z = get8();
  return (z << 8) + get8();
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
push   %rbx
xor    %eax,%eax
call   1030 <get8@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <get8@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get16() {
%1 = alloca i32
%2 = call i32 (...) @get8()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 (...) @get8()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get16() {
%1 = tail call i32 (...) @get8()
%2 = shl i32 %1, 8
%3 = tail call i32 (...) @get8()
%4 = add nsw i32 %2, %3
ret i32 %4
}
void noSpacePlease(char *str) {
  if (str[0] == " ") {
    str = cutStrFrom(str, 1);
    noSpacePlease(str);
  }
}


x86 assembly (clang, -O0):
<noSpacePlease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
lea    0xec5(%rip),%rcx
cmp    %rcx,%rax
jne    1163 <noSpacePlease+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <cutStrFrom@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <noSpacePlease@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noSpacePlease>:
push   %rbx
movsbq (%rdi),%rax
lea    0xee4(%rip),%rbx
cmp    %rbx,%rax
jne    1148 <noSpacePlease+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <cutStrFrom@plt>
movslq %eax,%rdi
movsbq (%rdi),%rax
cmp    %rbx,%rax
je     1130 <noSpacePlease+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @noSpacePlease(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i8* %4, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %5, label %6, label %15
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %0, %1 ]
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @cutStrFrom to i32 (i8*, i32, ...)*)(i8* %7, i32 1)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = icmp eq i8* %13, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %14, label %6, label %15
15: ; preds = %6, %1
ret void
}
void __attribute__((weak)) EXTI14_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI14_Callback() {
ret void
}
int main(int charc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t get_i8(const uint8_t *tab) { return (int8_t)*tab; }


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

x86 assembly (clang, -O2):
<get_i8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_i8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ *tmpfile();
int main() {
  FILE *fp = tmpfile();
  if (ftell(fp) != 0) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ftell@plt>
cmp    $0x0,%rax
je     115d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <tmpfile@plt>
mov    %rax,%rdi
call   1050 <ftell@plt>
test   %rax,%rax
jne    1149 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* (...) @tmpfile()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i64 @ftell(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @tmpfile()
%2 = tail call i64 @ftell(i32* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}
void INT_ST2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_ST2() {
ret void
}
int xhci_create_debug_file(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @xhci_create_debug_file(%struct.device* nocapture readnone %0) {
ret i32 0
}
int main(int argc, char **argv) { int x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [10 x i32]* %5 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int strcmp(const void *s1, const void *s2) {
  while (*(char *)s1 && (*(char *)s1 == *(char *)s2))
    s1++, s2++;
  return *(const unsigned char *)s1 - *(const unsigned char *)s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *);
void STEAM_GetInterfaceVersion(char *p, int maxlen) {
  snprintf(p, maxlen, "0.0.0.0");
}


x86 assembly (clang, -O0):
<STEAM_GetInterfaceVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEAM_GetInterfaceVersion>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0.0.0.0\00"
define void @STEAM_GetInterfaceVersion(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 @snprintf(i8* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.0.0.0\00"
define void @STEAM_GetInterfaceVersion(i8* %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendbuf(char *);
void put_s(char *s) { sendbuf(s); }


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

x86 assembly (clang, -O2):
<put_s>:
jmp    1030 <sendbuf@plt>

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

LLVM IR (-O2):
define void @put_s(i8* %0) {
%2 = tail call i32 @sendbuf(i8* %0)
ret void
}
int test_imm_7Fuint16_reg(unsigned short val) {
  return ((val) & (-0x7F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -127
%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_7Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -127
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float cos(float);
float deg_cos(float deg) { return cos(deg * 0.01745329251); }


x86 assembly (clang, -O0):
<deg_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_cos>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define float @deg_cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A226E211
%6 = fptrunc double %5 to float
%7 = call float @cos(float %6)
ret float %7
}

LLVM IR (-O2):
define float @deg_cos(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A226E211
%4 = fptrunc double %3 to float
%5 = tail call float @cos(float %4)
ret float %5
}
int tj_log_removeLogcatChannel(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tj_log_removeLogcatChannel() {
ret i32 0
}