xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ WINE_ERR(int /*<<< orphan*/);
int /*<<< orphan*/ WINE_WARN(int /*<<< orphan*/);
int /*<<< orphan*/ bar(int /*<<< orphan*/);
void foo() {
  bar(0);
  WINE_ERR(0);
  WINE_WARN(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1030 <WINE_ERR@plt>
xor    %edi,%edi
call   1050 <WINE_WARN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1030 <WINE_ERR@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <WINE_WARN@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 0)
%2 = call i32 @WINE_ERR(i32 0)
%3 = call i32 @WINE_WARN(i32 0)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 0)
%2 = tail call i32 @WINE_ERR(i32 0)
%3 = tail call i32 @WINE_WARN(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void ask_for(char *what, int c) {
  printf("%s   ", what);
  fflush(stdout);
  count(c);
}


x86 assembly (clang, -O0):
<ask_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1030 <count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_for>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <count@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s \00"
@stdout = global i32 0
define void @ask_for(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @count(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s \00"
@stdout = global i32 0
define void @ask_for(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @count(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
unsigned long get_kernel_addr_xenial(char *, int);
int /*<<< orphan*/ mmap_syslog(char **, int *);
int /*<<< orphan*/ printf(char *);
unsigned long get_kernel_addr() {
  char *syslog;
  int size;
  mmap_syslog(&syslog, &size);
  return get_kernel_addr_xenial(syslog, size);
  printf("[-] KASLR bypass only tested on trusty 4.4.0-* and xenial 4-8-0-*");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<get_kernel_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <mmap_syslog@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_kernel_addr_xenial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_kernel_addr>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <mmap_syslog@plt>
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1030 <get_kernel_addr_xenial@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i64 @get_kernel_addr() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @mmap_syslog(i8** %1, i32* %2)
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = call i64 @get_kernel_addr_xenial(i8* %4, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i64 @get_kernel_addr() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @mmap_syslog(i8** %1, i32* %2)
%6 = load i8*, i8** %1
%7 = load i32, i32* %2
%8 = call i64 @get_kernel_addr_xenial(i8* %6, i32 %7)
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_cond_init(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
void noreturn(void) {
  pthread_mutex_t mut;
  pthread_cond_t cond;
  pthread_mutex_init(&mut, NULL);
  pthread_cond_init(&cond, NULL);
  cond_wait(&cond, &mut);
}


x86 assembly (clang, -O0):
<noreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_mutex_init@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_cond_init@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <cond_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noreturn>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <pthread_mutex_init@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_cond_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cond_wait@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @noreturn() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @pthread_mutex_init(i32* %1, i32* null)
%4 = call i32 @pthread_cond_init(i32* %2, i32* null)
%5 = call i32 @cond_wait(i32* %2, i32* %1)
ret void
}

LLVM IR (-O2):
define void @noreturn() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @pthread_mutex_init(i32* %1, i32* null)
%6 = call i32 @pthread_cond_init(i32* %2, i32* null)
%7 = call i32 @cond_wait(i32* %2, i32* %1)
ret void
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_quit(int session) { return (ap_do_command_only(session, 0xcc07)); }


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

x86 assembly (clang, -O2):
<ap_quit>:
mov    $0xcc07,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_quit(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52231)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ A(int);
void C() { A(2); }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
mov    $0x2,%edi
jmp    1030 <A@plt>

LLVM IR (-O0):
define void @C() {
%1 = call i32 @A(i32 2)
ret void
}

LLVM IR (-O2):
define void @C() {
%1 = tail call i32 @A(i32 2)
ret void
}
void swapi(int *v, int j, int i) {
  int temp = v[j];
  v[j] = v[i];
  v[i] = temp;
}


x86 assembly (clang, -O0):
<swapi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapi>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swapi(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swapi(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
unsigned int midx(unsigned int row, unsigned int col, unsigned int col_c) {
  return (row - 1) * col_c + col - 1;
}


x86 assembly (clang, -O0):
<midx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<midx>:
add    $0xffffffff,%edi
imul   %edx,%edi
lea    (%rsi,%rdi,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @midx(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 = sub i32 %7, 1
%9 = load i32, i32* %6
%10 = mul i32 %8, %9
%11 = load i32, i32* %5
%12 = add i32 %10, %11
%13 = sub i32 %12, 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @midx(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = mul i32 %4, %2
%6 = add i32 %1, -1
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *standardize(char *);
main() { printf("standardize: %s\n", standardize("555 N.W. 190 TERRACE")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee6(%rip),%rdi
call   1030 <standardize@plt>
mov    %rax,%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"standardize: %s\0A\00"
@.str.1 = [21 x i8] c"555 N.W. 190 TERRACE\00"
define i32 @main() {
%1 = call i8* @standardize(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"standardize: %s\0A\00"
@.str.1 = [21 x i8] c"555 N.W. 190 TERRACE\00"
define i32 @main() {
%1 = tail call i8* @standardize(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int alpha_n(double const);
int beta_n(double const);
double tau_n(const double V_tilde) {
  return 1. / (alpha_n(V_tilde) + beta_n(V_tilde));
}


x86 assembly (clang, -O0):
<tau_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <alpha_n@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <beta_n@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xea9(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tau_n>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <alpha_n@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <beta_n@plt>
add    %ebx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @tau_n(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @alpha_n(double %3)
%5 = load double, double* %2
%6 = call i32 @beta_n(double %5)
%7 = add nsw i32 %4, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @tau_n(double %0) {
%2 = tail call i32 @alpha_n(double %0)
%3 = tail call i32 @beta_n(double %0)
%4 = add nsw i32 %3, %2
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
int myProduct(int x, int y) {
  if (y == 1)
    return x;
  else
    return (x + myProduct(x, y - 1));
}


x86 assembly (clang, -O0):
<myProduct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <myProduct+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <myProduct+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <myProduct@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myProduct>:
lea    -0x1(%rsi),%ecx
imul   %edi,%ecx
xor    %eax,%eax
cmp    $0x1,%esi
cmovne %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @myProduct(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* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = call i32 @myProduct(i32 %12, i32 %14)
%16 = add nsw i32 %11, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %10, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @myProduct(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = add i32 %1, -1
%5 = mul i32 %4, %0
%6 = select i1 %3, i32 0, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_yday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_dayofyear(void) {
  time_t t = time(NULL);
  struct tm *lt = localtime(&t);
  return lt->tm_yday;
}


x86 assembly (clang, -O0):
<date_get_dayofyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_dayofyear>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_dayofyear() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_dayofyear() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ OLED_Backlight();
void _oled_backlight_init() { OLED_Backlight(); }


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

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

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

LLVM IR (-O2):
define void @_oled_backlight_init() {
%1 = tail call i32 (...) @OLED_Backlight()
ret void
}
int test_imm_C6uint8_reg(unsigned char val) {
  return ((val) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -58
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct L0 {
  int dummy;
};

/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ l0_destroy(struct L0 *);
int /*<<< orphan*/ l0_insert(struct L0 **);
int main() {
  static struct L0 *list;
  do
    l0_insert(&list);
  while (__VERIFIER_nondet_int());
  l0_destroy(list);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2efa(%rip),%rdi
call   1050 <l0_insert@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
jne    113f <main+0xf>
mov    0x2edd(%rip),%rdi
call   1040 <l0_destroy@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x2f08(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <l0_insert@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1140 <main+0x10>
mov    0x2ee5(%rip),%rdi
call   1040 <l0_destroy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.L0 = type { i32 }
@main.list = internal global %struct.L0* null
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %4, %0
%3 = call i32 @l0_insert(%struct.L0** @main.list)
br label %4
4: ; preds = %2
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i64 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %4
%8 = load %struct.L0*, %struct.L0** @main.list
%9 = call i32 @l0_destroy(%struct.L0* %8)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.L0 = type { i32 }
@main.list = internal global %struct.L0* null
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @l0_insert(%struct.L0** @main.list)
%3 = tail call i64 (...) @__VERIFIER_nondet_int()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = load %struct.L0*, %struct.L0** @main.list
%7 = tail call i32 @l0_destroy(%struct.L0* %6)
ret i32 0
}
/* Type definitions */
typedef int u_short;

/* Variables and functions */
#define ETHERTYPE_IP 128
int /*<<< orphan*/ ip_parse(char const *, int);
int ether_encap_parse(const char *p, int len, const u_short ethtype) {
  switch (ethtype) {
  case ETHERTYPE_IP:
    ip_parse(p, len);
    break;
  default:
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<ether_encap_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x80,%eax
jne    1146 <ether_encap_parse+0x36>
jmp    1135 <ether_encap_parse+0x25>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <ip_parse@plt>
jmp    1152 <ether_encap_parse+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1159 <ether_encap_parse+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ether_encap_parse>:
xor    %eax,%eax
cmp    $0x80,%edx
jne    1129 <ether_encap_parse+0x19>
push   %rax
call   1030 <ip_parse@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @ether_encap_parse(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
switch i32 %8, label %13 [
i32 128, label %9
]
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @ip_parse(i8* %10, i32 %11)
br label %14
13: ; preds = %3
store i32 0, i32* %4
br label %15
14: ; preds = %9
store i32 1, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @ether_encap_parse(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 128
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @ip_parse(i8* %0, i32 %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **str) {
  free(*str);
  *str = NULL;
}


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

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_strdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int gf_inv(int const);
int gf_mul_bit(int const, int);
int gf_div_bit(const int x, const int y) {
  if (x == 0) {
    return 0;
  }
  if (y == 0) {
    return -1;
  }
  int inverse = gf_inv(y);
  return gf_mul_bit(x, inverse);
}


x86 assembly (clang, -O0):
<gf_div_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <gf_div_bit+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1173 <gf_div_bit+0x53>
cmpl   $0x0,-0xc(%rbp)
jne    115a <gf_div_bit+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <gf_div_bit+0x53>
mov    -0xc(%rbp),%edi
call   1040 <gf_inv@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <gf_mul_bit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_div_bit>:
test   %edi,%edi
je     113c <gf_div_bit+0x1c>
test   %esi,%esi
je     113f <gf_div_bit+0x1f>
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <gf_inv@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <gf_mul_bit@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @gf_div_bit(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @gf_inv(i32 %1)
%8 = tail call i32 @gf_mul_bit(i32 %0, i32 %7)
br label %9
9: ; preds = %4, %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_copy() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_copy"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_idxset_copy\0A\00"
define i32 @pa_idxset_copy() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_idxset_copy\00"
define i32 @pa_idxset_copy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int gpiotools_sets(char const *, unsigned int *, int, unsigned int *);
int gpiotools_set(const char *device_name, unsigned int line,
                  unsigned int value) {
  unsigned int lines[] = {line};
  return gpiotools_sets(device_name, lines, 1, &value);
}


x86 assembly (clang, -O0):
<gpiotools_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x1,%edx
lea    -0x10(%rbp),%rcx
call   1030 <gpiotools_sets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpiotools_set>:
push   %rax
mov    %edx,0x4(%rsp)
mov    %esi,(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rcx
mov    $0x1,%edx
call   1030 <gpiotools_sets@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gpiotools_set(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [1 x i32]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %5
store i32 %9, i32* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%12 = call i32 @gpiotools_sets(i8* %10, i32* %11, i32 1, i32* %6)
ret i32 %12
}

LLVM IR (-O2):
define i32 @gpiotools_set(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca [1 x i32]
store i32 %2, i32* %4
%6 = bitcast [1 x i32]* %5 to i8*
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = call i32 @gpiotools_sets(i8* %0, i32* %7, i32 1, i32* %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tgammal();
scalar_t__ tgammal(long double);
void test_tgammal(long double ld) {
  if (tgammal(ld) != tgammal(ld))
    link_failure_tgammal();
}


x86 assembly (clang, -O0):
<test_tgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tgammal@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tgammal@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_tgammal+0x43>
mov    $0x0,%al
call   1030 <link_failure_tgammal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tgammal>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <tgammal@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <tgammal@plt>
cmp    %rax,%rbx
jne    1151 <test_tgammal+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_tgammal@plt>

LLVM IR (-O0):
define void @test_tgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @tgammal(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @tgammal(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_tgammal()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_tgammal(x86_fp80 %0) {
%2 = tail call i64 @tgammal(x86_fp80 %0)
%3 = tail call i64 @tgammal(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tgammal()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ realloc(char *, size_t const);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t const);
void puglSetString(char **dest, const char *string) {
  if (*dest != string) {
    const size_t len = strlen(string);
    *dest = (char *)realloc(*dest, len + 1);
    strncpy(*dest, string, len + 1);
  }
}


x86 assembly (clang, -O0):
<puglSetString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
je     1194 <puglSetString+0x64>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1050 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puglSetString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%rbx
cmp    %rsi,%rbx
je     1179 <puglSetString+0x49>
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <realloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <strncpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @puglSetString(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i64
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = icmp ne i8* %7, %8
br i1 %9, label %10, label %26
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
store i64 %12, i64* %5
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = load i64, i64* %5
%16 = add i64 %15, 1
%17 = call i64 @realloc(i8* %14, i64 %16)
%18 = inttoptr i64 %17 to i8*
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = load i8*, i8** %4
%23 = load i64, i64* %5
%24 = add i64 %23, 1
%25 = call i32 @strncpy(i8* %21, i8* %22, i64 %24)
br label %26
26: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @puglSetString(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, %1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = add i64 %6, 1
%8 = tail call i64 @realloc(i8* %3, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %0
%10 = tail call i32 @strncpy(i8* %9, i8* %1, i64 %7)
br label %11
11: ; preds = %5, %2
ret void
}
char *strsave(psz)
char *psz;
{
  char *pszAlloc;
  if ((pszAlloc = (char *)malloc(strlen(psz) + 1)) == 0)
    Error("out of memory");
  strcpy(pszAlloc, psz);
  return pszAlloc;
}


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117d <strsave+0x3d>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <Error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsave>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116b <strsave+0x2b>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <Error@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @strsave(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @Error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i8* @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @strsave(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int strlen(char *);
char *stripLastChar(char *in) {
  char *out = malloc(sizeof(char) * strlen(in));
  snprintf(out, strlen(in) - 1, "%s", in);
  return out;
}


x86 assembly (clang, -O0):
<stripLastChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%rcx
lea    0xe85(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripLastChar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%esi
lea    0xea8(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <snprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @stripLastChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 1
%14 = load i8*, i8** %2
%15 = call i32 @snprintf(i8* %10, i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @stripLastChar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = tail call i32 @snprintf(i8* %3, i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %3
}
void placeholder() {}


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

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

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

LLVM IR (-O2):
define void @placeholder() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buffer_underflow();
void buffer_underflow_test(void **state) {
  (void)state;
  buffer_underflow();
}


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

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

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

LLVM IR (-O2):
define void @buffer_underflow_test(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @buffer_underflow()
ret void
}
double dsqr(double x) { return x * x; }


x86 assembly (clang, -O0):
<dsqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dsqr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @dsqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int EX_OK;
int /*<<< orphan*/ get_statistics(char *);
int main(int argc, char **argv) {
  get_statistics((argc > 1) ? argv[1] : "iwi0");
  return EX_OK;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1141 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <main+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <main+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <get_statistics@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
call   1030 <get_statistics@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"iwi0\00"
@EX_OK = 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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %12 ]
%15 = call i32 @get_statistics(i8* %14)
%16 = load i32, i32* @EX_OK
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"iwi0\00"
@EX_OK = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @get_statistics(i8* %8)
%10 = load i32, i32* @EX_OK
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int n = 0;
  while (n < 3)
    printf("n is %d\n", n);
  n++;
  printf("That's all this program does\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xeb3(%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
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"n is %d\0A\00"
@.str.1 = [30 x i8] c"That's all this program does\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"n is %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
br label %1
}
/* Variables and functions */
int PAPI_accum(int, long long *);
void papif_accum__(int *EventSet, long long *values, int *check) {
  *check = PAPI_accum(*EventSet, values);
}


x86 assembly (clang, -O0):
<papif_accum__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_accum@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_accum__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_accum@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_accum__(i32* %0, i64* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32*
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i64*, i64** %5
%10 = call i32 @PAPI_accum(i32 %8, i64* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @papif_accum__(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_accum(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
void swap(unsigned char *d1, unsigned char *d2) {
  unsigned char a;
  a = *d1;
  *d1 = *d2;
  *d2 = a;
}


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

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

LLVM IR (-O0):
define void @swap(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 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", bitcount((unsigned int)857028));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 857028)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld) {}


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

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

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

LLVM IR (-O2):
%struct.hda_codec = type opaque
%struct.hdmi_eld = type opaque
define void @snd_hda_eld_proc_free(%struct.hda_codec* nocapture %0, %struct.hdmi_eld* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
bool is_negated(const char *s) { return strncmp(s, "-no-", 5) == 0; }


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

x86 assembly (clang, -O2):
<is_negated>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"-no-\00"
define i32 @is_negated(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"-no-\00"
define i32 @is_negated(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void rcu_idle_enter(void) {}


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

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

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

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