xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ POP();
int /*<<< orphan*/ PUSH(scalar_t__);
void add(void) { PUSH(POP() + POP()); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <POP@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <POP@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <PUSH@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
xor    %eax,%eax
call   1030 <POP@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <POP@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <PUSH@plt>

LLVM IR (-O0):
define void @add() {
%1 = call i64 (...) @POP()
%2 = call i64 (...) @POP()
%3 = add nsw i64 %1, %2
%4 = call i32 @PUSH(i64 %3)
ret void
}

LLVM IR (-O2):
define void @add() {
%1 = tail call i64 (...) @POP()
%2 = tail call i64 (...) @POP()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @PUSH(i64 %3)
ret void
}
unsigned long str_len(char *str) {
  unsigned long len;
  len = 0;
  while (str[len])
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <str_len+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i64 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void main(void) {
  int q;
  int b;
  b = b + q;
  return;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %3, %4
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int ftok(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int ac, char **av) {
  while (*++av)
    printf("0x%x\n", ftok(*av, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1171 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1040 <ftok@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115d <main+0x3d>
mov    %rsi,%rbx
add    $0x10,%rbx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
call   1040 <ftok@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %12, %6 ], [ %4, %2 ]
%8 = phi i8** [ %11, %6 ], [ %3, %2 ]
%9 = tail call i32 @ftok(i8* %7, i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i8*, i8** %8, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
char *ft_strdup(char *);
scalar_t__ ft_strlen(char *);
int file_end(char **line, char **stock) {
  if (ft_strlen(*stock)) {
    *line = ft_strdup(*stock);
    ft_strdel(stock);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<file_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_strlen@plt>
cmp    $0x0,%rax
je     1181 <file_end+0x51>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1050 <ft_strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1040 <ft_strdel@plt>
movl   $0x1,-0x4(%rbp)
jmp    1188 <file_end+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
call   1030 <ft_strlen@plt>
test   %rax,%rax
je     1161 <file_end+0x31>
mov    (%rbx),%rdi
call   1050 <ft_strdup@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
call   1040 <ft_strdel@plt>
mov    $0x1,%eax
jmp    1163 <file_end+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @file_end(i8** nocapture writeonly %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @ft_strlen(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i8* @ft_strdup(i8* %7)
store i8* %8, i8** %0
%9 = tail call i32 @ft_strdel(i8** %1)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_cancel(scalar_t__);
int ser2net_stop(pthread_t threadID) {
  printf("will cancel ser2net thread #%02d\n", (int)threadID);
  pthread_cancel(threadID);
  return 0;
}


x86 assembly (clang, -O0):
<ser2net_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cancel@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ser2net_stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <pthread_cancel@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"will cancel ser2net thread #%02d\0A\00"
define i32 @ser2net_stop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i64, i64* %2
%7 = call i32 @pthread_cancel(i64 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"will cancel ser2net thread #%02d\0A\00"
define i32 @ser2net_stop(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_cancel(i64 %0)
ret i32 0
}
/* Variables and functions */
bool chars_is_octal_digit(char c) { return '0' <= c && c <= '7'; }


x86 assembly (clang, -O0):
<chars_is_octal_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <chars_is_octal_digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_octal_digit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @chars_is_octal_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @chars_is_octal_digit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int sgx_create_enclave(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sgx_create_enclave() {
ret i32 1
}
__attribute__((always_)) unsigned int inl(int port) {
  unsigned int value;
  asm volatile("in"
               "l"
               " %w1, %"
               ""
               "0"
               : "=a"(value)
               : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl(i32 %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ nd_int();
int *foo() {
  int *p = (int *)malloc(sizeof(int));
  if (nd_int()) {
    *p = 4;
  } else {
    *p = 10;
  }
  return p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <nd_int@plt>
cmp    $0x0,%rax
je     1156 <foo+0x36>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
jmp    1160 <foo+0x40>
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x4,%ebp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <nd_int@plt>
test   %rax,%rax
mov    $0xa,%eax
cmovne %ebp,%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = call i64 (...) @nd_int()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32*, i32** %1
store i32 4, i32* %7
br label %10
8: ; preds = %0
%9 = load i32*, i32** %1
store i32 10, i32* %9
br label %10
10: ; preds = %8, %6
%11 = load i32*, i32** %1
ret i32* %11
}

LLVM IR (-O2):
define i32* @foo() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 (...) @nd_int()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 10, i32 4
store i32 %5, i32* %2
ret i32* %2
}
unsigned int _uiPrint(const unsigned char *puszTxt) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @_uiPrint(i8* nocapture readnone %0) {
ret i32 1
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return c + ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
scalar_t__ foo(int, int, int, int);
int main() {
  if (foo(2, 24, 3, 4) == 0)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x18,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <foo@plt>
cmp    $0x0,%rax
jne    115c <main+0x3c>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x18,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <foo@plt>
test   %rax,%rax
jne    1149 <main+0x29>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 2, i32 24, i32 3, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @_exit(i32 -1)
unreachable
6: ; preds = %0
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 2, i32 24, i32 3, i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @_exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int set_socket_flag_non_block(int, int);
int set_socket_non_block(int socket) {
  return set_socket_flag_non_block(socket, 1);
}


x86 assembly (clang, -O0):
<set_socket_non_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <set_socket_flag_non_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_non_block>:
mov    $0x1,%esi
jmp    1030 <set_socket_flag_non_block@plt>

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

LLVM IR (-O2):
define i32 @set_socket_non_block(i32 %0) {
%2 = tail call i32 @set_socket_flag_non_block(i32 %0, i32 1)
ret i32 %2
}
int ipm_get_switchname(char *sname) {
  char *cptr1, *cptr2;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ipm_get_switchname(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  printf("message from popen %d\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"message from popen %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int execute_getitimer() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_getitimer() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_getitimer() {
ret i32 0
}
int bitParity(int x) {
  x = (x >> 1) ^ x;
  x = (x >> 2) ^ x;
  x = (x >> 4) ^ x;
  x = (x >> 8) ^ x;
  x = (x >> 16) ^ x;
  return x & 1;
}


x86 assembly (clang, -O0):
<bitParity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitParity>:
mov    %edi,%eax
sar    %eax
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitParity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = xor i32 %8, %9
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = xor i32 %16, %17
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 16
%21 = load i32, i32* %2
%22 = xor i32 %20, %21
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = and i32 %23, 1
ret i32 %24
}

LLVM IR (-O2):
define i32 @bitParity(i32 %0) {
%2 = ashr i32 %0, 1
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 2
%5 = xor i32 %4, %3
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = ashr i32 %7, 8
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 16
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
ret i32 %12
}
void h() {
  int a = 0;
  a += 3;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @h() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 3
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @h() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_hdlr(int sig) {
  exit(0);
  return;
}


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

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

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

LLVM IR (-O2):
define void @sig_hdlr(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned long xlnkGetBufPhyAddr(void *);
unsigned long cma_get_phy_addr(void *buf) { return xlnkGetBufPhyAddr(buf); }


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

x86 assembly (clang, -O2):
<cma_get_phy_addr>:
jmp    1030 <xlnkGetBufPhyAddr@plt>

LLVM IR (-O0):
define i64 @cma_get_phy_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @xlnkGetBufPhyAddr(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @cma_get_phy_addr(i8* %0) {
%2 = tail call i64 @xlnkGetBufPhyAddr(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void perror_exit(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perror_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long next_pow_2(unsigned long n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n |= n >> 32;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<next_pow_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pow_2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @next_pow_2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
int countPoints(int groupSize, int phase) {
  return 100 + (phase > 0 ? phase - 1 : 0) * 5000;
}


x86 assembly (clang, -O0):
<countPoints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1122 <countPoints+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <countPoints+0x2c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <countPoints+0x2c>
mov    -0xc(%rbp),%eax
imul   $0x1388,%eax,%eax
add    $0x64,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countPoints>:
imul   $0x1388,%esi,%ecx
add    $0xffffecdc,%ecx
test   %esi,%esi
mov    $0x64,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @countPoints(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %7
%12 = phi i32 [ %9, %7 ], [ 0, %10 ]
%13 = mul nsw i32 %12, 5000
%14 = add nsw i32 100, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @countPoints(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = mul i32 %1, 5000
%5 = add i32 %4, -4900
%6 = select i1 %3, i32 %5, i32 100
ret i32 %6
}
/* Variables and functions */
bool nrf53_errata_106(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_106() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_106() {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *ss = s;
  while (*ss)
    ss++;
  return ss - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
void __attribute__((unused)) sync(void) {
  int ret;
  asm volatile("syscall"
               : "=a"(ret)
               : "0"(162)
               : "%rcx", "%r11", "cc", "memory");
}


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

x86 assembly (clang, -O2):
<sync>:
mov    $0xa2,%eax
syscall
ret

LLVM IR (-O0):
define void @sync() {
%1 = alloca i32
%2 = call i32 asm sideeffect "syscall", "={ax},0,~{rcx},~{r11},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 162)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 asm sideeffect "syscall", "={ax},0,~{rcx},~{r11},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 162)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_add_dobldobl_Laurent_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc(556, a, exp, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_dobldobl_Laurent_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    $0x22c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_dobldobl_Laurent_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x22c,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_dobldobl_Laurent_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_c2phc(i32 556, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_dobldobl_Laurent_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_c2phc(i32 556, i32* %7, i32* %2, double* %3)
ret i32 %9
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int getlogin_r(char *name, size_t len) {
  char *foo = getenv("LOGNAME");
  if (!foo)
    return -1;
  strncpy(name, foo, len);
  name[len] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<getlogin_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <getlogin_r+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <getlogin_r+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1152 <getlogin_r+0x32>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
xor    %eax,%eax
jmp    1157 <getlogin_r+0x37>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"LOGNAME\00"
define i32 @getlogin_r(i8* %0, i64 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strncpy(i8* %0, i8* %3, i64 %1)
%7 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 0, i8* %7
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
void *t_fun4(void *arg) {
  int n = arg;
  if (n)
    t_fun4((void *)0);
  return (void *)n;
}


x86 assembly (clang, -O0):
<t_fun4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1136 <t_fun4+0x26>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <t_fun4@plt>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_fun4>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @t_fun4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i8* @t_fun4(i8* null)
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @t_fun4(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = shl i64 %2, 32
%4 = ashr exact i64 %3, 32
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void bl_uart_write_reg(uint32_t addr, uint16_t data) {
  *(volatile uint8_t *)addr = (uint8_t)data;
}


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

x86 assembly (clang, -O2):
<bl_uart_write_reg>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @bl_uart_write_reg(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @bl_uart_write_reg(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
int get_version() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_version() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mmio_readl(void *);
uint32_t mmio_le_readl(void *addr) { return (mmio_readl(addr)); }


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

x86 assembly (clang, -O2):
<mmio_le_readl>:
jmp    1030 <mmio_readl@plt>

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

LLVM IR (-O2):
define i32 @mmio_le_readl(i8* %0) {
%2 = tail call i32 @mmio_readl(i8* %0)
ret i32 %2
}
int mwsync_reg_reducers(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mwsync_reg_reducers() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mwsync_reg_reducers() {
ret i32 0
}
/* Variables and functions */
int japi_getrows(int);
int j_getrows(int arg0) { return (japi_getrows(arg0)); }


x86 assembly (clang, -O0):
<j_getrows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <japi_getrows@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_getrows>:
jmp    1030 <japi_getrows@plt>

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

LLVM IR (-O2):
define i32 @j_getrows(i32 %0) {
%2 = tail call i32 @japi_getrows(i32 %0)
ret i32 %2
}
/* Variables and functions */
void _set_double(char *data, size_t pos, double value) {
  double *buf = (double *)data;
  buf[pos] = value;
  return;
}


x86 assembly (clang, -O0):
<_set_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_double>:
movsd  %xmm0,(%rdi,%rsi,8)
ret

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

LLVM IR (-O2):
define void @_set_double(i8* nocapture writeonly %0, i64 %1, double %2) {
%4 = bitcast i8* %0 to double*
%5 = getelementptr inbounds double, double* %4, i64 %1
store double %2, double* %5
ret void
}
/* Variables and functions */
int R_precomp(int);
double sqrt(int);
double Rij_precomp(int spec_i, int spec_j) {
  return sqrt(R_precomp(spec_i) * R_precomp(spec_j));
}


x86 assembly (clang, -O0):
<Rij_precomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <R_precomp@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <R_precomp@plt>
mov    -0xc(%rbp),%edi
imul   %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rij_precomp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <R_precomp@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <R_precomp@plt>
imul   %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @Rij_precomp(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 @R_precomp(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @R_precomp(i32 %7)
%9 = mul nsw i32 %6, %8
%10 = call double @sqrt(i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @Rij_precomp(i32 %0, i32 %1) {
%3 = tail call i32 @R_precomp(i32 %0)
%4 = tail call i32 @R_precomp(i32 %1)
%5 = mul nsw i32 %4, %3
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
void osalSysUnlock(void) {}


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

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

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

LLVM IR (-O2):
define void @osalSysUnlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hi, how are you doing?\n");
  printf("So, yo're not in the mood for talking?\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hi, how are you doing?\0A\00"
@.str.1 = [40 x i8] c"So, yo're not in the mood for talking?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Hi, how are you doing?\00"
@str.2 = [39 x i8] c"So, yo're not in the mood for talking?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int wGetArrayBound(int, int);
int wPopNumber();
int /*<<< orphan*/ wPushNumber(int);
void wBasUBound() {
  int index, range;
  index = wPopNumber();
  range = wGetArrayBound(index, 1);
  wPopNumber();
  wPushNumber(range);
}


x86 assembly (clang, -O0):
<wBasUBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <wGetArrayBound@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    -0x8(%rbp),%edi
call   1030 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasUBound>:
push   %rbx
xor    %eax,%eax
call   1040 <wPopNumber@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <wGetArrayBound@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <wPopNumber@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasUBound() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @wPopNumber()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @wGetArrayBound(i32 %4, i32 1)
store i32 %5, i32* %2
%6 = call i32 (...) @wPopNumber()
%7 = load i32, i32* %2
%8 = call i32 @wPushNumber(i32 %7)
ret void
}

LLVM IR (-O2):
define void @wBasUBound() {
%1 = tail call i32 (...) @wPopNumber()
%2 = tail call i32 @wGetArrayBound(i32 %1, i32 1)
%3 = tail call i32 (...) @wPopNumber()
%4 = tail call i32 @wPushNumber(i32 %2)
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
#pragma omp parallel shared(i)
  {
    i = omp_get_thread_num();
    printf("thread num = %d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"thread num = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ crc32_byte(unsigned int);
void crc32_8bytes(unsigned val) {
  crc32_byte((val >> 0) & 0xff);
  crc32_byte((val >> 8) & 0xff);
  crc32_byte((val >> 16) & 0xff);
  crc32_byte((val >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<crc32_8bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x0,%edi
and    $0xff,%edi
call   1030 <crc32_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
call   1030 <crc32_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
call   1030 <crc32_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x18,%edi
and    $0xff,%edi
call   1030 <crc32_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_8bytes>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <crc32_byte@plt>
movzbl %bh,%edi
call   1030 <crc32_byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <crc32_byte@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <crc32_byte@plt>

LLVM IR (-O0):
define void @crc32_8bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 0
%5 = and i32 %4, 255
%6 = call i32 @crc32_byte(i32 %5)
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = and i32 %8, 255
%10 = call i32 @crc32_byte(i32 %9)
%11 = load i32, i32* %2
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = call i32 @crc32_byte(i32 %13)
%15 = load i32, i32* %2
%16 = lshr i32 %15, 24
%17 = and i32 %16, 255
%18 = call i32 @crc32_byte(i32 %17)
ret void
}

LLVM IR (-O2):
define void @crc32_8bytes(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @crc32_byte(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @crc32_byte(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @crc32_byte(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @crc32_byte(i32 %10)
ret void
}
void gtk_icon_view_set_column_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_set_column_spacing() {
ret void
}