xunge/DecIR huggingface dataset:
/* Variables and functions */
long simple_strtoul(char const *, char **, unsigned int);
long simple_strtol(const char *cp, char **endp, unsigned int base) {
  if (*cp == '-')
    return -simple_strtoul(cp + 1, endp, base);
  return simple_strtoul(cp, endp, base);
}


x86 assembly (clang, -O0):
<simple_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1158 <simple_strtol+0x48>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoul@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <simple_strtol+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtol>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <simple_strtol+0x14>
add    $0x1,%rdi
call   1030 <simple_strtoul@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <simple_strtoul@plt>

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

LLVM IR (-O2):
define i64 @simple_strtol(i8* %0, i8** %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @simple_strtoul(i8* %7, i8** %1, i32 %2)
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %3
%11 = tail call i64 @simple_strtoul(i8* %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
size_t round_power2(size_t val) {
  size_t i = 1;
  while (i < val)
    i <<= 1;
  return i;
}


x86 assembly (clang, -O0):
<round_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <round_power2+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <round_power2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_power2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <round_power2+0x10>
ret

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

LLVM IR (-O2):
define i64 @round_power2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 0));
  free((char *)(m + nrl - 0));
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
lea    0x0(,%rcx,4),%rax
add    (%rdi,%rsi,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = bitcast i32* %8 to i8*
%10 = tail call i32 @free(i8* %9)
%11 = bitcast i32** %6 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
void ReInitFrameCap(void) {}


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

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

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

LLVM IR (-O2):
define void @ReInitFrameCap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, unsigned int);
void bitstream_write_string(char **b, const char *string, unsigned int len) {
  strncpy((char *)*b, string, len);
  *b += len;
}


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

