xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strlen(char *);
int dbd_argv_len(char **in) {
  int len = 0;
  char **a;
  for (a = in; *a != NULL; a++) {
    len += strlen(*a) + 1;
  }
  return len + 1;
}


x86 assembly (clang, -O0):
<dbd_argv_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1167 <dbd_argv_len+0x57>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
add    $0x1,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <dbd_argv_len+0x1b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbd_argv_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114e <dbd_argv_len+0x3e>
add    $0x8,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
call   1030 <strlen@plt>
add    %eax,%r14d
add    $0x1,%r14d
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <dbd_argv_len+0x20>
add    $0x1,%r14d
jmp    1154 <dbd_argv_len+0x44>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @dbd_argv_len(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %13, %4 ], [ %2, %1 ]
%6 = phi i8** [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = tail call i64 @strlen(i8* %5)
%9 = trunc i64 %8 to i32
%10 = add i32 %7, 1
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8*, i8** %6, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = add i32 %11, 1
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 1, %1 ], [ %16, %15 ]
ret i32 %18
}
int test_imm_7Fuint8_reg(unsigned char val) {
  return ((val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Fuint8_reg>:
test   $0x7f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ ft_memalloc(size_t);
char *ft_strnew(size_t size) {
  char *str;
  if (!(str = (char *)ft_memalloc(size + 1)))
    return (NULL);
  return (str);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <ft_memalloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1144 <ft_strnew+0x34>
movq   $0x0,-0x8(%rbp)
jmp    114c <ft_strnew+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
add    $0x1,%rdi
jmp    1030 <ft_memalloc@plt>

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

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @ft_memalloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ test_rotate_long();
int /*<<< orphan*/ test_shift_byte();
void main() {
  test_rotate_long();
  test_shift_byte();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @test_rotate_long()
%2 = call i32 (...) @test_shift_byte()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_rotate_long()
%2 = tail call i32 (...) @test_shift_byte()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *string_date(char *buffer_time) {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer_time, 80, "%d_%m_%Y", timeinfo);
  return buffer_time;
}


x86 assembly (clang, -O0):
<string_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x50,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_date>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d_%m_%Y\00"
define i8* @string_date(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d_%m_%Y\00"
define i8* @string_date(i8* returned %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* %0
}
char *rewrite_url(char *url) {
  char *res = "";
  int tmp = 0;
  while (url[tmp] != '\0' && tmp != -1) {
    if (url[tmp] != '?') {
      res[tmp] = url[tmp];
    } else {
      tmp = -1;
    }
    tmp++;
  }
  return res;
}


x86 assembly (clang, -O0):
<rewrite_url>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113e <rewrite_url+0x3e>
cmpl   $0xffffffff,-0x14(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114e <rewrite_url+0x4e>
jmp    1193 <rewrite_url+0x93>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3f,%eax
je     117e <rewrite_url+0x7e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1185 <rewrite_url+0x85>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <rewrite_url+0x1a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @rewrite_url(i8* nocapture %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(int argc, char *argv[]) {
  int n = 5;
  int m = 7;
  printf("%d %d\n", n, m);
  swap(&n, &m);
  printf("%d %d\n", n, m);
  return EXIT_SUCCESS;
}


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   $0x5,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
movl   $0x7,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 7, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, i32 7)
%8 = call i32 @swap(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
unsigned long int_hash(void *vlocation) {
  int *location;
  location = (int *)vlocation;
  return (unsigned long)*location;
}


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

x86 assembly (clang, -O2):
<int_hash>:
movslq (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int write(int, unsigned char *, int);
int uart_write(int fd_uart, unsigned char *buf, int leng) {
  if (write(fd_uart, buf, leng) != leng) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uart_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     1146 <uart_write+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <uart_write+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @uart_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp ne i32 %4, %2
%6 = sext i1 %5 to i32
ret i32 %6
}
int find_root(int node, const int *ids) {
  while (ids[node] != node)
    node = ids[node];
  return node;
}


x86 assembly (clang, -O0):
<find_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
je     1132 <find_root+0x32>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    110b <find_root+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_root>:
mov    %edi,%eax
movslq %edi,%rcx
mov    (%rsi,%rcx,4),%edi
cmp    %ecx,%edi
jne    1100 <find_root>
ret

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

LLVM IR (-O2):
define i32 @find_root(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %4
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
void state_to_arr(int state, int base, int *arr, int arr_len) {
  for (int i = 0; i < arr_len; ++i) {
    int pos = arr_len - 1 - i;
    arr[pos] = (state % base);
    state /= base;
  }
}


x86 assembly (clang, -O0):
<state_to_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <state_to_arr+0x5c>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <state_to_arr+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_to_arr>:
test   %ecx,%ecx
jle    1123 <state_to_arr+0x23>
mov    %rdx,%r8
mov    %edi,%eax
mov    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    $0xffffffffffffffff,%rcx
movslq %ecx,%rdi
mov    %edx,(%r8,%rdi,4)
test   %rcx,%rcx
jne    1110 <state_to_arr+0x10>
ret

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

LLVM IR (-O2):
define void @state_to_arr(i32 %0, i32 %1, i32* nocapture writeonly %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %9
8: ; preds = %9, %4
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %19, %9 ]
%11 = phi i32 [ %0, %6 ], [ %18, %9 ]
%12 = trunc i64 %10 to i32
%13 = xor i32 %12, -1
%14 = add i32 %13, %3
%15 = srem i32 %11, %1
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i32, i32* %2, i64 %16
store i32 %15, i32* %17
%18 = sdiv i32 %11, %1
%19 = add nuw nsw i64 %10, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %8, label %9
}
/* Variables and functions */
int t(int);
void q(void) {
  int i = t(1);
  if (!i)
    i = t(1);
}


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <t@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113c <q+0x2c>
mov    $0x1,%edi
call   1030 <t@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q>:
push   %rax
mov    $0x1,%edi
call   1030 <t@plt>
test   %eax,%eax
je     1121 <q+0x11>
pop    %rax
ret
mov    $0x1,%edi
pop    %rax
jmp    1030 <t@plt>

LLVM IR (-O0):
define void @q() {
%1 = alloca i32
%2 = call i32 @t(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @t(i32 1)
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @q() {
%1 = tail call i32 @t(i32 1)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @t(i32 1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char const *, unsigned long long,
                            unsigned int, int);
char *xasprintf(const char *fmt, unsigned long long val, unsigned frac, int u) {
  static char buf[32];
  snprintf(buf, sizeof(buf), fmt, val, frac, u);
  buf[sizeof(buf) - 1] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<xasprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0x2f03(%rip),%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
movb   $0x0,0x2f11(%rip)
lea    0x2eeb(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xasprintf>:
push   %rbx
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f1c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
movb   $0x0,0x2f27(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@xasprintf.buf = internal global [32 x i8] zeroinitializer
define i8* @xasprintf(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 0), i32 32, i8* %9, i64 %10, i32 %11, i32 %12)
store i8 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 31)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@xasprintf.buf = internal global [32 x i8] zeroinitializer
define i8* @xasprintf(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 0), i32 32, i8* %0, i64 %1, i32 %2, i32 %3)
store i8 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 31)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @xasprintf.buf, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
unsigned long long timeval(const struct timeval *time) {
  return time->tv_sec * 1000000UL + time->tv_usec;
}


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

x86 assembly (clang, -O2):
<timeval>:
imul   $0xf4240,(%rdi),%rax
add    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timeval(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ sw_led_init();
int /*<<< orphan*/ sw_led_off();
int /*<<< orphan*/ sw_led_on();
int /*<<< orphan*/ sw_usleep(int);
int ledtest(int argc, char *argv[]) {
  sw_led_init();
  while (1) {
    sw_led_off();
    sw_usleep(1000 * 500);
    sw_led_on();
    sw_usleep(1000 * 500);
  }
  return 0;
}


x86 assembly (clang, -O0):
<ledtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sw_led_init@plt>
mov    $0x0,%al
call   1030 <sw_led_off@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
mov    $0x0,%al
call   1050 <sw_led_on@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
jmp    1156 <ledtest+0x16>

x86 assembly (clang, -O2):
<ledtest>:
push   %rax
xor    %eax,%eax
call   1040 <sw_led_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sw_led_off@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
xor    %eax,%eax
call   1050 <sw_led_on@plt>
mov    $0x7a120,%edi
call   1060 <sw_usleep@plt>
jmp    1150 <ledtest+0x10>

LLVM IR (-O0):
define i32 @ledtest(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @sw_led_init()
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @sw_led_off()
%8 = call i32 @sw_usleep(i32 500000)
%9 = call i32 (...) @sw_led_on()
%10 = call i32 @sw_usleep(i32 500000)
br label %6
}

LLVM IR (-O2):
define i32 @ledtest(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sw_led_init()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @sw_led_off()
%6 = tail call i32 @sw_usleep(i32 500000)
%7 = tail call i32 (...) @sw_led_on()
%8 = tail call i32 @sw_usleep(i32 500000)
br label %4
}
void cw1200_debug_tx_burst(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_tx_burst(%struct.cw1200_common* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char i2c_ReadStatREG(int /*<<< orphan*/);
unsigned char i2c0_ReadStatREG(void) { return i2c_ReadStatREG(0); }


x86 assembly (clang, -O0):
<i2c0_ReadStatREG>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <i2c_ReadStatREG@plt>
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @i2c0_ReadStatREG() {
%1 = call zeroext i8 @i2c_ReadStatREG(i32 0)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @i2c0_ReadStatREG() {
%1 = tail call zeroext i8 @i2c_ReadStatREG(i32 0)
ret i8 %1
}
int tm_isleapyear(int year) {
  return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
}


x86 assembly (clang, -O0):
<tm_isleapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <tm_isleapyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <tm_isleapyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_isleapyear>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1121 <tm_isleapyear+0x21>
xor    %eax,%eax
test   $0x3,%dil
je     1127 <tm_isleapyear+0x27>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @tm_isleapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @tm_isleapyear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void gloc_stdin() { exit(1); }


x86 assembly (clang, -O0):
<gloc_stdin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<gloc_stdin>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @gloc_stdin() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @gloc_stdin() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int f(int i, int j) {
  int k = i == -512;
  return k;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfffffe00,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xfffffe00,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -512
%4 = zext i1 %3 to i32
ret i32 %4
}
double __attribute__((no)) sub(double x, double y) {
  __asm__("");
  return x - y;
}


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

x86 assembly (clang, -O2):
<sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub(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 %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub(double %0, double %1) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef long uint32_t;
struct etimer {
  int dummy;
};

/* Variables and functions */
int timer_elapsed_milliseconds(struct etimer *, long);
bool timer_elapsed_seconds(struct etimer *t, uint32_t interval) {
  interval *= 1000L;
  return timer_elapsed_milliseconds(t, interval);
}


x86 assembly (clang, -O0):
<timer_elapsed_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <timer_elapsed_milliseconds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_seconds>:
imul   $0x3e8,%rsi,%rsi
jmp    1030 <timer_elapsed_milliseconds@plt>

LLVM IR (-O0):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_seconds(%struct.etimer* %0, i64 %1) {
%3 = alloca %struct.etimer*
%4 = alloca i64
store %struct.etimer* %0, %struct.etimer** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %4
%7 = load %struct.etimer*, %struct.etimer** %3
%8 = load i64, i64* %4
%9 = call i32 @timer_elapsed_milliseconds(%struct.etimer* %7, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_seconds(%struct.etimer* %0, i64 %1) {
%3 = mul nsw i64 %1, 1000
%4 = tail call i32 @timer_elapsed_milliseconds(%struct.etimer* %0, i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _debug_print_format(char *, char const *);
void _debug_print(const char *message) { _debug_print_format("%s", message); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_debug_print(i8* %0) {
%2 = tail call i32 @_debug_print_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
intptr_t Function1IntPtr(intptr_t x) { return x + 42; }


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

x86 assembly (clang, -O2):
<Function1IntPtr>:
lea    0x2a(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @Function1IntPtr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 42
ret i64 %4
}

LLVM IR (-O2):
define i64 @Function1IntPtr(i64 %0) {
%2 = add nsw i64 %0, 42
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ X509_SIG;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_PKCS8;
scalar_t__ d2i_X509_SIG;
X509_SIG *PEM_read_PKCS8(FILE *fp, X509_SIG **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_X509_SIG, PEM_STRING_PKCS8, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_PKCS8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_PKCS8>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%rdi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_X509_SIG = global i64 0
@PEM_STRING_PKCS8 = global i32 0
define i32* @PEM_read_PKCS8(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_X509_SIG
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_PKCS8
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_X509_SIG = global i64 0
@PEM_STRING_PKCS8 = global i32 0
define i32* @PEM_read_PKCS8(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_X509_SIG
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PKCS8
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_quaddobl_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(246, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_quaddobl_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf6,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_quaddobl_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xf6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_quaddobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 246, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_quaddobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 246, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int g_is_higher_f(float s, float d) {
  if (s > d) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<g_is_higher_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1129 <g_is_higher_f+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1130 <g_is_higher_f+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_higher_f>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @g_is_higher_f(float %0, float %1) {
%3 = fcmp ule float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void ICPrintIntValue(long long int intValue) {
  printf("Integer value = %lli\n", intValue);
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"Integer value = %lli\0A\00"
define void @ICPrintIntValue(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int f(int);
int main() { return f(42); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 42)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void sigterm_handler(int signum) {
  fprintf(stderr, "%s: [DEBUG]: Received SIGTERM\n", "path-activation");
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
lea    0xeed(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigterm_handler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xef8(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"%s: [DEBUG]: Received SIGTERM\0A\00"
@.str.1 = [16 x i8] c"path-activation\00"
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"%s: [DEBUG]: Received SIGTERM\0A\00"
@.str.1 = [16 x i8] c"path-activation\00"
define void @sigterm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int CMPRegionHeapToStack() {
  int x = 0;
  int *x1 = malloc(8);
  int *x2 = &x;
  clang_analyzer_eval(x1 == x2);
  free(x1);
  return x;
}


x86 assembly (clang, -O0):
<CMPRegionHeapToStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMPRegionHeapToStack>:
push   %rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1050 <clang_analyzer_eval@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CMPRegionHeapToStack() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 8)
store i32* %4, i32** %2
store i32* %1, i32** %3
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = icmp eq i32* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @CMPRegionHeapToStack() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @clang_analyzer_eval(i32 0)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
double rocket_fuel(double v) {
  double m_fuel = 0.0;
  return m_fuel;
}


x86 assembly (clang, -O0):
<rocket_fuel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rocket_fuel>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @rocket_fuel(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @rocket_fuel(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int STDOUT_FILENO;
int /*<<< orphan*/ errno;
int _isatty(int file) {
  if (STDOUT_FILENO == file)
    return 1;
  else {
    errno = EBADF;
    return 0;
  }
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0x2ee2(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1125 <_isatty+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113e <_isatty+0x3e>
mov    0x2ea4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea3(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
mov    0x2ee9(%rip),%rcx
mov    $0x1,%eax
cmp    %edi,(%rcx)
je     1124 <_isatty+0x24>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    0x2eb8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* @EBADF
store i32 %9, i32* @errno
store i32 0, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_isatty(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i32, i32* @EBADF
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
unsigned char test_01(int x) {
  if (x < 58 && x > 47)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3a,-0x8(%rbp)
jge    1124 <test_01+0x24>
cmpl   $0x2f,-0x8(%rbp)
jle    1124 <test_01+0x24>
movb   $0x1,-0x1(%rbp)
jmp    1128 <test_01+0x28>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @test_01(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 58
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %6
store i8 1, i8* %2
br label %11
10: ; preds = %6, %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @test_01(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_max_mask() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_max_mask"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_cvolume_max_mask\0A\00"
define i32 @pa_cvolume_max_mask() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_cvolume_max_mask\00"
define i32 @pa_cvolume_max_mask() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}