xunge/DecIR huggingface dataset:
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *new, struct list_head *old) {
  list_replace(new, old);
  INIT_LIST_HEAD(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x10(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rsi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cudaMemGetInfo(size_t *, size_t *);
size_t getGpuGlobalMem(int deviceID) {
  size_t free = 0, total = 0;
  cudaMemGetInfo(&free, &total);
  return total;
}


x86 assembly (clang, -O0):
<getGpuGlobalMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <cudaMemGetInfo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGpuGlobalMem>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <cudaMemGetInfo@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @getGpuGlobalMem(i32 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = call i32 @cudaMemGetInfo(i64* %2, i64* %3)
%7 = load i64, i64* %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_ssl_credentials_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_ssl_credentials_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_ssl_credentials_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_ssl_credentials_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_ssl_credentials_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int sub(int, int);
int /*<<< orphan*/ writeint(int);
int main() {
  int x = sub(5, 3);
  writeint(0);
  writeint(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <sub@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1030 <writeint@plt>
mov    -0x4(%rbp),%edi
call   1030 <writeint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <sub@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <writeint@plt>
mov    %ebx,%edi
call   1030 <writeint@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sub(i32 5, i32 3)
%2 = tail call i32 @writeint(i32 0)
%3 = tail call i32 @writeint(i32 %1)
ret i32 0
}
void test4(int x) {
  int buf[100];
  if (x > 99)
    buf[x] = 1;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jle    1127 <test4+0x27>
movslq -0x4(%rbp),%rax
movl   $0x1,-0x1a0(%rbp,%rax,4)
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 99
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %8
store i32 1, i32* %9
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0) {
ret void
}
void glTexParameterxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexParameterxv() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int strftime(char *, int, char *, struct tm *);
int misc_strftimegiven(char *out, int len, char *fmt, time_t tv) {
  struct tm tm;
  localtime_r(&tv, &tm);
  return strftime(out, len, fmt, &tm);
}


x86 assembly (clang, -O0):
<misc_strftimegiven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_strftimegiven>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %ecx,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%r15
mov    %r15,%rsi
call   1030 <localtime_r@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <strftime@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @misc_strftimegiven(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.tm
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = call i32 @localtime_r(i32* %8, %struct.tm* %9)
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = call i32 @strftime(i8* %11, i32 %12, i8* %13, %struct.tm* %9)
ret i32 %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @misc_strftimegiven(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.tm
store i32 %3, i32* %5
%7 = bitcast %struct.tm* %6 to i8*
%8 = call i32 @localtime_r(i32* %5, %struct.tm* %6)
%9 = call i32 @strftime(i8* %0, i32 %1, i8* %2, %struct.tm* %6)
ret i32 %9
}
void dump_pseudos() {}


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

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

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

LLVM IR (-O2):
define void @dump_pseudos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ malloc(int);
double *new_matrix(int size1, int size2) {
  double *m = (double *)malloc(size1 * size2 * sizeof(double));
  assert(m != NULL);
  return m;
}


x86 assembly (clang, -O0):
<new_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_matrix>:
push   %rbx
imul   %esi,%edi
shl    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @new_matrix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load double*, double** %5
ret double* %18
}

LLVM IR (-O2):
define double* @new_matrix(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = mul i32 %3, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to double*
%7 = icmp ne i64 %5, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret double* %6
}
int getSquareSides() { return 4; }


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

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

LLVM IR (-O0):
define i32 @getSquareSides() {
ret i32 4
}

LLVM IR (-O2):
define i32 @getSquareSides() {
ret i32 4
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *Make_new_Strcat(char *str1, char *str2) {
  char *newstr = (char *)malloc(strlen(str1) + strlen(str2) + 1);
  strcpy(newstr, str1);
  strcat(newstr, str2);
  return newstr;
}


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

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

LLVM IR (-O0):
define i8* @Make_new_Strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @Make_new_Strcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
/* Variables and functions */
char *safealloc(int);
void for_loop() {
  char *a;
  int i;
  a = safealloc(10);
  for (i = 0; i < 10; i++) {
    a[i] = 'a';
  }
  a = safealloc(5);
  for (i = 0; i < 10; i++) {
    a[i] = 'a';
  }
}


x86 assembly (clang, -O0):
<for_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <safealloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1151 <for_loop+0x41>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <for_loop+0x1d>
mov    $0x5,%edi
call   1030 <safealloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    118a <for_loop+0x7a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <for_loop+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_loop>:
push   %rbx
mov    $0xa,%edi
call   1030 <safealloc@plt>
movabs $0x6161616161616161,%rbx
61 61 61
mov    %rbx,(%rax)
movw   $0x6161,0x8(%rax)
mov    $0x5,%edi
call   1030 <safealloc@plt>
mov    %rbx,(%rax)
movw   $0x6161,0x8(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @for_loop() {
%1 = tail call i8* @safealloc(i32 10)
%2 = tail call i8* @safealloc(i32 5)
ret void
}
void glBindImageTexture(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBindImageTexture() {
ret void
}
/* Variables and functions */
int atoi(char *);
int get_para(int argc, char **argv) { return (argc < 2) ? -1 : atoi(argv[1]); }


x86 assembly (clang, -O0):
<get_para>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1136 <get_para+0x26>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <get_para+0x36>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_para>:
cmp    $0x2,%edi
jge    111b <get_para+0xb>
mov    $0xffffffff,%eax
ret
mov    0x8(%rsi),%rdi
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @get_para(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 = icmp slt i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
br label %13
13: ; preds = %8, %7
%14 = phi i32 [ -1, %7 ], [ %12, %8 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_para(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
void topicEncodeAddress(void) {}


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

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

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

LLVM IR (-O2):
define void @topicEncodeAddress() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Serial1SendBreak();
void BreakCOM(int portnum) {
  portnum;
  Serial1SendBreak();
}


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

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

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

LLVM IR (-O2):
define void @BreakCOM(i32 %0) {
%2 = tail call i32 (...) @Serial1SendBreak()
ret void
}
int test_imm_24uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x24 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_24uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x24,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_24uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 36
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void propagate_user_return_notify(struct task_struct *prev,
                                  struct task_struct *next) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @propagate_user_return_notify(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int foo_chkadd(int a, int b) {
  if (INT_MAX - b < a) {
    fputs("int overflow\n", stderr);
    return INT_MAX;
  }
  return a + b;
}


x86 assembly (clang, -O0):
<foo_chkadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
sub    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1159 <foo_chkadd+0x49>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <foo_chkadd+0x52>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_chkadd>:
push   %rbx
mov    0x2ed0(%rip),%rbx
mov    (%rbx),%ecx
sub    %esi,%ecx
cmp    %edi,%ecx
jge    1139 <foo_chkadd+0x29>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%eax
pop    %rbx
ret
mov    %esi,%eax
add    %edi,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@.str = [14 x i8] c"int overflow\0A\00"
@stderr = global i32 0
define i32 @foo_chkadd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* @INT_MAX
%7 = load i32, i32* %5
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @INT_MAX
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [14 x i8] c"int overflow\0A\00"
@stderr = global i32 0
define i32 @foo_chkadd(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = sub nsw i32 %3, %1
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @INT_MAX
br label %12
10: ; preds = %2
%11 = add nsw i32 %1, %0
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ isalnum(char);
int is_valid_name_char(char c) { return isalnum(c) || c == '_' || c == '.'; }


x86 assembly (clang, -O0):
<is_valid_name_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <is_valid_name_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     1158 <is_valid_name_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_name_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
cmp    $0x2e,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_valid_name_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_valid_name_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 46
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_inn_batchdir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_inn_batchdir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_inn_batchdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_inn_batchdir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int test_equal(void *x, void *y) { return (x == y); }


x86 assembly (clang, -O0):
<test_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @test_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Shuffle_array(int *, int);
int /*<<< orphan*/ _quick_sort_3_way(int *, int /*<<< orphan*/, int);
void quick_sort_3_way(int *array, int length) {
  Shuffle_array(array, length);
  _quick_sort_3_way(array, 0, length - 1);
}


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

x86 assembly (clang, -O2):
<quick_sort_3_way>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <Shuffle_array@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_quick_sort_3_way@plt>

LLVM IR (-O0):
define void @quick_sort_3_way(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @Shuffle_array(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @_quick_sort_3_way(i32* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @quick_sort_3_way(i32* %0, i32 %1) {
%3 = tail call i32 @Shuffle_array(i32* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_quick_sort_3_way(i32* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ dltest(char *);
int main(int argc, char **argv) {
  dltest("hello world!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <dltest@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\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 @dltest(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dltest(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void gtk_color_selection_palette_from_string() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_palette_from_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
void up_and_down(int n) {
  char fmt[30] = "Level %d:, n location %p\n";
  printf(fmt, n, &n);
  if (n < 4) {
    up_and_down(n + 1);
  }
  printf(fmt, n, &n);
}


x86 assembly (clang, -O0):
<up_and_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
cmpl   $0x4,-0x4(%rbp)
jge    1185 <up_and_down+0x65>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <up_and_down@plt>
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_and_down>:
sub    $0x38,%rsp
mov    %edi,%esi
mov    %edi,0xc(%rsp)
movups 0xedd(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    $0x3,%esi
jg     1168 <up_and_down+0x48>
add    $0x1,%esi
mov    %esi,%edi
call   1040 <up_and_down@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   1030 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.up_and_down.fmt = [30 x i8] c"Level %d:, n location %p\0A\00\00\00\00\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
store i32 %0, i32* %2
%4 = bitcast [30 x i8]* %3 to i8*
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* %5, i32 %6, i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %10, %1
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* %14, i32 %15, i32* %2)
ret void
}

LLVM IR (-O2):
@__const.up_and_down.fmt = [30 x i8] c"Level %d:, n location %p\0A\00\00\00\00\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* %4, i32 %0, i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = add nsw i32 %6, 1
%10 = load i32, i32* %2
br label %11
11: ; preds = %8, %1
%12 = phi i32 [ %10, %8 ], [ %6, %1 ]
%13 = call i32 @printf(i8* %4, i32 %12, i32* %2)
ret void
}
/* Variables and functions */
double next_rand();
double gg_drand(void) { return next_rand() * 2.328306436538696e-10; }


x86 assembly (clang, -O0):
<gg_drand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_rand@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_drand>:
push   %rax
xor    %eax,%eax
call   1030 <next_rand@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gg_drand() {
%1 = call double (...) @next_rand()
%2 = fmul double %1, 0x3DEFFFFFFFFFFFFF
ret double %2
}

LLVM IR (-O2):
define double @gg_drand() {
%1 = tail call double (...) @next_rand()
%2 = fmul double %1, 0x3DEFFFFFFFFFFFFF
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int override_redirect;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_override_redirect(void *_p, int _v) {
  ((XWindowAttributes *)_p)->override_redirect = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_override_redirect>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_override_redirect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_override_redirect(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void g_cclosure_marshal_BOOLEAN__FLAGS() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_BOOLEAN__FLAGS() {
ret void
}
/* Variables and functions */
int main() {}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct tms {
  scalar_t__ tms_utime;
};

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
unsigned long timer() {
  struct tms hold;
  times(&hold);
  return (unsigned long)((float)(hold.tms_utime) / 60.0);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <times@plt>
cvtsi2ssq -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
cvtsi2ssq (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xed5(%rip),%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xec9(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i64 }
define i64 @timer() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to float
%6 = fpext float %5 to double
%7 = fdiv double %6, 6.000000e+01
%8 = fptoui double %7 to i64
ret i64 %8
}

LLVM IR (-O2):
%struct.tms = type { i64 }
define i64 @timer() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to float
%7 = fpext float %6 to double
%8 = fdiv double %7, 6.000000e+01
%9 = fptoui double %8 to i64
ret i64 %9
}
/* Type definitions */
struct jerasure_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct jerasure_context *);
void jerasure_release_context(struct jerasure_context *ctx) { free(ctx); }


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

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

LLVM IR (-O0):
%struct.jerasure_context = type { i32 }
define void @jerasure_release_context(%struct.jerasure_context* %0) {
%2 = alloca %struct.jerasure_context*
store %struct.jerasure_context* %0, %struct.jerasure_context** %2
%3 = load %struct.jerasure_context*, %struct.jerasure_context** %2
%4 = call i32 @free(%struct.jerasure_context* %3)
ret void
}

LLVM IR (-O2):
%struct.jerasure_context = type { i32 }
define void @jerasure_release_context(%struct.jerasure_context* nocapture %0) {
%2 = tail call i32 @free(%struct.jerasure_context* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_dobldobl_Laurent_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(775, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_dobldobl_Laurent_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x307,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @solve_by_dobldobl_Laurent_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 775, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_dobldobl_Laurent_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 775, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
size_t strelen(char *p, char *e) {
  if (!p || !e || (p >= e))
    return 0;
  return (e - p);
}


x86 assembly (clang, -O0):
<strelen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1130 <strelen+0x30>
cmpq   $0x0,-0x18(%rbp)
je     1130 <strelen+0x30>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     113d <strelen+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    114c <strelen+0x4c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strelen>:
xor    %eax,%eax
sub    %rdi,%rsi
cmova  %rsi,%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @strelen(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = icmp uge i8* %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %8, %2
store i64 0, i64* %3
br label %22
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
store i64 %21, i64* %3
br label %22
22: ; preds = %16, %15
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @strelen(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ult i8* %0, %1
%5 = and i1 %3, %4
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = select i1 %5, i64 %8, i64 0
ret i64 %9
}
unsigned int f28(unsigned int x, int y __attribute__((unused))) {
  return (x >> 1) ^ (x << ((-1) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f28>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f28(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 = lshr i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 31
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f28(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int retrieve_continuation_parameters(double *c) {
  int *a, *b, fail;
  fail = _ada_use_c2phc4c(72, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<retrieve_continuation_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x48,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrieve_continuation_parameters>:
mov    %rdi,%rcx
mov    $0x48,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @retrieve_continuation_parameters(double* %0) {
%2 = alloca double*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store double* %0, double** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load double*, double** %2
%9 = call i32 @_ada_use_c2phc4c(i32 72, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @retrieve_continuation_parameters(double* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 72, i32* undef, i32* undef, double* %0, i32 0)
ret i32 %2
}
char *getifname(ptr)
struct ifnet *ptr;
{
  ptr = ptr;
  return "X";
}


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

x86 assembly (clang, -O2):
<getifname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.ifnet = type opaque
@.str = [2 x i8] c"X\00"
define i8* @getifname(%struct.ifnet* %0) {
%2 = alloca %struct.ifnet*
store %struct.ifnet* %0, %struct.ifnet** %2
%3 = load %struct.ifnet*, %struct.ifnet** %2
store %struct.ifnet* %3, %struct.ifnet** %2
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.ifnet = type opaque
@.str = [2 x i8] c"X\00"
define i8* @getifname(%struct.ifnet* nocapture readnone %0) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int test(void) {
  time_t time;
  struct tm *timestruct;
  timestruct = gmtime(&time);
  return (timestruct != NULL);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <gmtime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %3, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = icmp ne %struct.tm* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call %struct.tm* @gmtime(i32* %1)
%4 = icmp ne %struct.tm* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int is_qpel(int x, int y, int bx, int by) {
  return (((x & bx) % 2) || ((y & by) % 2)) ? (1) : (0);
}


x86 assembly (clang, -O0):
<is_qpel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x11(%rbp)
jne    1143 <is_qpel+0x43>
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_qpel>:
and    %edx,%edi
and    %ecx,%esi
and    $0x1,%esi
test   $0x1,%dil
mov    $0x1,%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @is_qpel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = and i32 %9, %10
%12 = srem i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %4
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = and i32 %15, %16
%18 = srem i32 %17, 2
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %14, %4
%21 = phi i1 [ true, %4 ], [ %19, %14 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_qpel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 1
%6 = and i32 %5, %2
%7 = icmp eq i32 %6, 0
%8 = and i32 %1, 1
%9 = and i32 %8, %3
%10 = select i1 %7, i32 %9, i32 1
ret i32 %10
}
/* Variables and functions */
void bzero(unsigned char *STR, unsigned int LENGTH) {
  int i = 0;
  for (; i < LENGTH; i++)
    STR[i] = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1138 <bzero+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bzero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
je     1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}