xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ aica_init();
int /*<<< orphan*/ cdops_init();
int /*<<< orphan*/ check_cable();
int /*<<< orphan*/ clrscr(int);
int /*<<< orphan*/ init_tmr0();
int /*<<< orphan*/ init_video(int /*<<< orphan*/, int);
int /*<<< orphan*/ run_test();
int main() {
  cdops_init();
  init_tmr0();
  aica_init();
  clrscr(0x1f);
  init_video(check_cable(), 1);
  run_test();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <cdops_init@plt>
mov    $0x0,%al
call   1090 <init_tmr0@plt>
mov    $0x0,%al
call   1070 <aica_init@plt>
mov    $0x1f,%edi
call   1030 <clrscr@plt>
mov    $0x0,%al
call   1050 <check_cable@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <init_video@plt>
mov    $0x0,%al
call   1080 <run_test@plt>
jmp    11b8 <main+0x48>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <cdops_init@plt>
xor    %eax,%eax
call   1090 <init_tmr0@plt>
xor    %eax,%eax
call   1070 <aica_init@plt>
mov    $0x1f,%edi
call   1030 <clrscr@plt>
xor    %eax,%eax
call   1050 <check_cable@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <init_video@plt>
xor    %eax,%eax
call   1080 <run_test@plt>
nopw   0x0(%rax,%rax,1)
jmp    11b0 <main+0x40>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @cdops_init()
%3 = call i32 (...) @init_tmr0()
%4 = call i32 (...) @aica_init()
%5 = call i32 @clrscr(i32 31)
%6 = call i32 (...) @check_cable()
%7 = call i32 @init_video(i32 %6, i32 1)
%8 = call i32 (...) @run_test()
br label %9
9: ; preds = %9, %0
br label %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cdops_init()
%2 = tail call i32 (...) @init_tmr0()
%3 = tail call i32 (...) @aica_init()
%4 = tail call i32 @clrscr(i32 31)
%5 = tail call i32 (...) @check_cable()
%6 = tail call i32 @init_video(i32 %5, i32 1)
%7 = tail call i32 (...) @run_test()
br label %8
8: ; preds = %8, %0
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ leak_memory();
int /*<<< orphan*/ other_func();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("#### Leak Memory test ####\n");
  leak_memory();
  other_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"#### Leak Memory test ####\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @leak_memory()
%3 = tail call i32 (...) @other_func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int, void (*)(int));
void handle_escape(int signo) {
  signal(signo, handle_escape);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_escape>:
push   %rax
mov    0x2eb8(%rip),%rsi
call   1030 <signal@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle_escape(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @handle_escape)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle_escape(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @handle_escape)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double ddot_(int *, double const *, int *, double const *, int *);
double ddot(int n, const double *x, const double *y) {
  int one = 1;
  return ddot_(&n, x, &one, y, &one);
}


x86 assembly (clang, -O0):
<ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x1c(%rbp),%r8
mov    %r8,%rdx
call   1030 <ddot_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddot>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
mov    %rdx,%r8
call   1030 <ddot_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @ddot(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
%6 = bitcast i32* %5 to i8*
store i32 1, i32* %5
%7 = call double @ddot_(i32* %4, double* %1, i32* %5, double* %2, i32* %5)
ret double %7
}
char *svz_itoa(unsigned int i) {
  static char buffer[32];
  char *p = buffer + sizeof(buffer) - 1;
  *p = '\0';
  do {
    p--;
    *p = (char)((i % 10) + '0');
  } while ((i /= 10) != 0);
  return p;
}


x86 assembly (clang, -O0):
<svz_itoa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f22(%rip),%rax
add    $0x1f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    111d <svz_itoa+0x1d>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_itoa>:
movb   $0x0,0x2f48(%rip)
lea    0x2f41(%rip),%rax
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
or     $0x30,%cl
mov    %cl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1120 <svz_itoa+0x20>
ret

LLVM IR (-O0):
@svz_itoa.buffer = internal global [32 x i8] zeroinitializer
define i8* @svz_itoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @svz_itoa.buffer, i64 1, i64 -1), i8** %3
%4 = load i8*, i8** %3
store i8 0, i8* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 -1
store i8* %7, i8** %3
%8 = load i32, i32* %2
%9 = urem i32 %8, 10
%10 = add i32 %9, 48
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
store i8 %11, i8* %12
br label %13
13: ; preds = %5
%14 = load i32, i32* %2
%15 = udiv i32 %14, 10
store i32 %15, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %5, label %17
17: ; preds = %13
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@svz_itoa.buffer = internal global [32 x i8] zeroinitializer
define i8* @svz_itoa(i32 %0) {
store i8 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @svz_itoa.buffer, i64 0, i64 31)
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %9, %2 ]
%4 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @svz_itoa.buffer, i64 0, i64 31), %1 ], [ %5, %2 ]
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = urem i32 %3, 10
%7 = trunc i32 %6 to i8
%8 = or i8 %7, 48
store i8 %8, i8* %5
%9 = udiv i32 %3, 10
%10 = icmp ult i32 %3, 10
br i1 %10, label %11, label %2
11: ; preds = %2
ret i8* %5
}
/* Variables and functions */
double cos(double);
double sin(double);
double cot(double x) { return cos(x) / sin(x); }


