xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(int);
char *str_chr(const char *s) {
  char *p;
  p = (char *)s;
  while (isspace((int)*p)) {
    ++p;
  }
  if (*p < 33 || *p > 126) {
    p = NULL;
  }
  return p;
}


x86 assembly (clang, -O0):
<str_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114b <str_chr+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <str_chr+0x14>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jl     116b <str_chr+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jle    1173 <str_chr+0x63>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_chr>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <str_chr+0x10>
mov    (%rbx),%cl
add    $0x81,%cl
xor    %eax,%eax
cmp    $0xa2,%cl
cmovae %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @str_chr(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = load i8, i8* %3
%11 = add i8 %10, -127
%12 = icmp ult i8 %11, -94
%13 = select i1 %12, i8* null, i8* %3
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_CALL();
void do0xED() { _I8080_CALL(); }


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

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

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

LLVM IR (-O2):
define void @do0xED() {
%1 = tail call i32 (...) @_I8080_CALL()
ret void
}
/* Variables and functions */
char *newstrn(char *, int);
char *strrchr(char *, char);
char *path_prefix(char *name) {
  char *p1;
  p1 = strrchr(name, '/');
  if (!p1)
    return NULL;
  return newstrn(name, p1 - name);
}


x86 assembly (clang, -O0):
<path_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <path_prefix+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1170 <path_prefix+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1040 <newstrn@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_prefix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1140 <path_prefix+0x20>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <newstrn@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @path_prefix(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @newstrn(i8* %0, i32 %8)
br label %10
10: ; preds = %1, %4
%11 = phi i8* [ %9, %4 ], [ null, %1 ]
ret i8* %11
}
void drawCaps(pRecContext) {}


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

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

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

LLVM IR (-O2):
define void @drawCaps(i32 %0) {
ret void
}
void _fillBufWithContent(void **buf, void **end, void *(*func)(void)) {
  void **trav = buf;
  while (trav < end) {
    *trav = func();
    ++trav;
  }
}


x86 assembly (clang, -O0):
<_fillBufWithContent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1148 <_fillBufWithContent+0x48>
call   *-0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <_fillBufWithContent+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fillBufWithContent>:
push   %r15
push   %r14
push   %rbx
cmp    %rsi,%rdi
jae    112f <_fillBufWithContent+0x2f>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   *%r14
mov    %rax,(%rbx)
add    $0x8,%rbx
cmp    %r15,%rbx
jb     1120 <_fillBufWithContent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @_fillBufWithContent(i8** writeonly %0, i8** readnone %1, i8* ()* nocapture %2) {
%4 = icmp ult i8** %0, %1
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i8** [ %8, %5 ], [ %0, %3 ]
%7 = tail call i8* %2()
store i8* %7, i8** %6
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = icmp ult i8** %8, %1
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void default_log_adapter(const char *file, int line, const char *format,
                         va_list args) {
  fprintf(stderr, "%s:%d ", file, line);
  vfprintf(stderr, format, args);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<default_log_adapter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_log_adapter>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2e9a(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <vfprintf@plt>
mov    0x0(%rbp),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%d \00"
define void @default_log_adapter(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @vfprintf(i32 %13, i8* %14, i32 %15)
%17 = load i32, i32* @stderr
%18 = call i32 @fputc(i8 signext 10, i32 %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%d \00"
define void @default_log_adapter(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @vfprintf(i32 %7, i8* %2, i32 %3)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fputc(i8 signext 10, i32 %9)
ret void
}
/* Variables and functions */
int factor_num(int);
int /*<<< orphan*/ printf(char *, int);
int triangle(int);
int main() {
  int i;
  for (i = 2; factor_num(triangle(i)) <= 500; i++)
    ;
  printf("%d\n", triangle(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <triangle@plt>
mov    %eax,%edi
call   1030 <factor_num@plt>
cmp    $0x1f4,%eax
jg     1173 <main+0x43>
jmp    1165 <main+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    -0x8(%rbp),%edi
call   1040 <triangle@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <triangle@plt>
mov    %eax,%edi
call   1030 <factor_num@plt>
cmp    $0x1f5,%eax
jl     1140 <main+0x10>
mov    %ebx,%edi
call   1040 <triangle@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 2, %0 ], [ %6, %1 ]
%3 = tail call i32 @triangle(i32 %2)
%4 = tail call i32 @factor_num(i32 %3)
%5 = icmp slt i32 %4, 501
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = tail call i32 @triangle(i32 %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ui_cancellation_enabled();
int ui_cancellation_disabled(void) { return !ui_cancellation_enabled(); }


x86 assembly (clang, -O0):
<ui_cancellation_disabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ui_cancellation_enabled@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_cancellation_disabled>:
push   %rax
xor    %eax,%eax
call   1030 <ui_cancellation_enabled@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ui_cancellation_disabled() {
%1 = call i32 (...) @ui_cancellation_enabled()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ui_cancellation_disabled() {
%1 = tail call i32 (...) @ui_cancellation_enabled()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int decryption_data_send_recv(unsigned char *, int);
int decryption_in_network(unsigned char *buf, int len) {
  return decryption_data_send_recv(buf, len);
}


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

x86 assembly (clang, -O2):
<decryption_in_network>:
jmp    1030 <decryption_data_send_recv@plt>

LLVM IR (-O0):
define i32 @decryption_in_network(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 @decryption_data_send_recv(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @decryption_in_network(i8* %0, i32 %1) {
%3 = tail call i32 @decryption_data_send_recv(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *stripper_dup(char *);
char *stripper(char *str) {
  char *results = stripper_dup(str);
  strcpy(str, results);
  free(results);
  return str;
}


x86 assembly (clang, -O0):
<stripper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <stripper_dup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <stripper_dup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stripper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @stripper_dup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @stripper(i8* returned %0) {
%2 = tail call i8* @stripper_dup(i8* %0)
%3 = tail call i32 @strcpy(i8* %0, i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ bmy_sudirription_internal_call(char const *, int, int);
void bmy_sudirription_del(int usernum, int boardnum) {
  const char *sql =
      "DELETE FROM t_user_sudirriptions WHERE usernum = ? AND boardnum = ?";
  bmy_sudirription_internal_call(sql, usernum, boardnum);
}


x86 assembly (clang, -O0):
<bmy_sudirription_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <bmy_sudirription_internal_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmy_sudirription_del>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <bmy_sudirription_internal_call@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"DELETE FROM t_user_sudirriptions WHERE usernum = ? AND boardnum = ?\00"
define void @bmy_sudirription_del(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @bmy_sudirription_internal_call(i8* %6, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"DELETE FROM t_user_sudirriptions WHERE usernum = ? AND boardnum = ?\00"
define void @bmy_sudirription_del(i32 %0, i32 %1) {
%3 = tail call i32 @bmy_sudirription_internal_call(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct ts_value {
  int dummy;
};

/* Variables and functions */
int ts_set_valuei_arr(struct ts_value *, int, int *);
int ts_set_valuei(struct ts_value *tsv, int inum) {
  return ts_set_valuei_arr(tsv, 1, &inum);
}


x86 assembly (clang, -O0):
<ts_set_valuei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    -0xc(%rbp),%rdx
call   1030 <ts_set_valuei_arr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ts_value = type { i32 }
define i32 @ts_set_valuei(%struct.ts_value* %0, i32 %1) {
%3 = alloca %struct.ts_value*
%4 = alloca i32
store %struct.ts_value* %0, %struct.ts_value** %3
store i32 %1, i32* %4
%5 = load %struct.ts_value*, %struct.ts_value** %3
%6 = call i32 @ts_set_valuei_arr(%struct.ts_value* %5, i32 1, i32* %4)
ret i32 %6
}

LLVM IR (-O2):
%struct.ts_value = type { i32 }
define i32 @ts_set_valuei(%struct.ts_value* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @ts_set_valuei_arr(%struct.ts_value* %0, i32 1, i32* %3)
ret i32 %4
}
/* Variables and functions */
float magnitudeVector(float *);
void normalizeVector(float *u) {
  float mag = magnitudeVector(u);
  u[0] = u[0] / mag;
  u[1] = u[1] / mag;
  u[2] = u[2] / mag;
}


x86 assembly (clang, -O0):
<normalizeVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <magnitudeVector@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
divss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizeVector>:
push   %rbx
mov    %rdi,%rbx
call   1030 <magnitudeVector@plt>
movss  (%rbx),%xmm1
movss  0x4(%rbx),%xmm2
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
divss  %xmm0,%xmm2
movss  %xmm2,0x4(%rbx)
movss  0x8(%rbx),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @normalizeVector(float* %0) {
%2 = tail call float @magnitudeVector(float* %0)
%3 = load float, float* %0
%4 = fdiv float %3, %2
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fdiv float %6, %2
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fdiv float %9, %2
store float %10, float* %8
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int timeDiff(struct timeval *pStart, struct timeval *pEnd) {
  return (pEnd->tv_usec - pStart->tv_usec) +
         1000000 * (pEnd->tv_sec - pStart->tv_sec);
}


x86 assembly (clang, -O0):
<timeDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x8(%rbp),%rdx
sub    0x4(%rdx),%ecx
imul   $0xf4240,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeDiff>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
sub    (%rdi),%ecx
sub    0x4(%rdi),%eax
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timeDiff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = load %struct.timeval*, %struct.timeval** %4
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.timeval*, %struct.timeval** %3
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = mul nsw i32 1000000, %18
%20 = add nsw i32 %11, %19
ret i32 %20
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timeDiff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub i32 %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = mul nsw i32 %12, 1000000
%14 = add nsw i32 %7, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int n1, n2;
  scanf("%d %i", &n1, &n2);
  printf("%d %d\n", n1, n2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %i\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %i\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ finn_mat4_scale(float *, float *);
void finn_mat4_scale_xyz(float *mat, float x, float y, float z) {
  float vec[3] = {x, y, z};
  finn_mat4_scale(mat, vec);
}


x86 assembly (clang, -O0):
<finn_mat4_scale_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <finn_mat4_scale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_mat4_scale_xyz>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0x14(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <finn_mat4_scale@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @finn_mat4_scale_xyz(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [3 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%11 = load float, float* %6
store float %11, float* %10
%12 = getelementptr inbounds float, float* %10, i64 1
%13 = load float, float* %7
store float %13, float* %12
%14 = getelementptr inbounds float, float* %12, i64 1
%15 = load float, float* %8
store float %15, float* %14
%16 = load float*, float** %5
%17 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%18 = call i32 @finn_mat4_scale(float* %16, float* %17)
ret void
}

LLVM IR (-O2):
define void @finn_mat4_scale_xyz(float* %0, float %1, float %2, float %3) {
%5 = alloca [3 x float]
%6 = bitcast [3 x float]* %5 to i8*
%7 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
store float %1, float* %7
%8 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
store float %2, float* %8
%9 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
store float %3, float* %9
%10 = call i32 @finn_mat4_scale(float* %0, float* %7)
ret void
}
void im_a_benign_func(void) {}


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

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

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

LLVM IR (-O2):
define void @im_a_benign_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkTainted(char *);
int /*<<< orphan*/ checkUntainted(char *);
void test(char *def) {
  checkTainted(def);
  checkUntainted(def);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
call   1040 <checkTainted@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <checkUntainted@plt>

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

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = tail call i32 @checkTainted(i8* %0)
%3 = tail call i32 @checkUntainted(i8* %0)
ret void
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int code_match(int c0, const char *code1) {
  int c1;
  if (code1 == NULL)
    return 0;
  c1 = strtol(code1, NULL, 0);
  return (c0 == c1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<code_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <code_match+0x26>
movl   $0x0,-0x4(%rbp)
jmp    115d <code_match+0x4d>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_match>:
test   %rsi,%rsi
je     112f <code_match+0x1f>
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @code_match(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %18
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @strtol(i8* %11, i32* null, i32 0)
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
store i32 %17, i32* %3
br label %18
18: ; preds = %10, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @code_match(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @strtol(i8* nocapture %1, i32* null, i32 0)
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int abs(int const);
int Sub3(int a, int b, int c) {
  const int pb = b - c;
  const int pa = a - c;
  return abs(pb) - abs(pa);
}


x86 assembly (clang, -O0):
<Sub3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sub3>:
sub    %edx,%esi
sub    %edx,%edi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    %edi,%eax
neg    %eax
cmovns %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Sub3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = call i32 @abs(i32 %15)
%17 = load i32, i32* %8
%18 = call i32 @abs(i32 %17)
%19 = sub nsw i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @Sub3(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = sub nsw i32 %0, %2
%6 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%7 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%8 = sub nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ rl_insert(int, char);
int main(void) {
  rl_insert(1, 'z');
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rl_insert(i32 1, i8 signext 122)
ret i32 0
}
int main(void) {
  float c[2] = {1.1, 2.2};
  (1 || 2 ? c[0] : 1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.c = [2 x float] [float 0x3FF19999A0000000, float 0x40019999A0000000]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 0, i32* %1
%3 = bitcast [2 x float]* %2 to i8*
%4 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%5 = load float, float* %4
%6 = fpext float %5 to double
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void PWMOutputState(uint32_t ui32Base, uint32_t ui32PWMOutBits, bool bEnable) {
  ;

  ;
  if (bEnable == 1) {
    (*((volatile unsigned long *)(ui32Base + 0x00000008))) |= ui32PWMOutBits;
  } else {
    (*((volatile unsigned long *)(ui32Base + 0x00000008))) &= ~(ui32PWMOutBits);
  }
}


x86 assembly (clang, -O0):
<PWMOutputState>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1131 <PWMOutputState+0x31>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x8(%rax)
jmp    1148 <PWMOutputState+0x48>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMOutputState>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x1,%edx
jne    111e <PWMOutputState+0x1e>
mov    -0x10(%rsp),%rcx
or     %rax,0x8(%rcx)
ret
not    %rax
mov    -0x10(%rsp),%rcx
and    %rax,0x8(%rcx)
ret

LLVM IR (-O0):
define void @PWMOutputState(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load volatile i64, i64* %5
%11 = load volatile i64, i64* %4
%12 = add i64 %11, 8
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
br label %24
16: ; preds = %3
%17 = load volatile i64, i64* %5
%18 = xor i64 %17, -1
%19 = load volatile i64, i64* %4
%20 = add i64 %19, 8
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = and i64 %22, %18
store volatile i64 %23, i64* %21
br label %24
24: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @PWMOutputState(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
%6 = icmp eq i32 %2, 1
%7 = load volatile i64, i64* %5
br i1 %6, label %8, label %14
8: ; preds = %3
%9 = load volatile i64, i64* %4
%10 = add i64 %9, 8
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %7
store volatile i64 %13, i64* %11
br label %21
14: ; preds = %3
%15 = xor i64 %7, -1
%16 = load volatile i64, i64* %4
%17 = add i64 %16, 8
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %15
store volatile i64 %20, i64* %18
br label %21
21: ; preds = %14, %8
ret void
}
foo(char *bufp) {
  int x = 80;
  return (*bufp++ = x ? 'a' : 'b');
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x50,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x62,%eax
mov    $0x61,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x61,(%rdi)
mov    $0x61,%eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 80, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 97, i32 98
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
store i8 %8, i8* %9
%11 = sext i8 %8 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret i32 97
}
/* Variables and functions */
unsigned long __pa(void *);
unsigned long virt_to_phys(volatile void *address) {
  return __pa((void *)address);
}


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

x86 assembly (clang, -O2):
<virt_to_phys>:
jmp    1030 <__pa@plt>

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

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = tail call i64 @__pa(i8* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void mpack_store_u8(char *p, uint8_t val) {
  uint8_t *u = (uint8_t *)p;
  u[0] = val;
}


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

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

LLVM IR (-O0):
define void @mpack_store_u8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
ret void
}

LLVM IR (-O2):
define void @mpack_store_u8(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _panic(char *, char const *, int, char const *);
void _kassertfail(const char *file, int line, const char *cond) {
  _panic("assertion failed at %s:%d: %s\n", file, line, cond);
}


x86 assembly (clang, -O0):
<_kassertfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <_panic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kassertfail>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <_panic@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"assertion failed at %s:%d: %s\0A\00"
define void @_kassertfail(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @_panic(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"assertion failed at %s:%d: %s\0A\00"
define void @_kassertfail(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @_panic(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sapxsumors(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sapxsumors(N, 5.0f, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_sapxsumors@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sapxsumors@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sapxsumors(i32 %6, float 5.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sapxsumors(i32 4, float 5.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int msmtitanium_unclamp_secondary_arm_cpu(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msmtitanium_unclamp_secondary_arm_cpu(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_sigint(int);
void handle_sigterm(int p) { handle_sigint(p); }


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

x86 assembly (clang, -O2):
<handle_sigterm>:
jmp    1030 <handle_sigint@plt>

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

LLVM IR (-O2):
define void @handle_sigterm(i32 %0) {
%2 = tail call i32 @handle_sigint(i32 %0)
ret void
}
int bar(const void *a, const void *b) {
  int c = *(const int *)a;
  int d = *(const int *)b;
  return c - d;
}


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

x86 assembly (clang, -O2):
<bar>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t _picohash_sha1_rol32(uint32_t number, uint8_t bits) {
  return ((number << bits) | (number >> (32 - bits)));
}


x86 assembly (clang, -O0):
<_picohash_sha1_rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_picohash_sha1_rol32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_picohash_sha1_rol32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_picohash_sha1_rol32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_move_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_move_ss(__m128 A, __m128 B) { return _mm_move_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_move_ss>:
jmp    1030 <_mm_move_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_move_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_move_ss(i32 %0, i32 %1)
ret i32 %3
}