xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, void *, unsigned long);
void show_pointer(void *p, char *descr) {
  printf("%s\t%p\t%lu\n", descr, p, (unsigned long)p);
}


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

x86 assembly (clang, -O2):
<show_pointer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09%p\09%lu\0A\00"
define void @show_pointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09%p\09%lu\0A\00"
define void @show_pointer(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i64 %3)
ret void
}
int precedence(int op) {
  switch (op) {
  case '+':
  case '-':
    return 1;
  case '&':
  case '!':
    return 3;
  case '>':
  case '<':
    return 4;
  case '*':
  case '/':
  case '\\':
    return 2;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffdf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3b,%eax
ja     1160 <precedence+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1167 <precedence+0x67>
movl   $0x3,-0x4(%rbp)
jmp    1167 <precedence+0x67>
movl   $0x4,-0x4(%rbp)
jmp    1167 <precedence+0x67>
movl   $0x2,-0x4(%rbp)
jmp    1167 <precedence+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xffffffdf,%edi
cmp    $0x3b,%edi
ja     112f <precedence+0x2f>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @precedence(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 43, label %5
i32 45, label %5
i32 38, label %6
i32 33, label %6
i32 62, label %7
i32 60, label %7
i32 42, label %8
i32 47, label %8
i32 92, label %8
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %10
6: ; preds = %1, %1
store i32 3, i32* %2
br label %10
7: ; preds = %1, %1
store i32 4, i32* %2
br label %10
8: ; preds = %1, %1, %1
store i32 2, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @precedence(i32 %0) {
switch i32 %0, label %5 [
i32 43, label %6
i32 45, label %6
i32 38, label %2
i32 33, label %2
i32 62, label %3
i32 60, label %3
i32 42, label %4
i32 47, label %4
i32 92, label %4
]
2: ; preds = %1, %1
br label %6
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3, %2
%7 = phi i32 [ 0, %5 ], [ 2, %4 ], [ 4, %3 ], [ 3, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void getServiceInput(int port, char *msg) {
  strncpy(msg, "GET / HTTP/1.0\r\n\r\n", 80);
}


x86 assembly (clang, -O0):
<getServiceInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x50,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getServiceInput>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
mov    $0x50,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"GET / HTTP/1.0\0D\0A\0D\0A\00"
define void @getServiceInput(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 80)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"GET / HTTP/1.0\0D\0A\0D\0A\00"
define void @getServiceInput(i32 %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 80)
ret void
}
void RTLogComPrintfV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogComPrintfV() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ show_error(char *);
void *xcalloc(size_t nmemb, size_t size) {
  void *tmp = calloc(nmemb, size);
  if (!tmp)
    show_error("Out of memory");
  return tmp;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <show_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <show_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ vec3d_scalarDiv_new(double *, double *, double const);
void vec3d_scalarDiv(double v[3], const double scalar) {
  vec3d_scalarDiv_new(v, v, scalar);
}


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

x86 assembly (clang, -O2):
<vec3d_scalarDiv>:
mov    %rdi,%rsi
jmp    1030 <vec3d_scalarDiv_new@plt>

LLVM IR (-O0):
define void @vec3d_scalarDiv(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double*, double** %3
%7 = load double, double* %4
%8 = call i32 @vec3d_scalarDiv_new(double* %5, double* %6, double %7)
ret void
}

LLVM IR (-O2):
define void @vec3d_scalarDiv(double* %0, double %1) {
%3 = tail call i32 @vec3d_scalarDiv_new(double* %0, double* %0, double %1)
ret void
}
/* Variables and functions */
double fabs(double);
double log10(double);
double EClog10(double x) {
  double y;
  double r;
  y = x;
  y = fabs(x);
  r = log10(y);
  return (r);
}


x86 assembly (clang, -O0):
<EClog10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xecd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EClog10>:
andps  0xee9(%rip),%xmm0
jmp    1030 <log10@plt>

LLVM IR (-O0):
define double @EClog10(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
%6 = load double, double* %2
%7 = call double @llvm.fabs.f64(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @log10(double %8)
store double %9, double* %4
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
define double @EClog10(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call double @log10(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ i2cslave_SetAddr(int, unsigned char);
void i2c1slave_SetAddr(unsigned char addr) { i2cslave_SetAddr(1, addr); }


x86 assembly (clang, -O0):
<i2c1slave_SetAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2cslave_SetAddr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1slave_SetAddr>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <i2cslave_SetAddr@plt>

LLVM IR (-O0):
define void @i2c1slave_SetAddr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @i2cslave_SetAddr(i32 1, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @i2c1slave_SetAddr(i8 zeroext %0) {
%2 = tail call i32 @i2cslave_SetAddr(i32 1, i8 zeroext %0)
ret void
}
/* Type definitions */
struct pcibx_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcibx_write(struct pcibx_device *, int, int /*<<< orphan*/);
int /*<<< orphan*/ prsendinfo(char *);
void pcibx_cmd_rstdefault(struct pcibx_device *dev) {
  prsendinfo("default RST#");
  pcibx_write(dev, 0x71, 0);
  pcibx_write(dev, 0x72, 0);
  pcibx_write(dev, 0x73, 0);
}


x86 assembly (clang, -O0):
<pcibx_cmd_rstdefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <prsendinfo@plt>
mov    -0x8(%rbp),%rdi
mov    $0x71,%esi
xor    %edx,%edx
call   1030 <pcibx_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x72,%esi
xor    %edx,%edx
call   1030 <pcibx_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x73,%esi
xor    %edx,%edx
call   1030 <pcibx_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibx_cmd_rstdefault>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <prsendinfo@plt>
mov    %rbx,%rdi
mov    $0x71,%esi
xor    %edx,%edx
call   1030 <pcibx_write@plt>
mov    %rbx,%rdi
mov    $0x72,%esi
xor    %edx,%edx
call   1030 <pcibx_write@plt>
mov    %rbx,%rdi
mov    $0x73,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <pcibx_write@plt>

LLVM IR (-O0):
%struct.pcibx_device = type { i32 }
@.str = [13 x i8] c"default RST#\00"
define void @pcibx_cmd_rstdefault(%struct.pcibx_device* %0) {
%2 = alloca %struct.pcibx_device*
store %struct.pcibx_device* %0, %struct.pcibx_device** %2
%3 = call i32 @prsendinfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.pcibx_device*, %struct.pcibx_device** %2
%5 = call i32 @pcibx_write(%struct.pcibx_device* %4, i32 113, i32 0)
%6 = load %struct.pcibx_device*, %struct.pcibx_device** %2
%7 = call i32 @pcibx_write(%struct.pcibx_device* %6, i32 114, i32 0)
%8 = load %struct.pcibx_device*, %struct.pcibx_device** %2
%9 = call i32 @pcibx_write(%struct.pcibx_device* %8, i32 115, i32 0)
ret void
}

LLVM IR (-O2):
%struct.pcibx_device = type { i32 }
@.str = [13 x i8] c"default RST#\00"
define void @pcibx_cmd_rstdefault(%struct.pcibx_device* %0) {
%2 = tail call i32 @prsendinfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pcibx_write(%struct.pcibx_device* %0, i32 113, i32 0)
%4 = tail call i32 @pcibx_write(%struct.pcibx_device* %0, i32 114, i32 0)
%5 = tail call i32 @pcibx_write(%struct.pcibx_device* %0, i32 115, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void errorOverflow(void) { printf("OVERFLOWWWWW\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"OVERFLOWWWWW\00"
define void @errorOverflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void foo(void) {
#pragma omp parallel if (__has_include("<stdlib.h>"))
  ;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmapcall();
int main(void) {
  int i = 0;
  while (i < 60000) {
    mmapcall();
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xea60,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x0,%al
call   1030 <mmapcall@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xea60,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mmapcall@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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 = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 60000
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @mmapcall()
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @mmapcall()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 60000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ main();
void reset_handler(void) { main(); }


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

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

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

LLVM IR (-O2):
define void @reset_handler() {
%1 = tail call i32 (...) @main()
ret void
}
/* Variables and functions */
int _t_do_copy(int *, int *, size_t, int, int);
int find(int *, size_t);
int copy(int arr1[], int arr2[], size_t arr1_len, size_t arr2_len) {
  if (arr1_len < 2)
    return -1;
  int index = find(arr1, arr1_len);
  return _t_do_copy(arr1, arr2, arr2_len, 1, index);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x2,-0x20(%rbp)
jae    114f <copy+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <copy+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <find@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%r8d
mov    $0x1,%ecx
call   1030 <_t_do_copy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
cmp    $0x2,%rdx
jae    112c <copy+0xc>
mov    $0xffffffff,%eax
ret
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <find@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <_t_do_copy@plt>

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

LLVM IR (-O2):
define i32 @copy(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %2, 2
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @find(i32* %0, i64 %2)
%8 = tail call i32 @_t_do_copy(i32* %0, i32* %1, i64 %3, i32 1, i32 %7)
br label %9
9: ; preds = %4, %6
%10 = phi i32 [ %8, %6 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ do_run();
int main(int argc, char *argv[]) {
  do_run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <do_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <do_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @do_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *nameOfProgram) {
  fprintf(stderr,
          "usage : %s -n numberOfNodes -k meanDegree -b "
          "probability\n\nmeanDegree is even\n",
          nameOfProgram);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"usage : %s -n numberOfNodes -k meanDegree -b probability\0A\0AmeanDegree is even\0A\00"
define void @usage(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 ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"usage : %s -n numberOfNodes -k meanDegree -b probability\0A\0AmeanDegree is even\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myPrintHelloMake();
int main() {
  myPrintHelloMake();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <myPrintHelloMake@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @myPrintHelloMake()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myPrintHelloMake()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TwDelay(int);
void TwAck(void) {
  (*((volatile unsigned int *)((0xFFFF0000 + 0x10))) = ((1 << 16)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 17)));
  TwDelay(2 * 8);
  (*((volatile unsigned int *)((0xFFFF0000 + 0x10))) = ((1 << 17)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 16)));
}


x86 assembly (clang, -O0):
<TwAck>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff0010,%eax
movl   $0x10000,(%rax)
mov    $0xffff0014,%eax
movl   $0x20000,(%rax)
mov    $0x10,%edi
call   1030 <TwDelay@plt>
mov    $0xffff0010,%eax
movl   $0x20000,(%rax)
mov    $0xffff0014,%eax
movl   $0x10000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwAck>:
push   %rbx
mov    $0xffff0010,%ebx
movl   $0x10000,(%rbx)
movl   $0x20000,0x4(%rbx)
mov    $0x10,%edi
call   1030 <TwDelay@plt>
movl   $0x20000,(%rbx)
movl   $0x10000,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @TwAck() {
store volatile i32 65536, i32* inttoptr (i64 4294901776 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
%1 = call i32 @TwDelay(i32 16)
store volatile i32 131072, i32* inttoptr (i64 4294901776 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
ret void
}

LLVM IR (-O2):
define void @TwAck() {
store volatile i32 65536, i32* inttoptr (i64 4294901776 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
%1 = tail call i32 @TwDelay(i32 16)
store volatile i32 131072, i32* inttoptr (i64 4294901776 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
ret void
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_transpose(float *, float *);
__attribute__((always_)) struct mat2 *psmat2_transpose(struct mat2 *result,
                                                       struct mat2 *m) {
  mat2_transpose((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat2_transpose>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2_transpose@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_transpose(%struct.mat2* %0, %struct.mat2* %1) {
%3 = alloca %struct.mat2*
%4 = alloca %struct.mat2*
store %struct.mat2* %0, %struct.mat2** %3
store %struct.mat2* %1, %struct.mat2** %4
%5 = load %struct.mat2*, %struct.mat2** %3
%6 = bitcast %struct.mat2* %5 to float*
%7 = load %struct.mat2*, %struct.mat2** %4
%8 = bitcast %struct.mat2* %7 to float*
%9 = call i32 @mat2_transpose(float* %6, float* %8)
%10 = load %struct.mat2*, %struct.mat2** %3
ret %struct.mat2* %10
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_transpose(%struct.mat2* returned %0, %struct.mat2* %1) {
%3 = bitcast %struct.mat2* %0 to float*
%4 = bitcast %struct.mat2* %1 to float*
%5 = tail call i32 @mat2_transpose(float* %3, float* %4)
ret %struct.mat2* %0
}
int f_bgt_rm1(float a1, float *a2) { return (__builtin_isgreater(a1, *a2)); }


x86 assembly (clang, -O0):
<f_bgt_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_rm1>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @f_bgt_rm1(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp ogt float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_bgt_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp olt float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
int length(char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
double sin(double);
int main() {
  int num;
  scanf("%d", &num);
  printf("%f\n", sin(3.14159265358979323846 * num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
call   1040 <sin@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double 0x400921FB54442D18, %5
%7 = call double @sin(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\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 = sitofp i32 %4 to double
%6 = fmul double %5, 0x400921FB54442D18
%7 = call double @sin(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
void wx11iv(dev) char dev[];
{}


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

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

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

LLVM IR (-O2):
define void @wx11iv(i8* nocapture %0) {
ret void
}
int test_imm_24uint16_reg(unsigned short val) {
  return ((val) & (0x24 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_24uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x24,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_24uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 36
%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_24uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 36
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo_1_1_2_2_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_1_1_1_2() {
ret void
}
int traceslang_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @traceslang_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  sleep(60);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3c,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 60)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 60)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_yocto(void) {
  printf("\nHello Yocto\n");
  printf("devtool test on poky 2.0.1\n");
}


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

x86 assembly (clang, -O2):
<hello_yocto>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AHello Yocto\0A\00"
@.str.1 = [28 x i8] c"devtool test on poky 2.0.1\0A\00"
define void @hello_yocto() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"\0AHello Yocto\00"
@str.2 = [27 x i8] c"devtool test on poky 2.0.1\00"
define void @hello_yocto() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned long, unsigned long,
                          unsigned long);
scalar_t__ pthread_self();
void print_ids(const char *prefix) {
  pid_t pid = getpid();
  pthread_t tid = pthread_self();
  printf("%s pid %lu tid %lu (0x%lx)\n", prefix, (unsigned long)pid,
         (unsigned long)tid, (unsigned long)tid);
}


x86 assembly (clang, -O0):
<print_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%lx)\0A\00"
define void @print_ids(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i64 %9, i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%lx)\0A\00"
define void @print_ids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3, i64 %3)
ret void
}
void Pause_Line(prt_line) int prt_line;
{
  Prt("[Press any key to continue.]", prt_line, 23);
  (void)inkey();
  Erase_Line(prt_line, 0);
}


x86 assembly (clang, -O0):
<Pause_Line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x17,%edx
mov    $0x0,%al
call   1040 <Prt@plt>
mov    $0x0,%al
call   1050 <inkey@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <Erase_Line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pause_Line>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
mov    $0x17,%edx
xor    %eax,%eax
call   1040 <Prt@plt>
xor    %eax,%eax
call   1050 <inkey@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <Erase_Line@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[Press any key to continue.]\00"
define void @Pause_Line(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Prt to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 23)
%5 = call i32 (...) @inkey()
%6 = load i32, i32* %2
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Erase_Line to i32 (i32, i32, ...)*)(i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"[Press any key to continue.]\00"
define void @Pause_Line(i32 %0) {
%2 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Prt to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 23)
%3 = tail call i32 (...) @inkey()
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Erase_Line to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *left, const void *right) {
  char **left_sp = (char **)left;
  char **right_sp = (char **)right;
  return strcmp(*left_sp, *right_sp);
}


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
double erf(double);
double sqrt(double);
double ncdf(double x) { return 0.5 * (1.0 + erf(x / sqrt(2.0))); }


x86 assembly (clang, -O0):
<ncdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <erf@plt>
movsd  0xeab(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncdf>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <erf@plt>
addsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ncdf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double 2.000000e+00)
%5 = fdiv double %3, %4
%6 = call double @erf(double %5)
%7 = fadd double 1.000000e+00, %6
%8 = fmul double 5.000000e-01, %7
ret double %8
}

LLVM IR (-O2):
define double @ncdf(double %0) {
%2 = fdiv double %0, 0x3FF6A09E667F3BCD
%3 = tail call double @erf(double %2)
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, 5.000000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s [String]...\n   or: %s [OPTION]\n\n     Repeatedly output "
         "a line with all specified STRING(s), or 'y'.\n     -h, "
         "--help\t\tdisplay this help\n     -V, --version\tdisplay version "
         "information\n\n     Report bugs to <bulliver@gmail.com>\n",
         "yes", "yes");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xfcd(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [235 x i8] c"Usage: %s [String]...\0A or: %s [OPTION]\0A\0A Repeatedly output a line with all specified STRING(s), or 'y'.\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"yes\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [235 x i8] c"Usage: %s [String]...\0A or: %s [OPTION]\0A\0A Repeatedly output a line with all specified STRING(s), or 'y'.\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"yes\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_39int8_mem(signed char *val) {
  return ((*val) & (0x39 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_39int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 57
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ ppuSetNameTblSingleLower();
int /*<<< orphan*/ ppuSetNameTblSingleUpper();
int /*<<< orphan*/ prg16setBank0(int);
void m78b_setParams8XXX(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0((val & 7) << 14);
  chr8setBank0(((val >> 4) & 0xF) << 13);
  if ((val & 0x8) == 0)
    ppuSetNameTblSingleLower();
  else
    ppuSetNameTblSingleUpper();
}


x86 assembly (clang, -O0):
<m78b_setParams8XXX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1040 <prg16setBank0@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1060 <chr8setBank0@plt>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1188 <m78b_setParams8XXX+0x48>
mov    $0x0,%al
call   1050 <ppuSetNameTblSingleLower@plt>
jmp    118f <m78b_setParams8XXX+0x4f>
mov    $0x0,%al
call   1030 <ppuSetNameTblSingleUpper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m78b_setParams8XXX>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1040 <prg16setBank0@plt>
mov    %ebx,%edi
shl    $0x9,%edi
and    $0x1e000,%edi
call   1060 <chr8setBank0@plt>
xor    %eax,%eax
test   $0x8,%bl
jne    116d <m78b_setParams8XXX+0x2d>
pop    %rbx
jmp    1050 <ppuSetNameTblSingleLower@plt>
pop    %rbx
jmp    1030 <ppuSetNameTblSingleUpper@plt>

LLVM IR (-O0):
define void @m78b_setParams8XXX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 7
%8 = shl i32 %7, 14
%9 = call i32 @prg16setBank0(i32 %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 4
%12 = and i32 %11, 15
%13 = shl i32 %12, 13
%14 = call i32 @chr8setBank0(i32 %13)
%15 = load i32, i32* %4
%16 = and i32 %15, 8
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @ppuSetNameTblSingleLower()
br label %22
20: ; preds = %2
%21 = call i32 (...) @ppuSetNameTblSingleUpper()
br label %22
22: ; preds = %20, %18
ret void
}

LLVM IR (-O2):
define void @m78b_setParams8XXX(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = and i32 %3, 114688
%5 = tail call i32 @prg16setBank0(i32 %4)
%6 = shl i32 %1, 9
%7 = and i32 %6, 122880
%8 = tail call i32 @chr8setBank0(i32 %7)
%9 = and i32 %1, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 (...) @ppuSetNameTblSingleLower()
br label %15
13: ; preds = %2
%14 = tail call i32 (...) @ppuSetNameTblSingleUpper()
br label %15
15: ; preds = %13, %11
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t bitScan_fun_uint16_t(uint16_t x) {
  uint32_t r = 16;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bitScan_fun_uint16_t+0x2f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitScan_fun_uint16_t+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_uint16_t>:
mov    $0x10,%eax
test   %edi,%edi
je     111c <bitScan_fun_uint16_t+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitScan_fun_uint16_t+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_uint16_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 16, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 16, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int __lxstat(int ver __attribute__((unused)),
             const char *path __attribute__((unused)),
             struct stat *stat_buf __attribute__((unused))) {
  printf("__lxstat\n");
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<__lxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c"__lxstat\0A\00"
@ENOENT = global i32 0
@errno = global i32 0
define i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @ENOENT
store i32 %8, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
@str = [9 x i8] c"__lxstat\00"
define i32 @__lxstat(i32 %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @ENOENT
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *a_thread_func() {
  pthread_exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<a_thread_func>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_thread_func>:
push   %rax
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @a_thread_func() {
%1 = call i32 @pthread_exit(i32 0)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @a_thread_func() {
%1 = tail call i32 @pthread_exit(i32 0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void congratulateStudents(char *studnet, char *course, int numDays) {
  printf("%s has done as much as programming in %s as I could fit in %d days\n",
         studnet, course, numDays);
}


x86 assembly (clang, -O0):
<congratulateStudents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<congratulateStudents>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"%s has done as much as programming in %s as I could fit in %d days\0A\00"
define void @congratulateStudents(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"%s has done as much as programming in %s as I could fit in %d days\0A\00"
define void @congratulateStudents(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}