xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ timer;
typedef int /*<<< orphan*/ period;

/* Variables and functions */
int /*<<< orphan*/ pwm_enable_timer(int /*<<< orphan*/, int /*<<< orphan*/);
size_t usart_in_waiting();
int /*<<< orphan*/ usart_read(int /*<<< orphan*/ *, int);
void rpc_pwm_enable_timer(void) {
  uint8_t timer;
  uint16_t period;
  size_t argsize = sizeof(timer) + sizeof(period);
  while (usart_in_waiting() < argsize)
    ;
  usart_read(&timer, sizeof(timer));
  usart_read(&period, sizeof(period));
  pwm_enable_timer(timer, period);
}


x86 assembly (clang, -O0):
<rpc_pwm_enable_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x8,-0x10(%rbp)
mov    $0x0,%al
call   1050 <usart_in_waiting@plt>
cmp    -0x10(%rbp),%rax
jae    1156 <rpc_pwm_enable_timer+0x26>
jmp    1140 <rpc_pwm_enable_timer+0x10>
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1040 <usart_read@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <usart_read@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <pwm_enable_timer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_pwm_enable_timer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <usart_in_waiting@plt>
cmp    $0x8,%rax
jb     1140 <rpc_pwm_enable_timer+0x10>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1040 <usart_read@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <usart_read@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <pwm_enable_timer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rpc_pwm_enable_timer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i64 8, i64* %3
br label %4
4: ; preds = %8, %0
%5 = call i64 (...) @usart_in_waiting()
%6 = load i64, i64* %3
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 @usart_read(i32* %1, i32 4)
%11 = call i32 @usart_read(i32* %2, i32 4)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @pwm_enable_timer(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @rpc_pwm_enable_timer() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = tail call i64 (...) @usart_in_waiting()
%7 = icmp ult i64 %6, 8
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = call i32 @usart_read(i32* %1, i32 4)
%10 = call i32 @usart_read(i32* %2, i32 4)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @pwm_enable_timer(i32 %11, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int print(int /*<<< orphan*/, char *);
int main(void) { return print(max(3, -5), "Hello world"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0xfffffffb,%esi
call   1030 <max@plt>
mov    %eax,%edi
lea    0xeb9(%rip),%rsi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0xfffffffb,%esi
call   1030 <max@plt>
lea    0xec9(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @max(i32 3, i32 -5)
%3 = call i32 @print(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @max(i32 3, i32 -5)
%2 = tail call i32 @print(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void rpc_wake_lock_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @rpc_wake_lock_reset() {
ret void
}
int return_one(void) { return 1; }


x86 assembly (clang, -O0):
<return_one>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @return_one() {
ret i32 1
}

LLVM IR (-O2):
define i32 @return_one() {
ret i32 1
}
int ft_isupper(int c) { return (((c >= 65) && (c <= 90)) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int mut_rec2(int);
int mut_rec1(int n) {
  if (n == 0)
    return 0;
  return mut_rec2(n - 1);
}


x86 assembly (clang, -O0):
<mut_rec1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <mut_rec1+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <mut_rec1+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <mut_rec2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mut_rec1>:
test   %edi,%edi
je     111c <mut_rec1+0xc>
add    $0xffffffff,%edi
jmp    1030 <mut_rec2@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mut_rec1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @mut_rec2(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap16(int /*<<< orphan*/);
void bswap16s(uint16_t *s) { *s = bswap16(*s); }


x86 assembly (clang, -O0):
<bswap16s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <bswap16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap16s>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <bswap16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bswap16s(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @bswap16(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void VdsFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<VdsFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @VdsFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strlen(char const *);
int write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void printStr(const char *str) {
  int ret = write(STDOUT_FILENO, str, strlen(str));
  if (ret < 0)
    perror("write");
}


x86 assembly (clang, -O0):
<printStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1180 <printStr+0x50>
lea    0xe85(%rip),%rdi
call   1050 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
js     115b <printStr+0x2b>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9e(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <perror@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"write\00"
define void @printStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"write\00"
define void @printStr(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %2, i8* %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int size;
  size = 10;
  -2;
  ;
  printf("Size is %d\n", size);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
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    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Size is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Size is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pile_runTests();
int /*<<< orphan*/ trim_runTests();
int main(int argc, char **argv) {
  trim_runTests();
  pile_runTests();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @trim_runTests()
%7 = call i32 (...) @pile_runTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @trim_runTests()
%4 = tail call i32 (...) @pile_runTests()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%lu\n", sizeof(u_long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
int gethostname(char *name, size_t len) {
  const char const *my_fine_hostname = "l4re-host";
  strncpy(name, my_fine_hostname, len);
  name[len - 1] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"l4re-host\00"
define i32 @gethostname(i8* %0, i64 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %1)
%4 = add i64 %1, -1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyRuWinfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyRuWinfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyRuWinfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lib_ao() { printf("ao \n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"ao \0A\00"
define void @lib_ao() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"ao \00"
define void @lib_ao() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ morse_encode(char *, char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) {
  const char *src = "HEY DUDE";
  char buff[1024];
  puts(morse_encode(buff, src, 2, 0));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <morse_encode@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%rdi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <morse_encode@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"HEY DUDE\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @morse_encode(i8* %4, i8* %5, i32 2, i32 0)
%7 = call i32 @puts(i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"HEY DUDE\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @morse_encode(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%4 = call i32 @puts(i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_24() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 1;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_24>:
push   %rax
mov    $0xc40,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x2,%eax
mov    $0xc40,%edi
mov    %eax,%esi
mov    $0x2,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_24() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3136, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_24() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = xor i32 %1, 2
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %2, i32 2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l9(uint32_t x) { return (x << 9) | (x >> 23); }


x86 assembly (clang, -O0):
<rot32l9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x9,%eax
mov    -0x4(%rbp),%ecx
sar    $0x17,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l9>:
mov    %edi,%eax
shl    $0x9,%eax
sar    $0x17,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rot32l9(i32 %0) {
%2 = shl i32 %0, 9
%3 = ashr i32 %0, 23
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buflist_bar_item_update(int /*<<< orphan*/);
void buflist_config_change_buflist(const void *pointer, void *data,
                                   struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  buflist_bar_item_update(0);
}


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

x86 assembly (clang, -O2):
<buflist_config_change_buflist>:
xor    %edi,%edi
jmp    1030 <buflist_bar_item_update@plt>

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @buflist_config_change_buflist(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 @buflist_bar_item_update(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkTcpEvents();
int /*<<< orphan*/ checkUdpEvents();
int checkNetworkEvents(void) {
  checkTcpEvents();
  checkUdpEvents();
  return 0;
}


x86 assembly (clang, -O0):
<checkNetworkEvents>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <checkTcpEvents@plt>
mov    $0x0,%al
call   1030 <checkUdpEvents@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @checkNetworkEvents() {
%1 = call i32 (...) @checkTcpEvents()
%2 = call i32 (...) @checkUdpEvents()
ret i32 0
}

LLVM IR (-O2):
define i32 @checkNetworkEvents() {
%1 = tail call i32 (...) @checkTcpEvents()
%2 = tail call i32 (...) @checkUdpEvents()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CloseMonitor();
int /*<<< orphan*/ StartMonitor();
int main() {
  StartMonitor();
  CloseMonitor();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @StartMonitor()
%2 = tail call i32 (...) @CloseMonitor()
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double fabs(double a) {
  double b;
  double epsilon;
  epsilon = 1e-10;
  b = sqrt(a * a + epsilon * epsilon);
  return b;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
mulsd  %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <fabs+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 1.000000e-10, double* %4
%5 = load double, double* %2
%6 = load double, double* %2
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 0x3BC79CA10C924224)
%3 = tail call double @sqrt(double %2)
ret double %3
}
int BIN_CheckType(const char *dummy) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @BIN_CheckType(i8* nocapture readnone %0) {
ret i32 1
}
void SPI2_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI2_IRQHandler() {
ret void
}
double lerp(double t, double a, double b) { return a + (b - a) * t; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %4
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @lerp(double %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %1)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main(void) {
  printf("The page size for this system is %ld bytes.\n",
         sysconf(_SC_PAGESIZE));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"The page size for this system is %ld bytes.\0A\00"
@_SC_PAGESIZE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_PAGESIZE
%3 = call i32 @sysconf(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"The page size for this system is %ld bytes.\0A\00"
@_SC_PAGESIZE = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int testElfCreationError() { return 1; }


x86 assembly (clang, -O0):
<testElfCreationError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @testElfCreationError() {
ret i32 1
}

LLVM IR (-O2):
define i32 @testElfCreationError() {
ret i32 1
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_system_audio_mode_status(const struct cec_msg *msg,
                                      __u8 *sys_aud_status) {
  *sys_aud_status = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_system_audio_mode_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_system_audio_mode_status(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_system_audio_mode_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
size_t fwrite(void const *, int, size_t, void *);
size_t default_fwrite(const void *buf, size_t size, void *f) {
  return fwrite(buf, 1, size, f);
}


x86 assembly (clang, -O0):
<default_fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_fwrite>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i64 @default_fwrite(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i64 @fwrite(i8* %0, i32 1, i64 %1, i8* %2)
ret i64 %4
}
void max1363_ring_cleanup(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @max1363_ring_cleanup(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int bar();
int baz(int);
int foo(int, int);
int main(void) { return foo(1, 2) + bar() + baz(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <baz@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <bar@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x5,%edi
call   1030 <baz@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i32 2)
%3 = call i32 (...) @bar()
%4 = add nsw i32 %2, %3
%5 = call i32 @baz(i32 5)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
%2 = tail call i32 (...) @bar()
%3 = add nsw i32 %2, %1
%4 = tail call i32 @baz(i32 5)
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int connection(int, char *, char *);
void cliente(int sock, char username[]) {
  char buffer[1024];
  int flag = 1;
  while (flag) {
    flag = connection(sock, buffer, username);
  }
}


x86 assembly (clang, -O0):
<cliente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x414(%rbp)
cmpl   $0x0,-0x414(%rbp)
je     1157 <cliente+0x47>
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <connection@plt>
mov    %eax,-0x414(%rbp)
jmp    112c <cliente+0x1c>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cliente>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <connection@plt>
test   %eax,%eax
jne    1130 <cliente+0x20>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @cliente(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1024 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 1, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i32 @connection(i32 %11, i8* %12, i8* %13)
store i32 %14, i32* %6
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @cliente(i32 %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %2, %5
%6 = call i32 @connection(i32 %0, i8* %4, i8* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %5
8: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void test5() {
  int *ptr;
  ptr = (int *)malloc(sizeof(int));
  *ptr = 50;
  free(ptr);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x32,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movl   $0x32,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test5() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 50, i32* %4
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 50, i32* %2
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test1(int b) {
  printf("test1 param %d", b);
  b = b - 10;
  printf("test1 %d", b);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xfffffff6,%ebx
lea    0xee4(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"test1 param %d\00"
@.str.1 = [9 x i8] c"test1 %d\00"
define void @test1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, -10
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
void test_conj(_Complex double d) {
  if (conj(d) != conj(d))
    link_failure_conj();
}


x86 assembly (clang, -O0):
<test_conj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm3,%xmm2
setne  %al
setp   %cl
or     %cl,%al
ucomisd %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
or     %cl,%al
test   $0x1,%al
jne    118b <test_conj+0x7b>
jmp    1192 <test_conj+0x82>
mov    $0x0,%al
call   1030 <link_failure_conj@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_conj>:
ucomisd %xmm1,%xmm0
jp     1117 <test_conj+0x7>
ret
xor    %eax,%eax
jmp    1030 <link_failure_conj@plt>

LLVM IR (-O0):
define void @test_conj(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = fneg double %9
%11 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%12 = load double, double* %11
%13 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%14 = load double, double* %13
%15 = fneg double %14
%16 = fcmp une double %7, %12
%17 = fcmp une double %10, %15
%18 = or i1 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @link_failure_conj()
br label %21
21: ; preds = %19, %2
ret void
}

LLVM IR (-O2):
define void @test_conj(double %0, double %1) {
%3 = fcmp uno double %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @link_failure_conj()
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int __recvn(int, void *, size_t, int);
int Recvn2(int fd, void *buf, size_t count, int flags) {
  return __recvn(fd, buf, count, flags);
}


x86 assembly (clang, -O0):
<Recvn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__recvn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Recvn2>:
jmp    1030 <__recvn@plt>

LLVM IR (-O0):
define i32 @Recvn2(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @__recvn(i32 %9, i8* %10, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @Recvn2(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @__recvn(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int testBit_fun_uint16_t(uint16_t x, uint32_t i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_uint16_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_uint16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_uint16_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct Connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ database_close(struct Connection *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message, struct Connection *conn) {
  database_close(conn);
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <database_close@plt>
mov    0x2e80(%rip),%rax
cmpq   $0x0,(%rax)
je     1178 <die+0x38>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
jmp    1188 <die+0x48>
mov    -0x8(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <database_close@plt>
mov    0x2e8d(%rip),%rax
cmpq   $0x0,(%rax)
je     116b <die+0x2b>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.Connection = type { i32 }
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0, %struct.Connection* %1) {
%3 = alloca i8*
%4 = alloca %struct.Connection*
store i8* %0, i8** %3
store %struct.Connection* %1, %struct.Connection** %4
%5 = load %struct.Connection*, %struct.Connection** %4
%6 = call i32 @database_close(%struct.Connection* %5)
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @perror(i8* %10)
br label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %9
%16 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.Connection = type { i32 }
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0, %struct.Connection* %1) {
%3 = tail call i32 @database_close(%struct.Connection* %1)
%4 = load i64, i64* @errno
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* %0)
br label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %6
%11 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, unsigned char *, int);
void outbyte(unsigned char c) { _write(1, &c, 1); }


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @outbyte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @outbyte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_write(i32 1, i8* %2, i32 1)
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rol(uint64_t x, unsigned s) { return (x << s) | (x >> (64 - s)); }


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

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

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 64, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
float interpolate(float a, float b, float t) { return (1 - t) * a + t * b; }


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

x86 assembly (clang, -O2):
<interpolate>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @interpolate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fsub float 1.000000e+00, %7
%9 = load float, float* %4
%10 = load float, float* %6
%11 = load float, float* %5
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @interpolate(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %4, float %0, float %5)
ret float %6
}