xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
char *getFilename(char *pathname) {
  char *fname = strrchr(pathname, '/');
  if (fname)
    return fname + 1;
  return pathname;
}


x86 assembly (clang, -O0):
<getFilename>:
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)
je     114a <getFilename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <getFilename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getFilename(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 %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @getFilename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void f(int p[]) { p++; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i32 1
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  char s[3] = {'a', 'b', 'c'};
  int x;
  for (x = 0; x < 3; x++)
    putchar(s[x]);
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1160 <main+0x50>
movslq -0xc(%rbp),%rax
movsbl -0x7(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [3 x i8] c"abc"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @putchar(i8 signext %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
%2 = tail call i32 @putchar(i8 signext 98)
%3 = tail call i32 @putchar(i8 signext 99)
%4 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Please enter a non-negative number: ");
  scanf("%d", &num);
  printf("You entered %d", num);
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Please enter a non-negative number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"You entered %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Please enter a non-negative number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"You entered %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
int isFlagChar(int c) {
  switch (c) {
  case '-':
  case '+':
  case '0':
  case ' ':
  case '#':
  case '\'':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isFlagChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x20,%eax
je     1170 <isFlagChar+0x70>
jmp    111b <isFlagChar+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1170 <isFlagChar+0x70>
jmp    112c <isFlagChar+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x27,%eax
je     1170 <isFlagChar+0x70>
jmp    113d <isFlagChar+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1170 <isFlagChar+0x70>
jmp    114e <isFlagChar+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1170 <isFlagChar+0x70>
jmp    115f <isFlagChar+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
jne    117c <isFlagChar+0x7c>
jmp    1170 <isFlagChar+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1183 <isFlagChar+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFlagChar>:
cmp    $0x30,%edi
ja     111d <isFlagChar+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x1288900000000,%rdx
bt     %rcx,%rdx
jae    111d <isFlagChar+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isFlagChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 45, label %5
i32 43, label %5
i32 48, label %5
i32 32, label %5
i32 35, label %5
i32 39, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isFlagChar(i32 %0) {
switch i32 %0, label %2 [
i32 45, label %3
i32 43, label %3
i32 48, label %3
i32 32, label %3
i32 35, label %3
i32 39, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct buffer {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ buffer_write(struct buffer *, double *, int);
void buffer_write_double(struct buffer *__restrict buf, double data) {
  buffer_write(buf, &data, sizeof(data));
}


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

x86 assembly (clang, -O2):
<buffer_write_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <buffer_write@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_write_double(%struct.buffer* noalias %0, double %1) {
%3 = alloca %struct.buffer*
%4 = alloca double
store %struct.buffer* %0, %struct.buffer** %3
store double %1, double* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buffer_write(%struct.buffer* %5, double* %4, i32 8)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_write_double(%struct.buffer* noalias %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @buffer_write(%struct.buffer* %0, double* %3, i32 8)
ret void
}
int args0(void) {
  void *local = 0;
  return local;
}


x86 assembly (clang, -O0):
<args0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @args0() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = ptrtoint i8* %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @args0() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g456distsq(double *, double *);
double sqrt(int /*<<< orphan*/);
double g456dist(double v1[6], double v2[6]) { return sqrt(g456distsq(v1, v2)); }


x86 assembly (clang, -O0):
<g456dist>:
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 <g456distsq@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g456dist>:
push   %rax
call   1030 <g456distsq@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @g456dist(double* %0, double* %1) {
%3 = tail call i32 @g456distsq(double* %0, double* %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Type definitions */
struct b_midicfg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ loadKeyTableA(struct b_midicfg *);
int /*<<< orphan*/ loadKeyTableB(struct b_midicfg *);
int /*<<< orphan*/ loadKeyTableC(struct b_midicfg *);
int /*<<< orphan*/ loadStatusTable(struct b_midicfg *);
void initMidiTables(void *mcfg) {
  struct b_midicfg *m = (struct b_midicfg *)mcfg;
  loadKeyTableA(m);
  loadKeyTableB(m);
  loadKeyTableC(m);
  loadStatusTable(m);
}


x86 assembly (clang, -O0):
<initMidiTables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <loadKeyTableA@plt>
mov    -0x10(%rbp),%rdi
call   1040 <loadKeyTableB@plt>
mov    -0x10(%rbp),%rdi
call   1050 <loadKeyTableC@plt>
mov    -0x10(%rbp),%rdi
call   1060 <loadStatusTable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMidiTables>:
push   %rbx
mov    %rdi,%rbx
call   1030 <loadKeyTableA@plt>
mov    %rbx,%rdi
call   1040 <loadKeyTableB@plt>
mov    %rbx,%rdi
call   1050 <loadKeyTableC@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <loadStatusTable@plt>

LLVM IR (-O0):
%struct.b_midicfg = type { i32 }
define void @initMidiTables(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.b_midicfg*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.b_midicfg*
store %struct.b_midicfg* %5, %struct.b_midicfg** %3
%6 = load %struct.b_midicfg*, %struct.b_midicfg** %3
%7 = call i32 @loadKeyTableA(%struct.b_midicfg* %6)
%8 = load %struct.b_midicfg*, %struct.b_midicfg** %3
%9 = call i32 @loadKeyTableB(%struct.b_midicfg* %8)
%10 = load %struct.b_midicfg*, %struct.b_midicfg** %3
%11 = call i32 @loadKeyTableC(%struct.b_midicfg* %10)
%12 = load %struct.b_midicfg*, %struct.b_midicfg** %3
%13 = call i32 @loadStatusTable(%struct.b_midicfg* %12)
ret void
}

LLVM IR (-O2):
%struct.b_midicfg = type { i32 }
define void @initMidiTables(i8* %0) {
%2 = bitcast i8* %0 to %struct.b_midicfg*
%3 = tail call i32 @loadKeyTableA(%struct.b_midicfg* %2)
%4 = tail call i32 @loadKeyTableB(%struct.b_midicfg* %2)
%5 = tail call i32 @loadKeyTableC(%struct.b_midicfg* %2)
%6 = tail call i32 @loadStatusTable(%struct.b_midicfg* %2)
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errf(char *);
int scanc();
void scan_to_eol(void) {
  int c;
  while ((c = scanc()) != '\n') {
    if (c == EOF) {
      errf("missing newline");
      return;
    }
  }
  assert(c == '\n');
}


x86 assembly (clang, -O0):
<scan_to_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <scanc@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xa,%eax
je     1173 <scan_to_eol+0x43>
mov    -0x4(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
jne    116e <scan_to_eol+0x3e>
lea    0xe9c(%rip),%rdi
call   1040 <errf@plt>
jmp    1184 <scan_to_eol+0x54>
jmp    1138 <scan_to_eol+0x8>
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_to_eol>:
push   %rbx
mov    0x2eb0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <scanc@plt>
cmp    $0xa,%eax
je     115d <scan_to_eol+0x2d>
cmp    (%rbx),%eax
jne    1140 <scan_to_eol+0x10>
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1040 <errf@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [16 x i8] c"missing newline\00"
define void @scan_to_eol() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @scanc()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @errf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %17
11: ; preds = %5
br label %2
12: ; preds = %2
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 10
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
br label %17
17: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [16 x i8] c"missing newline\00"
define void @scan_to_eol() {
br label %1
1: ; preds = %4, %0
%2 = tail call i32 (...) @scanc()
%3 = icmp eq i32 %2, 10
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %2, %5
br i1 %6, label %7, label %1
7: ; preds = %4
%8 = tail call i32 @errf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i32 @assert(i32 1)
br label %11
11: ; preds = %9, %7
ret void
}
unsigned xrop3_238_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = D | S;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_238_0_0>:
shl    $0x8,%edi
lea    0xff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_238_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @xrop3_238_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, 255
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t swap64(uint64_t x) {
  return (x << 56) | (x >> 56) | ((x & 0xff00) << 40) | ((x >> 40) & 0xff00) |
         ((x & 0xff0000) << 24) | ((x >> 24) & 0xff0000) |
         ((x & 0xff000000) << 8) | ((x >> 8) & 0xff000000);
}


x86 assembly (clang, -O0):
<swap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 56
%5 = load i32, i32* %2
%6 = ashr i32 %5, 56
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = and i32 %8, 65280
%10 = shl i32 %9, 40
%11 = or i32 %7, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 40
%14 = and i32 %13, 65280
%15 = or i32 %11, %14
%16 = load i32, i32* %2
%17 = and i32 %16, 16711680
%18 = shl i32 %17, 24
%19 = or i32 %15, %18
%20 = load i32, i32* %2
%21 = ashr i32 %20, 24
%22 = and i32 %21, 16711680
%23 = or i32 %19, %22
%24 = load i32, i32* %2
%25 = and i32 %24, -16777216
%26 = shl i32 %25, 8
%27 = or i32 %23, %26
%28 = load i32, i32* %2
%29 = ashr i32 %28, 8
%30 = and i32 %29, -16777216
%31 = or i32 %27, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @swap64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *);
int bye(int sock_fd) {
  close(sock_fd);
  printf("connection is closed....\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"connection is closed....\00"
define i32 @bye(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void TEXTVER_Debug(char *s) {}


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

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

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

LLVM IR (-O2):
define void @TEXTVER_Debug(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_rotation_x(float *, float);
__attribute__((always_)) struct mat3 *psmat3_rotation_x(struct mat3 *result,
                                                        float angle) {
  mat3_rotation_x((float *)result, angle);
  return result;
}


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

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

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

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_rotation_x(%struct.mat3* returned %0, float %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = tail call i32 @mat3_rotation_x(float* %3, float %1)
ret %struct.mat3* %0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRDB_get(void) { return U_WMRCORENONE_get("U_WMRDB"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRDB\00"
define i32 @U_WMRDB_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDB\00"
define i32 @U_WMRDB_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned char inb_local(unsigned long port) {
  unsigned char value;
  __asm__ __volatile__("in"
                       "b"
                       " %w1, %"
                       "b"
                       "0"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb_local>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_local>:
mov    %rdi,%rdx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb_local(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb_local(i64 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i8 %2
}
void freeSevenDigits(int *value) {}


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

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

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

LLVM IR (-O2):
define void @freeSevenDigits(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
int ptraceTraceMe() { return ptrace(0, 0, 0, 0); }


x86 assembly (clang, -O0):
<ptraceTraceMe>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <ptrace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptraceTraceMe>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
define i32 @ptraceTraceMe() {
%1 = call i32 @ptrace(i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ptraceTraceMe() {
%1 = tail call i32 @ptrace(i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inb(uint16_t port) {
  uint8_t value;
  __asm__ __volatile__("inb %w1, %b0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ testchecktkts();
int /*<<< orphan*/ testinitialize();
int /*<<< orphan*/ testlocktkts();
int /*<<< orphan*/ testnext();
int main() {
  testnext();
  testinitialize();
  testchecktkts();
  testlocktkts();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testnext@plt>
xor    %eax,%eax
call   1050 <testinitialize@plt>
xor    %eax,%eax
call   1060 <testchecktkts@plt>
xor    %eax,%eax
call   1030 <testlocktkts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testnext()
%3 = call i32 (...) @testinitialize()
%4 = call i32 (...) @testchecktkts()
%5 = call i32 (...) @testlocktkts()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testnext()
%2 = tail call i32 (...) @testinitialize()
%3 = tail call i32 (...) @testchecktkts()
%4 = tail call i32 (...) @testlocktkts()
ret i32 0
}
void HMETIS_PartKway(int nvtxs, int nhedges, int *vwgts, int *eptr, int *eind,
                     int *hewgts, int nparts, int nbfactor, int *options,
                     int *part, int *edgecnt) {}


x86 assembly (clang, -O0):
<HMETIS_PartKway>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HMETIS_PartKway(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6, i32 %7, i32* %8, i32* %9, i32* %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32* %2, i32** %14
store i32* %3, i32** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32* %8, i32** %20
store i32* %9, i32** %21
store i32* %10, i32** %22
ret void
}

LLVM IR (-O2):
define void @HMETIS_PartKway(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32 %6, i32 %7, i32* nocapture %8, i32* nocapture %9, i32* nocapture %10) {
ret void
}
int test() {
  int array[4] = {
      0xFF,
      0xFF,
  };
  int *arrPtr = array;
  char *ptr = (char *)array;
  char i;
  int result = 0;
  for (i = 0; i < 4; i++) {
    *arrPtr = 0xFF - i;
    arrPtr++;
  }
  for (i = 0; i < 4 + 4; i++) {
    result += *ptr;
    ptr++;
  }
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
movb   $0x0,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x4,%eax
jge    116c <test+0x6c>
movsbl -0x21(%rbp),%eax
mov    $0xff,%ecx
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x21(%rbp),%al
add    $0x1,%al
mov    %al,-0x21(%rbp)
jmp    1135 <test+0x35>
movb   $0x0,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x8,%eax
jge    11a3 <test+0xa3>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x21(%rbp),%al
add    $0x1,%al
mov    %al,-0x21(%rbp)
jmp    1170 <test+0x70>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xfffffffd,%eax
ret

LLVM IR (-O0):
@__const.test.array = [4 x i32] [i32 255, i32 255, i32 0, i32 0]
define i32 @test() {
%1 = alloca [4 x i32]
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = bitcast [4 x i32]* %1 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
store i32* %7, i32** %2
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%9 = bitcast i32* %8 to i8*
store i8* %9, i8** %3
store i32 0, i32* %5
store i8 0, i8* %4
br label %10
10: ; preds = %21, %0
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = sub nsw i32 255, %16
%18 = load i32*, i32** %2
store i32 %17, i32* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %2
br label %21
21: ; preds = %14
%22 = load i8, i8* %4
%23 = add i8 %22, 1
store i8 %23, i8* %4
br label %10
24: ; preds = %10
store i8 0, i8* %4
br label %25
25: ; preds = %37, %24
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp slt i32 %27, 8
br i1 %28, label %29, label %40
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = load i32, i32* %5
%34 = add nsw i32 %33, %32
store i32 %34, i32* %5
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %3
br label %37
37: ; preds = %29
%38 = load i8, i8* %4
%39 = add i8 %38, 1
store i8 %39, i8* %4
br label %25
40: ; preds = %25
%41 = load i32, i32* %5
ret i32 %41
}

LLVM IR (-O2):
define i32 @test() {
ret i32 -3
}
/* Variables and functions */
int /*<<< orphan*/ getLocal();
int /*<<< orphan*/ getUTC();
int main() {
  getLocal();
  getUTC();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getLocal()
%2 = tail call i32 (...) @getUTC()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_MD_CTX_cleanup(int /*<<< orphan*/ *);
int /*<<< orphan*/ bson_free(int /*<<< orphan*/ *);
void EVP_MD_CTX_free(EVP_MD_CTX *ctx) {
  EVP_MD_CTX_cleanup(ctx);
  bson_free(ctx);
}


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

x86 assembly (clang, -O2):
<EVP_MD_CTX_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <EVP_MD_CTX_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bson_free@plt>

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

LLVM IR (-O2):
define void @EVP_MD_CTX_free(i32* %0) {
%2 = tail call i32 @EVP_MD_CTX_cleanup(i32* %0)
%3 = tail call i32 @bson_free(i32* %0)
ret void
}
/* Variables and functions */
double mysinfp(double);
double bar(double x) { return mysinfp(x); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <mysinfp@plt>

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

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double @mysinfp(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int);
int sre_tolower(int c) {
  if (isupper(c))
    return tolower(c);
  else
    return c;
}


x86 assembly (clang, -O0):
<sre_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     114d <sre_tolower+0x2d>
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <sre_tolower+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sre_tolower>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1135 <sre_tolower+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sre_tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ComparatorConfigure(uint32_t ui32Base, uint32_t ui32Comp,
                         uint32_t ui32Config) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + (ui32Comp * 0x20) + 0x00000024))) =
      ui32Config;
}


x86 assembly (clang, -O0):
<ComparatorConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x5,%edx
add    %edx,%eax
add    $0x24,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorConfigure>:
shl    $0x5,%esi
lea    (%rdi,%rsi,1),%eax
add    $0x24,%eax
cltq
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @ComparatorConfigure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 32
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 36
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @ComparatorConfigure(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 5
%5 = add i32 %0, 36
%6 = add i32 %5, %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
int test_imm_B3uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xB3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B3uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xb3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B3uint64_highword_reg>:
movabs $0xb300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B3uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 179
%6 = icmp ne i64 %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_B3uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 768799145984
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void lcd_thread_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @lcd_thread_stop() {
ret void
}
double FPStoMPS(double FPS) {
  double MPS = 0.3048 * FPS;
  return MPS;
}


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

x86 assembly (clang, -O2):
<FPStoMPS>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @FPStoMPS(double %0) {
%2 = fmul double %0, 3.048000e-01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int const, char const *);
int /*<<< orphan*/ stderr;
void exit_error(const int err_num, const char *err_msg) {
  fprintf(stderr, "ERROR %d: %s\n", err_num, err_msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_error>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"ERROR %d: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"ERROR %d: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int isfinite(double);
int __pruabi_isfinite(double a) { return isfinite(a); }


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

x86 assembly (clang, -O2):
<__pruabi_isfinite>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_isfinite(double %0) {
%2 = tail call i32 @isfinite(double %0)
ret i32 %2
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_56(int Salt, int Parameter) {
  unsigned b = Salt * 0x2F076EEB + 0x5BCF;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_56>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x2f076eeb,-0x4(%rbp),%eax
add    $0x5bcf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_56>:
imul   $0x2f076eeb,%edi,%edi
add    $0x5bcf,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_56(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 789016299
%8 = add nsw i32 %7, 23503
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_56(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 789016299
%4 = add nsw i32 %3, 23503
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x98() {
  Assert_real((isupper(152) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              765, ("isupper should be 0 for 0x98"));
}


x86 assembly (clang, -O0):
<t_isupper_0x98>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2fd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x98>:
push   %rax
mov    $0x98,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2fd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x98\00"
define void @t_isupper_0x98() {
%1 = call i64 @isupper(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x98\00"
define void @t_isupper_0x98() {
%1 = tail call i64 @isupper(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int OK;
int PDC_scr_close(void) { return (OK); }


x86 assembly (clang, -O0):
<PDC_scr_close>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_scr_close>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @PDC_scr_close() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_scr_close() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void adv_sleep(int usec) {
  assert(usec >= 0);
  struct timespec req = {.tv_sec = 0, .tv_nsec = usec * 1e3};
  nanosleep(&req, NULL);
}


x86 assembly (clang, -O0):
<adv_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adv_sleep>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
imul   $0x3e8,%ebx,%eax
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @adv_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 1.000000e+03
%12 = fptosi double %11 to i32
store i32 %12, i32* %8
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @adv_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast %struct.timespec* %2 to i8*
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%8 = mul i32 %0, 1000
store i32 %8, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ putchar;

/* Variables and functions */
void nanotest_putchar(char ch) { (putchar)(ch); }


x86 assembly (clang, -O0):
<nanotest_putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nanotest_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret void
}

LLVM IR (-O2):
define void @nanotest_putchar(i8 signext %0) {
ret void
}