xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void programHeader2(int assignmentNumber) {
  printf("Student Assignment Number %d\n"
         "Student: Don Retzlaff donr@unt.edu\n\n",
         assignmentNumber);
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"Student Assignment Number %d\0AStudent: Don Retzlaff donr@unt.edu\0A\0A\00"
define void @programHeader2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"Student Assignment Number %d\0AStudent: Don Retzlaff donr@unt.edu\0A\0A\00"
define void @programHeader2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isspace(char);
void neglect_input() {
  while (getchar() != '\n' || !isspace(getchar()))
    ;
}


x86 assembly (clang, -O0):
<neglect_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <neglect_input+0xd>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x1(%rbp)
jne    115f <neglect_input+0x3f>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
test   $0x1,%al
jne    116f <neglect_input+0x4f>
jmp    1174 <neglect_input+0x54>
jmp    112d <neglect_input+0xd>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neglect_input>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1130 <neglect_input+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1130 <neglect_input+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @neglect_input() {
br label %1
1: ; preds = %12, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call signext i8 (...) @getchar()
%7 = call i32 @isspace(i8 signext %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %1
13: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @neglect_input() {
br label %1
1: ; preds = %4, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %5, label %4
4: ; preds = %1, %5
br label %1
5: ; preds = %1
%6 = tail call signext i8 (...) @getchar()
%7 = tail call i32 @isspace(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %5
ret void
}
/* Variables and functions */
int inotifytools_watch_files(char const **, int);
int inotifytools_watch_file(char const *filename, int events) {
  static char const *filenames[2];
  filenames[0] = filename;
  filenames[1] = NULL;
  return inotifytools_watch_files(filenames, events);
}


x86 assembly (clang, -O0):
<inotifytools_watch_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,0x2f16(%rip)
movq   $0x0,0x2f13(%rip)
mov    -0xc(%rbp),%esi
lea    0x2f01(%rip),%rdi
call   1030 <inotifytools_watch_files@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotifytools_watch_file>:
mov    %rdi,0x2f29(%rip)
lea    0x2f22(%rip),%rdi
movq   $0x0,0x2f1f(%rip)
jmp    1030 <inotifytools_watch_files@plt>

LLVM IR (-O0):
@inotifytools_watch_file.filenames = internal global [2 x i8*] zeroinitializer
define i32 @inotifytools_watch_file(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
store i8* %5, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 0)
store i8* null, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 1)
%6 = load i32, i32* %4
%7 = call i32 @inotifytools_watch_files(i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 0), i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@inotifytools_watch_file.filenames = internal global [2 x i8*] zeroinitializer
define i32 @inotifytools_watch_file(i8* %0, i32 %1) {
store i8* %0, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 0)
store i8* null, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 1)
%3 = tail call i32 @inotifytools_watch_files(i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @inotifytools_watch_file.filenames, i64 0, i64 0), i32 %1)
ret i32 %3
}
/* Type definitions */
struct random {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ random_int32(struct random *);
void random_loop_called(struct random *r, int called) {
  if (r == NULL)
    return;
  for (int i = 0; i < called; i++) {
    random_int32(r);
  }
}


x86 assembly (clang, -O0):
<random_loop_called>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <random_loop_called+0x1f>
jmp    1159 <random_loop_called+0x49>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <random_loop_called+0x49>
mov    -0x8(%rbp),%rdi
call   1030 <random_int32@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <random_loop_called+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_loop_called>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     113d <random_loop_called+0x2d>
mov    %esi,%ebx
test   %esi,%esi
jle    113d <random_loop_called+0x2d>
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <random_int32@plt>
add    $0xffffffff,%ebx
jne    1130 <random_loop_called+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.random = type { i32 }
define void @random_loop_called(%struct.random* %0, i32 %1) {
%3 = alloca %struct.random*
%4 = alloca i32
%5 = alloca i32
store %struct.random* %0, %struct.random** %3
store i32 %1, i32* %4
%6 = load %struct.random*, %struct.random** %3
%7 = icmp eq %struct.random* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
store i32 0, i32* %5
br label %10
10: ; preds = %17, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load %struct.random*, %struct.random** %3
%16 = call i32 @random_int32(%struct.random* %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %10
20: ; preds = %8, %10
ret void
}

LLVM IR (-O2):
%struct.random = type { i32 }
define void @random_loop_called(%struct.random* %0, i32 %1) {
%3 = icmp ne %struct.random* %0, null
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @random_int32(%struct.random* %0)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int print(int, char *);
int underline(int tty) { return print(tty, "\033[4m"); }


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

x86 assembly (clang, -O2):
<underline>:
lea    0xee9(%rip),%rsi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[4m\00"
define i32 @underline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[4m\00"
define i32 @underline(i32 %0) {
%2 = tail call i32 @print(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int rand();
int randomNumber(int min, int max) {
  return (min + (rand() % (max - min + 1)));
}


x86 assembly (clang, -O0):
<randomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomNumber(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randomNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void d2i_ECParameters(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ECParameters() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ szBuf;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcpy(char *, char *);
void *thread3(void *arg) {
  while (1) {
    sleep(1);
    char szBuf[128];
    memset(szBuf, 0, sizeof(szBuf));
    strcpy(szBuf, "thread3");
  }
}


x86 assembly (clang, -O0):
<thread3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcpy@plt>
jmp    113f <thread3+0xf>

x86 assembly (clang, -O2):
<thread3>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rbx
lea    0xebc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1150 <thread3+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"thread3\00"
define i8* @thread3(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %4
%5 = call i32 @sleep(i32 1)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 128)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"thread3\00"
define noalias i8* @thread3(i8* nocapture readnone %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %1, %4
%5 = call i32 @sleep(i32 1)
%6 = call i32 @memset(i8* %3, i32 0, i32 128)
%7 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ enable_button(int, int);
void buttons_init(void) {
  (*(volatile unsigned int *)((0x40023800 + 0x30))) |=
      (((unsigned int)0x00000002) | ((unsigned int)0x00000004) |
       ((unsigned int)0x00000004) | ((unsigned int)0x00000001) |
       ((unsigned int)0x00000001));
  enable_button((0x40020400), 14);
  enable_button((0x40020800), 6);
  enable_button((0x40020800), 7);
  enable_button((0x40020000), 8);
  enable_button((0x40020000), 15);
}


x86 assembly (clang, -O0):
<buttons_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40023830,%eax
mov    (%rax),%ecx
or     $0x7,%ecx
mov    $0x40023830,%eax
mov    %ecx,(%rax)
mov    $0x40020400,%edi
mov    $0xe,%esi
call   1030 <enable_button@plt>
mov    $0x40020800,%edi
mov    $0x6,%esi
call   1030 <enable_button@plt>
mov    $0x40020800,%edi
mov    $0x7,%esi
call   1030 <enable_button@plt>
mov    $0x40020000,%edi
mov    $0x8,%esi
call   1030 <enable_button@plt>
mov    $0x40020000,%edi
mov    $0xf,%esi
call   1030 <enable_button@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<buttons_init>:
push   %rax
orl    $0x7,0x40023830
07
mov    $0x40020400,%edi
mov    $0xe,%esi
call   1030 <enable_button@plt>
mov    $0x40020800,%edi
mov    $0x6,%esi
call   1030 <enable_button@plt>
mov    $0x40020800,%edi
mov    $0x7,%esi
call   1030 <enable_button@plt>
mov    $0x40020000,%edi
mov    $0x8,%esi
call   1030 <enable_button@plt>
mov    $0x40020000,%edi
mov    $0xf,%esi
pop    %rax
jmp    1030 <enable_button@plt>

LLVM IR (-O0):
define void @buttons_init() {
%1 = load volatile i32, i32* inttoptr (i64 1073887280 to i32*)
%2 = or i32 %1, 7
store volatile i32 %2, i32* inttoptr (i64 1073887280 to i32*)
%3 = call i32 @enable_button(i32 1073873920, i32 14)
%4 = call i32 @enable_button(i32 1073874944, i32 6)
%5 = call i32 @enable_button(i32 1073874944, i32 7)
%6 = call i32 @enable_button(i32 1073872896, i32 8)
%7 = call i32 @enable_button(i32 1073872896, i32 15)
ret void
}

LLVM IR (-O2):
define void @buttons_init() {
%1 = load volatile i32, i32* inttoptr (i64 1073887280 to i32*)
%2 = or i32 %1, 7
store volatile i32 %2, i32* inttoptr (i64 1073887280 to i32*)
%3 = tail call i32 @enable_button(i32 1073873920, i32 14)
%4 = tail call i32 @enable_button(i32 1073874944, i32 6)
%5 = tail call i32 @enable_button(i32 1073874944, i32 7)
%6 = tail call i32 @enable_button(i32 1073872896, i32 8)
%7 = tail call i32 @enable_button(i32 1073872896, i32 15)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *portable_strdup(const char *str) {
  size_t siz;
  char *copy;
  siz = strlen(str) + 1;
  if ((copy = malloc(siz)) == NULL)
    return (NULL);
  (void)memcpy(copy, str, siz);
  return (copy);
}


x86 assembly (clang, -O0):
<portable_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <portable_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <portable_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <portable_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @portable_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
int sspeek(void *userp) { return **((char **)userp); }


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

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

LLVM IR (-O0):
define i32 @sspeek(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @sspeek(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int dal_reg_tbl_write(unsigned int, unsigned int, unsigned int *, unsigned int);
int ingress_reg_tbl_set(unsigned int dev_id, unsigned int reg_addr,
                        unsigned int *pvalue, unsigned int width) {
  return dal_reg_tbl_write(dev_id, reg_addr + 0x100000, pvalue, width);
}


x86 assembly (clang, -O0):
<ingress_reg_tbl_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x100000,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dal_reg_tbl_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ingress_reg_tbl_set>:
add    $0x100000,%esi
jmp    1030 <dal_reg_tbl_write@plt>

LLVM IR (-O0):
define i32 @ingress_reg_tbl_set(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %10, 1048576
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @dal_reg_tbl_write(i32 %9, i32 %11, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @ingress_reg_tbl_set(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = add i32 %1, 1048576
%6 = tail call i32 @dal_reg_tbl_write(i32 %0, i32 %5, i32* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
scalar_t__ rand();
float Noise_tick() {
  float output;
  output = (float)rand() - 16384.;
  output *= 0.00006103516;
  return output;
}


x86 assembly (clang, -O0):
<Noise_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed8(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Noise_tick>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
addss  0xedb(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Noise_tick() {
%1 = alloca float
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = fpext float %3 to double
%5 = fsub double %4, 1.638400e+04
%6 = fptrunc double %5 to float
store float %6, float* %1
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3F100000107E1FE9
%10 = fptrunc double %9 to float
store float %10, float* %1
%11 = load float, float* %1
ret float %11
}

LLVM IR (-O2):
define float @Noise_tick() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = fadd float %2, -1.638400e+04
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F100000107E1FE9
%6 = fptrunc double %5 to float
ret float %6
}
int test_imm_46int16_mem(short *val) {
  return ((*val) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46int16_mem>:
testb  $0x46,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 70
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
double norminv(double p, double mu, double sig) {
  if (sig < 0)
    error("Parameter sig is smaller than 0.");
  return 0.0;
}


x86 assembly (clang, -O0):
<norminv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1141 <norminv+0x31>
lea    0xec4(%rip),%rdi
call   1030 <error@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norminv>:
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    112b <norminv+0x1b>
push   %rax
lea    0xede(%rip),%rdi
call   1030 <error@plt>
add    $0x8,%rsp
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Parameter sig is smaller than 0.\00"
define double @norminv(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [33 x i8] c"Parameter sig is smaller than 0.\00"
define double @norminv(double %0, double %1, double %2) {
%4 = fcmp olt double %2, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x12() {
  Assert_real((isalpha(18) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              95, ("isalpha should be 0 for 0x12"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x12>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x5f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x12>:
push   %rax
mov    $0x12,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x12\00"
define void @t_isalpha_0x12() {
%1 = call i64 @isalpha(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x12\00"
define void @t_isalpha_0x12() {
%1 = tail call i64 @isalpha(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getchar();
int lower(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  while ((c = getchar()) != '\n')
    printf("%c\n", lower(c));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     116d <main+0x3d>
mov    -0x8(%rbp),%edi
call   1050 <lower@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     116d <main+0x3d>
lea    0xebc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%edi
call   1050 <lower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 10
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = tail call i32 @lower(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ rawoff();
int wait(int *);
void sigchld(int n) {
  while (wait(&n) != -1)
    ;
  rawoff();
  exit(n);
}


x86 assembly (clang, -O0):
<sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <wait@plt>
cmp    $0xffffffff,%eax
je     1152 <sigchld+0x22>
jmp    113b <sigchld+0xb>
mov    $0x0,%al
call   1030 <rawoff@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigchld>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <wait@plt>
cmp    $0xffffffff,%eax
jne    1140 <sigchld+0x10>
xor    %eax,%eax
call   1030 <rawoff@plt>
mov    0xc(%rsp),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = call i32 @wait(i32* %2)
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = call i32 (...) @rawoff()
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define void @sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = call i32 @wait(i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = call i32 (...) @rawoff()
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ msg(char *);
int open(char *, int /*<<< orphan*/);
int read_file(char *path) {
  int fd;
  if ((fd = open(path, O_RDONLY)) < 0) {
    msg("file is NOT readable");
    return 0;
  }
  close(fd);
  msg("file is readable");
  return 1;
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1172 <read_file+0x42>
lea    0xe9f(%rip),%rdi
call   1050 <msg@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <read_file+0x5d>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
lea    0xe94(%rip),%rdi
call   1050 <msg@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1158 <read_file+0x28>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%ebx
lea    0xebf(%rip),%rdi
jmp    1161 <read_file+0x31>
xor    %ebx,%ebx
lea    0xe9f(%rip),%rdi
call   1050 <msg@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [21 x i8] c"file is NOT readable\00"
@.str.1 = [17 x i8] c"file is readable\00"
define i32 @read_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @msg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @close(i32 %12)
%14 = call i32 @msg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [21 x i8] c"file is NOT readable\00"
@.str.1 = [17 x i8] c"file is readable\00"
define i32 @read_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
%9 = phi i32 [ 1, %5 ], [ 0, %1 ]
%10 = tail call i32 @msg(i8* %8)
ret i32 %9
}
int main() {
  char Array[20] = {"Miss Dong"};
  printf("%s", my_strrchr(Array, 's'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x73,%esi
mov    $0x0,%al
call   1030 <my_strrchr@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x73,%esi
xor    %eax,%eax
call   1030 <my_strrchr@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.Array = [20 x i8] c"Miss Dong\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @my_strrchr to i32 (i8*, i32, ...)*)(i8* %4, i32 115)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.Array = [20 x i8] c"Miss Dong\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @my_strrchr to i32 (i8*, i32, ...)*)(i8* %2, i32 115)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void ps(name, value) const char *const name, *const value;
{
  pname(name, 0);
  putsesc(value);
  putsg();
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <pname@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <putsesc@plt>
mov    $0x0,%al
call   1030 <putsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <pname@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <putsesc@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <putsg@plt>

LLVM IR (-O0):
define void @ps(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*, i32, ...) bitcast (i32 (...)* @pname to i32 (i8*, i32, ...)*)(i8* %5, i32 0)
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @putsesc to i32 (i8*, ...)*)(i8* %7)
%9 = call i32 (...) @putsg()
ret void
}

LLVM IR (-O2):
define void @ps(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @pname to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putsesc to i32 (i8*, ...)*)(i8* %1)
%5 = tail call i32 (...) @putsg()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_flttoflt_d_d(double *, double);
double xil_fpo_flttoflt_d_d(double a) {
  double res_d;
  xip_fpo_flttoflt_d_d(&res_d, a);
  return res_d;
}


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

x86 assembly (clang, -O2):
<xil_fpo_flttoflt_d_d>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_flttoflt_d_d@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_flttoflt_d_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @xip_fpo_flttoflt_d_d(double* %3, double %4)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @xil_fpo_flttoflt_d_d(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_flttoflt_d_d(double* %2, double %0)
%5 = load double, double* %2
ret double %5
}
int dsf_find(int *t, int a) {
  if (a != t[a])
    t[a] = dsf_find(t, t[a]);
  return t[a];
}


x86 assembly (clang, -O0):
<dsf_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1154 <dsf_find+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <dsf_find@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsf_find>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%esi
cmp    %ebx,%esi
je     112c <dsf_find+0x1c>
mov    %rdi,%r14
call   1030 <dsf_find@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @dsf_find(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @dsf_find(i32* %0, i32 %5)
store i32 %8, i32* %4
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ %1, %2 ]
ret i32 %10
}
/* Variables and functions */
int foo(int);
int PopCount2(long b) {
  int c = 0;
  while (b) {
    b &= b - 1;
    c++;
  }
  foo(c);
  return foo(c);
}


x86 assembly (clang, -O0):
<PopCount2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <PopCount2+0x3c>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <PopCount2+0x13>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopCount2>:
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     112c <PopCount2+0x1c>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rax
add    $0x1,%ebx
and    %rax,%rdi
jne    1120 <PopCount2+0x10>
mov    %ebx,%edi
call   1030 <foo@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @PopCount2(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sub nsw i64 %8, 1
%10 = load i64, i64* %2
%11 = and i64 %10, %9
store i64 %11, i64* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @foo(i32 %15)
%17 = load i32, i32* %3
%18 = call i32 @foo(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @PopCount2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = and i64 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
%12 = tail call i32 @foo(i32 %11)
%13 = tail call i32 @foo(i32 %11)
ret i32 %13
}
int libbtrfs_version() { return 1; }


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

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

LLVM IR (-O0):
define i32 @libbtrfs_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @libbtrfs_version() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ applications_update();
int /*<<< orphan*/ device_state_update();
int status_run() {
  device_state_update();
  applications_update();
  return 0;
}


x86 assembly (clang, -O0):
<status_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <device_state_update@plt>
mov    $0x0,%al
call   1030 <applications_update@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_run>:
push   %rax
xor    %eax,%eax
call   1040 <device_state_update@plt>
xor    %eax,%eax
call   1030 <applications_update@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @status_run() {
%1 = call i32 (...) @device_state_update()
%2 = call i32 (...) @applications_update()
ret i32 0
}

LLVM IR (-O2):
define i32 @status_run() {
%1 = tail call i32 (...) @device_state_update()
%2 = tail call i32 (...) @applications_update()
ret i32 0
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char ch;
  printf("Enter a character : ");
  ch = getch();
  printf("\nThe entered character is : %c\n", ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
movsbl %al,%esi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter a character : \00"
@.str.1 = [32 x i8] c"\0AThe entered character is : %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getch()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter a character : \00"
@.str.1 = [32 x i8] c"\0AThe entered character is : %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getch()
%3 = sext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct widget {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
struct widget *createwidget(struct view *);
int /*<<< orphan*/ widget_slider_init(struct widget *, char *, char *, int, int,
                                      int);
void pool_create_slider(struct view *view, char *id, char *in, int min, int max,
                        int value) {
  struct widget *widget = createwidget(view);
  widget_slider_init(widget, id, in, min, max, value);
}


x86 assembly (clang, -O0):
<pool_create_slider>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <createwidget@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1040 <widget_slider_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_create_slider>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %rdx,%rbp
mov    %rsi,%rbx
call   1030 <createwidget@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <widget_slider_init@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_slider(%struct.view* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.view*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.widget*
store %struct.view* %0, %struct.view** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load %struct.view*, %struct.view** %7
%15 = call %struct.widget* @createwidget(%struct.view* %14)
store %struct.widget* %15, %struct.widget** %13
%16 = load %struct.widget*, %struct.widget** %13
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @widget_slider_init(%struct.widget* %16, i8* %17, i8* %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_slider(%struct.view* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call %struct.widget* @createwidget(%struct.view* %0)
%8 = tail call i32 @widget_slider_init(%struct.widget* %7, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
char const *version_get_compilation_date();
const char *plugin_api_info_date_cb(const void *pointer, void *data,
                                    const char *info_name,
                                    const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  (void)arguments;
  return version_get_compilation_date();
}


x86 assembly (clang, -O0):
<plugin_api_info_date_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <version_get_compilation_date@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @plugin_api_info_date_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* (...) @version_get_compilation_date()
ret i8* %13
}

LLVM IR (-O2):
define i8* @plugin_api_info_date_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i8* (...) @version_get_compilation_date()
ret i8* %5
}
int ls_alg_create(struct device *dev, struct ls_alg_classdev *ls_cdev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.ls_alg_classdev = type opaque
define i32 @ls_alg_create(%struct.device* %0, %struct.ls_alg_classdev* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.ls_alg_classdev*
store %struct.device* %0, %struct.device** %3
store %struct.ls_alg_classdev* %1, %struct.ls_alg_classdev** %4
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.ls_alg_classdev = type opaque
define i32 @ls_alg_create(%struct.device* nocapture readnone %0, %struct.ls_alg_classdev* nocapture readnone %1) {
ret i32 0
}