xunge/DecIR huggingface dataset:
/* Variables and functions */
void free(void *);
void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int),
                                        void (**f)(void *)) {
  if (m != NULL)
    *m = NULL;
  if (f != NULL)
    *f = free;
}


x86 assembly (clang, -O0):
<CRYPTO_get_locked_mem_ex_functions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <CRYPTO_get_locked_mem_ex_functions+0x22>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113b <CRYPTO_get_locked_mem_ex_functions+0x3b>
mov    -0x10(%rbp),%rax
mov    0x2ea0(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_get_locked_mem_ex_functions>:
test   %rdi,%rdi
je     110c <CRYPTO_get_locked_mem_ex_functions+0xc>
movq   $0x0,(%rdi)
test   %rsi,%rsi
je     111b <CRYPTO_get_locked_mem_ex_functions+0x1b>
mov    0x2ec0(%rip),%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @CRYPTO_get_locked_mem_ex_functions(i8* (i64, i8*, i32)** writeonly %0, void (i8*)** writeonly %1) {
%3 = icmp eq i8* (i64, i8*, i32)** %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8* (i64, i8*, i32)* null, i8* (i64, i8*, i32)** %0
br label %5
5: ; preds = %4, %2
%6 = icmp eq void (i8*)** %1, null
br i1 %6, label %8, label %7
7: ; preds = %5
store void (i8*)* @free, void (i8*)** %1
br label %8
8: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fmtint(char *, unsigned int, int, int /*<<< orphan*/);
int fputs(char *, int /*<<< orphan*/ *);
int fputx(unsigned d, FILE *f) {
  char buff[32];
  fmtint(buff, d, 16, 0);
  return fputs(buff, f);
}


x86 assembly (clang, -O0):
<fputx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputx>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputx(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @fmtint(i8* %6, i32 %7, i32 16, i32 0)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fputx(i32 %0, i32* nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @fmtint(i8* %4, i32 %0, i32 16, i32 0)
%6 = call i32 @fputs(i8* %4, i32* %1)
ret i32 %6
}
int drm_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
               unsigned long arg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @drm_modctx(%struct.inode* %0, %struct.file* %1, i32 %2, i64 %3) {
%5 = alloca %struct.inode*
%6 = alloca %struct.file*
%7 = alloca i32
%8 = alloca i64
store %struct.inode* %0, %struct.inode** %5
store %struct.file* %1, %struct.file** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @drm_modctx(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1, i32 %2, i64 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int xp_sem_unlink(const char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<xp_sem_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xp_sem_unlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @xp_sem_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @xp_sem_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wcstok(wchar_t *s1, const wchar_t *s2, wchar_t **ptr) { return s1; }


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

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

LLVM IR (-O0):
define i32* @wcstok(i32* %0, i32* %1, i32** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32**
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32** %2, i32*** %6
%7 = load i32*, i32** %4
ret i32* %7
}

LLVM IR (-O2):
define i32* @wcstok(i32* readnone returned %0, i32* nocapture readnone %1, i32** nocapture readnone %2) {
ret i32* %0
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  printf("Enter a number - ");
  scanf("%i", &number);
  printf("The factorial of %i is %i\n", number, fact(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fact@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a number - \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [27 x i8] c"The factorial of %i is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fact(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a number - \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [27 x i8] c"The factorial of %i is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
char *strtok(char *, char *);
char *Command_GetValue(char *expression) {
  char *value;
  value = strtok(expression, " ");
  value = strtok(NULL, " ");
  return value;
}


x86 assembly (clang, -O0):
<Command_GetValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xec5(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_GetValue>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strtok@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @Command_GetValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @Command_GetValue(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ UART0_ERR_DriverIRQHandler();
__attribute__((weak)) void UART0_ERR_IRQHandler(void) {
  UART0_ERR_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @UART0_ERR_IRQHandler() {
%1 = call i32 (...) @UART0_ERR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART0_ERR_IRQHandler() {
%1 = tail call i32 (...) @UART0_ERR_DriverIRQHandler()
ret void
}
int findfirstl(long *a, int n, long val) {
  int i;
  for (i = 0; i < n; i++) {
    if (a[i] == val)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findfirstl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <findfirstl+0x56>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    1143 <findfirstl+0x43>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <findfirstl+0x5d>
jmp    1148 <findfirstl+0x48>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <findfirstl+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findfirstl>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111f <findfirstl+0x1f>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %rdx,(%rdi,%rcx,8)
je     1120 <findfirstl+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <findfirstl+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findfirstl(i64* nocapture %0, i32 %1, i64 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
unsigned long power2(unsigned long n) {
  unsigned long p = 8;
  while (p <= n)
    p <<= 1;
  return p;
}


x86 assembly (clang, -O0):
<power2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     112f <power2+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <power2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power2>:
mov    $0x8,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jbe    1110 <power2+0x10>
ret

LLVM IR (-O0):
define i64 @power2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 8, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ule i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 1
store i64 %10, i64* %3
br label %4
11: ; preds = %4
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @power2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 8, %1 ], [ %5, %2 ]
%4 = icmp ugt i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SAI2_DriverIRQHandler();
__attribute__((weak)) void SAI2_IRQHandler(void) { SAI2_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SAI2_IRQHandler() {
%1 = call i32 (...) @SAI2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SAI2_IRQHandler() {
%1 = tail call i32 (...) @SAI2_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t primes_index(uint64_t index) { return (index - 3) / 2; }


x86 assembly (clang, -O0):
<primes_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<primes_index>:
mov    %edi,%eax
add    $0xfffffffd,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xfffffffd,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @primes_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 3
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @primes_index(i32 %0) {
%2 = add nsw i32 %0, -3
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ remove_duplicates(char *);
scalar_t__ strcmp(char *, char *);
int test_with_duplicates() {
  char input[] = "aabbcc";
  remove_duplicates(input);
  return strcmp(input, "abc") == 0;
}


x86 assembly (clang, -O0):
<test_with_duplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
call   1040 <remove_duplicates@plt>
lea    -0x7(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_with_duplicates>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636362,0xb(%rsp)
movl   $0x62626161,0x8(%rsp)
62
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <remove_duplicates@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_with_duplicates.input = [7 x i8] c"aabbcc\00"
@.str = [4 x i8] c"abc\00"
define i32 @test_with_duplicates() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @remove_duplicates(i8* %3)
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@__const.test_with_duplicates.input = [7 x i8] c"aabbcc\00"
@.str = [4 x i8] c"abc\00"
define i32 @test_with_duplicates() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @remove_duplicates(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ exp(double);
double log(scalar_t__);
double softplus(double x) { return log(1.0 + exp(x)); }


x86 assembly (clang, -O0):
<softplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %rax,%xmm1
movsd  0xebc(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softplus>:
push   %rax
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @softplus(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @exp(double %3)
%5 = sitofp i64 %4 to double
%6 = fadd double 1.000000e+00, %5
%7 = fptosi double %6 to i64
%8 = call double @log(i64 %7)
ret double %8
}

LLVM IR (-O2):
define double @softplus(double %0) {
%2 = tail call i64 @exp(double %0)
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fptosi double %4 to i64
%6 = tail call double @log(i64 %5)
ret double %6
}
int test_percent_q_plus_d(void) {
  int local = 0;
  return local;
}


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

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

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

LLVM IR (-O2):
define i32 @test_percent_q_plus_d() {
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand_unit() { return (((double)rand()) / RAND_MAX); }


x86 assembly (clang, -O0):
<rand_unit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_unit>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_unit() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_unit() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
int count_1_1(int v) {
  int num = 0;
  while (v) {
    if (v % 2 == 1) {
      num++;
    }
    v >>= 1;
  }
  return num;
}


x86 assembly (clang, -O0):
<count_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <count_1_1+0x43>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1135 <count_1_1+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_1_1+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_1_1>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <count_1_1+0x31>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
xor    %edx,%edx
cmp    $0x1,%esi
sete   %dl
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_1_1+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_1_1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = ashr i32 %5, 1
%11 = icmp ult i32 %5, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
void check_clz(int n) {
  __builtin_clz(n);
  __builtin_clzl(n);
  __builtin_clzll(n);
}


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

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

LLVM IR (-O0):
define void @check_clz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = call i64 @llvm.ctlz.i64(i64 %6, i1 true)
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = call i64 @llvm.ctlz.i64(i64 %10, i1 true)
%12 = trunc i64 %11 to i32
ret void
}

LLVM IR (-O2):
define void @check_clz(i32 %0) {
ret void
}
int test_imm_9Dint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Dint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 157
%7 = icmp ne i64 %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_9Dint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10289152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void HitTheBonus(int param) {}


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

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

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

LLVM IR (-O2):
define void @HitTheBonus(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_to_montgomery(uintptr_t, uintptr_t);
void fiat_p224_to_montgomery(uint64_t out1[4], const uint64_t arg1[4]) {
  internal_fiat_p224_to_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_p224_to_montgomery>:
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 <internal_fiat_p224_to_montgomery@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p224_to_montgomery>:
jmp    1030 <internal_fiat_p224_to_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p224_to_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p224_to_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_to_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p224_to_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inicia();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ tenta(int, int, char);
int main(int argc, char *argv[]) {
  inicia();
  tenta(1, 1, '*');
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <inicia@plt>
mov    $0x1,%esi
mov    $0x2a,%edx
mov    %esi,%edi
call   1030 <tenta@plt>
lea    0xe9b(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <inicia@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x2a,%edx
call   1030 <tenta@plt>
lea    0xead(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @inicia()
%7 = call i32 @tenta(i32 1, i32 1, i8 signext 42)
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @inicia()
%4 = tail call i32 @tenta(i32 1, i32 1, i8 signext 42)
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
main() {
  int a, b, c;
  if (a < b) {
    a = a + b;
  }
  while (a < b) {
    a = a + b;
  }
  if (a <= b) {
    c = a - b;
  } else {
    c = a + b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1120 <main+0x20>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <main+0x25>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <main+0x3f>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <main+0x25>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1159 <main+0x59>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1162 <main+0x62>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %0
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
store i32 %20, i32* %2
br label %13
21: ; preds = %13
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %4
br label %33
29: ; preds = %21
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = add nsw i32 %30, %31
store i32 %32, i32* %4
br label %33
33: ; preds = %29, %25
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 0, b = 0;
  set(&a);
  test_assert(a == 13);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @set(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @set(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
unsigned xrop3_89_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_89_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_89_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %ecx
or     %ecx,%eax
xor    $0xff,%eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_89_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_89_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
%9 = xor i32 %8, 255
%10 = and i32 %9, %7
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ e_cli();
void e_cli_accu() { e_cli(); }


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

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

LLVM IR (-O0):
define void @e_cli_accu() {
%1 = call i32 (...) @e_cli()
ret void
}

LLVM IR (-O2):
define void @e_cli_accu() {
%1 = tail call i32 (...) @e_cli()
ret void
}
/* Type definitions */
typedef unsigned char uint8_t;

/* Variables and functions */
unsigned char gf2v_get_ele(const uint8_t *a, unsigned i) {
  unsigned char r = a[i >> 3];
  r = r >> (i & 7);
  return r & 1;
}


x86 assembly (clang, -O0):
<gf2v_get_ele>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
sar    %cl,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2v_get_ele>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf2v_get_ele(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i32, i32* %4
%15 = and i32 %14, 7
%16 = ashr i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = and i32 %19, 1
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @gf2v_get_ele(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = trunc i32 %9 to i8
%11 = and i8 %10, 1
ret i8 %11
}
void ff_hevc_put_hevc_uni_pel_pixels64_10_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @MUTEX_UNLOCK_WL_SCAN_SET() {
ret void
}
int smaller(int x, int y, int z) {
  return (((x < y ? x : y) < z) ? (x < y ? x : y) : z);
}


x86 assembly (clang, -O0):
<smaller>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <smaller+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <smaller+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <smaller+0x5e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114d <smaller+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <smaller+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1164 <smaller+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaller>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmp    %edx,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @smaller(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load i32, i32* %4
br label %26
24: ; preds = %18
%25 = load i32, i32* %5
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
br label %30
28: ; preds = %14
%29 = load i32, i32* %6
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @smaller(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_help(void) {
  fprintf(stderr, "Usage: btcoex_ratio [-i ifname][-z]\n"
                  "Options:\n"
                  "   -i, change interface\n"
                  "   -z, reset counters to zero.\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: btcoex_ratio [-i ifname][-z]\0AOptions:\0A -i, change interface\0A -z, reset counters to zero.\0A\00"
define void @show_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: btcoex_ratio [-i ifname][-z]\0AOptions:\0A -i, change interface\0A -z, reset counters to zero.\0A\00"
define void @show_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  char *ret;
  int len;
  len = strlen(s) + 1;
  ret = malloc(len);
  if (ret)
    memcpy(ret, s, len);
  return ret;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <strdup+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Main\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ command(char *);
void pwd() { (void)command("PWD"); }


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
lea    0xee9(%rip),%rdi
jmp    1030 <command@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"PWD\00"
define void @pwd() {
%1 = call i32 @command(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"PWD\00"
define void @pwd() {
%1 = tail call i32 @command(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int IntCmp(const void *a, const void *b) {
  return ((int)((intptr_t)(a))) - ((int)((intptr_t)(b)));
}


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

x86 assembly (clang, -O2):
<IntCmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @IntCmp(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 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @IntCmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void init() {
  void init_bondi(void);
  void init_torus(void);
  void init_sndwave(void);
  void init_entwave(void);
  void init_monopole(double Rout_val);
  switch (4) {
  case 1:
  case 2:
    init_monopole(1e3);
    break;
  case 3:
    init_monopole(100.);
    break;
  case 4:
    init_torus();
    break;
  case 7:
    init_sndwave();
    break;
  case 8:
    init_entwave();
    break;
  case 5:
  case 6:
    init_bondi();
    break;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
call   1030 <init_torus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
jmp    1030 <init_torus@plt>

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

LLVM IR (-O2):
define void @init() {
tail call void @init_torus()
ret void
}
double tosReal_sub(double x, double y) { return x - y; }


x86 assembly (clang, -O0):
<tosReal_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosReal_sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @tosReal_sub(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @tosReal_sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
void arch_halt() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ worker();
int main() {
  uint64_t out;
  out = worker();
  printf("%lx\n", out);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lx\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @worker()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}