x86 assembly (clang, -O0):
<cot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cot>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = call double @sin(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @cot(double %0) {
%2 = tail call double @cos(double %0)
%3 = tail call double @sin(double %0)
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int hash2(void const *, unsigned int, int /*<<< orphan*/);
unsigned hash(const void *data, unsigned size) { return hash2(data, size, 0); }


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

x86 assembly (clang, -O2):
<hash>:
xor    %edx,%edx
jmp    1030 <hash2@plt>

LLVM IR (-O0):
define i32 @hash(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 = load i32, i32* %4
%7 = call i32 @hash2(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash(i8* %0, i32 %1) {
%3 = tail call i32 @hash2(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int32_t main(void) {
  printf("Hello World!\n");
  return 1;
}


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>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void f1(void *para) {}


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

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

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

LLVM IR (-O2):
define void @f1(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void priv_alloc_end(FILE *outfile) { fprintf(outfile, ");\n"); }


x86 assembly (clang, -O0):
<priv_alloc_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_alloc_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [4 x i8] c");\0A\00"
define void @priv_alloc_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c");\0A\00"
define void @priv_alloc_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enable_latch();
int /*<<< orphan*/ enable_spi();
int /*<<< orphan*/ frame_init();
void com_init(void) {
  frame_init();
  enable_spi();
  enable_latch();
}


x86 assembly (clang, -O0):
<com_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <frame_init@plt>
mov    $0x0,%al
call   1030 <enable_spi@plt>
mov    $0x0,%al
call   1040 <enable_latch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_init>:
push   %rax
xor    %eax,%eax
call   1050 <frame_init@plt>
xor    %eax,%eax
call   1030 <enable_spi@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <enable_latch@plt>

LLVM IR (-O0):
define void @com_init() {
%1 = call i32 (...) @frame_init()
%2 = call i32 (...) @enable_spi()
%3 = call i32 (...) @enable_latch()
ret void
}

LLVM IR (-O2):
define void @com_init() {
%1 = tail call i32 (...) @frame_init()
%2 = tail call i32 (...) @enable_spi()
%3 = tail call i32 (...) @enable_latch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  int i;
  for (i = 0; i < 10; i++)
    continue;
  if (i < 10)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1153 <main+0x33>
jmp    1145 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
cmpl   $0xa,-0x8(%rbp)
jge    1164 <main+0x44>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int printErrorAndExit(char *errString) {
  fprintf(stderr, "%s\n", errString);
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<printErrorAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printErrorAndExit>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @printErrorAndExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @printErrorAndExit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
unsigned int f82(unsigned int x, long int y) {
  return (x << (8 * 4 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f82>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f82>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f82(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = add i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f82(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = add i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *s, size_t n) {
  const char *p = memchr(s, 0, n);
  return p ? p - s : n;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
int /*<<< orphan*/ strcpy(void *, char *);
void *usr_alloc1(int);
void usr_alloc1_int_strcpy(int n) {
  void *p = usr_alloc1(7 < n ? 7 : n);
  strcpy(p, "0123456");
  sink(p);
  strcpy(p, "012345");
  sink(p);
}


x86 assembly (clang, -O0):
<usr_alloc1_int_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7,%eax
cmp    -0x4(%rbp),%eax
jge    1156 <usr_alloc1_int_strcpy+0x26>
mov    $0x7,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <usr_alloc1_int_strcpy+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <usr_alloc1@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <sink@plt>
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <sink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usr_alloc1_int_strcpy>:
push   %rbx
cmp    $0x7,%edi
mov    $0x7,%eax
cmovge %eax,%edi
call   1050 <usr_alloc1@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <sink@plt>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sink@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0123456\00"
@.str.1 = [7 x i8] c"012345\00"
define void @usr_alloc1_int_strcpy(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 7, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 7, %6 ], [ %8, %7 ]
%11 = call i8* @usr_alloc1(i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %3
%15 = call i32 @sink(i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = load i8*, i8** %3
%19 = call i32 @sink(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0123456\00"
@.str.1 = [7 x i8] c"012345\00"
define void @usr_alloc1_int_strcpy(i32 %0) {
%2 = icmp slt i32 %0, 7
%3 = select i1 %2, i32 %0, i32 7
%4 = tail call i8* @usr_alloc1(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sink(i8* %4)
%7 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @sink(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int, int, int, int, int);
int main() { test(5, 1, 2, 3, 4, 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_init3() {
  printf("so_init3"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_init3\00"
define void @so_init3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
float f6(float x, float y) { return 7.5f * y * __builtin_copysignf(2.0f, x); }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xf0a(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movaps 0xed9(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xede(%rip),%xmm2
por    %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mulss  0xef8(%rip),%xmm1
andps  0xf01(%rip),%xmm0
orps   0xf0a(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f6(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fmul float 7.500000e+00, %5
%7 = load float, float* %3
%8 = call float @llvm.copysign.f32(float 2.000000e+00, float %7)
%9 = fmul float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @f6(float %0, float %1) {
%3 = fmul float %1, 7.500000e+00
%4 = tail call float @llvm.copysign.f32(float 2.000000e+00, float %0)
%5 = fmul float %4, %3
ret float %5
}
void foo(const void **p) {
  void *labs[] = {&&l1, &&l2, &&l3};
l1:
  goto *p++;
l2:
  goto *p;
l3:;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2d21(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2d1e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d1b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x28(%rbp)
jmp    1150 <foo+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1150 <foo+0x50>
pop    %rbp
ret
mov    -0x28(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
LLVM IR (-O0):
@__const.foo.labs = [3 x i8*] [i8* blockaddress(@foo, %5), i8* blockaddress(@foo, %9), i8* blockaddress(@foo, %12)]
define void @foo(i8** %0) {
%2 = alloca i8**
%3 = alloca [3 x i8*]
store i8** %0, i8*** %2
%4 = bitcast [3 x i8*]* %3 to i8*
br label %5
5: ; preds = %1, %13
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i32 1
store i8** %7, i8*** %2
%8 = bitcast i8** %6 to i8*
br label %13
9: ; preds = %13
%10 = load i8**, i8*** %2
%11 = bitcast i8** %10 to i8*
br label %13
12: ; preds = %13
ret void
13: ; preds = %9, %5
%14 = phi i8* [ %8, %5 ], [ %11, %9 ]
indirectbr i8* %14, [label %5, label %9, label %12]
}

LLVM IR (-O2):
/* Type definitions */
struct shader_load_settings {
  int dummy;
};

/* Variables and functions */
char const *shader_read(char const *, int *, struct shader_load_settings *);
const char *shader_load(const char *uri,
                        struct shader_load_settings *settings) {
  int ec = 0;
  return shader_read(uri, &ec, settings);
}


x86 assembly (clang, -O0):
<shader_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1030 <shader_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shader_load>:
push   %rax
mov    %rsi,%rdx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <shader_read@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.shader_load_settings = type { i32 }
define i8* @shader_load(i8* %0, %struct.shader_load_settings* %1) {
%3 = alloca i8*
%4 = alloca %struct.shader_load_settings*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.shader_load_settings* %1, %struct.shader_load_settings** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load %struct.shader_load_settings*, %struct.shader_load_settings** %4
%8 = call i8* @shader_read(i8* %6, i32* %5, %struct.shader_load_settings* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.shader_load_settings = type { i32 }
define i8* @shader_load(i8* %0, %struct.shader_load_settings* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i8* @shader_read(i8* %0, i32* %3, %struct.shader_load_settings* %1)
ret i8* %5
}
/* Variables and functions */
int GPTLerror(char *, char const *);
int init_papitime() {
  static const char *thisfunc = "init_papitime";
  return GPTLerror("%s: not enabled\n", thisfunc);
}


x86 assembly (clang, -O0):
<init_papitime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xeec(%rip),%rdi
call   1030 <GPTLerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_papitime>:
lea    0xef7(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <GPTLerror@plt>

LLVM IR (-O0):
@init_papitime.thisfunc = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0)
@.str = [14 x i8] c"init_papitime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_papitime() {
%1 = load i8*, i8** @init_papitime.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"init_papitime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_papitime() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned char bcd2bin(unsigned char bcd) {
  return ((bcd >> 4) * 10) + (bcd & 0x0F);
}


x86 assembly (clang, -O0):
<bcd2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2bin>:
mov    %edi,%eax
shr    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @bcd2bin(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = mul nsw i32 %5, 10
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @bcd2bin(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = mul nuw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nuw i8 %3, %4
ret i8 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int x) {
  char *str = malloc(15 * sizeof(char));
  sprintf(str, "%d", x);
  return str;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xf,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @itoa(i32 %0) {
%2 = tail call dereferenceable_or_null(15) i8* @malloc(i32 15)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ two_safety_conditions2_Bad(int);
void call_two_safety_conditions2_Bad() { two_safety_conditions2_Bad(15); }


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

x86 assembly (clang, -O2):
<call_two_safety_conditions2_Bad>:
mov    $0xf,%edi
jmp    1030 <two_safety_conditions2_Bad@plt>

LLVM IR (-O0):
define void @call_two_safety_conditions2_Bad() {
%1 = call i32 @two_safety_conditions2_Bad(i32 15)
ret void
}

LLVM IR (-O2):
define void @call_two_safety_conditions2_Bad() {
%1 = tail call i32 @two_safety_conditions2_Bad(i32 15)
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
float sinf(float);
float sinc(float x) {
  return 0.0f == x ? 1.0f : sinf((float)M_PI * x) / ((float)M_PI * x);
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jne    1142 <sinc+0x32>
jp     1142 <sinc+0x32>
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1172 <sinc+0x62>
mov    0x2e9f(%rip),%rax
cvtsi2ssq (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    0x2e89(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    112c <sinc+0x1c>
jp     112c <sinc+0x1c>
movss  0xed6(%rip),%xmm0
jmp    115c <sinc+0x4c>
mov    0x2eb5(%rip),%rbx
xorps  %xmm0,%xmm0
cvtsi2ssq (%rbx),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm1,0xc(%rsp)
call   1030 <sinf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssq (%rbx),%xmm1
mulss  0xc(%rsp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @sinc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float 0.000000e+00, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %17
6: ; preds = %1
%7 = load i64, i64* @M_PI
%8 = sitofp i64 %7 to float
%9 = load float, float* %2
%10 = fmul float %8, %9
%11 = call float @sinf(float %10)
%12 = load i64, i64* @M_PI
%13 = sitofp i64 %12 to float
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = fdiv float %11, %15
br label %17
17: ; preds = %6, %5
%18 = phi float [ 1.000000e+00, %5 ], [ %16, %6 ]
ret float %18
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @sinc(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %5, %0
%7 = tail call float @sinf(float %6)
%8 = load i64, i64* @M_PI
%9 = sitofp i64 %8 to float
%10 = fmul float %9, %0
%11 = fdiv float %7, %10
br label %12
12: ; preds = %1, %3
%13 = phi float [ %11, %3 ], [ 1.000000e+00, %1 ]
ret float %13
}
/* Type definitions */
struct listen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ listen_close(struct listen *);
void listen_hup(void *arg) {
  struct listen *f = arg;
  listen_close(f);
}


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

x86 assembly (clang, -O2):
<listen_hup>:
jmp    1030 <listen_close@plt>

LLVM IR (-O0):
%struct.listen = type { i32 }
define void @listen_hup(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.listen*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.listen*
store %struct.listen* %5, %struct.listen** %3
%6 = load %struct.listen*, %struct.listen** %3
%7 = call i32 @listen_close(%struct.listen* %6)
ret void
}

LLVM IR (-O2):
%struct.listen = type { i32 }
define void @listen_hup(i8* %0) {
%2 = bitcast i8* %0 to %struct.listen*
%3 = tail call i32 @listen_close(%struct.listen* %2)
ret void
}
void LPCIRQClear(unsigned long ulBase, unsigned long ulIRQ) {
  unsigned long ulTemp;
  ;
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000008)));
  ulTemp &= ~(ulIRQ & 0xFFFF0000);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulTemp;
}


x86 assembly (clang, -O0):
<LPCIRQClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffff0000,%rax
and    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIRQClear>:
not    %esi
movabs $0xffffffff0000ffff,%rax
ff ff ff
or     %rsi,%rax
and    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @LPCIRQClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = and i64 %10, 4294901760
%12 = xor i64 %11, -1
%13 = load i64, i64* %5
%14 = and i64 %13, %12
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %3
%17 = add i64 %16, 8
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @LPCIRQClear(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %1, 4294901760
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
int is_hex_palidrom(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int d, n;
  scanf("%d", &d);
  for (n = d; n <= 32767; n++) {
    if (is_hex_palidrom(n) == 1) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7fff,-0xc(%rbp)
jg     117b <main+0x5b>
mov    -0xc(%rbp),%edi
call   1030 <is_hex_palidrom@plt>
cmp    $0x1,%eax
jne    1168 <main+0x48>
jmp    117b <main+0x5b>
jmp    116d <main+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <main+0x25>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x7fff,%ebx
jg     1169 <main+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <is_hex_palidrom@plt>
cmp    $0x1,%eax
je     1169 <main+0x49>
lea    0x1(%rbx),%eax
cmp    $0x7fff,%ebx
mov    %eax,%ebx
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
store i32 %5, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 32767
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 @is_hex_palidrom(i32 %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %9
br label %18
14: ; preds = %9
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %13, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 32768
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @is_hex_palidrom(i32 %7)
%9 = icmp eq i32 %8, 1
%10 = add i32 %7, 1
%11 = icmp eq i32 %10, 32768
%12 = or i1 %9, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
int suma3(int *array, int len) {
  asm("mov 8(%%ebp), %%ebx	\n"
      "	mov 12(%%ebp), %%ecx	\n"
      "				\n"
      "	mov $0, %%eax		\n"
      "	mov $0, %%edx		\n"
      "bucle:				\n"
      "	add (%%ebx,%%edx,4),%%eax\n"
      "	inc       %%edx		\n"
      "	cmp %%edx,%%ecx		\n"
      "	jne bucle		\n"
      :
      :
      : "ebx");
}


x86 assembly (clang, -O0):
<suma3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    0x8(%ebp),%ebx
mov    0xc(%ebp),%ecx
mov    $0x0,%eax
mov    $0x0,%edx

x86 assembly (clang, -O2):
<suma3>:
push   %rbx
mov    0x8(%ebp),%ebx
mov    0xc(%ebp),%ecx
mov    $0x0,%eax
mov    $0x0,%edx

LLVM IR (-O0):
define i32 @suma3(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @suma3(i32* nocapture readnone %0, i32 %1) {
tail call void asm sideeffect "mov 8(%ebp), %ebx\09\0A\09mov 12(%ebp), %ecx\09\0A\09\09\09\09\0A\09mov $$0, %eax\09\09\0A\09mov $$0, %edx\09\09\0Abucle:\09\09\09\09\0A\09add (%ebx,%edx,4),%eax\0A\09inc %edx\09\09\0A\09cmp %edx,%ecx\09\09\0A\09jne bucle\09\09\0A", "~{ebx},~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
unsigned long int _default_storage_message_count() { return 0; }


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

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

LLVM IR (-O0):
define i64 @_default_storage_message_count() {
ret i64 0
}

LLVM IR (-O2):
define i64 @_default_storage_message_count() {
ret i64 0
}
/* Variables and functions */
scalar_t__ Fork();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 3;
  if (Fork() != 0)
    printf("x=%d\n", ++x);
  printf("x=%d\n", --x);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Fork@plt>
cmp    $0x0,%rax
je     116c <main+0x3c>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x8(%rbp)
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Fork@plt>
mov    $0x2,%esi
test   %rax,%rax
je     1158 <main+0x28>
lea    0xeb7(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    $0x3,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"x=%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 3, %3 ], [ 2, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debugprint(int /*<<< orphan*/, char *);
void help_gate(void) {
  debugprint(0, "  Gate options\n");
  debugprint(0,
             "    Name: gate\n    t=threshold (dBFS)\n    h=holdtime (sec)\n");
  debugprint(0, "    Example: -p gate,t=-80,h=30\n");
}


x86 assembly (clang, -O0):
<help_gate>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <debugprint@plt>
xor    %edi,%edi
lea    0xee5(%rip),%rsi
call   1030 <debugprint@plt>
xor    %edi,%edi
lea    0xf13(%rip),%rsi
call   1030 <debugprint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_gate>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <debugprint@plt>
lea    0xeea(%rip),%rsi
xor    %edi,%edi
call   1030 <debugprint@plt>
lea    0xf18(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <debugprint@plt>

LLVM IR (-O0):
@.str = [16 x i8] c" Gate options\0A\00"
@.str.1 = [60 x i8] c" Name: gate\0A t=threshold (dBFS)\0A h=holdtime (sec)\0A\00"
@.str.2 = [33 x i8] c" Example: -p gate,t=-80,h=30\0A\00"
define void @help_gate() {
%1 = call i32 @debugprint(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @debugprint(i32 0, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @debugprint(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c" Gate options\0A\00"
@.str.1 = [60 x i8] c" Name: gate\0A t=threshold (dBFS)\0A h=holdtime (sec)\0A\00"
@.str.2 = [33 x i8] c" Example: -p gate,t=-80,h=30\0A\00"
define void @help_gate() {
%1 = tail call i32 @debugprint(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @debugprint(i32 0, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @debugprint(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void abc5defghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abc5defghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void two(void) { printf("Hi from two()\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hi from two()\0A\00"
define void @two() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hi from two()\00"
define void @two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ taskExit();
void __attribute__((weak)) abort() {
  taskExit();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <taskExit@plt>
jmp    111b <abort+0xb>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1030 <taskExit@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <abort+0x10>

LLVM IR (-O0):
define weak void @abort() {
%1 = call i32 (...) @taskExit()
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define weak void @abort() {
%1 = tail call i32 (...) @taskExit()
br label %2
2: ; preds = %2, %0
br label %2
}
int fmax2(double a, double b) { return (b > a) ? b : a; }


x86 assembly (clang, -O0):
<fmax2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112d <fmax2+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmax2+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax2>:
maxsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @fmax2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
%14 = fptosi double %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @fmax2(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
%5 = fptosi double %4 to i32
ret i32 %5
}