xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t GET_BE16(const uint8_t *buff) {
  uint16_t val = ((uint16_t)buff[0]) << 8U;
  val += buff[1] & 0xFFU;
  return val;
}


x86 assembly (clang, -O0):
<GET_BE16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xff,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_BE16>:
mov    (%rdi),%ecx
shl    $0x8,%ecx
movzbl 0x4(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GET_BE16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = and i32 %10, 255
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @GET_BE16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ lcd(char *);
int login();
int main(int argc, char const *argv[]) {
  int loginr;
  loginr = login();
  lcd("w\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <login@plt>
mov    %eax,-0x14(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <lcd@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <login@plt>
lea    0xed1(%rip),%rdi
call   1040 <lcd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @login()
store i32 %7, i32* %6
%8 = call i32 @lcd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"w\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @login()
%4 = tail call i32 @lcd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int str_is_integer(char *input) {
  while (*input) {
    if (!isdigit(*input))
      return 1;
    input++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<str_is_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <str_is_integer+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <str_is_integer+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1162 <str_is_integer+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <str_is_integer+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_integer>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1137 <str_is_integer+0x27>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1137 <str_is_integer+0x27>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_is_integer+0x10>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_is_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
ret i32 1
}
/* Variables and functions */
char *regexS(char *string) {
  if (string != NULL) {
    return string;
  }
  return "Hello World!";
}


x86 assembly (clang, -O0):
<regexS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <regexS+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <regexS+0x2b>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regexS>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i8* @regexS(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
store i8* %7, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i8* @regexS(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
unsigned bitScan_fun_ullong(unsigned long long x) {
  unsigned r = 64;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x40,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <bitScan_fun_ullong+0x34>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <bitScan_fun_ullong+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_ullong>:
mov    $0x40,%eax
test   %rdi,%rdi
je     111f <bitScan_fun_ullong+0x1f>
mov    %rdi,%rcx
nopl   (%rax)
add    $0xffffffff,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bitScan_fun_ullong+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_ullong(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 64, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 64, %1 ], [ %6, %3 ]
ret i32 %10
}
void foo_1_1_2_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr(char const *s) {
  (void)write(0x01, s, ft_strlen(s));
  return;
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ LONG_MAX;
scalar_t__ __ccaprice_ftell(int /*<<< orphan*/ *);
long ftell(FILE *fp) {
  off_t pos = __ccaprice_ftell(fp);
  if (pos > LONG_MAX)
    return -1;
  return pos;
}


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ccaprice_ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jle    114a <ftell+0x3a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1152 <ftell+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
push   %rax
call   1030 <__ccaprice_ftell@plt>
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%rax
mov    $0xffffffffffffffff,%rcx
cmovg  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@LONG_MAX = global i64 0
define i64 @ftell(i32* %0) {
%2 = tail call i64 @__ccaprice_ftell(i32* %0)
%3 = load i64, i64* @LONG_MAX
%4 = icmp sgt i64 %2, %3
%5 = select i1 %4, i64 -1, i64 %2
ret i64 %5
}
void *getp2p(struct udphdr *pudp, int tproto, void *pdir, void *plast) {
  return (void *)pudp;
}


x86 assembly (clang, -O0):
<getp2p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.udphdr = type opaque
define i8* @getp2p(%struct.udphdr* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.udphdr*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.udphdr* %0, %struct.udphdr** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.udphdr*, %struct.udphdr** %5
%10 = bitcast %struct.udphdr* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
%struct.udphdr = type opaque
define i8* @getp2p(%struct.udphdr* readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = bitcast %struct.udphdr* %0 to i8*
ret i8* %5
}
int main(int argc, char *argv[]) {
  printf("%s [%s]\n", __func__, "begin");
  test_signal();
  printf("%s [%s]\n", __func__, "end");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_signal@plt>
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
lea    0xea6(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed7(%rip),%r14
lea    0xed5(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <test_signal@plt>
lea    0xec0(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [6 x i8] c"begin\00"
@.str.2 = [4 x i8] c"end\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @test_signal()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [6 x i8] c"begin\00"
@.str.2 = [4 x i8] c"end\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @test_signal()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void DummyCDDeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @DummyCDDeInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SHL_B_IMM(int reg, int count) {
  addbyte(0xc0);
  addbyte(0xc0 | reg | 0x20);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SHL_B_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xc0,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x20,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHL_B_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc0,%edi
call   1030 <addbyte@plt>
or     $0xe0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SHL_B_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 192)
%6 = load i32, i32* %3
%7 = or i32 192, %6
%8 = or i32 %7, 32
%9 = call i32 @addbyte(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @addbyte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @SHL_B_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 192)
%4 = or i32 %0, 224
%5 = tail call i32 @addbyte(i32 %4)
%6 = tail call i32 @addbyte(i32 %1)
ret void
}
int funcion(unsigned int valor) {
  if (valor < 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<funcion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jae    111d <funcion+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <funcion+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @funcion(i32 %0) {
ret i32 1
}
struct sk_buff *l3mdev_ip6_rcv(struct sk_buff *skb) {
  return skb;
}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define %struct.sk_buff* @l3mdev_ip6_rcv(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
ret %struct.sk_buff* %3
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define %struct.sk_buff* @l3mdev_ip6_rcv(%struct.sk_buff* readnone returned %0) {
ret %struct.sk_buff* %0
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int log2f(float);
int powf(int, float);
int sqrtf(int);
float filterGetNotchQ(uint16_t centerFreq, uint16_t cutoff) {
  float octaves = log2f((float)centerFreq / (float)cutoff) * 2;
  return sqrtf(powf(2, octaves)) / (powf(2, octaves) - 1);
}


x86 assembly (clang, -O0):
<filterGetNotchQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssq -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <log2f@plt>
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %eax,%edi
call   1050 <sqrtf@plt>
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterGetNotchQ>:
push   %rbx
sub    $0x10,%rsp
cvtsi2ss %rdi,%xmm0
cvtsi2ss %rsi,%xmm1
divss  %xmm1,%xmm0
call   1040 <log2f@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %eax,%edi
call   1050 <sqrtf@plt>
mov    %eax,%ebx
mov    $0x2,%edi
movss  0xc(%rsp),%xmm0
call   1030 <powf@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @filterGetNotchQ(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to float
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to float
%10 = fdiv float %7, %9
%11 = call i32 @log2f(float %10)
%12 = mul nsw i32 %11, 2
%13 = sitofp i32 %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = call i32 @powf(i32 2, float %14)
%16 = call i32 @sqrtf(i32 %15)
%17 = load float, float* %5
%18 = call i32 @powf(i32 2, float %17)
%19 = sub nsw i32 %18, 1
%20 = sdiv i32 %16, %19
%21 = sitofp i32 %20 to float
ret float %21
}

LLVM IR (-O2):
define float @filterGetNotchQ(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to float
%4 = sitofp i64 %1 to float
%5 = fdiv float %3, %4
%6 = tail call i32 @log2f(float %5)
%7 = shl nsw i32 %6, 1
%8 = sitofp i32 %7 to float
%9 = tail call i32 @powf(i32 2, float %8)
%10 = tail call i32 @sqrtf(i32 %9)
%11 = tail call i32 @powf(i32 2, float %8)
%12 = add nsw i32 %11, -1
%13 = sdiv i32 %10, %12
%14 = sitofp i32 %13 to float
ret float %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_width;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
int get_XIconSize_max_width(void *_p) {
  return (int)((XIconSize *)_p)->max_width;
}


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

x86 assembly (clang, -O2):
<get_XIconSize_max_width>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIconSize_max_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIconSize_max_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char c, int x, int y) {
  switch (c) {
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <keyboard+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fc_host_get_statistic(char *, char const *);
uint64_t fc_stat_loss_of_sync_count(const char *host) {
  return fc_host_get_statistic("loss_of_sync_count", host);
}


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"loss_of_sync_count\00"
define i32 @fc_stat_loss_of_sync_count(i8* %0) {
%2 = tail call i32 @fc_host_get_statistic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
void do_fd_request() {}


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

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

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

LLVM IR (-O2):
define void @do_fd_request() {
ret void
}
/* Variables and functions */
float sincoshf(float const, int /*<<< orphan*/);
float sinhf(const float x) { return sincoshf(x, 0); }


x86 assembly (clang, -O0):
<sinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1030 <sincoshf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @sinhf(float %0) {
%2 = tail call float @sincoshf(float %0, i32 0)
ret float %2
}
/* Variables and functions */
scalar_t__ floor(double);
long long llrint(double s) { return (long long)floor(s); }


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

x86 assembly (clang, -O2):
<llrint>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @floor(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 @floor(double %0)
ret i64 %2
}
/* Type definitions */
struct tree_node {
  int dummy;
};
struct tree {
  int dummy;
};

/* Variables and functions */
struct tree_node *tnode_match(struct tree *, void const *, size_t);
struct tree_node *tree_match(struct tree *tp, const void *key, size_t len) {
  return tnode_match(tp, key, len);
}


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

x86 assembly (clang, -O2):
<tree_match>:
jmp    1030 <tnode_match@plt>

LLVM IR (-O0):
%struct.tree_node = type { i32 }
%struct.tree = type { i32 }
define %struct.tree_node* @tree_match(%struct.tree* %0, i8* %1, i64 %2) {
%4 = alloca %struct.tree*
%5 = alloca i8*
%6 = alloca i64
store %struct.tree* %0, %struct.tree** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.tree*, %struct.tree** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call %struct.tree_node* @tnode_match(%struct.tree* %7, i8* %8, i64 %9)
ret %struct.tree_node* %10
}

LLVM IR (-O2):
%struct.tree_node = type { i32 }
%struct.tree = type { i32 }
define %struct.tree_node* @tree_match(%struct.tree* %0, i8* %1, i64 %2) {
%4 = tail call %struct.tree_node* @tnode_match(%struct.tree* %0, i8* %1, i64 %2)
ret %struct.tree_node* %4
}
float sq_perimeter_sperimeter(float semiperimeter) {
  float perimeter = semiperimeter * 2;
  return perimeter;
}


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

x86 assembly (clang, -O2):
<sq_perimeter_sperimeter>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sq_perimeter_sperimeter(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 2.000000e+00
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @sq_perimeter_sperimeter(float %0) {
%2 = fmul float %0, 2.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fini_2(void) { printf("fini array 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"fini array 2\00"
define void @fini_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int arng(int range) {
  int temp = rand() % (range + 1);
  return temp;
}


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

x86 assembly (clang, -O2):
<arng>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @arng(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = add nsw i32 %0, 1
%4 = srem i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef char *__m128d;

/* Variables and functions */
char *_mm_div_pd(char *, char *);
__m128d __attribute__((no, unused)) test(__m128d s1, __m128d s2) {
  __asm("" : "+v"(s1), "+v"(s2));
  return _mm_div_pd(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_div_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_div_pd@plt>

LLVM IR (-O0):
define i8* @test(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*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_div_pd(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_div_pd(i8* %4, i8* %5)
ret i8* %6
}
void fillCharVectorWithSpaces(unsigned char vector[], int len) {
  for (int i = 0; i < len; i++)
    vector[i] = ' ';
}


x86 assembly (clang, -O0):
<fillCharVectorWithSpaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <fillCharVectorWithSpaces+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <fillCharVectorWithSpaces+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillCharVectorWithSpaces>:
test   %esi,%esi
jle    1125 <fillCharVectorWithSpaces+0x15>
push   %rax
mov    %esi,%edx
mov    $0x20,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fillCharVectorWithSpaces(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn17();
__attribute__((noipa)) int fn18(int x) {
  if (x & 8)
    fn17();
}


x86 assembly (clang, -O0):
<fn18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1131 <fn18+0x21>
mov    $0x0,%al
call   1030 <fn17@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn18>:
test   $0x8,%dil
je     1122 <fn18+0x12>
push   %rax
xor    %eax,%eax
call   1030 <fn17@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @fn18(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 8
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @fn17()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @fn18(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @fn17()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
void servo(char direction) {}


x86 assembly (clang, -O0):
<servo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @servo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @servo(i8 signext %0) {
ret void
}
int qsort_cmp_SVEC_VAL(const void *x, const void *y) {
  if (*((double *)x) < *((double *)y))
    return (-1);
  else
    return (*((double *)x) > *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_SVEC_VAL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <qsort_cmp_SVEC_VAL+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp_SVEC_VAL+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_SVEC_VAL>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_SVEC_VAL(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int hash(char *s) {
  unsigned hashval = 0;
  while (*s != '\0') {
    hashval = hashval * 31 + *s;
    s++;
  }
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
__attribute__((no, noclone)) void fn_p(int p) {}


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

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

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

LLVM IR (-O2):
define void @fn_p(i32 %0) {
ret void
}
/* Type definitions */
struct tmx {
  int dummy;
};
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ mkxtime(struct tmx *);
void uninitvar_mktime(void) {
  struct tm *tp;
  (void)mktime(tp);
  struct tmx *tpx;
  (void)mkxtime(tpx);
}


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

x86 assembly (clang, -O2):
<uninitvar_mktime>:
push   %rax
call   1040 <mktime@plt>
pop    %rax
jmp    1030 <mkxtime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
%struct.tmx = type { i32 }
define void @uninitvar_mktime() {
%1 = alloca %struct.tm*
%2 = alloca %struct.tmx*
%3 = load %struct.tm*, %struct.tm** %1
%4 = call i32 @mktime(%struct.tm* %3)
%5 = load %struct.tmx*, %struct.tmx** %2
%6 = call i32 @mkxtime(%struct.tmx* %5)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
%struct.tmx = type { i32 }
define void @uninitvar_mktime() {
%1 = tail call i32 @mktime(%struct.tm* undef)
%2 = tail call i32 @mkxtime(%struct.tmx* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main() {
  test1();
  test2();
  printf("Application exiting!\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [21 x i8] c"Application exiting!\00"
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int euclide(int a, int b) {
  int q, r;
  if (b == 0) {
    return a;
  } else {
    q = a / b;
    r = a - b * q;
    return euclide(b, r);
  }
}


x86 assembly (clang, -O0):
<euclide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <euclide+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <euclide+0x4a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <euclide@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclide>:
mov    %edi,%eax
test   %esi,%esi
je     111d <euclide+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclide+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @euclide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ func2();
void func1() { func2(); }


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

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

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

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @func2()
ret void
}
/* Variables and functions */
int SOCK_STREAM;
int sock_stream() { return SOCK_STREAM; }


x86 assembly (clang, -O0):
<sock_stream>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_stream>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SOCK_STREAM = global i32 0
define i32 @sock_stream() {
%1 = load i32, i32* @SOCK_STREAM
ret i32 %1
}

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
define i32 @sock_stream() {
%1 = load i32, i32* @SOCK_STREAM
ret i32 %1
}
void SetBitfieldBit(char *bitfield, unsigned long index) {
  char *temp;
  unsigned byte;
  int bit;
  byte = (unsigned)(index / 8);
  bit = (unsigned)(index % 8);
  temp = bitfield + byte;
  *temp |= 1 << bit;
}


x86 assembly (clang, -O0):
<SetBitfieldBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBitfieldBit>:
mov    %rsi,%rcx
mov    %rsi,%rax
shr    $0x3,%rax
and    $0x7,%cl
mov    $0x1,%dl
shl    %cl,%dl
mov    %eax,%eax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @SetBitfieldBit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = udiv i64 %8, 8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i64, i64* %4
%12 = urem i64 %11, 8
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8* %17, i8** %5
%18 = load i32, i32* %7
%19 = shl i32 1, %18
%20 = load i8*, i8** %5
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = or i32 %22, %19
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
ret void
}

LLVM IR (-O2):
define void @SetBitfieldBit(i8* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 3
%4 = trunc i64 %1 to i8
%5 = and i8 %4, 7
%6 = and i64 %3, 4294967295
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = shl nuw i8 1, %5
%9 = load i8, i8* %7
%10 = or i8 %9, %8
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
double convert_to_fahrenheit(double);
char *convert_to_fahrenheit_should_return_93_2_when_input_is_34() {
  double degrees = convert_to_fahrenheit(34.0);
  do {
    if (!(degrees == 93.2))
      return "error, fahrenheit conversion != 93.2";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<convert_to_fahrenheit_should_return_93_2_when_input_is_34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
call   1030 <convert_to_fahrenheit@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114c <convert_to_fahrenheit_should_return_93_2_when_input_is_34+0x3c>
jp     114c <convert_to_fahrenheit_should_return_93_2_when_input_is_34+0x3c>
jmp    115c <convert_to_fahrenheit_should_return_93_2_when_input_is_34+0x4c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <convert_to_fahrenheit_should_return_93_2_when_input_is_34+0x59>
jmp    1161 <convert_to_fahrenheit_should_return_93_2_when_input_is_34+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_fahrenheit_should_return_93_2_when_input_is_34>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <convert_to_fahrenheit@plt>
xor    %eax,%eax
ucomisd 0xee0(%rip),%xmm0
lea    0xee1(%rip),%rcx
cmovne %rcx,%rax
cmovp  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"error, fahrenheit conversion != 93.2\00"
define i8* @convert_to_fahrenheit_should_return_93_2_when_input_is_34() {
%1 = alloca i8*
%2 = alloca double
%3 = call double @convert_to_fahrenheit(double 3.400000e+01)
store double %3, double* %2
br label %4
4: ; preds = %0
%5 = load double, double* %2
%6 = fcmp oeq double %5, 9.320000e+01
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [37 x i8] c"error, fahrenheit conversion != 93.2\00"
define i8* @convert_to_fahrenheit_should_return_93_2_when_input_is_34() {
%1 = tail call double @convert_to_fahrenheit(double 3.400000e+01)
%2 = fcmp oeq double %1, 9.320000e+01
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}