xunge/DecIR huggingface dataset:
int suma(char *p) {
  int suma1 = 0, i;
  while ((*p) != '\0') {
    if ((*p) >= '0' && (*p) <= '9') {
      suma1 += (*p - 48);
    }
    p++;
  }
  return suma1;
}


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <suma+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     114f <suma+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     114f <suma+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <suma+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
mov    (%rdi),%dl
test   %dl,%dl
je     112e <suma+0x2e>
add    $0x1,%rdi
xor    %ecx,%ecx
xor    %eax,%eax
xchg   %ax,%ax
movsbl %dl,%edx
lea    -0x30(%rdx),%esi
add    $0xffffffd0,%edx
cmp    $0xa,%sil
cmovae %ecx,%edx
add    %edx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <suma+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @suma(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i8* [ %14, %4 ], [ %0, %1 ]
%7 = phi i32 [ %13, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i8 %5, -48
%10 = icmp ult i8 %9, 10
%11 = add nsw i32 %8, -48
%12 = select i1 %10, i32 %11, i32 0
%13 = add nsw i32 %12, %7
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i32 [ 0, %1 ], [ %13, %4 ]
ret i32 %18
}
/* Type definitions */
struct dtree_dev_t {
  int dummy;
};

/* Variables and functions */
struct dtree_dev_t *dtree_procfs_next();
struct dtree_dev_t *dtree_next(void) {
  return dtree_procfs_next();
}


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

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

LLVM IR (-O0):
%struct.dtree_dev_t = type { i32 }
define %struct.dtree_dev_t* @dtree_next() {
%1 = call %struct.dtree_dev_t* (...) @dtree_procfs_next()
ret %struct.dtree_dev_t* %1
}

LLVM IR (-O2):
%struct.dtree_dev_t = type { i32 }
define %struct.dtree_dev_t* @dtree_next() {
%1 = tail call %struct.dtree_dev_t* (...) @dtree_procfs_next()
ret %struct.dtree_dev_t* %1
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_set_local_data_error(int);
int /*<<< orphan*/ fd_nrf8001_set_local_data_success();
void fd_nrf8001_dispatch_set_local_data_response(uint8_t status,
                                                 uint8_t *response_data
                                                 __attribute__((unused)),
                                                 uint32_t response_data_length
                                                 __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_set_local_data_error(status);
    return;
  }
  fd_nrf8001_set_local_data_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_set_local_data_response+0x29>
mov    -0x4(%rbp),%edi
call   1030 <fd_nrf8001_set_local_data_error@plt>
jmp    1150 <fd_nrf8001_dispatch_set_local_data_response+0x30>
mov    $0x0,%al
call   1040 <fd_nrf8001_set_local_data_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_set_local_data_response+0x9>
jmp    1030 <fd_nrf8001_set_local_data_error@plt>
xor    %eax,%eax
jmp    1040 <fd_nrf8001_set_local_data_success@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_set_local_data_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_set_local_data_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_set_local_data_success()
br label %9
9: ; preds = %7, %5
ret void
}
void av_ripemd_init() {}


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

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

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

LLVM IR (-O2):
define void @av_ripemd_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f2();
void f1() { f2(); }


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

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

LLVM IR (-O0):
define void @f1() {
%1 = call i32 (...) @f2()
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 (...) @f2()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACFrameFilterSet(uint32_t ui32Base, uint32_t ui32FilterOpts) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000004))) &
        ~(0x80000000 | 0x00010000 | 0x00000400 | 0x00000200 | 0x00000100 |
          (0x01 << 6) | (0x02 << 6) | (0x03 << 6) | 0x00000020 | 0x00000010 |
          0x00000008 | 0x00000004 | 0x00000002 | 0x00000001)) |
       ui32FilterOpts);
}


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

x86 assembly (clang, -O2):
<EMACFrameFilterSet>:
movslq %edi,%rax
mov    $0x7ffef800,%ecx
and    0x4(%rax),%ecx
or     %esi,%ecx
mov    %ecx,0x4(%rax)
ret

LLVM IR (-O0):
define void @EMACFrameFilterSet(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 = add nsw i32 %5, 4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 2147416064
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 4
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @EMACFrameFilterSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 4
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 2147416064
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CMasterIntDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000810))) = 0;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40002810,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisable>:
movq   $0x0,0x40002810
ret

