xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void gpioCleanup(int gpio) {
  int fd;
  char buf[255];
  fd = open("/sys/class/gpio/unexport", O_WRONLY);
  sprintf(buf, "%d", gpio);
  write(fd, buf, 3);
  close(fd);
}


x86 assembly (clang, -O0):
<gpioCleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioCleanup>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ebx
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebp
lea    0xeae(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %ebp,%edi
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define void @gpioCleanup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [255 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%12 = call i32 @write(i32 %10, i8* %11, i32 3)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define void @gpioCleanup(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @O_WRONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = call i32 @write(i32 %5, i8* %3, i32 3)
%8 = tail call i32 @close(i32 %5)
ret void
}
void *test_anti_range_64(short n) {
  extern void *alloc_anti_range_64(short) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_64(n);
}


x86 assembly (clang, -O0):
<test_anti_range_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_64+0x30>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jg     1140 <test_anti_range_64+0x30>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_64>:
cmp    $0x1,%di
sbb    %eax,%eax
or     %eax,%edi
jmp    1030 <alloc_anti_range_64@plt>

LLVM IR (-O0):
define i8* @test_anti_range_64(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_64(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_64(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_64(i16 signext %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
bool strequal(char *a, char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<strequal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strequal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @strequal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int is_integer(s)
char *s;
{
  char *x;
  if (*s == '-')
    s++;
  for (x = s; isdigit(*s); s++)
    continue;
  return (s > x && !*s);
}


x86 assembly (clang, -O0):
<is_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1138 <is_integer+0x28>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     116b <is_integer+0x5b>
jmp    115a <is_integer+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <is_integer+0x30>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jbe    118d <is_integer+0x7d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_integer>:
xor    %ecx,%ecx
cmpb   $0x2d,(%rdi)
sete   %cl
lea    (%rdi,%rcx,1),%rax
add    %rdi,%rcx
add    $0xffffffffffffffff,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x1(%rcx),%edx
add    $0x1,%rcx
lea    -0x30(%rdx),%esi
cmp    $0xa,%esi
jb     1120 <is_integer+0x20>
cmp    %rax,%rcx
seta   %al
test   %dl,%dl
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %2
store i8* %12, i8** %3
br label %13
13: ; preds = %20, %11
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 @isdigit(i32 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %13
23: ; preds = %13
%24 = load i8*, i8** %2
%25 = load i8*, i8** %3
%26 = icmp ugt i8* %24, %25
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i8*, i8** %2
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
%31 = xor i1 %30, true
br label %32
32: ; preds = %27, %23
%33 = phi i1 [ false, %23 ], [ %31, %27 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_integer(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
br label %6
6: ; preds = %6, %1
%7 = phi i8* [ %5, %1 ], [ %12, %6 ]
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, -48
%11 = icmp ult i32 %10, 10
%12 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %11, label %6, label %13
13: ; preds = %6
%14 = icmp ugt i8* %7, %5
%15 = icmp eq i8 %8, 0
%16 = select i1 %14, i1 %15, i1 false
%17 = zext i1 %16 to i32
ret i32 %17
}
int M_add(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<M_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @M_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct fastbuf {
  int dummy;
};

/* Variables and functions */
int bget_utf8_32_repl(struct fastbuf *, int);
int bget_utf8_32(struct fastbuf *b) { return bget_utf8_32_repl(b, 0xfffc); }


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

x86 assembly (clang, -O2):
<bget_utf8_32>:
mov    $0xfffc,%esi
jmp    1030 <bget_utf8_32_repl@plt>

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

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
define i32 @bget_utf8_32(%struct.fastbuf* %0) {
%2 = tail call i32 @bget_utf8_32_repl(%struct.fastbuf* %0, i32 65532)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 3; i++) {
    static int a = 5;
    printf("%d", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1150 <main+0x40>
mov    0x2ef2(%rip),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char const *);
int sscanf(char const *, char *, int *);
int block_name_to_int(const char *str) {
  int b;
  int nread;
  nread = sscanf(str, "block%i", &b);
  if (nread != 1)
    fatal_error("Could not read block number from name \"%s\"", str);
  return b;
}


x86 assembly (clang, -O0):
<block_name_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     115d <block_name_to_int+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_name_to_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     114d <block_name_to_int+0x2d>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <fatal_error@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"block%i\00"
@.str.1 = [43 x i8] c"Could not read block number from name \22%s\22\00"
define i32 @block_name_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @fatal_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"block%i\00"
@.str.1 = [43 x i8] c"Could not read block number from name \22%s\22\00"
define i32 @block_name_to_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @fatal_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void rewind(FILE *stream) { fseek(stream, 0L, SEEK_SET); }


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t1(int /*<<< orphan*/);
int /*<<< orphan*/ t2(int /*<<< orphan*/);
int /*<<< orphan*/ t3(int /*<<< orphan*/);
int /*<<< orphan*/ t4(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ t5();
int /*<<< orphan*/ t6(int /*<<< orphan*/);
int main() {
  {
    t1(0);
    t2(0);
    t3(0);
    t4(0, 0);
    t5();
    t6(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <t1@plt>
xor    %edi,%edi
call   1060 <t2@plt>
xor    %edi,%edi
call   1040 <t3@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <t4@plt>
mov    $0x0,%al
call   1050 <t5@plt>
xor    %edi,%edi
call   1080 <t6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <t1@plt>
xor    %edi,%edi
call   1060 <t2@plt>
xor    %edi,%edi
call   1040 <t3@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <t4@plt>
xor    %eax,%eax
call   1050 <t5@plt>
xor    %edi,%edi
call   1080 <t6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @t1(i32 0)
%3 = call i32 @t2(i32 0)
%4 = call i32 @t3(i32 0)
%5 = call i32 @t4(i32 0, i32 0)
%6 = call i32 (...) @t5()
%7 = call i32 @t6(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t1(i32 0)
%2 = tail call i32 @t2(i32 0)
%3 = tail call i32 @t3(i32 0)
%4 = tail call i32 @t4(i32 0, i32 0)
%5 = tail call i32 (...) @t5()
%6 = tail call i32 @t6(i32 0)
ret i32 0
}
/* Variables and functions */
int printf(char *, void *);
int print_pointer(void *v) { return printf("%p", v); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @print_pointer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int bitAnd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 60;
  int b = 13;
  int c = bitAnd(a, b);
  printf("%d&%d should be %d\n", a, b, 12);
  printf("bitAnd(%d, %d) -> %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3c,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <bitAnd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaf(%rip),%rdi
mov    $0xc,%ecx
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3c,%edi
mov    $0xd,%esi
call   1030 <bitAnd@plt>
mov    %eax,%ebx
lea    0xec7(%rip),%rdi
mov    $0x3c,%esi
mov    $0xd,%edx
mov    $0xc,%ecx
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x3c,%esi
mov    $0xd,%edx
mov    %ebx,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d&%d should be %d\0A\00"
@.str.1 = [22 x i8] c"bitAnd(%d, %d) -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 60, i32* %1
store i32 13, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @bitAnd(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 12)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d&%d should be %d\0A\00"
@.str.1 = [22 x i8] c"bitAnd(%d, %d) -> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitAnd(i32 60, i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 60, i32 13, i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 60, i32 13, i32 %1)
ret i32 0
}
__attribute__((const)) int utf8_chain(const char c) {
  return (c & 0xC0) == 0x80;
}


x86 assembly (clang, -O0):
<utf8_chain>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_chain>:
and    $0xc0,%dil
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @utf8_chain(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 192
%6 = icmp eq i32 %5, 128
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @utf8_chain(i8 signext %0) {
%2 = and i8 %0, -64
%3 = icmp eq i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteByte(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketTXBufferSize(uint8_t socket, uint8_t size) {
  wiznetRegWriteByte(socket, (0x0000 + 0x001F), size);
}


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

x86 assembly (clang, -O2):
<wiznetSetSocketTXBufferSize>:
mov    %esi,%edx
mov    $0x1f,%esi
jmp    1030 <wiznetRegWriteByte@plt>

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

LLVM IR (-O2):
define void @wiznetSetSocketTXBufferSize(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteByte(i32 %0, i32 31, i32 %1)
ret void
}
/* Variables and functions */
float coshf(float);
void __hv_cosh_f(float bIn, float *bOut) { *bOut = coshf(bIn); }


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

x86 assembly (clang, -O2):
<__hv_cosh_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <coshf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_cosh_f(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = call float @coshf(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @__hv_cosh_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @coshf(float %0)
store float %3, float* %1
ret void
}
unsigned xrop3_162_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_162_1_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)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_162_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
not    %ecx
mov    %edi,%eax
xor    $0xff,%eax
or     %esi,%eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_162_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_162_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = xor i32 %3, 255
%8 = or i32 %7, %5
%9 = and i32 %8, %6
%10 = or i32 %9, %3
ret i32 %10
}
float FP32ToFloat(const char *fp32Pixel) { return *((float *)fp32Pixel); }


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

x86 assembly (clang, -O2):
<FP32ToFloat>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @FP32ToFloat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @FP32ToFloat(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
                            int (*getfrag)(void *from, char *to, int offset,
                                           int len, int odd,
                                           struct sk_buff *skb),
                            void *from, int length) {
  return 0;
}


x86 assembly (clang, -O0):
<skb_append_datato_frags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sock = type opaque
%struct.sk_buff = type opaque
define i32 @skb_append_datato_frags(%struct.sock* %0, %struct.sk_buff* %1, i32 (i8*, i8*, i32, i32, i32, %struct.sk_buff*)* %2, i8* %3, i32 %4) {
%6 = alloca %struct.sock*
%7 = alloca %struct.sk_buff*
%8 = alloca i32 (i8*, i8*, i32, i32, i32, %struct.sk_buff*)*
%9 = alloca i8*
%10 = alloca i32
store %struct.sock* %0, %struct.sock** %6
store %struct.sk_buff* %1, %struct.sk_buff** %7
store i32 (i8*, i8*, i32, i32, i32, %struct.sk_buff*)* %2, i32 (i8*, i8*, i32, i32, i32, %struct.sk_buff*)** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.sock = type opaque
%struct.sk_buff = type opaque
define i32 @skb_append_datato_frags(%struct.sock* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1, i32 (i8*, i8*, i32, i32, i32, %struct.sk_buff*)* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __remap_file_pages(void *start, size_t size, int prot, size_t pgoff,
                       int flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__remap_file_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__remap_file_pages>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__remap_file_pages(i8* %0, i64 %1, i32 %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__remap_file_pages(i8* nocapture readnone %0, i64 %1, i32 %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printArray(int *_array, int _size) {
  int i;
  for (i = 0; i < _size; i++) {
    printf("Numero %d: %d\n", i, _array[i]);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printArray+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printArray+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Numero %d: %d\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Numero %d: %d\0A\00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
unsigned int align_formula(unsigned int size, unsigned int align) {
  return (size + align - 1) & -align;
}


x86 assembly (clang, -O0):
<align_formula>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_formula>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @align_formula(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @align_formula(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
int isBridgedBy9(char *s, int p1, int p2) {
  int i;
  for (i = p1 + 1; i < p2; i++) {
    if (s[i] != '9') {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isBridgedBy9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1157 <isBridgedBy9+0x57>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
je     1144 <isBridgedBy9+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115e <isBridgedBy9+0x5e>
jmp    1149 <isBridgedBy9+0x49>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <isBridgedBy9+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBridgedBy9>:
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
cmp    %rcx,%rax
jge    1122 <isBridgedBy9+0x22>
cmpb   $0x39,(%rdi,%rax,1)
lea    0x1(%rax),%rax
je     1110 <isBridgedBy9+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isBridgedBy9(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
br label %6
6: ; preds = %10, %3
%7 = phi i64 [ %8, %10 ], [ %4, %3 ]
%8 = add nsw i64 %7, 1
%9 = icmp slt i64 %8, %5
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 57
br i1 %13, label %6, label %14
14: ; preds = %6, %10
%15 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ flush(size_t *);
size_t rdtsc();
size_t flushandreload(size_t *addr) {
  size_t time = rdtsc();
  flush(addr);
  size_t delta = rdtsc() - time;
  flush(addr);
  return delta;
}


x86 assembly (clang, -O0):
<flushandreload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <flush@plt>
mov    $0x0,%al
call   1040 <rdtsc@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <flush@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushandreload>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <flush@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
sub    %r14,%rbx
mov    %r15,%rdi
call   1030 <flush@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @flushandreload(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = call i64 (...) @rdtsc()
store i64 %5, i64* %3
%6 = load i64*, i64** %2
%7 = call i32 @flush(i64* %6)
%8 = call i64 (...) @rdtsc()
%9 = load i64, i64* %3
%10 = sub i64 %8, %9
store i64 %10, i64* %4
%11 = load i64*, i64** %2
%12 = call i32 @flush(i64* %11)
%13 = load i64, i64* %4
ret i64 %13
}

LLVM IR (-O2):
define i64 @flushandreload(i64* %0) {
%2 = tail call i64 (...) @rdtsc()
%3 = tail call i32 @flush(i64* %0)
%4 = tail call i64 (...) @rdtsc()
%5 = sub i64 %4, %2
%6 = tail call i32 @flush(i64* %0)
ret i64 %5
}
/* Variables and functions */
int cpu_num_cores();
int getCPUCores() { return cpu_num_cores(); }


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

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

LLVM IR (-O0):
define i32 @getCPUCores() {
%1 = call i32 (...) @cpu_num_cores()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getCPUCores() {
%1 = tail call i32 (...) @cpu_num_cores()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fcloseall();
int getpid();
int /*<<< orphan*/ printf(char *, int);
void closingSender() {
  printf("\nClosing Sender... '%d' ", getpid());
  fcloseall();
  exit(2);
}


x86 assembly (clang, -O0):
<closingSender>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fcloseall@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<closingSender>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <fcloseall@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AClosing Sender... '%d' \00"
define void @closingSender() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @fcloseall()
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AClosing Sender... '%d' \00"
define void @closingSender() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fcloseall()
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SDIO_DriverIRQHandler();
__attribute__((weak)) void SDIO_IRQHandler(void) { SDIO_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SDIO_IRQHandler() {
%1 = call i32 (...) @SDIO_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SDIO_IRQHandler() {
%1 = tail call i32 (...) @SDIO_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main(int argc, const char *argv[]) {
  int a = 3;
  printf("%d", sum(a << a, a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%ecx
shl    %cl,%edi
mov    -0x14(%rbp),%esi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
mov    $0x3,%esi
call   1040 <sum@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 24, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
main() {
  int a = 0, *b = (void *)0, c = 0;
  a = b;
  if (a = c)
    ;
  while (a = c)
    ;
  do
    ;
  while (a = c);
  for (; a = c;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     113c <main+0x3c>
jmp    113c <main+0x3c>
jmp    1141 <main+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1155 <main+0x55>
jmp    1141 <main+0x41>
jmp    115a <main+0x5a>
jmp    115f <main+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    115a <main+0x5a>
jmp    1173 <main+0x73>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1187 <main+0x87>
jmp    1173 <main+0x73>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fspath_get_size(const char path[]) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_get_size(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int rand();
int rand_for_x(int x, int x_end) { return x + rand() % (x_end - x); }


x86 assembly (clang, -O0):
<rand_for_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_for_x>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_for_x(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %6, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_for_x(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int est_6mem_for_8str(int len) { return 1 + (int)(0.75 * len); }


x86 assembly (clang, -O0):
<est_6mem_for_8str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<est_6mem_for_8str>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @est_6mem_for_8str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 7.500000e-01, %4
%6 = fptosi double %5 to i32
%7 = add nsw i32 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @est_6mem_for_8str(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.500000e-01
%4 = fptosi double %3 to i32
%5 = add nsw i32 %4, 1
ret i32 %5
}
int reset_tty() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @reset_tty() {
ret i32 0
}
/* Variables and functions */
int func2(void) {
  char c;
  int *p;
  p = &c;
  return *p;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func2() {
%1 = alloca i8
%2 = alloca i32*
%3 = bitcast i8* %1 to i32*
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showException4WDump(int);
void _chkinst_callback() {
  VDP_init();
  VDP_drawText("CHK INSTRUCTION EXCEPTION !", 5, 10);
  showException4WDump(12);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_chkinst_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
call   1050 <VDP_drawText@plt>
mov    $0xc,%edi
call   1040 <showException4WDump@plt>
jmp    115b <_chkinst_callback+0x2b>

x86 assembly (clang, -O2):
<_chkinst_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
call   1050 <VDP_drawText@plt>
mov    $0xc,%edi
call   1040 <showException4WDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_chkinst_callback+0x30>

LLVM IR (-O0):
@.str = [28 x i8] c"CHK INSTRUCTION EXCEPTION !\00"
define void @_chkinst_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 5, i32 10)
%3 = call i32 @showException4WDump(i32 12)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [28 x i8] c"CHK INSTRUCTION EXCEPTION !\00"
define void @_chkinst_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 5, i32 10)
%3 = tail call i32 @showException4WDump(i32 12)
br label %4
4: ; preds = %0, %4
br label %4
}
int maxi(int x, int y) {
  if (x >= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <maxi+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <maxi+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxi>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}