xunge/DecIR huggingface dataset:
int f3(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f3(i32 returned %0) {
ret i32 %0
}
int comp_int(const void *a, const void *b) {
  if (*((int *)a) == *((int *)b))
    return 0;
  else if (*((int *)a) < *((int *)b))
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<comp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <comp_int+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <comp_int+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <comp_int+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <comp_int+0x54>
jmp    114d <comp_int+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long milk_file_get_size_f(FILE *file) {
  long result, old_pos;
  old_pos = ftell(file);
  fseek(file, 0, SEEK_END);
  result = ftell(file);
  fseek(file, old_pos, SEEK_SET);
  return result;
}


x86 assembly (clang, -O0):
<milk_file_get_size_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<milk_file_get_size_f>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @milk_file_get_size_f(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %3
%12 = load i32*, i32** %2
%13 = load i64, i64* %4
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @milk_file_get_size_f(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
volatile short *test_01(volatile short *x) {
  int xx = *x++;
  return x;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%ax
cwtl
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
movzwl (%rdi),%eax
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i16* @test_01(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i32 1
store i16* %5, i16** %2
%6 = load volatile i16, i16* %4
%7 = sext i16 %6 to i32
store i32 %7, i32* %3
%8 = load i16*, i16** %2
ret i16* %8
}

LLVM IR (-O2):
define i16* @test_01(i16* %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 1
%3 = load volatile i16, i16* %0
ret i16* %2
}
/* Type definitions */
struct addrinfo {
  struct addrinfo *ai_next;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void diet_freeaddrinfo(struct addrinfo *res) {
  while (res) {
    struct addrinfo *duh;
    duh = res;
    res = res->ai_next;
    free(duh);
  }
}


x86 assembly (clang, -O0):
<diet_freeaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <diet_freeaddrinfo+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    111c <diet_freeaddrinfo+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diet_freeaddrinfo>:
push   %rbx
test   %rdi,%rdi
je     1130 <diet_freeaddrinfo+0x20>
cs nopw 0x0(%rax,%rax,1)
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <diet_freeaddrinfo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.addrinfo = type { %struct.addrinfo* }
define void @diet_freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
%3 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
br label %4
4: ; preds = %7, %1
%5 = load %struct.addrinfo*, %struct.addrinfo** %2
%6 = icmp ne %struct.addrinfo* %5, null
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load %struct.addrinfo*, %struct.addrinfo** %2
store %struct.addrinfo* %8, %struct.addrinfo** %3
%9 = load %struct.addrinfo*, %struct.addrinfo** %2
%10 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 0
%11 = load %struct.addrinfo*, %struct.addrinfo** %10
store %struct.addrinfo* %11, %struct.addrinfo** %2
%12 = load %struct.addrinfo*, %struct.addrinfo** %3
%13 = call i32 @free(%struct.addrinfo* %12)
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { %struct.addrinfo* }
define void @diet_freeaddrinfo(%struct.addrinfo* %0) {
%2 = icmp eq %struct.addrinfo* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi %struct.addrinfo* [ %6, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 0
%6 = load %struct.addrinfo*, %struct.addrinfo** %5
%7 = tail call i32 @free(%struct.addrinfo* %4)
%8 = icmp eq %struct.addrinfo* %6, null
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *);
void go_syslog(int facility, const char *msg) { syslog(facility, "%s", msg); }


x86 assembly (clang, -O0):
<go_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_syslog>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @go_syslog(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 = load i8*, i8** %4
%7 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @go_syslog(i32 %0, i8* %1) {
%3 = tail call i32 @syslog(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_thread();
int /*<<< orphan*/ done_making_threads();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < 5; i++)
    create_thread();
  done_making_threads();
  printf("hello\n");
  printf("hello\n");
  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   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116c <main+0x3c>
mov    $0x0,%al
call   1050 <create_thread@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1040 <done_making_threads@plt>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_thread@plt>
xor    %eax,%eax
call   1050 <create_thread@plt>
xor    %eax,%eax
call   1050 <create_thread@plt>
xor    %eax,%eax
call   1050 <create_thread@plt>
xor    %eax,%eax
call   1050 <create_thread@plt>
xor    %eax,%eax
call   1040 <done_making_threads@plt>
lea    0xe9e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\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 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 (...) @create_thread()
br label %12
12: ; preds = %10
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
%16 = call i32 (...) @done_making_threads()
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.1 = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @create_thread()
%4 = tail call i32 (...) @create_thread()
%5 = tail call i32 (...) @create_thread()
%6 = tail call i32 (...) @create_thread()
%7 = tail call i32 (...) @create_thread()
%8 = tail call i32 (...) @done_making_threads()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.1, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int badvpn_set_nonblocking(int fd) {
  if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<badvpn_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    114b <badvpn_set_nonblocking+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <badvpn_set_nonblocking+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_set_nonblocking>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @badvpn_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @F_SETFL
%6 = load i32, i32* @O_NONBLOCK
%7 = call i64 @fcntl(i32 %4, i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @badvpn_set_nonblocking(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_NONBLOCK
%4 = tail call i64 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int ENOSYS;
int hwconfig(const char *opt) { return -ENOSYS; }


x86 assembly (clang, -O0):
<hwconfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwconfig>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @hwconfig(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @hwconfig(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
void *rtai_malloc_adr(int /*<<< orphan*/, unsigned long, unsigned long);
void *rtai_malloc(unsigned long name, unsigned long size) {
  return rtai_malloc_adr(0, name, size);
}


x86 assembly (clang, -O0):
<rtai_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <rtai_malloc_adr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtai_malloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <rtai_malloc_adr@plt>

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

LLVM IR (-O2):
define i8* @rtai_malloc(i64 %0, i64 %1) {
%3 = tail call i8* @rtai_malloc_adr(i32 0, i64 %0, i64 %1)
ret i8* %3
}
float inhg2hpa(float inhg) { return inhg * 33.8639f; }


x86 assembly (clang, -O0):
<inhg2hpa>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @inhg2hpa(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x4040EE9440000000
ret float %4
}

LLVM IR (-O2):
define float @inhg2hpa(float %0) {
%2 = fmul float %0, 0x4040EE9440000000
ret float %2
}
/* Variables and functions */
int INT_MAX;
int add_overflow(int a, int b) { return (INT_MAX - a) < b; }


x86 assembly (clang, -O0):
<add_overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
sub    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_overflow>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
sub    %edi,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
setl   %al
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @add_overflow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @INT_MAX
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @add_overflow(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = sub nsw i32 %3, %0
%5 = icmp slt i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned short foo(unsigned short x, unsigned short c) {
  unsigned char i = 0;
  for (i = 0; i < 8; i++) {
    x >>= 1;
    x &= c;
  }
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x0,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x8,%eax
jge    114d <foo+0x4d>
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x4(%rbp),%ecx
movzwl -0x2(%rbp),%eax
and    %ecx,%eax
mov    %ax,-0x2(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    111a <foo+0x1a>
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shr    $0x2,%edi
mov    %esi,%eax
shr    %eax
and    %eax,%edi
and    %esi,%edi
shr    $0x2,%edi
and    %esi,%eax
and    %eax,%edi
shr    $0x2,%edi
and    %eax,%edi
shr    $0x2,%edi
and    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i8
store i16 %0, i16* %3
store i16 %1, i16* %4
store i8 0, i8* %5
store i8 0, i8* %5
br label %6
6: ; preds = %21, %2
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 1
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %4
%16 = zext i16 %15 to i32
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = and i32 %18, %16
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
br label %21
21: ; preds = %10
%22 = load i8, i8* %5
%23 = add i8 %22, 1
store i8 %23, i8* %5
br label %6
24: ; preds = %6
%25 = load i16, i16* %3
ret i16 %25
}

LLVM IR (-O2):
define zeroext i16 @foo(i16 zeroext %0, i16 zeroext %1) {
%3 = lshr i16 %0, 2
%4 = lshr i16 %1, 1
%5 = and i16 %3, %4
%6 = and i16 %5, %1
%7 = lshr i16 %6, 2
%8 = lshr i16 %1, 1
%9 = and i16 %7, %8
%10 = and i16 %9, %1
%11 = lshr i16 %10, 2
%12 = lshr i16 %1, 1
%13 = and i16 %11, %12
%14 = and i16 %13, %1
%15 = lshr i16 %14, 2
%16 = lshr i16 %1, 1
%17 = and i16 %15, %16
%18 = and i16 %17, %1
ret i16 %18
}
char *dgettext(const char *domainname, const char *msgid) {
  return (char *)msgid;
}


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

x86 assembly (clang, -O2):
<dgettext>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @dgettext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @dgettext(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int /*<<< orphan*/ scanf(char *, unsigned long long *, unsigned long long *);
int main() {
  unsigned long long int L = 0, N = 0, temp, soma = 0;
  scanf(" %llu %llu", &L, &N);
  temp = L - (N - 1);
  soma = temp * temp + (N - 1);
  printf("%llu", soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xec3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
lea    -0x1(%rcx),%rdx
sub    %rdx,%rax
imul   %rax,%rax
lea    (%rax,%rcx,1),%rsi
add    $0xffffffffffffffff,%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c" %llu %llu\00"
@.str.1 = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store i64 0, i64* %3
store i64 0, i64* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = sub i64 %8, 1
%10 = sub i64 %7, %9
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = load i64, i64* %3
%15 = sub i64 %14, 1
%16 = add i64 %13, %15
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c" %llu %llu\00"
@.str.1 = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = add i64 %7, -1
%9 = sub i64 %6, %8
%10 = mul i64 %9, %9
%11 = add i64 %10, %8
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char const *);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void append(unsigned char *buf, int i, const char *str) {
  if (*buf)
    strcat((char *)buf, " ");
  sprintf((char *)buf + strlen((char *)buf), "%d%s", i, str);
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <append+0x30>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe7a(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1150 <append+0x20>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
lea    0xe9d(%rip),%rsi
mov    %ebp,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"%d%s\00"
define void @append(i8* %0, i32 %1, i8* %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @strlen(i8* %0)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
/* Variables and functions */
double const cpm_c(double const);
double exp(double const);
double thetas_c(const double s, const double qt) {
  return 298.15 * exp((s - (1.0 - qt) * 6864.8 - qt * 10513.6) / cpm_c(qt));
}


x86 assembly (clang, -O0):
<thetas_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xead(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe79(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cpm_c@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe3e(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thetas_c>:
push   %rax
movsd  0xed7(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  0xed3(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  0xecf(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <cpm_c@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0xea7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @thetas_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double 1.000000e+00, %6
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %8, double 6.864800e+03, double %5)
%10 = load double, double* %4
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 1.051360e+04, double %9)
%13 = load double, double* %4
%14 = call double @cpm_c(double %13)
%15 = fdiv double %12, %14
%16 = call double @exp(double %15)
%17 = fmul double 2.981500e+02, %16
ret double %17
}

LLVM IR (-O2):
define double @thetas_c(double %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 6.864800e+03, double %0)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.051360e+04, double %5)
%8 = tail call double @cpm_c(double %1)
%9 = fdiv double %7, %8
%10 = tail call double @exp(double %9)
%11 = fmul double %10, 2.981500e+02
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ *strptime(char const *, char *, struct tm *);
time_t str2date(const char *s) {
  struct tm date = {0};
  if (strptime(s, "%Y%m%d", &date) == NULL) {
    return 0;
  }
  return mktime(&date);
}


x86 assembly (clang, -O0):
<str2date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <strptime@plt>
cmp    $0x0,%rax
jne    1176 <str2date+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1182 <str2date+0x52>
lea    -0x18(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2date>:
push   %rax
movl   $0x0,(%rsp)
lea    0xed1(%rip),%rsi
mov    %rsp,%rdx
call   1040 <strptime@plt>
test   %rax,%rax
je     1146 <str2date+0x26>
mov    %rsp,%rdi
call   1030 <mktime@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
define i32 @str2date(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.tm
store i8* %0, i8** %3
%5 = bitcast %struct.tm* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32* @strptime(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 @mktime(%struct.tm* %4)
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
define i32 @str2date(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32* @strptime(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @mktime(%struct.tm* %2)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ f;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c = 'a';
  int i = 32;
  float f = 2.3;
  printf("Size of Character is %d\n", sizeof(c));
  printf("Size of Integer   is %d\n", sizeof(i));
  printf("Size of Float     is %d\n", sizeof(f));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movl   $0x20,-0x8(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Size of Character is %d\0A\00"
@.str.1 = [25 x i8] c"Size of Integer is %d\0A\00"
@.str.2 = [25 x i8] c"Size of Float is %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
store i8 97, i8* %1
store i32 32, i32* %2
store float 0x4002666660000000, float* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Size of Character is %d\0A\00"
@.str.1 = [25 x i8] c"Size of Integer is %d\0A\00"
@.str.2 = [25 x i8] c"Size of Float is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int tolower(char);
void convminus(char *str) {
  char *ch;
  for (ch = str; *ch != '\0'; ch++)
    printf("%c", tolower(*ch));
}


x86 assembly (clang, -O0):
<convminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <convminus+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <convminus+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convminus>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     115d <convminus+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <tolower@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <convminus+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @convminus(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @tolower(i8 signext %5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_constStaticSizedArray(int *);
void f_12(void) {
  int t[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  doStuff_constStaticSizedArray(t);
}


x86 assembly (clang, -O0):
<f_12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <doStuff_constStaticSizedArray@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_12>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <doStuff_constStaticSizedArray@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.f_12.t = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @f_12() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_constStaticSizedArray(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.f_12.t = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @f_12() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_constStaticSizedArray(i32* %3)
ret void
}
float dotProduct2f(float x1, float y1, float x2, float y2) {
  return x1 * x2 + y1 * y2;
}


x86 assembly (clang, -O0):
<dotProduct2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotProduct2f>:
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dotProduct2f(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = load float, float* %6
%12 = load float, float* %8
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %9, float %10, float %13)
ret float %14
}

LLVM IR (-O2):
define float @dotProduct2f(float %0, float %1, float %2, float %3) {
%5 = fmul float %1, %3
%6 = tail call float @llvm.fmuladd.f32(float %0, float %2, float %5)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int parse_ip_from_str(char *ip, u_int32_t *addr) {
  return inet_pton(AF_INET, ip, addr);
}


x86 assembly (clang, -O0):
<parse_ip_from_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ip_from_str>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <inet_pton@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @parse_ip_from_str(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i32 @inet_pton(i32 %5, i8* %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @parse_ip_from_str(i8* %0, i32* %1) {
%3 = load i32, i32* @AF_INET
%4 = tail call i32 @inet_pton(i32 %3, i8* %0, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TestAll(char const *);
void Rmalloc_test(const char *file) { TestAll(file); }


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

x86 assembly (clang, -O2):
<Rmalloc_test>:
jmp    1030 <TestAll@plt>

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

LLVM IR (-O2):
define void @Rmalloc_test(i8* %0) {
%2 = tail call i32 @TestAll(i8* %0)
ret void
}
void writel(unsigned int b, volatile void *addr) {
  *(volatile unsigned int *)addr = b;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @writel(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 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arg_passing_test2();
int main(void) {
  arg_passing_test2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @arg_passing_test2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void EssentialFunc1() {
  printf("Called essential function dll version %s\n", "1.00");
}


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

x86 assembly (clang, -O2):
<EssentialFunc1>:
lea    0xee9(%rip),%rdi
lea    0xf0c(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Called essential function dll version %s\0A\00"
@.str.1 = [5 x i8] c"1.00\00"
define void @EssentialFunc1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Called essential function dll version %s\0A\00"
@.str.1 = [5 x i8] c"1.00\00"
define void @EssentialFunc1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *__get_sys_hostname();
char *hostname(void) {
  static char *cx = 0;
  if (!cx)
    cx = __get_sys_hostname();
  return cx;
}


x86 assembly (clang, -O0):
<hostname>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1130 <hostname+0x20>
mov    $0x0,%al
call   1030 <__get_sys_hostname@plt>
mov    %rax,0x2f00(%rip)
mov    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hostname>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <hostname+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <__get_sys_hostname@plt>
mov    %rax,0x2f03(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@hostname.cx = internal global i8* null
define i8* @hostname() {
%1 = load i8*, i8** @hostname.cx
%2 = icmp ne i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i8* (...) @__get_sys_hostname()
store i8* %4, i8** @hostname.cx
br label %5
5: ; preds = %3, %0
%6 = load i8*, i8** @hostname.cx
ret i8* %6
}

LLVM IR (-O2):
@hostname.cx = internal unnamed_addr global i8* null
define i8* @hostname() {
%1 = load i8*, i8** @hostname.cx
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* (...) @__get_sys_hostname()
store i8* %4, i8** @hostname.cx
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
int main() {
  int pippo = 42;
  return pippo;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
int func1_in_obj() { return 0; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_benthic_project()
ret i32 0
}
void av_register_codec_parser() {}


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

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

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

LLVM IR (-O2):
define void @av_register_codec_parser() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ imprimemenu(int **, int);
int /*<<< orphan*/ imprimetab(int **);
int /*<<< orphan*/ inicio(int **);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int tab[3][3], vez = -1;
  srand(time(NULL));
  inicio(tab);
  imprimemenu(tab, vez);
  imprimetab(tab);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x34(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    -0x30(%rbp),%rdi
call   1060 <inicio@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <imprimemenu@plt>
lea    -0x30(%rbp),%rdi
call   1070 <imprimetab@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <inicio@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1030 <imprimemenu@plt>
mov    %rbx,%rdi
call   1070 <imprimetab@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i32]]
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%7 = bitcast [3 x i32]* %6 to i32**
%8 = call i32 @inicio(i32** %7)
%9 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%10 = bitcast [3 x i32]* %9 to i32**
%11 = load i32, i32* %3
%12 = call i32 @imprimemenu(i32** %10, i32 %11)
%13 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%14 = bitcast [3 x i32]* %13 to i32**
%15 = call i32 @imprimetab(i32** %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = bitcast [3 x [3 x i32]]* %1 to i32**
%6 = call i32 @inicio(i32** %5)
%7 = call i32 @imprimemenu(i32** %5, i32 -1)
%8 = call i32 @imprimetab(i32** %5)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
char *setlocale(category, name)
int category;
const char *name;
{
  (void)category;
  (void)name;
  return "C";
}


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeee(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
define i8* @setlocale(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 = load i8*, i8** %4
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
define i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}