x86 assembly (clang, -O2):
<bitstream_write_string>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1030 <strncpy@plt>
mov    %ebx,%eax
add    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bitstream_write_string(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @strncpy(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %13
ret void
}

LLVM IR (-O2):
define void @bitstream_write_string(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strncpy(i8* %4, i8* %1, i32 %2)
%6 = load i8*, i8** %0
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
scalar_t__ spin_red(int);
int get_num_wins(int num_spins) {
  int wins = 0;
  int spin;
  int my_bet = 10;
  for (spin = 0; spin < num_spins; spin++) {
    if (spin_red(my_bet) > 0) {
      wins++;
    }
  }
  return wins;
}


x86 assembly (clang, -O0):
<get_num_wins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116a <get_num_wins+0x5a>
mov    -0x10(%rbp),%edi
call   1030 <spin_red@plt>
cmp    $0x0,%rax
jle    1157 <get_num_wins+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <get_num_wins+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <get_num_wins+0x20>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_wins>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    113b <get_num_wins+0x2b>
mov    %edi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <spin_red@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
add    %ecx,%ebx
add    $0xffffffff,%ebp
jne    1120 <get_num_wins+0x10>
jmp    113d <get_num_wins+0x2d>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_num_wins(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 10, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = call i64 @spin_red(i32 %11)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_num_wins(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = tail call i64 @spin_red(i32 10)
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int flushinp();
int wrap_flushinp(void) { return flushinp(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_flushinp() {
%1 = tail call i32 (...) @flushinp()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ DIST_POINT_NAME;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ DIST_POINT_NAME_it;
DIST_POINT_NAME *DIST_POINT_NAME_new(void) {
  return (DIST_POINT_NAME *)ASN1_item_new(&DIST_POINT_NAME_it);
}


x86 assembly (clang, -O0):
<DIST_POINT_NAME_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIST_POINT_NAME_new>:
mov    0x2ed9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@DIST_POINT_NAME_it = global i32 0
define i32* @DIST_POINT_NAME_new() {
%1 = call i64 @ASN1_item_new(i32* @DIST_POINT_NAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@DIST_POINT_NAME_it = global i32 0
define i32* @DIST_POINT_NAME_new() {
%1 = tail call i64 @ASN1_item_new(i32* @DIST_POINT_NAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ hexa_line(int);
void optimain_one(int n) {
  hexa_line(n);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<optimain_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hexa_line@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimain_one>:
push   %rax
call   1040 <hexa_line@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @optimain_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @hexa_line(i32 %3)
%5 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @optimain_one(i32 %0) {
%2 = tail call i32 @hexa_line(i32 %0)
%3 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: verifyconf filename\n");
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: verifyconf filename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int arrayLength(void **arr) {
  if (arr == NULL)
    return 0;
  unsigned int i = -1;
  while (arr[++i] != NULL)
    ;
  return i;
}


x86 assembly (clang, -O0):
<arrayLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <arrayLength+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114b <arrayLength+0x4b>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %ecx,%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1145 <arrayLength+0x45>
jmp    1126 <arrayLength+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayLength>:
test   %rdi,%rdi
je     111b <arrayLength+0x1b>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <arrayLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @arrayLength(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ -1, %1 ]
%5 = add i32 %4, 1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %5, %3 ]
ret i32 %11
}
void TA1_N_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<TA1_N_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TA1_N_IRQHandler+0x9>
jmp    1109 <TA1_N_IRQHandler+0x9>

x86 assembly (clang, -O2):
<TA1_N_IRQHandler>:
jmp    1100 <TA1_N_IRQHandler>

LLVM IR (-O0):
define void @TA1_N_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TA1_N_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void foo(int *a, int *b, int *c) {}


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

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

LLVM IR (-O0):
define void @foo(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *tfm_memcpy(void *dest, const void *src, size_t num) {
  return (memcpy(dest, src, num));
}


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

x86 assembly (clang, -O2):
<tfm_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @tfm_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
void f() {
  int i __asm__("%eax");
  __asm__ volatile("" : "=a"(i));
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 asm sideeffect "", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
int /*<<< orphan*/ printf(char *, double);
void tempo(clock_t tempoInicial, clock_t tempoFinal) {
  double tempoGasto;
  printf("%lf\n", ((double)(tempoFinal - tempoInicial) / CLOCKS_PER_SEC));
}


x86 assembly (clang, -O0):
<tempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempo>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @tempo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @tempo(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightStatusHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void FlightStatusUpdated() { UAVObjUpdated(FlightStatusHandle()); }


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

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

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

LLVM IR (-O2):
define void @FlightStatusUpdated() {
%1 = tail call i32 (...) @FlightStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long atol(int /*<<< orphan*/);
int /*<<< orphan*/ findLine(int /*<<< orphan*/ *, char *);
long parseid(FILE *plr_file) { return atol(findLine(plr_file, "Id  :")); }


x86 assembly (clang, -O0):
<parseid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
call   1030 <atol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseid>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Id :\00"
define i64 @parseid(i32* %0) {
%2 = tail call i32 @findLine(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @atol(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M123_f(char *s) {
  debug("M123_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M123_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M123_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M123_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M123_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M123_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M123_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void umocktypes_free_double(double *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_double(double* nocapture %0) {
ret void
}
/* Type definitions */
struct fdmi_queue {
  int dummy;
};

/* Variables and functions */
void *fdmi_queue_deq(struct fdmi_queue *);
int /*<<< orphan*/ fdmi_queue_lock(struct fdmi_queue *);
int /*<<< orphan*/ fdmi_queue_unlock(struct fdmi_queue *);
void *fdmi_queue_lock_deq(struct fdmi_queue *q) {
  void *data;
  fdmi_queue_lock(q);
  data = fdmi_queue_deq(q);
  fdmi_queue_unlock(q);
  return data;
}


x86 assembly (clang, -O0):
<fdmi_queue_lock_deq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fdmi_queue_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fdmi_queue_deq@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fdmi_queue_unlock@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_queue_lock_deq>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <fdmi_queue_lock@plt>
mov    %rbx,%rdi
call   1030 <fdmi_queue_deq@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fdmi_queue_unlock@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.fdmi_queue = type { i32 }
define i8* @fdmi_queue_lock_deq(%struct.fdmi_queue* %0) {
%2 = alloca %struct.fdmi_queue*
%3 = alloca i8*
store %struct.fdmi_queue* %0, %struct.fdmi_queue** %2
%4 = load %struct.fdmi_queue*, %struct.fdmi_queue** %2
%5 = call i32 @fdmi_queue_lock(%struct.fdmi_queue* %4)
%6 = load %struct.fdmi_queue*, %struct.fdmi_queue** %2
%7 = call i8* @fdmi_queue_deq(%struct.fdmi_queue* %6)
store i8* %7, i8** %3
%8 = load %struct.fdmi_queue*, %struct.fdmi_queue** %2
%9 = call i32 @fdmi_queue_unlock(%struct.fdmi_queue* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
%struct.fdmi_queue = type { i32 }
define i8* @fdmi_queue_lock_deq(%struct.fdmi_queue* %0) {
%2 = tail call i32 @fdmi_queue_lock(%struct.fdmi_queue* %0)
%3 = tail call i8* @fdmi_queue_deq(%struct.fdmi_queue* %0)
%4 = tail call i32 @fdmi_queue_unlock(%struct.fdmi_queue* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putchar(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<ft_putchar>:
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):
<ft_putchar>:
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 @ft_putchar(i8 signext %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 @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
char *sexpcode_unescape(char *content) {
  char *start = content;
  do {
    if (*content == 1)
      *content = '{';
    if (*content == 2)
      *content = '}';
  } while (*content++);
  return start;
}


x86 assembly (clang, -O0):
<sexpcode_unescape>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1127 <sexpcode_unescape+0x27>
mov    -0x8(%rbp),%rax
movb   $0x7b,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
jne    113e <sexpcode_unescape+0x3e>
mov    -0x8(%rbp),%rax
movb   $0x7d,(%rax)
jmp    1143 <sexpcode_unescape+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1110 <sexpcode_unescape+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sexpcode_unescape>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    111d <sexpcode_unescape+0x1d>
nopl   0x0(%rax,%rax,1)
mov    %sil,(%rcx)
mov    $0x7b,%dl
add    $0x1,%rcx
test   %dl,%dl
je     1132 <sexpcode_unescape+0x32>
movzbl (%rcx),%edx
mov    $0x7b,%sil
cmp    $0x1,%dl
je     1110 <sexpcode_unescape+0x10>
cmp    $0x2,%dl
jne    1115 <sexpcode_unescape+0x15>
mov    $0x7d,%sil
jmp    1110 <sexpcode_unescape+0x10>
ret

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

LLVM IR (-O2):
define i8* @sexpcode_unescape(i8* returned %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 1, label %6
i8 2, label %5
]
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = phi i8 [ 125, %5 ], [ 123, %2 ]
store i8 %7, i8* %3
br label %8
8: ; preds = %6, %2
%9 = phi i8 [ %4, %2 ], [ 123, %6 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %2
12: ; preds = %8
ret i8* %0
}
unsigned int cpuid_edx(unsigned value) {
  unsigned int res, dummy;
  asm volatile("cpuid" : "=d"(res), "=a"(dummy) : "a"(value) : "ebx", "ecx");
  return res;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %edx,-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm sideeffect "cpuid", "={dx},={ax},{ax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "cpuid", "={dx},={ax},{ax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
ret i32 %3
}
long int longint_ignoring_unsignedlonglongint(long int x,
                                              unsigned long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<longint_ignoring_unsignedlonglongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @longint_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int printf(char *, ...);
int main() {
  printf(" e zbor dolg %d bukvi.\n", printf("Makedonija"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c" e zbor dolg %d bukvi.\0A\00"
@.str.1 = [11 x i8] c"Makedonija\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c" e zbor dolg %d bukvi.\0A\00"
@.str.1 = [11 x i8] c"Makedonija\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int cwbit(int *datastream, int i) {
  int resultant = 0;
  if (datastream[(i / 8)] & (0x80 >> (i % 8))) {
    resultant = 1;
  }
  return resultant;
}


x86 assembly (clang, -O0):
<cwbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <cwbit+0x5f>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwbit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shl    %cl,%eax
movzbl %al,%eax
shr    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @cwbit(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 128, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
double quawak_(double *, double *);
double cquawak(double *f, double *para) { return quawak_(f, para); }


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

x86 assembly (clang, -O2):
<cquawak>:
jmp    1030 <quawak_@plt>

LLVM IR (-O0):
define double @cquawak(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 = call double @quawak_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquawak(double* %0, double* %1) {
%3 = tail call double @quawak_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
long sysconf(int /*<<< orphan*/);
long get_open_fd_max(void) { return sysconf(_SC_OPEN_MAX); }


x86 assembly (clang, -O0):
<get_open_fd_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_open_fd_max>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_OPEN_MAX = global i32 0
define i64 @get_open_fd_max() {
%1 = load i32, i32* @_SC_OPEN_MAX
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_OPEN_MAX = global i32 0
define i64 @get_open_fd_max() {
%1 = load i32, i32* @_SC_OPEN_MAX
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *str, const char *delim) {
  static char *saveptr;
  return strtok_r(str, delim, &saveptr);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.saveptr = internal global i8* null
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.saveptr)
ret i8* %7
}

LLVM IR (-O2):
@strtok.saveptr = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.saveptr)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EchoP__Boot__booted();
void RealMainP__Boot__booted(void) { EchoP__Boot__booted(); }


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

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

LLVM IR (-O0):
define void @RealMainP__Boot__booted() {
%1 = call i32 (...) @EchoP__Boot__booted()
ret void
}

LLVM IR (-O2):
define void @RealMainP__Boot__booted() {
%1 = tail call i32 (...) @EchoP__Boot__booted()
ret void
}
int test_imm_1Cuint8_reg(unsigned char val) {
  return ((val) & (-0x1C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Cuint8_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, -28
%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_1Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -28
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t _lseek(int fd, off_t offset, int whence) { return ((off_t)-1); }


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
int main() { extern char test[(1 == 1) ? 1 : -1]; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int directory_p(char *);
int fileutils___directory_p(char *filename) { return (directory_p(filename)); }


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

x86 assembly (clang, -O2):
<fileutils___directory_p>:
jmp    1030 <directory_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___directory_p(i8* %0) {
%2 = tail call i32 @directory_p(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void usage() {
  printf("\nGetHttp -- http request dump program -- (%s) build (%s)\n\n%s "
         "\n\nUsage: [http://serv_name:port/path<?query>] -[d]\n\t-d - show "
         "HTTP header only\n\t-x - set invalid char(0x1) in header\n\n\n",
         "Linux", "Mar 18 2022",
         "Autor: (c) 2007 Borislav Sapundzhiev <bsapundjiev@gmail.com>");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf93(%rip),%rsi
lea    0xf92(%rip),%rdx
lea    0xf97(%rip),%rcx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0xf97(%rip),%rsi
lea    0xf96(%rip),%rdx
lea    0xf9b(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [181 x i8] c"\0AGetHttp -- http request dump program -- (%s) build (%s)\0A\0A%s \0A\0AUsage: [http://serv_name:port/path<?query>] -[d]\0A\09-d - show HTTP header only\0A\09-x - set invalid char(0x1) in header\0A\0A\0A\00"
@.str.1 = [6 x i8] c"Linux\00"
@.str.2 = [12 x i8] c"Mar 18 2022\00"
@.str.3 = [61 x i8] c"Autor: (c) 2007 Borislav Sapundzhiev <bsapundjiev@gmail.com>\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [181 x i8] c"\0AGetHttp -- http request dump program -- (%s) build (%s)\0A\0A%s \0A\0AUsage: [http://serv_name:port/path<?query>] -[d]\0A\09-d - show HTTP header only\0A\09-x - set invalid char(0x1) in header\0A\0A\0A\00"
@.str.1 = [6 x i8] c"Linux\00"
@.str.2 = [12 x i8] c"Mar 18 2022\00"
@.str.3 = [61 x i8] c"Autor: (c) 2007 Borislav Sapundzhiev <bsapundjiev@gmail.com>\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int, int);
int write(int, char *, int);
int transbridgeoff(int fp) {
  char LocalBuff[200];
  int LocalLength, Lcount;
  LocalLength = sprintf(LocalBuff, "%c%c\n", 0x04, 0x81);
  Lcount = write(fp, LocalBuff, LocalLength);
  return 0;
}


x86 assembly (clang, -O0):
<transbridgeoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x4,%edx
mov    $0x81,%ecx
call   1040 <sprintf@plt>
mov    %eax,-0xd4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xd0(%rbp),%rsi
mov    -0xd4(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0xd8(%rbp)
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transbridgeoff>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %edi,%ebx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4,%edx
mov    $0x81,%ecx
call   1040 <sprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c%c\0A\00"
define i32 @transbridgeoff(i32 %0) {
%2 = alloca i32
%3 = alloca [200 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4, i32 129)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %5
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%c\0A\00"
define i32 @transbridgeoff(i32 %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4, i32 129)
%5 = call i32 @write(i32 %0, i8* %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calc_fpscf_parameters();
void change_fpscf_scaling(void) {
  ;
  calc_fpscf_parameters();
}


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

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

LLVM IR (-O0):
define void @change_fpscf_scaling() {
%1 = call i32 (...) @calc_fpscf_parameters()
ret void
}

LLVM IR (-O2):
define void @change_fpscf_scaling() {
%1 = tail call i32 (...) @calc_fpscf_parameters()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_52(int /*<<< orphan*/);
int gen_52() {
  handle_52(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_52() {
%1 = call i32 @handle_52(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_52() {
%1 = tail call i32 @handle_52(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ someFunction(int *, int);
int main() {
  int a[10] = {8, 3, 1, 2, 6, 0, 9, 7, 4, 5};
  printf("Answer is:\n");
  someFunction(a, 10);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <someFunction@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1050 <someFunction@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@.str = [12 x i8] c"Answer is:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @someFunction(i32* %5, i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@str = [11 x i8] c"Answer is:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @someFunction(i32* %4, i32 10)
%6 = call i32 @putchar(i32 10)
ret i32 0
}