xunge/DecIR huggingface dataset:
ISR(TIMER1_COMPA_vect) { (void)irsnd_ISR(); }


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
%2 = tail call i32 (...) @irsnd_ISR()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *opendir(char *);
char *vfs_translate_path(char const *);
DIR *vfs_opendir(char const *filename) {
  char *path = vfs_translate_path(filename);
  if (!path) {
    return NULL;
  }
  DIR *dh = opendir(path);
  free(path);
  return dh;
}


x86 assembly (clang, -O0):
<vfs_opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <vfs_translate_path@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <vfs_opendir+0x31>
movq   $0x0,-0x8(%rbp)
jmp    117f <vfs_opendir+0x4f>
mov    -0x18(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfs_opendir>:
push   %r14
push   %rbx
push   %rax
call   1050 <vfs_translate_path@plt>
test   %rax,%rax
je     1159 <vfs_opendir+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <opendir@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    115b <vfs_opendir+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @vfs_opendir(i8* %0) {
%2 = tail call i8* @vfs_translate_path(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32* @opendir(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32* [ %5, %4 ], [ null, %1 ]
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void putchar(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int GetMinPeriod(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  printf("%s : %d\n", "abcabcabcabc", GetMinPeriod("abcabcabcabc"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed3(%rip),%rdi
call   1040 <GetMinPeriod@plt>
mov    %eax,%edx
lea    0xebc(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <GetMinPeriod@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s : %d\0A\00"
@.str.1 = [13 x i8] c"abcabcabcabc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @GetMinPeriod(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s : %d\0A\00"
@.str.1 = [13 x i8] c"abcabcabcabc\00"
define i32 @main() {
%1 = tail call i32 @GetMinPeriod(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_num_temporal_layers(const uint8_t *p) {
  return (p[21] >> 3) & 0x3;
}


x86 assembly (clang, -O0):
<h265hvcc_get_num_temporal_layers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x54(%rax),%eax
sar    $0x3,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_num_temporal_layers>:
mov    0x54(%rdi),%eax
shr    $0x3,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_num_temporal_layers(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 21
%5 = load i32, i32* %4
%6 = ashr i32 %5, 3
%7 = and i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @h265hvcc_get_num_temporal_layers(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 21
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int write(int, char *, int);
int send_msg(int sockfd, char *msg, int size) {
  int n;
  n = write(sockfd, msg, size);
  if (n < 0)
    error("ERROR writing to socket");
}


x86 assembly (clang, -O0):
<send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <send_msg+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg>:
push   %rax
call   1030 <write@plt>
test   %eax,%eax
js     112c <send_msg+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1040 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR writing to socket\00"
define i32 @send_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"ERROR writing to socket\00"
define i32 @send_msg(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printUsage();
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void printExtendedUsage() {
  printUsage();
  printf("\t\033[1m"
         "-?"
         "%s"
         "--help"
         " "
         ""
         "\033[m\n\t\t"
         "Displays this help."
         "\n\n",
         strcmp("", "--help") == 0 ? "" : ", ");
  ;
}


x86 assembly (clang, -O0):
<printExtendedUsage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <printUsage@plt>
lea    0xee9(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rsi
lea    0xecc(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printExtendedUsage>:
push   %rbx
xor    %eax,%eax
call   1050 <printUsage@plt>
lea    0xeec(%rip),%rbx
lea    0xee6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xedb(%rip),%rsi
cmove  %rbx,%rsi
lea    0xe9d(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\09\1B[1m-?%s--help \1B[m\0A\09\09Displays this help.\0A\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [3 x i8] c", \00"
define void @printExtendedUsage() {
%1 = call i32 (...) @printUsage()
%2 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"\09\1B[1m-?%s--help \1B[m\0A\09\09Displays this help.\0A\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [3 x i8] c", \00"
define void @printExtendedUsage() {
%1 = tail call i32 (...) @printUsage()
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void psm__cleanup() {
  do {
  } while (0);
  return;
}


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

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

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

LLVM IR (-O2):
define void @psm__cleanup() {
ret void
}
int re_assemble_16(int as16) {
  int s, t;
  t = (as16 << 1) & 0xffff;
  s = (as16 & 0x8000);
  return (t ^ s ^ (s >> 1)) | (s >> 15);
}


x86 assembly (clang, -O0):
<re_assemble_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0xf,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_assemble_16>:
lea    (%rdi,%rdi,1),%eax
movzwl %ax,%ecx
and    $0x8000,%edi
xor    %edi,%ecx
mov    %edi,%eax
shr    %eax
xor    %ecx,%eax
shr    $0xf,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @re_assemble_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
%7 = and i32 %6, 65535
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = and i32 %8, 32768
store i32 %9, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
%13 = load i32, i32* %3
%14 = ashr i32 %13, 1
%15 = xor i32 %12, %14
%16 = load i32, i32* %3
%17 = ashr i32 %16, 15
%18 = or i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @re_assemble_16(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 65534
%4 = and i32 %0, 32768
%5 = xor i32 %3, %4
%6 = lshr exact i32 %4, 1
%7 = xor i32 %5, %6
%8 = lshr exact i32 %4, 15
%9 = or i32 %7, %8
ret i32 %9
}
void INT_Excep_UndefinedInst(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_UndefinedInst() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void testIndirection() {
  int a;
  int b;
  int *p1;
  int *p2;
  a = 5;
  b = 10;
  p1 = &a;
  p2 = p1;
  test(*p1 == *p2);
  test(*p2 == a);
  test(*p1 != b);
  a = b;
  test(*p1 == b);
}


x86 assembly (clang, -O0):
<testIndirection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testIndirection>:
push   %rax
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @testIndirection() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 5, i32* %1
store i32 10, i32* %2
store i32* %1, i32** %3
%5 = load i32*, i32** %3
store i32* %5, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp eq i32 %7, %9
%11 = zext i1 %10 to i32
%12 = call i32 @test(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32, i32* %1
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @test(i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = load i32, i32* %2
%22 = icmp ne i32 %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @test(i32 %23)
%25 = load i32, i32* %2
store i32 %25, i32* %1
%26 = load i32*, i32** %3
%27 = load i32, i32* %26
%28 = load i32, i32* %2
%29 = icmp eq i32 %27, %28
%30 = zext i1 %29 to i32
%31 = call i32 @test(i32 %30)
ret void
}

LLVM IR (-O2):
define void @testIndirection() {
%1 = tail call i32 @test(i32 1)
%2 = tail call i32 @test(i32 1)
%3 = tail call i32 @test(i32 1)
%4 = tail call i32 @test(i32 1)
ret void
}
int test_imm_CAint32_reg(int val) { return ((val) & (0xCA << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_CAint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xca,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAint32_reg>:
test   $0xca,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CAint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 202
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_CAint32_reg(i32 %0) {
%2 = and i32 %0, 202
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void sched_ticker_switch(int prev_policy, int next_policy) {}


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

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

LLVM IR (-O0):
define void @sched_ticker_switch(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 @sched_ticker_switch(i32 %0, i32 %1) {
ret void
}
void handle_62(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_62(i32 %0) {
ret void
}
void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
                                  struct o2net_sock_container *sc) {}


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

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

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

LLVM IR (-O2):
%struct.o2net_send_tracking = type opaque
%struct.o2net_sock_container = type opaque
define void @o2net_set_nst_sock_container(%struct.o2net_send_tracking* nocapture %0, %struct.o2net_sock_container* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintMama();
int /*<<< orphan*/ ICPrintPapa();
void ICPrintParents() {
  ICPrintMama();
  ICPrintPapa();
}


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

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

LLVM IR (-O0):
define void @ICPrintParents() {
%1 = call i32 (...) @ICPrintMama()
%2 = call i32 (...) @ICPrintPapa()
ret void
}

LLVM IR (-O2):
define void @ICPrintParents() {
%1 = tail call i32 (...) @ICPrintMama()
%2 = tail call i32 (...) @ICPrintPapa()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned short *, int);
void set_val(char *d, unsigned short val) {
  val = val;
  memcpy(d, &val, 2);
}


x86 assembly (clang, -O0):
<set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_val>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @set_val(i8* %0, i16 zeroext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = call i32 @memcpy(i8* %0, i16* %3, i32 2)
ret void
}
unsigned int inswap_le32(unsigned int num) {
  return (num >> 24) | ((num & 0xff0000) >> 8) | ((num & 0xff00) << 8) |
         ((num & 0xff) << 24);
}


x86 assembly (clang, -O0):
<inswap_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inswap_le32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @inswap_le32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 16711680
%7 = lshr i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = and i32 %13, 255
%15 = shl i32 %14, 24
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @inswap_le32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ report_error(char *);
int /*<<< orphan*/ stderr;
void error_on_excessive_string_length(int string_length) {
  if (string_length >= 16 - 1) {
    fprintf(stderr,
            "Error: Strings longer than %d characters are not supported.\n",
            16);
    report_error("Parsing ended unexpectedly");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<error_on_excessive_string_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jl     1179 <error_on_excessive_string_length+0x49>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    $0x10,%edx
call   1030 <fprintf@plt>
lea    0xed7(%rip),%rdi
call   1040 <report_error@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_on_excessive_string_length>:
cmp    $0xf,%edi
jge    1136 <error_on_excessive_string_length+0x6>
ret
push   %rax
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
mov    $0x10,%edx
call   1030 <fprintf@plt>
lea    0xee5(%rip),%rdi
call   1040 <report_error@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"Error: Strings longer than %d characters are not supported.\0A\00"
@.str.1 = [27 x i8] c"Parsing ended unexpectedly\00"
@EXIT_FAILURE = global i32 0
define void @error_on_excessive_string_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 15
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 16)
%8 = call i32 @report_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"Error: Strings longer than %d characters are not supported.\0A\00"
@.str.1 = [27 x i8] c"Parsing ended unexpectedly\00"
@EXIT_FAILURE = global i32 0
define void @error_on_excessive_string_length(i32 %0) {
%2 = icmp sgt i32 %0, 14
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = tail call i32 @report_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void ff_hevc_put_hevc_bi_qpel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h12_12_sse4() {
ret void
}
void free_wordtab(char **wt) {
  int i;
  if (!wt)
    return;
  for (i = 0; wt[i]; i++)
    free(wt[i]);
  free(wt);
}


x86 assembly (clang, -O0):
<free_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_wordtab+0x1c>
jmp    116e <free_wordtab+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <free_wordtab+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <free_wordtab+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_wordtab>:
test   %rdi,%rdi
je     1150 <free_wordtab+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_wordtab+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_wordtab+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_wordtab(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %27
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %21, %7
%9 = load i8**, i8*** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %24
15: ; preds = %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
br label %21
21: ; preds = %15
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %8
24: ; preds = %8
%25 = load i8**, i8*** %2
%26 = bitcast i8** %25 to i8*
br label %27
27: ; preds = %24, %6
ret void
}

LLVM IR (-O2):
define void @free_wordtab(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
void f2fs_destroy_iostat_processing(void) {}


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

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

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

LLVM IR (-O2):
define void @f2fs_destroy_iostat_processing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_on_sigint(int s) { exit(0); }


x86 assembly (clang, -O0):
<exit_on_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @exit_on_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_on_sigint(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double log(double);
double futhark_log64(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<futhark_log64>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @futhark_log64(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
int score(char a, char b) {
  int score;
  if (a == '-' || b == '-')
    score = -4;
  else
    score = (a == b) ? 4 : -3;
  return score;
}


x86 assembly (clang, -O0):
<score>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
je     112a <score+0x2a>
movsbl -0x2(%rbp),%eax
cmp    $0x2d,%eax
jne    1136 <score+0x36>
movl   $0xfffffffc,-0x8(%rbp)
jmp    1150 <score+0x50>
movsbl -0x1(%rbp),%edx
movsbl -0x2(%rbp),%esi
mov    $0xfffffffd,%eax
mov    $0x4,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<score>:
cmp    %sil,%dil
mov    $0x4,%ecx
mov    $0xfffffffd,%eax
cmove  %ecx,%eax
cmp    $0x2d,%sil
mov    $0xfffffffc,%ecx
cmove  %ecx,%eax
cmp    $0x2d,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @score(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 45
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 -4, i32* %5
br label %22
14: ; preds = %9
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %16, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 4, i32 -3
store i32 %21, i32* %5
br label %22
22: ; preds = %14, %13
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @score(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 45
%4 = icmp eq i8 %1, 45
%5 = or i1 %3, %4
%6 = icmp eq i8 %0, %1
%7 = select i1 %6, i32 4, i32 -3
%8 = select i1 %5, i32 -4, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t ROL64(uint64_t val, int offset) {
  if (offset == 0) {
    return val;
  } else if (!(0)) {
    return (val << offset) | (val >> (64 - offset));
  } else {
    uint32_t hi = (uint32_t)(val >> 32), lo = (uint32_t)val;
    if (offset & 1) {
      uint32_t tmp = hi;
      offset >>= 1;
      hi = (((lo) << (offset)) | ((lo) >> ((32 - (offset)) & 31)));
      lo = (((tmp) << (offset + 1)) | ((tmp) >> ((32 - (offset + 1)) & 31)));
    } else {
      offset >>= 1;
      lo = (((lo) << (offset)) | ((lo) >> ((32 - (offset)) & 31)));
      hi = (((hi) << (offset)) | ((hi) >> ((32 - (offset)) & 31)));
    }
    return ((uint64_t)hi << 32) | lo;
  }
}


x86 assembly (clang, -O0):
<ROL64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <ROL64+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <ROL64+0x3b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x40,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ROL64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = shl i32 %11, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub nsw i32 64, %15
%17 = ashr i32 %14, %16
%18 = or i32 %13, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %10, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ROL64(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = shl i32 %0, %1
%5 = sub nsw i32 64, %1
%6 = ashr i32 %0, %5
%7 = or i32 %6, %4
%8 = select i1 %3, i32 %0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ s(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b = 0xda, c = 0xd1;
  a = b + c;
  b = 3;
  c = 5;
  s(&a);
  test_assert(a == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xda,-0xc(%rbp)
movl   $0xd1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <s@plt>
cmpl   $0xd,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1ab,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <s@plt>
xor    %edi,%edi
cmpl   $0xd,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 218, i32* %3
store i32 209, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = call i32 @s(i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 427, i32* %1
%3 = call i32 @s(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
struct Node *do_balance(int *, int /*<<< orphan*/, int);
struct Node *balance(int *a, int len) {
  return do_balance(a, 0, len - 1);
}


x86 assembly (clang, -O0):
<balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <do_balance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<balance>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <do_balance@plt>

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

LLVM IR (-O2):
%struct.Node = type { i32 }
define %struct.Node* @balance(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call %struct.Node* @do_balance(i32* %0, i32 0, i32 %3)
ret %struct.Node* %4
}
int equal(s1, s2)
char *s1, *s2;
{ return !strcmp(skip(s1), skip(s2)); }


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <skip@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <skip@plt>
mov    -0x18(%rbp),%rdi
movslq %eax,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %eax,%eax
call   1030 <skip@plt>
movslq %eax,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <skip@plt>
movslq %eax,%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @equal(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 = call i32 (i8*, ...) bitcast (i32 (...)* @skip to i32 (i8*, ...)*)(i8* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @skip to i32 (i8*, ...)*)(i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @strcmp(i8* %8, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @equal(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @skip to i32 (i8*, ...)*)(i8* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @skip to i32 (i8*, ...)*)(i8* %1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ nrf24_configRegister(int, int);
void nrf24_powerUpTx() {
  nrf24_configRegister(0x07, (1 << 6) | (1 << 5) | (1 << 4));
  nrf24_configRegister(0x00, ((1 << 3) | (0 << 2)) | ((1 << 1) | (0 << 0)));
}


x86 assembly (clang, -O0):
<nrf24_powerUpTx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x70,%esi
call   1030 <nrf24_configRegister@plt>
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <nrf24_configRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24_powerUpTx>:
push   %rax
mov    $0x7,%edi
mov    $0x70,%esi
call   1030 <nrf24_configRegister@plt>
xor    %edi,%edi
mov    $0xa,%esi
pop    %rax
jmp    1030 <nrf24_configRegister@plt>

LLVM IR (-O0):
define void @nrf24_powerUpTx() {
%1 = call i32 @nrf24_configRegister(i32 7, i32 112)
%2 = call i32 @nrf24_configRegister(i32 0, i32 10)
ret void
}

LLVM IR (-O2):
define void @nrf24_powerUpTx() {
%1 = tail call i32 @nrf24_configRegister(i32 7, i32 112)
%2 = tail call i32 @nrf24_configRegister(i32 0, i32 10)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_add_dobldobl_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc4c(336, a, exp, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_dobldobl_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x150,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_dobldobl_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x150,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_dobldobl_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc4c(i32 336, i32* %15, i32* %16, double* %17, i32 0)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_dobldobl_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %0, i32* %8
%9 = call i32 @_ada_use_c2phc4c(i32 336, i32* %7, i32* %2, double* %3, i32 0)
ret i32 %9
}
int fo_scheduler_get_special(int option) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @fo_scheduler_get_special(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, short);
int main() {
  int x, y;
  short int z;
  x = 111111;
  y = 123456;
  z = x + y;
  printf("If x = %d, y = %d and z = x+y then z= %hd \n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b207,-0x8(%rbp)
movl   $0x1e240,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
movswl -0xe(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1b207,%esi
mov    $0x1e240,%edx
mov    $0xffff9447,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"If x = %d, y = %d and z = x+y then z= %hd \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
store i32 0, i32* %1
store i32 111111, i32* %2
store i32 123456, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i16
store i16 %8, i16* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i16, i16* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i16 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"If x = %d, y = %d and z = x+y then z= %hd \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 111111, i32 123456, i16 signext -27577)
ret i32 0
}
unsigned long gsd_hash_str(const unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<gsd_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <gsd_hash_str+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <gsd_hash_str+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsd_hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <gsd_hash_str+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <gsd_hash_str+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @gsd_hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
unsigned char kernel___Byte_rsh___impl(unsigned char, long);
unsigned char core___core__Byte___rsh(unsigned char self, long p0) {
  unsigned char var;
  unsigned char var1;
  var1 = kernel___Byte_rsh___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Byte___rsh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <kernel___Byte_rsh___impl@plt>
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__Byte___rsh>:
jmp    1030 <kernel___Byte_rsh___impl@plt>

LLVM IR (-O0):
define zeroext i8 @core___core__Byte___rsh(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i64 %1, i64* %4
%7 = load i8, i8* %3
%8 = load i64, i64* %4
%9 = call zeroext i8 @kernel___Byte_rsh___impl(i8 zeroext %7, i64 %8)
store i8 %9, i8* %6
%10 = load i8, i8* %6
store i8 %10, i8* %5
br label %11
11: ; preds = %2
%12 = load i8, i8* %5
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @core___core__Byte___rsh(i8 zeroext %0, i64 %1) {
%3 = tail call zeroext i8 @kernel___Byte_rsh___impl(i8 zeroext %0, i64 %1)
ret i8 %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kfork() {
  int child, pid;
  pid = getpid();
  printf("Proc[%d] enter kernel to kfork a child\n", pid);
  child = syscall(7, 0, 0);
  printf("Proc[%d] kforked a child %d\n", pid, child);
}


x86 assembly (clang, -O0):
<kfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <syscall@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kfork>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <syscall@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Proc[%d] enter kernel to kfork a child\0A\00"
@.str.1 = [29 x i8] c"Proc[%d] kforked a child %d\0A\00"
define i32 @kfork() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @syscall(i32 7, i32 0, i32 0)
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [40 x i8] c"Proc[%d] enter kernel to kfork a child\0A\00"
@.str.1 = [29 x i8] c"Proc[%d] kforked a child %d\0A\00"
define i32 @kfork() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @syscall(i32 7, i32 0, i32 0)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %3)
ret i32 undef
}