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

/* Variables and functions */
int /*<<< orphan*/ free(struct slist_node *);
int /*<<< orphan*/ printf(char *);
void _string_child_free(struct slist_node *node) {
  static int string_free_flag = 0;
  free(node);
  if (!string_free_flag) {
    string_free_flag = 1;
    printf("int node free\n");
  }
}


x86 assembly (clang, -O0):
<_string_child_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,0x2ef8(%rip)
jne    1158 <_string_child_free+0x38>
movl   $0x1,0x2ee8(%rip)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string_child_free>:
push   %rax
call   1030 <free@plt>
cmpb   $0x0,0x2f07(%rip)
je     1131 <_string_child_free+0x11>
pop    %rax
ret
movb   $0x1,0x2efc(%rip)
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.slist_node = type { i32 }
@_string_child_free.string_free_flag = internal global i32 0
@.str = [15 x i8] c"int node free\0A\00"
define void @_string_child_free(%struct.slist_node* %0) {
%2 = alloca %struct.slist_node*
store %struct.slist_node* %0, %struct.slist_node** %2
%3 = load %struct.slist_node*, %struct.slist_node** %2
%4 = call i32 @free(%struct.slist_node* %3)
%5 = load i32, i32* @_string_child_free.string_free_flag
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
store i32 1, i32* @_string_child_free.string_free_flag
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.slist_node = type { i32 }
@_string_child_free.string_free_flag = internal unnamed_addr global i1 false
@str = [14 x i8] c"int node free\00"
define void @_string_child_free(%struct.slist_node* nocapture %0) {
%2 = tail call i32 @free(%struct.slist_node* %0)
%3 = load i1, i1* @_string_child_free.string_free_flag
br i1 %3, label %6, label %4
4: ; preds = %1
store i1 true, i1* @_string_child_free.string_free_flag
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
unsigned char get_off_mask(unsigned int pos) {
  unsigned char array[] = {0xFE, 0xFC, 0xFA, 0xF7, 0xEF, 0xCF, 0xAF, 0x7F};
  return array[pos];
}


x86 assembly (clang, -O0):
<get_off_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0xc(%rbp,%rax,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_off_mask>:
mov    %edi,%eax
lea    0xef7(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.get_off_mask.array = [8 x i8] c"\FE\FC\FA\F7\EF\CF\AF\7F"
define zeroext i8 @get_off_mask(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 %0, i32* %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@__const.get_off_mask.array = [8 x i8] c"\FE\FC\FA\F7\EF\CF\AF\7F"
define zeroext i8 @get_off_mask(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.get_off_mask.array, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ MakeCPointList(int);
int /*<<< orphan*/ MakeCurveList(int);
void MakeJointLists(int joint) {
  MakeCurveList(joint);
  MakeCPointList(joint);
}


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

x86 assembly (clang, -O2):
<MakeJointLists>:
push   %rbx
mov    %edi,%ebx
call   1030 <MakeCurveList@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <MakeCPointList@plt>

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

LLVM IR (-O2):
define void @MakeJointLists(i32 %0) {
%2 = tail call i32 @MakeCurveList(i32 %0)
%3 = tail call i32 @MakeCPointList(i32 %0)
ret void
}
void SubOscillatorOff(void) {}


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

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

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

LLVM IR (-O2):
define void @SubOscillatorOff() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t bar_read8(uint32_t bar, uint32_t offset) {
  volatile uint8_t *preg = (volatile uint8_t *)(bar | (offset & 0xFF));
  return (*preg);
}


x86 assembly (clang, -O0):
<bar_read8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_read8>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @bar_read8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = or i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar_read8(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = or i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
int do_115() { return 115; }


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

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

LLVM IR (-O0):
define i32 @do_115() {
ret i32 115
}

LLVM IR (-O2):
define i32 @do_115() {
ret i32 115
}
int ft_isascii(int c) { return (0 <= c && c <= 127); }


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1121 <ft_isascii+0x21>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
void ff_hevc_put_hevc_epel_hv16_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv16_10_avx2() {
ret void
}
int proc1(int a, int b) { return a - b; }


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

x86 assembly (clang, -O2):
<proc1>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @proc1(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @proc1(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *UWAPI_StringDup(char const *s) {
  char *a = malloc(strlen(s) + 1);
  if (a)
    strcpy(a, s);
  return a;
}


x86 assembly (clang, -O0):
<UWAPI_StringDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <UWAPI_StringDup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UWAPI_StringDup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <UWAPI_StringDup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @UWAPI_StringDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @UWAPI_StringDup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("casecnvt1 version 1.0\nHitlion King\n"); }


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"casecnvt1 version 1.0\0AHitlion King\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void CFGMR3GetChildF(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3GetChildF() {
ret void
}
int BTSHASP_FlushToken() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @BTSHASP_FlushToken() {
ret i32 0
}
/* Variables and functions */
double modff(double, float *);
double modf(double value, double *pIntegral) {
  return modff(value, (float *)pIntegral);
}


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

x86 assembly (clang, -O2):
<modf>:
jmp    1030 <modff@plt>

LLVM IR (-O0):
define double @modf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = bitcast double* %6 to float*
%8 = call double @modff(double %5, float* %7)
ret double %8
}

LLVM IR (-O2):
define double @modf(double %0, double* nocapture %1) {
%3 = bitcast double* %1 to float*
%4 = tail call double @modff(double %0, float* %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ __wake_up();
int /*<<< orphan*/ xfer_secondary_pool();
void extract_entropy(void) {
  xfer_secondary_pool();
  __wake_up();
}


x86 assembly (clang, -O0):
<extract_entropy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <xfer_secondary_pool@plt>
mov    $0x0,%al
call   1030 <__wake_up@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_entropy>:
push   %rax
xor    %eax,%eax
call   1040 <xfer_secondary_pool@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__wake_up@plt>

LLVM IR (-O0):
define void @extract_entropy() {
%1 = call i32 (...) @xfer_secondary_pool()
%2 = call i32 (...) @__wake_up()
ret void
}

LLVM IR (-O2):
define void @extract_entropy() {
%1 = tail call i32 (...) @xfer_secondary_pool()
%2 = tail call i32 (...) @__wake_up()
ret void
}
int main() { return (5 + 3); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void dump_data_ascii(unsigned char *b, int count) {
  int i;
  for (i = 0; i < count; i++) {
    printf("%c", b[i]);
  }
}


x86 assembly (clang, -O0):
<dump_data_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <dump_data_ascii+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_data_ascii+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @dump_data_ascii(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ dicebag_roll(int);
int dicebag_dice(int number, int sides) {
  int value = 0;
  for (int i = 0; i < number; i++)
    value += dicebag_roll(sides);
  return value;
}


x86 assembly (clang, -O0):
<dicebag_dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <dicebag_dice+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <dicebag_roll@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <dicebag_dice+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dicebag_dice>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1131 <dicebag_dice+0x21>
mov    %esi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
nop
mov    %r14d,%edi
call   1030 <dicebag_roll@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <dicebag_dice+0x10>
jmp    1133 <dicebag_dice+0x23>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dicebag_dice(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i32 [ 0, %2 ], [ %11, %6 ]
ret i32 %5
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ 0, %2 ]
%8 = phi i32 [ %11, %6 ], [ 0, %2 ]
%9 = tail call i64 @dicebag_roll(i32 %1)
%10 = trunc i64 %9 to i32
%11 = add i32 %8, %10
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %4, label %6
}
void atm_proc_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @atm_proc_exit() {
ret void
}
/* Variables and functions */
int voCore_writeFile(char *, char *, char *);
int voCore_gpioSetValue(char *index, char *valeur) {
  return voCore_writeFile("/value", index, valeur);
}


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

x86 assembly (clang, -O2):
<voCore_gpioSetValue>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <voCore_writeFile@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"/value\00"
define i32 @voCore_gpioSetValue(i8* %0, i8* %1) {
%3 = tail call i32 @voCore_writeFile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 %3
}
void _Jv_AllocString() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_AllocString() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sock_sendline(char *, char *, char *);
void ircproto_mode(char *chan_name, char *modes) {
  sock_sendline("MODE %s %s", chan_name, modes);
}


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

x86 assembly (clang, -O2):
<ircproto_mode>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <sock_sendline@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"MODE %s %s\00"
define void @ircproto_mode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sock_sendline(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"MODE %s %s\00"
define void @ircproto_mode(i8* %0, i8* %1) {
%3 = tail call i32 @sock_sendline(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void prepare_switch_to(struct task_struct *prev, struct task_struct *next) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @prepare_switch_to(%struct.task_struct* %0, %struct.task_struct* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @prepare_switch_to(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
float simple_sqrt(const float x) {
  const float xhalf = 0.5f * x;
  union {
    float x;
    int i;
  } u;
  u.x = x;
  u.i = 0x5f3759df - (u.i >> 1);
  return x * u.x * (1.5f - xhalf * u.x * u.x);
}


x86 assembly (clang, -O0):
<simple_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe99(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_sqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
movdqa %xmm1,%xmm2
mulss  %xmm0,%xmm2
mulss  0xedf(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xed3(%rip),%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @simple_sqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = bitcast %union.anon* %4 to float*
store float %7, float* %8
%9 = bitcast %union.anon* %4 to i32*
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
%12 = sub nsw i32 1597463007, %11
%13 = bitcast %union.anon* %4 to i32*
store i32 %12, i32* %13
%14 = load float, float* %2
%15 = bitcast %union.anon* %4 to float*
%16 = load float, float* %15
%17 = fmul float %14, %16
%18 = load float, float* %3
%19 = bitcast %union.anon* %4 to float*
%20 = load float, float* %19
%21 = fmul float %18, %20
%22 = bitcast %union.anon* %4 to float*
%23 = load float, float* %22
%24 = fneg float %21
%25 = call float @llvm.fmuladd.f32(float %24, float %23, float 1.500000e+00)
%26 = fmul float %17, %25
ret float %26
}

LLVM IR (-O2):
define float @simple_sqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %5, %0
%7 = fmul float %0, -5.000000e-01
%8 = fmul float %7, %5
%9 = tail call float @llvm.fmuladd.f32(float %8, float %5, float 1.500000e+00)
%10 = fmul float %6, %9
ret float %10
}
int _kill(int n, int m) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
signed long long int signedlonglongint_ignoring_shortint(signed long long int x,
                                                         short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlonglongint_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
int do_parse_flags(char const **, char const *, int /*<<< orphan*/);
int parse_one_flag(const char **strp, const char *flags) {
  return do_parse_flags(strp, flags, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @parse_one_flag(i8** %0, i8* %1) {
%3 = tail call i32 @do_parse_flags(i8** %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u8(void) { return (rand() & 0xff); }


x86 assembly (clang, -O0):
<mk_rnd_u8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u8() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 255
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u8() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
size_t grow_cap(size_t cap) { return cap + (cap >> 1); }


x86 assembly (clang, -O0):
<grow_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_cap>:
mov    %rdi,%rax
shr    %rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @grow_cap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 1
%6 = add i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @grow_cap(i64 %0) {
%2 = lshr i64 %0, 1
%3 = add i64 %2, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ puts(char *);
char *strdup(int /*<<< orphan*/);
char *get_user() {
  struct passwd *pw;
  uint64_t uid;
  uid = getuid();
  pw = getpwuid(uid);
  if (!pw) {
    puts("????");
    exit(1);
  }
  return strdup(pw->pw_name);
}


x86 assembly (clang, -O0):
<get_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118f <get_user+0x3f>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1070 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user>:
push   %rax
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
test   %rax,%rax
je     116c <get_user+0x1c>
mov    (%rax),%edi
pop    %rax
jmp    1070 <strdup@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"????\00"
define i8* @get_user() {
%1 = alloca %struct.passwd*
%2 = alloca i32
%3 = call i32 (...) @getuid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %1
%6 = load %struct.passwd*, %struct.passwd** %1
%7 = icmp ne %struct.passwd* %6, null
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load %struct.passwd*, %struct.passwd** %1
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i8* @strdup(i32 %14)
ret i8* %15
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"????\00"
define i8* @get_user() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i8* @strdup(i32 %9)
ret i8* %10
}
void pbstr(in) char *in;
{
  register int i;
  for (i = strlen(in) - 1; i >= 0; i--)
    pushback(in[i] & 0xFF);
}


x86 assembly (clang, -O0):
<pbstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116d <pbstr+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1040 <pushback@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <pbstr+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0xffffffff,%eax
js     1156 <pbstr+0x36>
mov    %eax,%eax
add    %rax,%r14
nopl   0x0(%rax)
movzbl (%r14),%edi
xor    %eax,%eax
call   1040 <pushback@plt>
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%r14
test   %ebx,%ebx
jg     1140 <pbstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @pbstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub i64 %5, 1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
br label %8
8: ; preds = %20, %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = and i32 %17, 255
%19 = call i32 (i32, ...) bitcast (i32 (...)* @pushback to i32 (i32, ...)*)(i32 %18)
br label %20
20: ; preds = %11
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @pbstr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, -1
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %15
6: ; preds = %1, %6
%7 = phi i32 [ %13, %6 ], [ %4, %1 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @pushback to i32 (i32, ...)*)(i32 %11)
%13 = add nsw i32 %7, -1
%14 = icmp sgt i32 %7, 0
br i1 %14, label %6, label %15
15: ; preds = %6, %1
ret void
}
int slice_width(int sig_width, int slices, int slice_n) {
  int pos_start = sig_width * slice_n / slices;
  int pos_end = sig_width * (slice_n + 1) / slices;
  return pos_end - pos_start;
}


x86 assembly (clang, -O0):
<slice_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_width>:
mov    %edx,%ecx
mov    %edx,%eax
imul   %edi,%eax
cltd
idiv   %esi
mov    %eax,%r8d
add    $0x1,%ecx
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @slice_width(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
%17 = mul nsw i32 %14, %16
%18 = load i32, i32* %5
%19 = sdiv i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @slice_width(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %4, %1
%6 = add nsw i32 %2, 1
%7 = mul nsw i32 %6, %0
%8 = sdiv i32 %7, %1
%9 = sub nsw i32 %8, %5
ret i32 %9
}
void pops(s) char *s;
{
  void pushc(), trash();
  trash();
  for (; isalnum(*s = popc()); ++s)
    ;
  pushc(*s);
  *s = '\0';
  return;
}


x86 assembly (clang, -O0):
<pops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <trash@plt>
mov    $0x0,%al
call   1060 <popc@plt>
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
je     1187 <pops+0x47>
jmp    1176 <pops+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pops+0x13>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1050 <pushc@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pops>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <trash@plt>
nopl   (%rax)
xor    %eax,%eax
call   1060 <popc@plt>
mov    %al,(%rbx)
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isalnum@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1150 <pops+0x10>
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <pushc@plt>
movb   $0x0,-0x1(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pops(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %11, %1
%4 = call i32 (...) @popc()
%5 = trunc i32 %4 to i8
%6 = load i8*, i8** %2
store i8 %5, i8* %6
%7 = sext i8 %5 to i32
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
br label %11
11: ; preds = %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %2
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
define void @pops(i8* nocapture writeonly %0) {
tail call void (...) @trash()
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %10, %2 ]
%4 = tail call i32 (...) @popc()
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = shl i32 %4, 24
%7 = ashr exact i32 %6, 24
%8 = tail call i32 @isalnum(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %9, label %11, label %2
11: ; preds = %2
tail call void (i32, ...) bitcast (void (...)* @pushc to void (i32, ...)*)(i32 %7)
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "%s [-v] [-o output_filename] input_files ...\n", prog);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"%s [-v] [-o output_filename] input_files ...\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"%s [-v] [-o output_filename] input_files ...\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG(int /*<<< orphan*/, char *);
int cmd_history(void) {
  DEBUG(0, ("no history without readline support\n"));
  return 0;
}


x86 assembly (clang, -O0):
<cmd_history>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <DEBUG@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_history>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <DEBUG@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"no history without readline support\0A\00"
define i32 @cmd_history() {
%1 = call i32 @DEBUG(i32 0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"no history without readline support\0A\00"
define i32 @cmd_history() {
%1 = tail call i32 @DEBUG(i32 0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int first_colon(char *p) {
  int n = 0;
  while (p[n] && p[n] != ':')
    n++;
  return n;
}


x86 assembly (clang, -O0):
<first_colon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     113e <first_colon+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <first_colon+0x4e>
jmp    115c <first_colon+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <first_colon+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_colon>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <first_colon+0x23>
cmp    $0x3a,%cl
je     1123 <first_colon+0x23>
add    $0x1,%rax
jmp    1110 <first_colon+0x10>
ret

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

LLVM IR (-O2):
define i32 @first_colon(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 58, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_byte(unsigned char, int, unsigned char);
void setLed(unsigned char id, unsigned char on) {
  dxl_write_byte(id, (25), on);
}


x86 assembly (clang, -O0):
<setLed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x19,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <dxl_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLed>:
mov    %esi,%edx
mov    $0x19,%esi
jmp    1030 <dxl_write_byte@plt>

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

LLVM IR (-O2):
define void @setLed(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @dxl_write_byte(i8 zeroext %0, i32 25, i8 zeroext %1)
ret void
}
int noop_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @noop_shutdown() {
ret i32 0
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ kbhit();
int getkey() {
  while (!kbhit())
    ;
  return inb(0x3f8);
}


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <getkey+0x9>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <getkey+0x25>
jmp    114a <getkey+0x2a>
jmp    1129 <getkey+0x9>
mov    $0x3f8,%edi
call   1040 <inb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1130 <getkey+0x10>
mov    $0x3f8,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define i32 @getkey() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @kbhit()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 @inb(i32 1016)
ret i32 %7
}

LLVM IR (-O2):
define i32 @getkey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 @inb(i32 1016)
ret i32 %5
}
void genbeq_test() {}


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

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

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

LLVM IR (-O2):
define void @genbeq_test() {
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void cls(int hndl) {
  int rslt;
  rslt = close(hndl);
  if (rslt < 0) {
    fprintf(stderr, "cls: close error %d\n", hndl);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1172 <cls+0x42>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
push   %rbx
mov    %edi,%ebx
call   1030 <close@plt>
test   %eax,%eax
js     113e <cls+0xe>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"cls: close error %d\0A\00"
define void @cls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"cls: close error %d\0A\00"
define void @cls(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void unsigned_char_and_signed_char_unsigned_int(unsigned char *LHS,
                                                unsigned int RHS) {
  (*LHS) &= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_and_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_and_signed_char_unsigned_int>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_and_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_and_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = and i8 %3, %4
store i8 %5, i8* %0
ret void
}