xunge/DecIR huggingface dataset:
/* Variables and functions */
int sysfs_find_fd(int, char **, int);
int sysfs_write_attr(char *, char const *, char const *, void *, int);
int sysfs_set_attr(int fd, const char *attr, const char *fmt, void *val_p,
                   int verbose) {
  char *path;
  int err;
  err = sysfs_find_fd(fd, &path, verbose);
  if (!err)
    err = sysfs_write_attr(path, attr, fmt, val_p, verbose);
  return err;
}


x86 assembly (clang, -O0):
<sysfs_set_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%edx
lea    -0x30(%rbp),%rsi
call   1030 <sysfs_find_fd@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    1173 <sysfs_set_attr+0x53>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1040 <sysfs_write_attr@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_set_attr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rsp,%rsi
mov    %r8d,%edx
call   1030 <sysfs_find_fd@plt>
test   %eax,%eax
jne    1158 <sysfs_set_attr+0x38>
mov    (%rsp),%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %ebx,%r8d
call   1040 <sysfs_write_attr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @sysfs_set_attr(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = bitcast i8** %6 to i8*
%8 = call i32 @sysfs_find_fd(i32 %0, i8** %6, i32 %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %6
%12 = call i32 @sysfs_write_attr(i8* %11, i8* %1, i8* %2, i8* %3, i32 %4)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %8, %5 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int count_pairs(char *, int, int /*<<< orphan*/, int);
int count_pairs_wrapper(char *str, int len) {
  if (len == 0) {
    return 0;
  }
  if (len == 1 || len == 2) {
    return 0;
  }
  if (str == NULL) {
    return 0;
  }
  return count_pairs(str, len, 0, 2);
}


x86 assembly (clang, -O0):
<count_pairs_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1135 <count_pairs_wrapper+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1182 <count_pairs_wrapper+0x72>
cmpl   $0x1,-0x14(%rbp)
je     1149 <count_pairs_wrapper+0x39>
cmpl   $0x2,-0x14(%rbp)
jne    1155 <count_pairs_wrapper+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1182 <count_pairs_wrapper+0x72>
cmpq   $0x0,-0x10(%rbp)
jne    116c <count_pairs_wrapper+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1182 <count_pairs_wrapper+0x72>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1030 <count_pairs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_pairs_wrapper>:
test   %rdi,%rdi
je     1126 <count_pairs_wrapper+0x16>
cmp    $0x3,%esi
jb     1126 <count_pairs_wrapper+0x16>
xor    %edx,%edx
mov    $0x2,%ecx
jmp    1030 <count_pairs@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_pairs_wrapper(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ult i32 %1, 3
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @count_pairs(i8* %0, i32 %1, i32 0, i32 2)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
void tracing_off(void) {}


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

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

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

LLVM IR (-O2):
define void @tracing_off() {
ret void
}
/* Type definitions */
struct mod {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct mod *);
int mod_exit(struct mod *mod) {
  ;
  g_free(mod);
  ;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mod = type { i32 }
define i32 @mod_exit(%struct.mod* %0) {
%2 = alloca %struct.mod*
store %struct.mod* %0, %struct.mod** %2
%3 = load %struct.mod*, %struct.mod** %2
%4 = call i32 @g_free(%struct.mod* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.mod = type { i32 }
define i32 @mod_exit(%struct.mod* %0) {
%2 = tail call i32 @g_free(%struct.mod* %0)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t __u_bswap16(uint16_t val) {
  return ((val >> 8) & 0xffu) | ((val & 0xffu) << 8);
}


x86 assembly (clang, -O0):
<__u_bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__u_bswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @__u_bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__u_bswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: zyxbcm [-i <inputfile>] [-o <outputfile>]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: zyxbcm [-i <inputfile>] [-o <outputfile>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: zyxbcm [-i <inputfile>] [-o <outputfile>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ read_number();
int read_degree() {
  int n = 0;
  printf("Entra el nombre de subintervals (n > 0): ");
  n = (int)read_number();
  if (n <= 0) {
    printf("ERROR: el nombre ha de ser positiu\n");
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<read_degree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <read_number@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1175 <read_degree+0x45>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_degree>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <read_number@plt>
test   %eax,%eax
jle    115a <read_degree+0x1a>
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Entra el nombre de subintervals (n > 0): \00"
@.str.1 = [36 x i8] c"ERROR: el nombre ha de ser positiu\0A\00"
define i32 @read_degree() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @read_number()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [42 x i8] c"Entra el nombre de subintervals (n > 0): \00"
@str = [35 x i8] c"ERROR: el nombre ha de ser positiu\00"
define i32 @read_degree() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @read_number()
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ VtolPathFollowerStatusHandle();
void VtolPathFollowerStatusUpdated() {
  UAVObjUpdated(VtolPathFollowerStatusHandle());
}


x86 assembly (clang, -O0):
<VtolPathFollowerStatusUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VtolPathFollowerStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VtolPathFollowerStatusUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <VtolPathFollowerStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @VtolPathFollowerStatusUpdated() {
%1 = call i32 (...) @VtolPathFollowerStatusHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VtolPathFollowerStatusUpdated() {
%1 = tail call i32 (...) @VtolPathFollowerStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int is_num(char *s) {
  while (*s) {
    if (!isdigit(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <is_num+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <is_num+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_num+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_num+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_num+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_num+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_num+0x20>
jmp    114b <is_num+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_num(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int KMPSearch(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int index;
  char *test = "BBC ABCDAB ABCDABCDABDE364e35rfs-e296532=%342&";
  char *subString = "364e35";
  index = KMPSearch(subString, test);
  printf("index: %d\n", index);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"BBC ABCDAB ABCDABCDABDE364e35rfs-e296532=%342&\00"
@.str.1 = [7 x i8] c"364e35\00"
@.str.2 = [11 x i8] c"index: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %7
%11 = call i32 @KMPSearch(i8* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"BBC ABCDAB ABCDABCDABDE364e35rfs-e296532=%342&\00"
@.str.1 = [7 x i8] c"364e35\00"
@.str.2 = [11 x i8] c"index: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @KMPSearch(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
int fnmatch_with_rdiff_extension(const char *pattern, const char *name,
                                 int flags) {
  pattern = pattern;
  name = name;
  flags = flags;
  return -1;
}


x86 assembly (clang, -O0):
<fnmatch_with_rdiff_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fnmatch_with_rdiff_extension(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int geturand(void) {
  FILE *fp;
  int r;
  fp = fopen("/dev/urandom", "rb");
  if (!fp)
    return -1;
  r = fgetc(fp) & 0xff;
  fclose(fp);
  return r;
}


x86 assembly (clang, -O0):
<geturand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1166 <geturand+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <geturand+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geturand>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1163 <geturand+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fgetc@plt>
movzbl %al,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    1168 <geturand+0x38>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @geturand() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i32 -1, i32* %1
br label %15
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @fgetc(i32* %9)
%11 = and i32 %10, 255
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %3
store i32 %14, i32* %1
br label %15
15: ; preds = %8, %7
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @geturand() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @fgetc(i32* %1)
%5 = and i32 %4, 255
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
double *alloc_vector(size_t size) {
  return (double *)calloc(size, sizeof(double));
}


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

x86 assembly (clang, -O2):
<alloc_vector>:
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define double* @alloc_vector(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @calloc(i64 %3, i32 8)
%5 = inttoptr i64 %4 to double*
ret double* %5
}

LLVM IR (-O2):
define double* @alloc_vector(i64 %0) {
%2 = tail call i64 @calloc(i64 %0, i32 8)
%3 = inttoptr i64 %2 to double*
ret double* %3
}
void altos_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @altos_fini() {
ret void
}
/* Variables and functions */
int sleep(int);
int Sleep(int sleepMs) { return sleep(sleepMs / 1000); }


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define i32 @Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = call i32 @sleep(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i32 @sleep(i32 %2)
ret i32 %3
}
void movedown(int frame[][4]) { return; }


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

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

LLVM IR (-O0):
define void @movedown([4 x i32]* %0) {
%2 = alloca [4 x i32]*
store [4 x i32]* %0, [4 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @movedown([4 x i32]* nocapture %0) {
ret void
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
size_t printSquareIndex(size_t, char *);
void printSq(char *buff, int32_t sq) {
  int32_t idx = printSquareIndex(sq, buff);
  buff[idx] = '\0';
}


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

x86 assembly (clang, -O2):
<printSq>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <printSquareIndex@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printSq(i8* %0, i64 %1) {
%3 = tail call i64 @printSquareIndex(i64 %1, i8* %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
char *strchr(char *, int);
void crcut(char *s) {
  char *p;
  if ((p = strchr(s, 0x0a)) != NULL)
    *p = '\0';
  if ((p = strchr(s, 0x0d)) != NULL)
    *p = '\0';
}


x86 assembly (clang, -O0):
<crcut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <crcut+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1162 <crcut+0x52>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crcut>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <crcut+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <crcut+0x2b>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @crcut(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i32 10)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8 0, i8* %8
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %2
%11 = call i8* @strchr(i8* %10, i32 13)
store i8* %11, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i8*, i8** %3
store i8 0, i8* %14
br label %15
15: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
define void @crcut(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_peer_profile_delete_1_svc(char *, void *, struct svc_req *);
int _l2tp_peer_profile_delete_1(char **argp, void *result,
                                struct svc_req *rqstp) {
  return (l2tp_peer_profile_delete_1_svc(*argp, result, rqstp));
}


x86 assembly (clang, -O0):
<_l2tp_peer_profile_delete_1>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <l2tp_peer_profile_delete_1_svc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_l2tp_peer_profile_delete_1>:
mov    (%rdi),%rdi
jmp    1030 <l2tp_peer_profile_delete_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_profile_delete_1(i8** %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load %struct.svc_req*, %struct.svc_req** %6
%11 = call i32 @l2tp_peer_profile_delete_1_svc(i8* %8, i8* %9, %struct.svc_req* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_profile_delete_1(i8** nocapture %0, i8* %1, %struct.svc_req* %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @l2tp_peer_profile_delete_1_svc(i8* %4, i8* %1, %struct.svc_req* %2)
ret i32 %5
}
extern int isonum_731(p)
unsigned char *p;
{ return *p | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); }


x86 assembly (clang, -O0):
<isonum_731>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isonum_731(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ chmod(char *, int /*<<< orphan*/);
void c_chmod_(char *path, mode_t *mode, int lpath) { chmod(path, *mode); }


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

x86 assembly (clang, -O2):
<c_chmod_>:
mov    (%rsi),%esi
jmp    1030 <chmod@plt>

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

LLVM IR (-O2):
define void @c_chmod_(i8* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @chmod(i8* %0, i32 %4)
ret void
}
long int get_stat_ctime_ns(struct stat const *st) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i64 @get_stat_ctime_ns(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
ret i64 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i64 @get_stat_ctime_ns(%struct.stat* nocapture readnone %0) {
ret i64 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int volatile);
int main() {
  volatile uint64_t a = 3, b = 1, c = 0;
  b = a ^ 150000;
  c = b + 1;
  printf("%ld\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x249f0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x3,0x14(%rsp)
movl   $0x1,0xc(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x249f0,%eax
xor    0x14(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x10(%rsp)
mov    0xc(%rsp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 3, i32* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%6 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%7 = load volatile i32, i32* %1
%8 = xor i32 %7, 150000
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %3
%11 = load volatile i32, i32* %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void p0(int x) {
  bar(x);
  bar(x + 1);
}


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

x86 assembly (clang, -O2):
<p0>:
push   %rbx
mov    %edi,%ebx
call   1030 <bar@plt>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @p0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bar(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @bar(i32 %6)
ret void
}

LLVM IR (-O2):
define void @p0(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @bar(i32 %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_bitdepth_luma_8(const uint8_t *p) { return p[16] & 0x7; }


x86 assembly (clang, -O0):
<h265hvcc_get_bitdepth_luma_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_bitdepth_luma_8>:
mov    0x40(%rdi),%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_bitdepth_luma_8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 16
%5 = load i32, i32* %4
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265hvcc_get_bitdepth_luma_8(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 16
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
intmax_t imaxabs(intmax_t i) {
  if (i < 0)
    i = -i;
  return i;
}


x86 assembly (clang, -O0):
<imaxabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <imaxabs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imaxabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imaxabs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @imaxabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int get_operation_priority(char op) {
  if (op == '^')
    return 3;
  if (op == '*' || op == '/')
    return 2;
  if (op == '+' || op == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_operation_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1123 <get_operation_priority+0x23>
movl   $0x3,-0x4(%rbp)
jmp    1176 <get_operation_priority+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     113d <get_operation_priority+0x3d>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1149 <get_operation_priority+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1176 <get_operation_priority+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1163 <get_operation_priority+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    116f <get_operation_priority+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <get_operation_priority+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_operation_priority>:
lea    -0x2a(%rdi),%eax
cmp    $0x5,%al
ja     1127 <get_operation_priority+0x27>
movzbl %al,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%eax
ret
mov    $0x1,%eax
jmp    1132 <get_operation_priority+0x32>
mov    $0x3,%eax
cmp    $0x5e,%dil
jne    1133 <get_operation_priority+0x33>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_operation_priority(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 94
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 3, i32* %2
br label %27
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %17
16: ; preds = %12, %8
store i32 2, i32* %2
br label %27
17: ; preds = %12
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 45
br i1 %24, label %25, label %26
25: ; preds = %21, %17
store i32 1, i32* %2
br label %27
26: ; preds = %21
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25, %16, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_operation_priority(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %5
i8 47, label %3
i8 42, label %3
i8 45, label %4
i8 43, label %4
]
2: ; preds = %1
br label %5
3: ; preds = %1, %1
br label %5
4: ; preds = %1, %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %2 ], [ 3, %1 ], [ 2, %3 ], [ 1, %4 ]
ret i32 %6
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ def_shell_mode();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_def_shell_mode(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(def_shell_mode());
}


x86 assembly (clang, -O0):
<cmd_def_shell_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_def_shell_mode+0x27>
jmp    117f <cmd_def_shell_mode+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <def_shell_mode@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_def_shell_mode>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_def_shell_mode+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <def_shell_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_def_shell_mode(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @def_shell_mode()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_def_shell_mode(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @def_shell_mode()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ vec3_dot(float const *, float const *);
float vec3_length(const float v[3]) { return sqrtf(vec3_dot(v, v)); }


x86 assembly (clang, -O0):
<vec3_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_length>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
define float @vec3_length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @vec3_dot(float* %3, float* %4)
%6 = call float @sqrtf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @vec3_length(float* %0) {
%2 = tail call i32 @vec3_dot(float* %0, float* %0)
%3 = tail call float @sqrtf(i32 %2)
ret float %3
}
void PBISTStart(void) {
  (*((volatile unsigned long *)(0x400FB000 + 0x00000164))) = 0x21C;
}


x86 assembly (clang, -O0):
<PBISTStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb164,%eax
movq   $0x21c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PBISTStart>:
movq   $0x21c,0x400fb164
ret

LLVM IR (-O0):
define void @PBISTStart() {
store volatile i64 540, i64* inttoptr (i64 1074770276 to i64*)
ret void
}

LLVM IR (-O2):
define void @PBISTStart() {
store volatile i64 540, i64* inttoptr (i64 1074770276 to i64*)
ret void
}
void do_it() {
  char *p = 1;
  *p = 'a';
}


x86 assembly (clang, -O0):
<do_it>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_it>:
movb   $0x61,0x1
61
ret

LLVM IR (-O0):
define void @do_it() {
%1 = alloca i8*
store i8* inttoptr (i64 1 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
ret void
}

LLVM IR (-O2):
define void @do_it() {
store i8 97, i8* inttoptr (i64 1 to i8*)
ret void
}
void gtk_tree_sortable_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_sortable_get_type() {
ret void
}
int test_imm_59uint8_mem(unsigned char *val) {
  return ((*val) & (-0x59 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_59uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -89
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%i", &a);
  scanf("%i", &b);
  g(a, &c, b);
  printf("%d", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%edx
lea    0x4(%rsp),%rsi
call   1040 <g@plt>
mov    0x4(%rsp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @g(i32 %9, i32* %3, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int (*xCurrentTime)(TYPE_1__ *, double *);
  scalar_t__ pAppData;
};
typedef TYPE_1__ sqlite3_vfs;

/* Variables and functions */
int stub1(TYPE_1__ *, double *);
int memCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut) {
  return ((sqlite3_vfs *)((pVfs)->pAppData))
      ->xCurrentTime(((sqlite3_vfs *)((pVfs)->pAppData)), pTimeOut);
}


x86 assembly (clang, -O0):
<memCurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memCurrentTime>:
mov    0x8(%rdi),%rdi
mov    (%rdi),%rax
jmp    *%rax

LLVM IR (-O0):
%struct.TYPE_4__ = type { {}*, i64 }
define i32 @memCurrentTime(%struct.TYPE_4__* %0, double* %1) {
%3 = alloca %struct.TYPE_4__*
%4 = alloca double*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %3
store double* %1, double** %4
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = bitcast {}** %9 to i32 (%struct.TYPE_4__*, double*)**
%11 = load i32 (%struct.TYPE_4__*, double*)*, i32 (%struct.TYPE_4__*, double*)** %10
%12 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to %struct.TYPE_4__*
%16 = load double*, double** %4
%17 = call i32 %11(%struct.TYPE_4__* %15, double* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { {}*, i64 }
define i32 @memCurrentTime(%struct.TYPE_4__* nocapture %0, double* %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to %struct.TYPE_4__*
%6 = inttoptr i64 %4 to i32 (%struct.TYPE_4__*, double*)**
%7 = load i32 (%struct.TYPE_4__*, double*)*, i32 (%struct.TYPE_4__*, double*)** %6
%8 = tail call i32 %7(%struct.TYPE_4__* %5, double* %1)
ret i32 %8
}