xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int);
int main(int argc, char *argv[]) {
  printf("%d\n", sum(2, 10, 16));
  return EXIT_SUCCESS;
}


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    $0x2,%edi
mov    $0xa,%esi
mov    $0x10,%edx
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x10,%edx
call   1040 <sum@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
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
%6 = call i32 @sum(i32 2, i32 10, i32 16)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 2, i32 10, i32 16)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void deckbum(int flag) {
  if (flag)
    sm("?68");
  else
    rm("?68");
}


x86 assembly (clang, -O0):
<deckbum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <deckbum+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <deckbum+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deckbum>:
test   %edi,%edi
je     1130 <deckbum+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?68\00"
define void @deckbum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?68\00"
define void @deckbum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int _match_keyval(char *item, char *key) {
  return (strcasecmp(item, key) == 0);
}


x86 assembly (clang, -O0):
<_match_keyval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_match_keyval>:
push   %rax
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_match_keyval(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 = load i8*, i8** %4
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_match_keyval(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
int get_path_length(char *fullfilename) {
  int i, l;
  i = strlen(fullfilename) - 1;
  while (i >= 0 && fullfilename[i] != '/')
    i--;
  return i + 1;
}


x86 assembly (clang, -O0):
<get_path_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jl     114f <get_path_length+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <get_path_length+0x4f>
jmp    116d <get_path_length+0x5d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <get_path_length+0x1b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_path_length>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %eax,%edx
xor    %eax,%eax
test   %ecx,%ecx
cmovs  %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %edx,%edx
jle    1147 <get_path_length+0x37>
lea    -0x1(%rdx),%rcx
cmpb   $0x2f,-0x1(%rbx,%rdx,1)
mov    %rcx,%rdx
jne    1130 <get_path_length+0x20>
add    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_path_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
%4 = call i32 @llvm.smin.i32(i32 %2, i32 0)
br label %5
5: ; preds = %10, %1
%6 = phi i64 [ %7, %10 ], [ %3, %1 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %0, i64 %7
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 47
br i1 %13, label %14, label %5
14: ; preds = %10
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %5, %14
%17 = phi i32 [ %15, %14 ], [ %4, %5 ]
ret i32 %17
}
/* Variables and functions */
double get_rand_double();
int scale_rand(int num_nodes, double *cumpd) {
  int i;
  double k;
  k = get_rand_double();
  i = 1;
  while (cumpd[i] < k) {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<scale_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_rand_double@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <scale_rand+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <scale_rand+0x22>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_rand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_rand_double@plt>
ucomisd 0x8(%r14,%rbx,8),%xmm0
lea    0x1(%rbx),%rbx
ja     1120 <scale_rand+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @scale_rand(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %3
store double* %1, double** %4
%7 = call double (...) @get_rand_double()
store double %7, double* %6
store i32 1, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load double*, double** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
%13 = load double, double* %12
%14 = load double, double* %6
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @scale_rand(i32 %0, double* nocapture %1) {
%3 = tail call double (...) @get_rand_double()
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ 1, %2 ]
%6 = getelementptr inbounds double, double* %1, i64 %5
%7 = load double, double* %6
%8 = fcmp olt double %7, %3
%9 = add nuw i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write_config();
int /*<<< orphan*/ write_contacts();
int /*<<< orphan*/ write_macros();
void file_end() {
  write_contacts();
  write_config();
  write_macros();
}


x86 assembly (clang, -O0):
<file_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <write_contacts@plt>
mov    $0x0,%al
call   1050 <write_config@plt>
mov    $0x0,%al
call   1040 <write_macros@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_end>:
push   %rax
xor    %eax,%eax
call   1030 <write_contacts@plt>
xor    %eax,%eax
call   1050 <write_config@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_macros@plt>

LLVM IR (-O0):
define void @file_end() {
%1 = call i32 (...) @write_contacts()
%2 = call i32 (...) @write_config()
%3 = call i32 (...) @write_macros()
ret void
}

LLVM IR (-O2):
define void @file_end() {
%1 = tail call i32 (...) @write_contacts()
%2 = tail call i32 (...) @write_config()
%3 = tail call i32 (...) @write_macros()
ret void
}
/* Type definitions */
typedef scalar_t__ const uint16_t;

/* Variables and functions */
uint16_t rdp_packed_size(const uint16_t payload_size) {
  return payload_size + 15;
}


x86 assembly (clang, -O0):
<rdp_packed_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_packed_size>:
lea    0xf(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @rdp_packed_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 15
ret i64 %4
}

LLVM IR (-O2):
define i64 @rdp_packed_size(i64 %0) {
%2 = add nsw i64 %0, 15
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void SkipWhitespace(char const **ppszLine) {
  assert(ppszLine && *ppszLine);
  while (**ppszLine == ' ')
    ++(*ppszLine);
}


x86 assembly (clang, -O0):
<SkipWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113a <SkipWhitespace+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    116d <SkipWhitespace+0x5d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1147 <SkipWhitespace+0x37>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipWhitespace>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1125 <SkipWhitespace+0x15>
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
jmp    1127 <SkipWhitespace+0x17>
xor    %edi,%edi
call   1030 <assert@plt>
mov    (%rbx),%rax
cmpb   $0x20,(%rax)
jne    114c <SkipWhitespace+0x3c>
add    $0x1,%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,(%rbx)
cmpb   $0x20,(%rax)
lea    0x1(%rax),%rax
je     1140 <SkipWhitespace+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @SkipWhitespace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %13
13: ; preds = %19, %9
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i8**, i8*** %2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
br label %13
23: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @SkipWhitespace(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
%9 = tail call i32 @assert(i32 %8)
%10 = load i8*, i8** %0
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %7, %13
%14 = phi i8* [ %15, %13 ], [ %10, %7 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %0
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 32
br i1 %17, label %13, label %18
18: ; preds = %13, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int bw_nbioify(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  if (flags < 0)
    return flags;
  flags = flags & ~O_NONBLOCK;
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<bw_nbioify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <bw_nbioify+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <bw_nbioify+0x61>
mov    -0xc(%rbp),%eax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bw_nbioify>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1147 <bw_nbioify+0x37>
mov    0x2eba(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @bw_nbioify(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %21
12: ; preds = %1
%13 = load i32, i32* %4
%14 = load i32, i32* @O_NONBLOCK
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = load i32, i32* @F_SETFL
%19 = load i32, i32* %4
%20 = call i32 @fcntl(i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %2
br label %21
21: ; preds = %12, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @bw_nbioify(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @O_NONBLOCK
%7 = xor i32 %6, -1
%8 = and i32 %3, %7
%9 = load i32, i32* @F_SETFL
%10 = tail call i32 @fcntl(i32 %0, i32 %9, i32 %8)
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ %10, %5 ], [ %3, %1 ]
ret i32 %12
}
int foo(int i) { return -2 * __builtin_abs(i - 2); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
imul   $0xfffffffe,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x7ffffffe(%rdi),%ecx
lea    -0x2(%rdi),%eax
neg    %eax
cmp    $0x2,%edi
cmovl  %ecx,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 2
%5 = sub nsw i32 0, %4
%6 = icmp slt i32 %4, 0
%7 = select i1 %6, i32 %5, i32 %4
%8 = mul nsw i32 -2, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = sub i32 2, %0
%3 = add i32 %0, 2147483646
%4 = icmp slt i32 %0, 2
%5 = select i1 %4, i32 %3, i32 %2
%6 = shl i32 %5, 1
ret i32 %6
}
void gl_sort(void) {
  _Bool tmp;
  {
    {
      while (1) {
      while_22_continue:;
        { tmp = gl_sort_pass(); }
        if (tmp) {
        } else {
          goto while_22_break;
        }
      }
    while_22_break:;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<gl_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <gl_sort+0xd>
mov    $0x0,%al
call   1030 <gl_sort_pass@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x1(%rbp)
testb  $0x1,-0x1(%rbp)
je     113e <gl_sort+0x2e>
jmp    1143 <gl_sort+0x33>
jmp    1148 <gl_sort+0x38>
jmp    1118 <gl_sort+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_sort>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gl_sort_pass@plt>
test   %eax,%eax
jne    1120 <gl_sort+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @gl_sort() {
%1 = alloca i8
br label %2
2: ; preds = %0, %11
br label %3
3: ; preds = %2
%4 = call i32 (...) @gl_sort_pass()
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = trunc i8 %7 to i1
br i1 %8, label %9, label %10
9: ; preds = %3
br label %11
10: ; preds = %3
br label %12
11: ; preds = %9
br label %2
12: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @gl_sort() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @gl_sort_pass()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *zmalloc(size_t);
char *strclone(const char *str) {
  size_t len;
  char *result;
  len = strlen(str);
  result = zmalloc(len + 1);
  strcpy(result, str);
  return result;
}


x86 assembly (clang, -O0):
<strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <zmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strclone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <zmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @zmalloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @strclone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @zmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void *TestObjType_init(void *self) { return self; }


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

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

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

LLVM IR (-O2):
define i8* @TestObjType_init(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
double random_d(double range) {
  return (double)random() * range / ((double)RAND_MAX + 1);
}


x86 assembly (clang, -O0):
<random_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xebe(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_d>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2ebc(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  (%rsp),%xmm0
addsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @random_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @random_d(double %0) {
%2 = tail call i64 (...) @random()
%3 = sitofp i64 %2 to double
%4 = fmul double %3, %0
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int declen(const char *str) {
  unsigned int sum = 0;
  while (1) {
    char chh = *str;
    if (!isdigit(chh))
      break;
    str++;
    sum++;
  }
  do {
    if (0)
      printf("LEN: %x\n", sum);
  } while (0);
  return (sum);
}


x86 assembly (clang, -O0):
<declen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1143 <declen+0x33>
jmp    115d <declen+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <declen+0x13>
jmp    1162 <declen+0x52>
jmp    1167 <declen+0x57>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
add    $0x1,%ebp
test   %eax,%eax
jne    1120 <declen+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @declen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i8* [ %0, %1 ], [ %8, %2 ]
%5 = load i8, i8* %4
%6 = tail call i32 @isdigit(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = add i32 %3, 1
br i1 %7, label %10, label %2
10: ; preds = %2
ret i32 %3
}
/* Variables and functions */
size_t mirror_hash_string(const char *str) {
  size_t hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


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

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

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

LLVM IR (-O2):
define i64 @mirror_hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void find_extensionsGL(void) {}


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

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

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

LLVM IR (-O2):
define void @find_extensionsGL() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_ENABLE;
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_setcancelstate(int /*<<< orphan*/,
                                          int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *a_thread_function() {
  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
  while (1)
    sleep(1);
  pthread_exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<a_thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_setcancelstate@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <a_thread_function+0x16>

x86 assembly (clang, -O2):
<a_thread_function>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <pthread_setcancelstate@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <a_thread_function+0x20>

LLVM IR (-O0):
@PTHREAD_CANCEL_ENABLE = global i32 0
define i8* @a_thread_function() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = call i32 @pthread_setcancelstate(i32 %1, i32* null)
br label %3
3: ; preds = %0, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ENABLE = global i32 0
define noalias i8* @a_thread_function() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = tail call i32 @pthread_setcancelstate(i32 %1, i32* null)
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @sleep(i32 1)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int **a, *b;
  int x = 10, y = 15;
  if (y < *b) {
    a = &b;
    printf("x=%d  %d, b=%d\n", x, **a, *b);
  }
  printf("%d", **a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0xf,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1164 <main+0x54>
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int ya_getopt_internal(int, char *const *, char const *, struct option const *,
                       int *, int);
int ya_getopt_long_only(int argc, char *const argv[], const char *optstring,
                        const struct option *longopts, int *longindex) {
  return ya_getopt_internal(argc, argv, optstring, longopts, longindex, 1);
}


x86 assembly (clang, -O0):
<ya_getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <ya_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <ya_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @ya_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @ya_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @ya_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @ya_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void _speex_fatal(const char *str, const char *file, int line) {
  fprintf(stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line,
          str);
  exit(1);
}


x86 assembly (clang, -O0):
<_speex_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_speex_fatal>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Fatal (internal) error in %s, line %d: %s\0A\00"
define void @_speex_fatal(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Fatal (internal) error in %s, line %d: %s\0A\00"
define void @_speex_fatal(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
bool is_set_prime(int *a) {
  while (*a) {
    if (!is_prime(*a))
      return false;
    a++;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_set_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     115a <is_set_prime+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
jne    1149 <is_set_prime+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_set_prime+0x51>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_set_prime+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_set_prime>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    $0x1,%ebp
test   %edi,%edi
je     1147 <is_set_prime+0x37>
add    $0x4,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <is_prime@plt>
test   %eax,%eax
je     1145 <is_set_prime+0x35>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1130 <is_set_prime+0x20>
jmp    1147 <is_set_prime+0x37>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_set_prime(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i32, i32* %12
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ %2, %1 ]
%9 = phi i32* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @is_prime(i32 %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i32, i32* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void init_glapi_relocs_once(void) {}


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

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

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

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

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ ISSUING_DIST_POINT_it;
int i2d_ISSUING_DIST_POINT(ISSUING_DIST_POINT *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ISSUING_DIST_POINT_it);
}


x86 assembly (clang, -O0):
<i2d_ISSUING_DIST_POINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ISSUING_DIST_POINT>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@ISSUING_DIST_POINT_it = global i32 0
define i32 @i2d_ISSUING_DIST_POINT(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @ISSUING_DIST_POINT_it)
ret i32 %7
}

LLVM IR (-O2):
@ISSUING_DIST_POINT_it = global i32 0
define i32 @i2d_ISSUING_DIST_POINT(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ISSUING_DIST_POINT_it)
ret i32 %3
}
void gdk_window_is_viewable() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_is_viewable() {
ret void
}
int evry_plugins_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @evry_plugins_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *threadFunc2(void *arg) {
  printf("thread 2 exiting\n");
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<threadFunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadFunc2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"thread 2 exiting\0A\00"
define i8* @threadFunc2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [17 x i8] c"thread 2 exiting\00"
define noalias i8* @threadFunc2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
int test_imm_16uint16_mem(unsigned short *val) {
  return ((*val) & (-0x16 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_16uint16_mem>:
movzwl (%rdi),%eax
test   $0xffea,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_16uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -22
%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_16uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -22
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void suma(int a, int b) {
  int suma;
  suma = a + b;
  printf(" Suma %d\n", suma);
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c" Suma %d\0A\00"
define void @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void caller_2_1_1_1_2_1_1() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigsuspend(int /*<<< orphan*/ *);
void wait_for_signal(int signo, sigset_t *oldmask) {
  sigset_t mask;
  __sigfillset(&mask);
  sigdelset(&mask, signo);
  sigsuspend(&mask);
}


x86 assembly (clang, -O0):
<wait_for_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <__sigfillset@plt>
mov    -0x4(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1050 <sigdelset@plt>
lea    -0x14(%rbp),%rdi
call   1040 <sigsuspend@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_signal>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <__sigfillset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigdelset@plt>
mov    %r14,%rdi
call   1040 <sigsuspend@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @wait_for_signal(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 @__sigfillset(i32* %5)
%7 = load i32, i32* %3
%8 = call i32 @sigdelset(i32* %5, i32 %7)
%9 = call i32 @sigsuspend(i32* %5)
ret void
}

LLVM IR (-O2):
define void @wait_for_signal(i32 %0, i32* nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @__sigfillset(i32* %3)
%6 = call i32 @sigdelset(i32* %3, i32 %0)
%7 = call i32 @sigsuspend(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __all_init();
int /*<<< orphan*/ __pid_loop();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int main(void) {
  __all_init();
  printf("");
  while (1) {
    __pid_loop();
    usleep(10000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__all_init@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__pid_loop@plt>
mov    $0x2710,%edi
call   1060 <usleep@plt>
jmp    1162 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__all_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__pid_loop@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__all_init()
%3 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @__pid_loop()
%6 = call i32 @usleep(i32 10000)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__all_init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @__pid_loop()
%4 = tail call i32 @usleep(i32 10000)
br label %2
}
int fun779() { return 779; }


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

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

LLVM IR (-O0):
define i32 @fun779() {
ret i32 779
}

LLVM IR (-O2):
define i32 @fun779() {
ret i32 779
}
/* Variables and functions */
void *malloc(int);
void *oa_malloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<oa_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @oa_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_call(void *bus, void *m, uint64_t usec, void *ret_error, void **reply) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_call>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ec0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_call>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_call(i8* %0, i8* %1, i32 %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8**
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_call(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i8** nocapture readnone %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}