xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strcpy(char *__restrict to, const char *__restrict from) {
  char *save = to;
  for (; (*to = *from); ++from, ++to)
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114a <strcpy+0x4a>
jmp    112d <strcpy+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal_str(int /*<<< orphan*/ *, char *, char *,
                                    char *);
char *pl_slice(char *, int, int);
void test_slice_equal_offlim() {
  char the_string[] = "spam, eggs, and ham";
  char *ret_val;
  ret_val = pl_slice(the_string, 3, 3);
  assert_equal_str(NULL, ret_val, "test_slice_equal_offlim",
                   "The strings are not equal.");
}


x86 assembly (clang, -O0):
<test_slice_equal_offlim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1040 <pl_slice@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xeaa(%rip),%rdx
lea    0xebb(%rip),%rcx
call   1030 <assert_equal_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_slice_equal_offlim>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x6d6168,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1040 <pl_slice@plt>
lea    0xec4(%rip),%rdx
lea    0xed5(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
call   1030 <assert_equal_str@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_slice_equal_offlim.the_string = [20 x i8] c"spam, eggs, and ham\00"
@.str = [24 x i8] c"test_slice_equal_offlim\00"
@.str.1 = [27 x i8] c"The strings are not equal.\00"
define void @test_slice_equal_offlim() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = bitcast [20 x i8]* %1 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i8* @pl_slice(i8* %4, i32 3, i32 3)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @assert_equal_str(i32* null, i8* %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test_slice_equal_offlim.the_string = [20 x i8] c"spam, eggs, and ham\00"
@.str = [24 x i8] c"test_slice_equal_offlim\00"
@.str.1 = [27 x i8] c"The strings are not equal.\00"
define void @test_slice_equal_offlim() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @pl_slice(i8* %2, i32 3, i32 3)
%4 = call i32 @assert_equal_str(i32* null, i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void right_case_1(struct rbt *tree, struct node *node, struct node *sibling) {}


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

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

LLVM IR (-O0):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_1(%struct.rbt* %0, %struct.node* %1, %struct.node* %2) {
%4 = alloca %struct.rbt*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.rbt* %0, %struct.rbt** %4
store %struct.node* %1, %struct.node** %5
store %struct.node* %2, %struct.node** %6
ret void
}

LLVM IR (-O2):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_1(%struct.rbt* nocapture %0, %struct.node* nocapture %1, %struct.node* nocapture %2) {
ret void
}
int unmarshall(char *s) { return 10 * (s[0] - 'A') + s[1] - '1'; }


x86 assembly (clang, -O0):
<unmarshall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
sub    $0x31,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmarshall>:
movsbl (%rdi),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rax,2),%eax
add    $0xfffffd45,%eax
ret

LLVM IR (-O0):
define i32 @unmarshall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 65
%8 = mul nsw i32 10, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = sub nsw i32 %13, 49
ret i32 %14
}

LLVM IR (-O2):
define i32 @unmarshall(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %4, -699
%9 = add nsw i32 %8, %7
ret i32 %9
}
void c16k_set_b(const unsigned char source, int values[], int *bar_chars) {
  if (source > 127) {
    values[(*bar_chars)] = source - 32 - 128;
  } else {
    values[(*bar_chars)] = source - 32;
  }
  (*bar_chars)++;
}


x86 assembly (clang, -O0):
<c16k_set_b>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
jle    113f <c16k_set_b+0x3f>
movzbl -0x1(%rbp),%edx
sub    $0x20,%edx
sub    $0x80,%edx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1154 <c16k_set_b+0x54>
movzbl -0x1(%rbp),%edx
sub    $0x20,%edx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c16k_set_b>:
xor    %eax,%eax
test   %dil,%dil
setns  %al
shl    $0x7,%eax
add    %edi,%eax
add    $0xffffff60,%eax
movslq (%rdx),%rcx
mov    %eax,(%rsi,%rcx,4)
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @c16k_set_b(i8 zeroext %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = zext i8 %0 to i32
%5 = icmp slt i8 %0, 0
%6 = select i1 %5, i32 -160, i32 -32
%7 = add nsw i32 %6, %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %1, i64 %9
store i32 %7, i32* %10
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int ENOSYS;
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol) {
  return (ENOSYS);
}


x86 assembly (clang, -O0):
<pthread_mutexattr_setprotocol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_setprotocol>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_mutexattr_setprotocol(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
int ieee80211_fhss_chan_to_freq(int channel) {
  if ((channel > 1) && (channel < 96))
    return channel + 2400;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ieee80211_fhss_chan_to_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    112b <ieee80211_fhss_chan_to_freq+0x2b>
cmpl   $0x60,-0x8(%rbp)
jge    112b <ieee80211_fhss_chan_to_freq+0x2b>
mov    -0x8(%rbp),%eax
add    $0x960,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ieee80211_fhss_chan_to_freq+0x32>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_fhss_chan_to_freq>:
lea    -0x2(%rdi),%eax
lea    0x960(%rdi),%ecx
cmp    $0x5e,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ieee80211_fhss_chan_to_freq(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 94
%4 = add nsw i32 %0, 2400
%5 = select i1 %3, i32 %4, i32 -1
ret i32 %5
}
int test(str)
register char *str;
{
  char tokenbuf[510];
  if (match(tokenbuf, str))
    return (1);
  else {
    pbstr(tokenbuf);
    return (0);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <match@plt>
cmp    $0x0,%eax
je     1156 <test+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116b <test+0x4b>
lea    -0x210(%rbp),%rdi
mov    $0x0,%al
call   1040 <pbstr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x208,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <match@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1147 <test+0x27>
add    $0x208,%rsp
ret
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <pbstr@plt>
xor    %eax,%eax
add    $0x208,%rsp
ret

LLVM IR (-O0):
define i32 @test(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [510 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [510 x i8], [510 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds [510 x i8], [510 x i8]* %4, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @test(i8* %0) {
%2 = alloca [510 x i8]
%3 = getelementptr inbounds [510 x i8], [510 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %3, i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %9
}
void send_host(unsigned long data) {}


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

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

LLVM IR (-O0):
define void @send_host(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @send_host(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
main() {
  int x = 1;
  int y = 2;
  swap(&x, &y);
  printf("%d %d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _lis(int *, int, int *);
int longest_increasing_subsequence(int data[], int size) {
  int max_length = 1;
  _lis(data, size, &max_length);
  return max_length;
}


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

x86 assembly (clang, -O2):
<longest_increasing_subsequence>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <_lis@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @longest_increasing_subsequence(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 1, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @_lis(i32* %6, i32 %7, i32* %5)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @longest_increasing_subsequence(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @_lis(i32* %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ findPair(int *, int, int);
int main() {
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 2};
  findPair(a, 10, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
call   1030 <findPair@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
mov    $0x4,%edx
call   1030 <findPair@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 2]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @findPair(i32* %3, i32 10, i32 4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t ROTR32(int32_t value, int32_t rotbits) {
  return (((uint32_t)value >> rotbits) | (value << (32 - rotbits)));
}


x86 assembly (clang, -O0):
<ROTR32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTR32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ROTR32(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ROTR32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
float SLOW_OperatorMul(float a, float b) { return a * b; }


x86 assembly (clang, -O0):
<SLOW_OperatorMul>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLOW_OperatorMul>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @SLOW_OperatorMul(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  while (1) {
    printf("y\n\r");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"y\0A\0D\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"y\0A\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %3
}
_Complex float test1(_Complex float f) {
  __asm__("" : "+r"(__real f));
  return f;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
movd   %xmm0,%eax
movd   %eax,%xmm1
movss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @test1(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = call float asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(float %6)
store float %7, float* %5
%8 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%13 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %9, float* %12
store float %11, float* %13
%14 = bitcast { float, float }* %2 to <2 x float>*
%15 = load <2 x float>, <2 x float>* %14
ret <2 x float> %15
}

LLVM IR (-O2):
define <2 x float> @test1(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
%3 = tail call float asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(float %2)
%4 = insertelement <2 x float> %0, float %3, i64 0
ret <2 x float> %4
}
float fun5() {}


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

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

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

LLVM IR (-O2):
define float @fun5() {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void Done(void) { putchar(':'); }


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

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

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

LLVM IR (-O2):
define void @Done() {
%1 = tail call i32 @putchar(i8 signext 58)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, unsigned int);
void bar(unsigned int a) { foo("%s", a); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <foo@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @bar(i32 %0) {
%2 = tail call i32 @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mhs_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<mhs_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mhs_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t crc_ibm_shift(unsigned bit, uint16_t bcc) {
  unsigned val = ((bcc >> 15) ^ bit) & 1;
  if (val != 0) {
    bcc <<= 1;
    bcc ^= 0x8005;
  } else {
    bcc <<= 1;
  }
  return bcc & 0xffff;
}


x86 assembly (clang, -O0):
<crc_ibm_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0xf,%eax
xor    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113c <crc_ibm_shift+0x3c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x8005,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <crc_ibm_shift+0x45>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_ibm_shift>:
mov    %esi,%eax
shr    $0xf,%eax
xor    %edi,%eax
add    %esi,%esi
mov    %esi,%ecx
xor    $0x8005,%ecx
test   $0x1,%al
cmove  %esi,%ecx
movzwl %cx,%eax
ret

LLVM IR (-O0):
define i32 @crc_ibm_shift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = ashr i32 %6, 15
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
%10 = and i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* %4
%15 = shl i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = xor i32 %16, 32773
store i32 %17, i32* %4
br label %21
18: ; preds = %2
%19 = load i32, i32* %4
%20 = shl i32 %19, 1
store i32 %20, i32* %4
br label %21
21: ; preds = %18, %13
%22 = load i32, i32* %4
%23 = and i32 %22, 65535
ret i32 %23
}

LLVM IR (-O2):
define i32 @crc_ibm_shift(i32 %0, i32 %1) {
%3 = lshr i32 %1, 15
%4 = xor i32 %3, %0
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = shl i32 %1, 1
%8 = xor i32 %7, 32773
%9 = select i1 %6, i32 %7, i32 %8
%10 = and i32 %9, 65535
ret i32 %10
}
int ConfigConvertModeToInt(const char *str) {
  int i;
  int r;
  r = 0;
  for (i = 0; str[i] != '\0'; i++)
    r = (r * 8) + ((int)str[i] - (int)'0');
  return (r);
}


x86 assembly (clang, -O0):
<ConfigConvertModeToInt>:
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     1153 <ConfigConvertModeToInt+0x53>
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ConfigConvertModeToInt+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigConvertModeToInt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <ConfigConvertModeToInt+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ConfigConvertModeToInt+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ConfigConvertModeToInt(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 = %24, %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 %27
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 8
%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 = sub nsw i32 %21, 48
%23 = add nsw i32 %15, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %13
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @ConfigConvertModeToInt(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 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl nsw i32 %7, 3
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%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 ], [ %11, %4 ]
ret i32 %17
}
void test12(unsigned a) {
  if (0 && -1 > a) {
  }
}


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

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

LLVM IR (-O0):
define void @test12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @test12(i32 %0) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)(t.tv_sec + t.tv_usec / 1e6);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdl 0x8(%rsp),%xmm0
divsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
typedef int const uint64_t;

/* Variables and functions */
int UINT64_C(int);
uint64_t fBlaMka(uint64_t x, uint64_t y) {
  const uint64_t m = UINT64_C(0xFFFFFFFF);
  const uint64_t xy = (x & m) * (y & m);
  return x + y + 2 * xy;
}


x86 assembly (clang, -O0):
<fBlaMka>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <UINT64_C@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fBlaMka>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xffffffff,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
and    %ebp,%ecx
and    %ebx,%eax
imul   %ecx,%eax
add    %ebp,%ebx
lea    (%rbx,%rax,2),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fBlaMka(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 = call i32 @UINT64_C(i32 -1)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = and i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = and i32 %11, %12
%14 = mul nsw i32 %10, %13
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %6
%19 = mul nsw i32 2, %18
%20 = add nsw i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @fBlaMka(i32 %0, i32 %1) {
%3 = tail call i32 @UINT64_C(i32 -1)
%4 = and i32 %3, %0
%5 = and i32 %3, %1
%6 = add nsw i32 %1, %0
%7 = shl i32 %5, 1
%8 = mul i32 %7, %4
%9 = add nsw i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeMemoryBlock(void **memory_pointer, int memory_block_index) {
  free(memory_pointer[memory_block_index]);
  return;
}


x86 assembly (clang, -O0):
<freeMemoryBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMemoryBlock>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeMemoryBlock(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @freeMemoryBlock(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
ret void
}
long long fll2(long long j, char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll2>:
movsbq (%rsi,%rdx,1),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fll2(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fll2(i64 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
scalar_t__ clock();
void Temporisation(int n) {
  clock_t start, stop;
  n = n * CLOCKS_PER_SEC / 1000;
  start = clock();
  stop = start + n;
  while (clock() < stop) {
  }
}


x86 assembly (clang, -O0):
<Temporisation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
imul   (%rcx),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x18(%rbp),%rax
jge    1163 <Temporisation+0x53>
jmp    114d <Temporisation+0x3d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Temporisation>:
push   %rbx
mov    0x2ed0(%rip),%rax
imul   (%rax),%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x26,%rbx
add    %eax,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
movslq %ebx,%rbx
add    %rax,%rbx
nop
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1140 <Temporisation+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @Temporisation(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @CLOCKS_PER_SEC
%7 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 1000
store i32 %8, i32* %2
%9 = call i64 (...) @clock()
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = add nsw i64 %10, %12
store i64 %13, i64* %4
br label %14
14: ; preds = %18, %1
%15 = call i64 (...) @clock()
%16 = load i64, i64* %4
%17 = icmp slt i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
br label %14
19: ; preds = %14
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @Temporisation(i32 %0) {
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 1000
%5 = tail call i64 (...) @clock()
%6 = sext i32 %4 to i64
%7 = add nsw i64 %5, %6
br label %8
8: ; preds = %8, %1
%9 = tail call i64 (...) @clock()
%10 = icmp slt i64 %9, %7
br i1 %10, label %8, label %11
11: ; preds = %8
ret void
}
/* Variables and functions */
int strncmp(char *, char *, size_t);
int strncmpz(char *l, char *r, size_t llen) {
  int i = strncmp(l, r, llen);
  if (i == 0)
    return -r[llen];
  else
    return i;
}


x86 assembly (clang, -O0):
<strncmpz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    115a <strncmpz+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <strncmpz+0x50>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmpz>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    112a <strncmpz+0x1a>
movsbl (%rbx,%r14,1),%eax
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @strncmpz(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %1, i64 %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sub nsw i32 0, %9
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ %10, %6 ], [ %4, %3 ]
ret i32 %12
}
/* Type definitions */
struct sock {
  int dummy;
};

/* Variables and functions */
scalar_t__ sock_read(struct sock *);
void sock_in(void *arg) {
  struct sock *f = arg;
  while (sock_read(f))
    ;
}


x86 assembly (clang, -O0):
<sock_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sock_read@plt>
cmp    $0x0,%rax
je     113c <sock_in+0x2c>
jmp    1124 <sock_in+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_in>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <sock_read@plt>
test   %rax,%rax
jne    1120 <sock_in+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.sock = type { i32 }
define void @sock_in(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sock*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.sock*
store %struct.sock* %5, %struct.sock** %3
br label %6
6: ; preds = %10, %1
%7 = load %struct.sock*, %struct.sock** %3
%8 = call i64 @sock_read(%struct.sock* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.sock = type { i32 }
define void @sock_in(i8* %0) {
%2 = bitcast i8* %0 to %struct.sock*
br label %3
3: ; preds = %3, %1
%4 = tail call i64 @sock_read(%struct.sock* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ multi_arr(int **);
int main() {
  int arr[3][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};
  int barr[2][2];
  multi_arr(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <multi_arr@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <multi_arr@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 0, i32 1, i32 2], [3 x i32] [i32 3, i32 4, i32 5], [3 x i32] [i32 6, i32 7, i32 8]]
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @multi_arr(i32** %3)
ret i32 0
}
void initialize_cuda_device_(int *myrank_f, int *ncuda_devices) {}


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

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

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

LLVM IR (-O2):
define void @initialize_cuda_device_(i32* nocapture %0, i32* nocapture %1) {
ret void
}
void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
                             int (*read_fn)(struct seq_file *seq, void *data)) {
}


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

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

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
%struct.seq_file = type opaque
define void @brcmf_debugfs_add_entry(%struct.brcmf_pub* %0, i8* %1, i32 (%struct.seq_file*, i8*)* %2) {
%4 = alloca %struct.brcmf_pub*
%5 = alloca i8*
%6 = alloca i32 (%struct.seq_file*, i8*)*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %4
store i8* %1, i8** %5
store i32 (%struct.seq_file*, i8*)* %2, i32 (%struct.seq_file*, i8*)** %6
ret void
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
%struct.seq_file = type opaque
define void @brcmf_debugfs_add_entry(%struct.brcmf_pub* nocapture %0, i8* nocapture %1, i32 (%struct.seq_file*, i8*)* nocapture %2) {
ret void
}
int main(t) {
  for (;; t++)
    putchar(((t << 1) ^ ((t << 1) + (t >> 7) & t >> 12)) |
            t >> (4 - (1 ^ 7 & (t >> 19))) | t >> 7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%ecx
sar    $0x7,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0xc,%ecx
and    %ecx,%eax
xor    %eax,%edi
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%edx
sar    $0x13,%edx
and    $0x7,%edx
xor    $0x1,%edx
mov    $0x4,%ecx
sub    %edx,%ecx
sar    %cl,%eax
or     %eax,%edi
mov    -0x8(%rbp),%eax
sar    $0x7,%eax
or     %eax,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%r14d
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
sar    $0x7,%eax
lea    (%r14,%rax,1),%edx
mov    %ebx,%edi
sar    $0xc,%edi
mov    %ebx,%ecx
shr    $0x13,%ecx
and    $0x7,%cl
xor    $0xfe,%cl
add    $0x5,%cl
mov    %ebx,%esi
sar    %cl,%esi
and    %edx,%edi
xor    %r14d,%edi
or     %eax,%edi
or     %esi,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%ebx
add    $0x2,%r14d
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
br label %4
4: ; preds = %28, %1
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 7
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %3
%13 = ashr i32 %12, 12
%14 = and i32 %11, %13
%15 = xor i32 %6, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = ashr i32 %17, 19
%19 = and i32 7, %18
%20 = xor i32 1, %19
%21 = sub nsw i32 4, %20
%22 = ashr i32 %16, %21
%23 = or i32 %15, %22
%24 = load i32, i32* %3
%25 = ashr i32 %24, 7
%26 = or i32 %23, %25
%27 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %26)
br label %28
28: ; preds = %4
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %18, %2 ]
%4 = shl i32 %3, 1
%5 = ashr i32 %3, 7
%6 = add nsw i32 %4, %5
%7 = ashr i32 %3, 12
%8 = and i32 %6, %7
%9 = xor i32 %8, %4
%10 = lshr i32 %3, 19
%11 = and i32 %10, 7
%12 = xor i32 %11, -2
%13 = add nsw i32 %12, 5
%14 = ashr i32 %3, %13
%15 = or i32 %9, %5
%16 = or i32 %15, %14
%17 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %16)
%18 = add nsw i32 %3, 1
br label %2
}