LLVM IR (-O0):
define void @I2CMasterIntDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 0, i64* inttoptr (i64 1073752080 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisable(i32 %0) {
store volatile i64 0, i64* inttoptr (i64 1073752080 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ vfwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/);
void uninitvar_vfwscanf(void) {
  FILE *stream;
  wchar_t *format;
  va_list arg;
  (void)vfwscanf(stream, format, arg);
}


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

x86 assembly (clang, -O2):
<uninitvar_vfwscanf>:
jmp    1030 <vfwscanf@plt>

LLVM IR (-O0):
define void @uninitvar_vfwscanf() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = call i32 @vfwscanf(i32* %4, i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vfwscanf() {
%1 = tail call i32 @vfwscanf(i32* undef, i32* undef, i32 undef)
ret void
}
void api_stream_on_terminate(struct api_filter_t *filter) {}


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

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

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

LLVM IR (-O2):
%struct.api_filter_t = type opaque
define void @api_stream_on_terminate(%struct.api_filter_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int CMPRegionHeapToHeap() {
  int x = 0;
  int *x1 = malloc(8);
  int *x4 = x1;
  if (x1 == x4) {
    free(x1);
    return 5 / x;
  }
  return x;
}


x86 assembly (clang, -O0):
<CMPRegionHeapToHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    116d <CMPRegionHeapToHeap+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x5,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1173 <CMPRegionHeapToHeap+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMPRegionHeapToHeap>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CMPRegionHeapToHeap() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
void _Jv_Malloc() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_Malloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void writeConsole(char *s) {
  fprintf(stdout, "%s\n", s);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<writeConsole>:
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    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeConsole>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @writeConsole(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @writeConsole(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse(struct TreeNode *, int *, int *);
int kthSmallest(struct TreeNode *root, int k) {
  int value = 0;
  traverse(root, &k, &value);
  return value;
}


x86 assembly (clang, -O0):
<kthSmallest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <traverse@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kthSmallest>:
push   %rax
mov    %esi,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <traverse@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @kthSmallest(%struct.TreeNode* %0, i32 %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32
%5 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load %struct.TreeNode*, %struct.TreeNode** %3
%7 = call i32 @traverse(%struct.TreeNode* %6, i32* %4, i32* %5)
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @kthSmallest(%struct.TreeNode* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @traverse(%struct.TreeNode* %0, i32* %3, i32* %4)
%7 = load i32, i32* %4
ret i32 %7
}
void lsm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @lsm_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int /*<<< orphan*/ emsSeti(char *, int);
void ems_seti_(char *const token, int *const ivalue, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsSeti(ctok, *ivalue);
  return;
}


x86 assembly (clang, -O0):
<ems_seti_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0xf,%edx
call   1030 <cnfImpn@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <emsSeti@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_seti_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   1030 <cnfImpn@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1040 <emsSeti@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ems_seti_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = call i32 @cnfImpn(i8* %8, i32 %9, i32 15, i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @emsSeti(i8* %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @ems_seti_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @cnfImpn(i8* %0, i32 %2, i32 15, i8* %5)
%7 = load i32, i32* %1
%8 = call i32 @emsSeti(i8* %5, i32 %7)
ret void
}
/* Type definitions */
struct sysinfo {
  size_t uptime;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
size_t getUptime() {
  struct sysinfo info;
  sysinfo(&info);
  return info.uptime;
}


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

x86 assembly (clang, -O2):
<getUptime>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64 }
define i64 @getUptime() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
%struct.sysinfo = type { i64 }
define i64 @getUptime() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
unsigned char rand();
void gen_rand_str(unsigned char *buffer, size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    buffer[i] = rand();
  }
}


x86 assembly (clang, -O0):
<gen_rand_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <gen_rand_str+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <gen_rand_str+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_rand_str>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <gen_rand_str+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gen_rand_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @gen_rand_str(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call zeroext i8 (...) @rand()
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 %11, i8* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @gen_rand_str(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call zeroext i8 (...) @rand()
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %6, i8* %7
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    sleep(2);
    printf("\n i am a process,my process id is %d\n", getpid());
    printf("My parent's process id is %d\n\n", getppid());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0xed4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [38 x i8] c"\0A i am a process,my process id is %d\0A\00"
@.str.1 = [31 x i8] c"My parent's process id is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 2)
%4 = call i32 (...) @getpid()
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getppid()
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %2
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A i am a process,my process id is %d\0A\00"
@.str.1 = [31 x i8] c"My parent's process id is %d\0A\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 2)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @getppid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %1
}
char is_pawn(char p) { return (p & (1 << 0)) == (1 << 0); }


x86 assembly (clang, -O0):
<is_pawn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pawn>:
mov    %edi,%eax
and    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @is_pawn(i8 signext %0) {
%2 = and i8 %0, 1
ret i8 %2
}
int asn1_check_eoc(unsigned char **in, long len) {
  unsigned char *p;
  if (len < 2)
    return 0;
  p = *in;
  if (!p[0] && !p[1]) {
    *in += 2;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<asn1_check_eoc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jge    1123 <asn1_check_eoc+0x23>
movl   $0x0,-0x4(%rbp)
jmp    116a <asn1_check_eoc+0x6a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1163 <asn1_check_eoc+0x63>
mov    -0x20(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    1163 <asn1_check_eoc+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116a <asn1_check_eoc+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_check_eoc>:
xor    %eax,%eax
cmp    $0x2,%rsi
jl     1110 <asn1_check_eoc+0x10>
mov    (%rdi),%rcx
cmpb   $0x0,(%rcx)
je     1111 <asn1_check_eoc+0x11>
ret
cmpb   $0x0,0x1(%rcx)
jne    1110 <asn1_check_eoc+0x10>
add    $0x2,%rcx
mov    %rcx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @asn1_check_eoc(i8** nocapture %0, i64 %1) {
%3 = icmp slt i64 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %13, i8** %0
br label %14
14: ; preds = %4, %8, %2, %12
%15 = phi i32 [ 1, %12 ], [ 0, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %15
}
/* Variables and functions */
int f0();
int f1(int);
int f2(int, int);
int main() { return f0() + f1(1) + f2(2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f0@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1050 <f1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <f0@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <f1@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <f2@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f0()
%3 = call i32 @f1(i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @f2(i32 2, i32 3)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f0()
%2 = tail call i32 @f1(i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @f2(i32 2, i32 3)
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int strlength(char *);
void str_id(char *str) {
  char *other = str + strlength(str);
  while (str < other) {
    *str = *str;
    str++;
  }
}


x86 assembly (clang, -O0):
<str_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlength@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <str_id+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113d <str_id+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_id>:
jmp    1030 <strlength@plt>

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

LLVM IR (-O2):
define void @str_id(i8* %0) {
%2 = tail call i32 @strlength(i8* %0)
ret void
}
/* Variables and functions */
char *config_read_file(char *);
int /*<<< orphan*/ database_parse(char *);
int /*<<< orphan*/ free(char *);
int database_credentials() {
  char *source = config_read_file("config-private");
  database_parse(source);
  free(source);
  return 0;
}


x86 assembly (clang, -O0):
<database_credentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <config_read_file@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <database_parse@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<database_credentials>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <config_read_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <database_parse@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"config-private\00"
define i32 @database_credentials() {
%1 = tail call i8* @config_read_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @database_parse(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void bell() { putchar('\a'); }


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

x86 assembly (clang, -O2):
<bell>:
mov    $0x7,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @bell() {
%1 = call i32 @putchar(i8 signext 7)
ret void
}

LLVM IR (-O2):
define void @bell() {
%1 = tail call i32 @putchar(i8 signext 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sectioning_underscore(char *);
void cm_subheading(void) { sectioning_underscore("subheading"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"subheading\00"
define void @cm_subheading() {
%1 = tail call i32 @sectioning_underscore(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void negate() { emitln("neg\t%%eax"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"neg\09%%eax\00"
define void @negate() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"neg\09%%eax\00"
define void @negate() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
long aa_lmodulo(long a, long b) {
  return (((a) % (b)) + (b)) % (b);
  ;
}


x86 assembly (clang, -O0):
<aa_lmodulo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
add    -0x10(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_lmodulo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1119 <aa_lmodulo+0x19>
cqto
idiv   %rsi
mov    %rdx,%rax
jmp    111f <aa_lmodulo+0x1f>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
add    %rsi,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1137 <aa_lmodulo+0x37>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @aa_lmodulo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = srem i64 %5, %6
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
%10 = load i64, i64* %4
%11 = srem i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @aa_lmodulo(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = add nsw i64 %3, %1
%5 = srem i64 %4, %1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *pthread_barrier_init;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = pthread_barrier_init;
  exit(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    0x2eb3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@pthread_barrier_init = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** @pthread_barrier_init
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@pthread_barrier_init = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float fromRep32(int);
float makeNegativeInf32(void) { return fromRep32(0xff800000U); }


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

x86 assembly (clang, -O2):
<makeNegativeInf32>:
mov    $0xff800000,%edi
jmp    1030 <fromRep32@plt>

LLVM IR (-O0):
define float @makeNegativeInf32() {
%1 = call float @fromRep32(i32 -8388608)
ret float %1
}

LLVM IR (-O2):
define float @makeNegativeInf32() {
%1 = tail call float @fromRep32(i32 -8388608)
ret float %1
}
XSetCommand() {}


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

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

LLVM IR (-O0):
define i32 @XSetCommand() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetCommand() {
ret i32 undef
}
/* Type definitions */
struct cluster_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ cluster_cmdline_parser_required2(struct cluster_args_info *,
                                            char const *, int /*<<< orphan*/);
int cluster_cmdline_parser_required(struct cluster_args_info *args_info,
                                    const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (cluster_cmdline_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<cluster_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <cluster_cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <cluster_cmdline_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cluster_cmdline_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <cluster_cmdline_parser_required2@plt>
test   %rax,%rax
jle    112f <cluster_cmdline_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cluster_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cluster_cmdline_parser_required(%struct.cluster_args_info* %0, i8* %1) {
%3 = alloca %struct.cluster_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.cluster_args_info* %0, %struct.cluster_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.cluster_args_info*, %struct.cluster_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @cluster_cmdline_parser_required2(%struct.cluster_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.cluster_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cluster_cmdline_parser_required(%struct.cluster_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @cluster_cmdline_parser_required2(%struct.cluster_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int /*<<< orphan*/ write_l(int, int);
void entrypoint(void) {
  volatile unsigned int x = 5;
  volatile unsigned int y = 10;
  volatile unsigned int z = 0;
  while (1) {
    z = x + y;
    write_l(0xb0010548, (1 << 15));
    delay();
    write_l(0xb0010544, (1 << 15));
    delay();
  }
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    $0xb0010548,%edi
mov    $0x8000,%esi
call   1040 <write_l@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xb0010544,%edi
mov    $0x8000,%esi
call   1040 <write_l@plt>
mov    $0x0,%al
call   1030 <delay@plt>
jmp    113d <entrypoint+0x1d>

x86 assembly (clang, -O2):
<entrypoint>:
sub    $0x18,%rsp
movl   $0x5,0x14(%rsp)
movl   $0xa,0x10(%rsp)
movl   $0x0,0xc(%rsp)
nopl   0x0(%rax)
mov    0x14(%rsp),%eax
add    0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    $0xb0010548,%edi
mov    $0x8000,%esi
call   1040 <write_l@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xb0010544,%edi
mov    $0x8000,%esi
call   1040 <write_l@plt>
xor    %eax,%eax
call   1030 <delay@plt>
jmp    1140 <entrypoint+0x20>

LLVM IR (-O0):
define void @entrypoint() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store volatile i32 5, i32* %1
store volatile i32 10, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %0, %4
%5 = load volatile i32, i32* %1
%6 = load volatile i32, i32* %2
%7 = add i32 %5, %6
store volatile i32 %7, i32* %3
%8 = call i32 @write_l(i32 -1342110392, i32 32768)
%9 = call i32 (...) @delay()
%10 = call i32 @write_l(i32 -1342110396, i32 32768)
%11 = call i32 (...) @delay()
br label %4
}

LLVM IR (-O2):
define void @entrypoint() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 10, i32* %2
%6 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
br label %7
7: ; preds = %7, %0
%8 = load volatile i32, i32* %1
%9 = load volatile i32, i32* %2
%10 = add i32 %9, %8
store volatile i32 %10, i32* %3
%11 = tail call i32 @write_l(i32 -1342110392, i32 32768)
%12 = tail call i32 (...) @delay()
%13 = tail call i32 @write_l(i32 -1342110396, i32 32768)
%14 = tail call i32 (...) @delay()
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void banner(void) {
  printf("\n");
  printf("Memento CLI v %s\n", "0.0.1");
  printf("Type h or ? or help to print command list\n\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
lea    0xec9(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [18 x i8] c"Memento CLI v %s\0A\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@.str.3 = [44 x i8] c"Type h or ? or help to print command list\0A\0A\00"
define void @banner() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Memento CLI v %s\0A\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@str = [43 x i8] c"Type h or ? or help to print command list\0A\00"
define void @banner() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}
int stringHash2(char *str) {
  int i;
  int r = 0;
  for (i = 0; str[i] != '\0'; i++)
    r += (i + 1) * str[i];
  return r;
}


x86 assembly (clang, -O0):
<stringHash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1154 <stringHash2+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <stringHash2+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringHash2>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <stringHash2+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <stringHash2+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringHash2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, %8
%12 = add nsw i32 %11, %7
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %17
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
bool xscom_readable(uint64_t addr) {
  if (((addr >> 60) & 0xf) == 9)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<xscom_readable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
sar    %cl,%eax
and    $0xf,%eax
cmp    $0x9,%eax
jne    1129 <xscom_readable+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1130 <xscom_readable+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xscom_readable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 60
%6 = and i32 %5, 15
%7 = icmp eq i32 %6, 9
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @xscom_readable(i32 %0) {
ret i32 1
}
const int round_up(const int x) { return (x + 31) >> 5; }


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f,%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
lea    0x1f(%rdi),%eax
sar    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @round_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 31
%5 = ashr i32 %4, 5
ret i32 %5
}

LLVM IR (-O2):
define i32 @round_up(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = ashr i32 %2, 5
ret i32 %3
}