xunge/DecIR huggingface dataset:
void cb_version(char *string) {
  char *version = "1.1c";
  while (*version)
    *string++ = *version++;
  *string = 0x0;
}


x86 assembly (clang, -O0):
<cb_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <cb_version+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1113 <cb_version+0x13>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_version>:
movl   $0x63312e31,(%rdi)
movb   $0x0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @cb_version(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 49, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 46, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 49, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 99, i8* %4
store i8 0, i8* %5
ret void
}
void cycle_shift(char *dest, const char *const src, unsigned int n,
                 unsigned int msp) {
  unsigned int i;
  char *eos = dest + n;
  for (i = msp; dest < eos; i++, dest++) {
    i %= n;
    *dest = src[i];
  }
}


x86 assembly (clang, -O0):
<cycle_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    116b <cycle_shift+0x6b>
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1126 <cycle_shift+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_shift>:
test   %edx,%edx
je     1129 <cycle_shift+0x29>
mov    %ecx,%eax
mov    %edx,%r8d
mov    %edx,%ecx
add    %rdi,%rcx
xchg   %ax,%ax
xor    %edx,%edx
div    %r8d
mov    %edx,%eax
movzbl (%rsi,%rax,1),%edx
mov    %dl,(%rdi)
add    $0x1,%eax
add    $0x1,%rdi
cmp    %rcx,%rdi
jb     1110 <cycle_shift+0x10>
ret

LLVM IR (-O0):
define void @cycle_shift(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %7
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %10
%15 = load i32, i32* %8
store i32 %15, i32* %9
br label %16
16: ; preds = %30, %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %10
%19 = icmp ult i8* %17, %18
br i1 %19, label %20, label %35
20: ; preds = %16
%21 = load i32, i32* %7
%22 = load i32, i32* %9
%23 = urem i32 %22, %21
store i32 %23, i32* %9
%24 = load i8*, i8** %6
%25 = load i32, i32* %9
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = load i8*, i8** %5
store i8 %28, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %9
%32 = add i32 %31, 1
store i32 %32, i32* %9
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %5
br label %16
35: ; preds = %16
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void tbst_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<tbst_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <tbst_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbst_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @tbst_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @tbst_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ EC_GROUP;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, void *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_ECPARAMETERS;
scalar_t__ i2d_ECPKParameters;
int PEM_write_bio_ECPKParameters(BIO *bp, const EC_GROUP *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_ECPKParameters,
                            PEM_STRING_ECPARAMETERS, bp, (void *)x, NULL, NULL,
                            0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_ECPKParameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_ECPKParameters>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_ECPKParameters = global i64 0
@PEM_STRING_ECPARAMETERS = global i32 0
define i32 @PEM_write_bio_ECPKParameters(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_ECPKParameters
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_ECPARAMETERS
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = bitcast i32* %9 to i8*
%11 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i8* %10, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@i2d_ECPKParameters = global i64 0
@PEM_STRING_ECPARAMETERS = global i32 0
define i32 @PEM_write_bio_ECPKParameters(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_ECPKParameters
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_ECPARAMETERS
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i8* %6, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %7
}
int getchar2(void) {
  while (!((*(volatile unsigned int *)((0x3FF0000 + 0xE008))) & 0x20))
    ;
  return (int)(*(volatile unsigned int *)((0x3FF0000 + 0xE010)));
}


x86 assembly (clang, -O0):
<getchar2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getchar2+0x9>
mov    $0x3ffe008,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <getchar2+0x28>
jmp    112d <getchar2+0x2d>
jmp    1109 <getchar2+0x9>
mov    $0x3ffe010,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar2>:
testl  $0x20,0x3ffe008
je     1100 <getchar2>
mov    0x3ffe010,%eax
ret

LLVM IR (-O0):
define i32 @getchar2() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 67100680 to i32*)
%3 = and i32 %2, 32
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 67100688 to i32*)
ret i32 %8
}

LLVM IR (-O2):
define i32 @getchar2() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 67100680 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 67100688 to i32*)
ret i32 %6
}
void f(int *a, int *b) {
  int x;
  int *y;
  x = *a;
  x = *a;
  x = *a;
  x = *b;
  y = a;
  *a = 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x3,(%rdi)
ret

LLVM IR (-O0):
define void @f(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
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32*, i32** %3
store i32* %15, i32** %6
%16 = load i32*, i32** %3
store i32 3, i32* %16
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture writeonly %0, i32* nocapture readnone %1) {
store i32 3, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int _q_countsave(char const *, scalar_t__);
scalar_t__ time(int /*<<< orphan*/ *);
bool _update_timeout(const char *filepath, time_t timeout_interval) {
  if (timeout_interval <= 0)
    return false;
  if (_q_countsave(filepath, (time(NULL) + timeout_interval)) == false) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<_update_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jg     1147 <_update_timeout+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1184 <_update_timeout+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
add    -0x18(%rbp),%rsi
call   1030 <_q_countsave@plt>
cmp    $0x0,%eax
jne    117d <_update_timeout+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <_update_timeout+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_update_timeout>:
test   %rsi,%rsi
jle    1155 <_update_timeout+0x35>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <_q_countsave@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_update_timeout(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i64 @time(i32* null)
%12 = load i64, i64* %5
%13 = add nsw i64 %11, %12
%14 = call i32 @_q_countsave(i8* %10, i64 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 0, i32* %3
br label %18
17: ; preds = %9
store i32 1, i32* %3
br label %18
18: ; preds = %17, %16, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @_update_timeout(i8* %0, i64 %1) {
%3 = icmp slt i64 %1, 1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i64 @time(i32* null)
%6 = add nsw i64 %5, %1
%7 = tail call i32 @_q_countsave(i8* %0, i64 %6)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %11
}
int multi(int x, int y) { return x * y; }


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

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

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

LLVM IR (-O2):
define i32 @multi(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct crate {
  int dummy;
};

/* Variables and functions */
int crate_cmp(struct crate *, struct crate *);
int qcompar(const void *a, const void *b) {
  return crate_cmp(*(struct crate **)a, *(struct crate **)b);
}


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

x86 assembly (clang, -O2):
<qcompar>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <crate_cmp@plt>

LLVM IR (-O0):
%struct.crate = type { i32 }
define i32 @qcompar(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 = bitcast i8* %5 to %struct.crate**
%7 = load %struct.crate*, %struct.crate** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.crate**
%10 = load %struct.crate*, %struct.crate** %9
%11 = call i32 @crate_cmp(%struct.crate* %7, %struct.crate* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.crate = type { i32 }
define i32 @qcompar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.crate**
%4 = load %struct.crate*, %struct.crate** %3
%5 = bitcast i8* %1 to %struct.crate**
%6 = load %struct.crate*, %struct.crate** %5
%7 = tail call i32 @crate_cmp(%struct.crate* %4, %struct.crate* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int bar(int nargs, int *args) {
  int d = args[0];
  int x = 77;
  printf("bar called with %d, 77/%d is %d", d, d, x / d);
  return x / d;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x4d,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    (%rsi),%esi
mov    $0x4d,%eax
xor    %edx,%edx
idiv   %esi
mov    %eax,%ebx
lea    0xedb(%rip),%rdi
mov    %esi,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"bar called with %d, 77/%d is %d\00"
define i32 @bar(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
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 77, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@.str = [32 x i8] c"bar called with %d, 77/%d is %d\00"
define i32 @bar(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sdiv i32 77, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3, i32 %4)
ret i32 %4
}
int lib$extzv(int *position, char *size, int *base) {
  int retval;
  int s = *size;
  int pos = *position;
  int src_mask = (1 << s) - 1;
  retval = ((*base) >> pos) & src_mask;
  return retval;
}


x86 assembly (clang, -O0):
<lib$extzv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x24(%rbp),%ecx
sar    %cl,%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib$extzv>:
mov    (%rsi),%cl
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    (%rdi),%cl
not    %esi
mov    (%rdx),%eax
sar    %cl,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @"lib$extzv"(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %8
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = shl i32 1, %16
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %10
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32, i32* %9
%22 = ashr i32 %20, %21
%23 = load i32, i32* %10
%24 = and i32 %22, %23
store i32 %24, i32* %7
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @"lib$extzv"(i32* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i8, i8* %1
%5 = load i32, i32* %0
%6 = zext i8 %4 to i32
%7 = shl nsw i32 -1, %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %2
%10 = ashr i32 %9, %5
%11 = and i32 %10, %8
ret i32 %11
}
void ldb_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @ldb_iomux_config() {
ret void
}
int main() {
  int data1 = 10;
  int data2 = 20;
  int result;
  __asm__ __volatile__("cmp %1, %2\n\t"
                       "jge 0f\n\t"
                       "movl %1, %0\n\t"
                       "jmp 1f\n"
                       "0:\n\t"
                       "movl %2, %0\n"
                       "1:"
                       : "=r"(result)
                       : "r"(data1), "r"(data2));
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
cmp    %eax,%ecx
jge    1142 <main+0x32>
mov    %eax,%eax
jmp    1144 <main+0x34>
mov    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%eax
mov    $0x14,%ecx
cmp    %eax,%ecx
jge    1123 <main+0x13>
mov    %eax,%esi
jmp    1125 <main+0x15>
mov    %ecx,%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "cmp $1, $2\0A\09jge 0f\0A\09movl $1, $0\0A\09jmp 1f\0A0:\0A\09movl $2, $0\0A1:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "cmp $1, $2\0A\09jge 0f\0A\09movl $1, $0\0A\09jmp 1f\0A0:\0A\09movl $2, $0\0A1:", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int granalign(int x) { return x + (10 - x % 10); }


x86 assembly (clang, -O0):
<granalign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
sub    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<granalign>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @granalign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = sub nsw i32 10, %5
%7 = add nsw i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @granalign(i32 %0) {
%2 = srem i32 %0, 10
%3 = add i32 %0, 10
%4 = sub i32 %3, %2
ret i32 %4
}
int if_equal(int a, int b) { return (a ^ b); }


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

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

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

LLVM IR (-O2):
define i32 @if_equal(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
long double return_long_double(long double value) { return value; }


x86 assembly (clang, -O0):
<return_long_double>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_long_double>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @return_long_double(x86_fp80 returned %0) {
ret x86_fp80 %0
}
/* Variables and functions */
int FindCode(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ writes(char *);
int FindFlags(void) {
  int pos = FindCode("\x01\x06\x00\xED\xB0\xC9\x00\xFD", 0);
  if (pos == -1) {
    writes("Cannot find initial flag data.\n");
    exit(1);
  }
  return pos + 6;
}


x86 assembly (clang, -O0):
<FindFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %esi,%esi
call   1040 <FindCode@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1169 <FindFlags+0x39>
lea    0xeaf(%rip),%rdi
call   1030 <writes@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x6,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindFlags>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <FindCode@plt>
cmp    $0xffffffff,%eax
je     1149 <FindFlags+0x19>
add    $0x6,%eax
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <writes@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\01\06\00\ED\B0\C9\00\FD\00"
@.str.1 = [32 x i8] c"Cannot find initial flag data.\0A\00"
define i32 @FindFlags() {
%1 = alloca i32
%2 = call i32 @FindCode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @writes(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 6
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"\01\06\00\ED\B0\C9\00\FD\00"
@.str.1 = [32 x i8] c"Cannot find initial flag data.\0A\00"
define i32 @FindFlags() {
%1 = tail call i32 @FindCode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @writes(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = add nsw i32 %1, 6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ initCards(int *);
int /*<<< orphan*/ printCards(int *);
int /*<<< orphan*/ shuffleCards(int *);
int main() {
  int cards[52];
  initCards(cards);
  printCards(cards);
  shuffleCards(cards);
  printCards(cards);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe0(%rbp),%rdi
call   1030 <initCards@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <printCards@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <shuffleCards@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <printCards@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <initCards@plt>
mov    %rbx,%rdi
call   1050 <printCards@plt>
mov    %rbx,%rdi
call   1040 <shuffleCards@plt>
mov    %rbx,%rdi
call   1050 <printCards@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [52 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [52 x i32], [52 x i32]* %2, i64 0, i64 0
%4 = call i32 @initCards(i32* %3)
%5 = getelementptr inbounds [52 x i32], [52 x i32]* %2, i64 0, i64 0
%6 = call i32 @printCards(i32* %5)
%7 = getelementptr inbounds [52 x i32], [52 x i32]* %2, i64 0, i64 0
%8 = call i32 @shuffleCards(i32* %7)
%9 = getelementptr inbounds [52 x i32], [52 x i32]* %2, i64 0, i64 0
%10 = call i32 @printCards(i32* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [52 x i32]
%2 = bitcast [52 x i32]* %1 to i8*
%3 = getelementptr inbounds [52 x i32], [52 x i32]* %1, i64 0, i64 0
%4 = call i32 @initCards(i32* %3)
%5 = call i32 @printCards(i32* %3)
%6 = call i32 @shuffleCards(i32* %3)
%7 = call i32 @printCards(i32* %3)
ret i32 0
}
/* Variables and functions */
short find_pos(short *);
void move_left(short *puzzle) {
  short temp, pos = find_pos(puzzle);
  temp = puzzle[pos];
  puzzle[pos] = puzzle[pos - 1];
  puzzle[pos - 1] = temp;
}


x86 assembly (clang, -O0):
<move_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_pos@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0xa(%rbp),%dx
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_left>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_pos@plt>
movswq %ax,%rax
roll   $0x10,-0x2(%rbx,%rax,2)
pop    %rbx
ret

LLVM IR (-O0):
define void @move_left(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call signext i16 @find_pos(i16* %5)
store i16 %6, i16* %4
%7 = load i16*, i16** %2
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
store i16 %11, i16* %3
%12 = load i16*, i16** %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i16, i16* %12, i64 %16
%18 = load i16, i16* %17
%19 = load i16*, i16** %2
%20 = load i16, i16* %4
%21 = sext i16 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
store i16 %18, i16* %22
%23 = load i16, i16* %3
%24 = load i16*, i16** %2
%25 = load i16, i16* %4
%26 = sext i16 %25 to i32
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i16, i16* %24, i64 %28
store i16 %23, i16* %29
ret void
}

LLVM IR (-O2):
define void @move_left(i16* %0) {
%2 = tail call signext i16 @find_pos(i16* %0)
%3 = sext i16 %2 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = add nsw i64 %3, -1
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
store i16 %8, i16* %4
store i16 %5, i16* %7
ret void
}
/* Variables and functions */
int f309(int *);
int f310(int *p) { return f309(p); }


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

x86 assembly (clang, -O2):
<f310>:
jmp    1030 <f309@plt>

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

LLVM IR (-O2):
define i32 @f310(i32* %0) {
%2 = tail call i32 @f309(i32* %0)
ret i32 %2
}
/* Variables and functions */
int findMultipleSum_efficient(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int findMultipleDupes_efficient(int rootMultipleA, int rootMultipleB,
                                int maxValue, int totalSumOfMultipleB) {
  int dupedValue = rootMultipleA * rootMultipleB;
  int dupedSum = findMultipleSum_efficient(dupedValue, maxValue);
  printf("Duplicated Multiple to find = %d : Duplicated Total Sum = %d\n",
         dupedValue, dupedSum);
  return totalSumOfMultipleB - dupedSum;
}


x86 assembly (clang, -O0):
<findMultipleDupes_efficient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <findMultipleSum_efficient@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findMultipleDupes_efficient>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
imul   %edi,%ebp
mov    %ebp,%edi
mov    %edx,%esi
call   1040 <findMultipleSum_efficient@plt>
mov    %eax,%ebx
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
sub    %ebx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"Duplicated Multiple to find = %d : Duplicated Total Sum = %d\0A\00"
define i32 @findMultipleDupes_efficient(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = call i32 @findMultipleSum_efficient(i32 %14, i32 %15)
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %8
%21 = load i32, i32* %10
%22 = sub nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@.str = [62 x i8] c"Duplicated Multiple to find = %d : Duplicated Total Sum = %d\0A\00"
define i32 @findMultipleDupes_efficient(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = tail call i32 @findMultipleSum_efficient(i32 %5, i32 %2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = sub nsw i32 %3, %6
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
void test(wchar_t *dst) { dst[0] = 0; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @test(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @test(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void parr(int *arr, int len) {
  int i;
  for (i = 0; i < len; ++i)
    printf("%2d", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<parr>:
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    1159 <parr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <parr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%2d\00"
define void @parr(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Jacobi(int, int, double *, double *, double *);
extern void SolveJacobi(int n, int ks, double *A, double *x, double *b) {
  Jacobi(n, ks, A, x, b);
  return;
}


x86 assembly (clang, -O0):
<SolveJacobi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <Jacobi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveJacobi>:
jmp    1030 <Jacobi@plt>

LLVM IR (-O0):
define void @SolveJacobi(i32 %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %9
%15 = load double*, double** %10
%16 = call i32 @Jacobi(i32 %11, i32 %12, double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @SolveJacobi(i32 %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @Jacobi(i32 %0, i32 %1, double* %2, double* %3, double* %4)
ret void
}
void glmMakeVector3f(float result[3], const float p1[3], const float p2[3]) {
  result[0] = p2[0] - p1[0];
  result[1] = p2[1] - p1[1];
  result[2] = p2[2] - p1[2];
}


x86 assembly (clang, -O0):
<glmMakeVector3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMakeVector3f>:
movss  (%rdx),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rdx),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rdx),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmMakeVector3f(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %6
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %6
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %6
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @glmMakeVector3f(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %2
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %2, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %2, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Message(void) {
  CompileArgument();
  WriteInstruction("call dmsg");
}


x86 assembly (clang, -O0):
<CR_Message>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xece(%rip),%rdi
call   1040 <WriteInstruction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Message>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"call dmsg\00"
define void @CR_Message() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"call dmsg\00"
define void @CR_Message() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int, int);
int main(void) {
  for (int n = -10; n < 10; ++n)
    for (int offset = -33; offset <= 33; ++offset)
      test(n, 1, offset);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff6,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1172 <main+0x62>
movl   $0xffffffdf,-0xc(%rbp)
cmpl   $0x21,-0xc(%rbp)
jg     115f <main+0x4f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <test@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    1164 <main+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xfffffff6,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xffffffdf,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1030 <test@plt>
add    $0x1,%ebp
cmp    $0x22,%ebp
jne    1130 <main+0x20>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %4
%2 = phi i32 [ -10, %0 ], [ %5, %4 ]
br label %7
3: ; preds = %4
ret i32 0
4: ; preds = %7
%5 = add nsw i32 %2, 1
%6 = icmp eq i32 %5, 10
br i1 %6, label %3, label %1
7: ; preds = %1, %7
%8 = phi i32 [ -33, %1 ], [ %10, %7 ]
%9 = tail call i32 @test(i32 %2, i32 1, i32 %8)
%10 = add nsw i32 %8, 1
%11 = icmp eq i32 %10, 34
br i1 %11, label %4, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int *twosum(int *, int, int);
int main(void) {
  int a[] = {2, 7, 11, 15};
  int *idx = twosum(a, 4, 26);
  printf("%d\n", *idx);
  idx++;
  printf("%d\n", *idx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1a,%edx
call   1040 <twosum@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1a,%edx
call   1040 <twosum@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xec0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 2, i32 7, i32 11, i32 15]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%6 = call i32* @twosum(i32* %5, i32 4, i32 26)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 2, i32 7, i32 11, i32 15]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32* @twosum(i32* %3, i32 4, i32 26)
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %4, i64 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}