xunge/DecIR huggingface dataset:
int btor_cmp_ptr(const void *p, const void *q) { return ((long)p) - ((long)q); }


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

x86 assembly (clang, -O2):
<btor_cmp_ptr>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @btor_cmp_ptr(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub nsw i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @btor_cmp_ptr(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
void gg_userlist_put_free(struct gg_http *h) {}


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

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

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

LLVM IR (-O2):
%struct.gg_http = type opaque
define void @gg_userlist_put_free(%struct.gg_http* nocapture %0) {
ret void
}
void anc_hs_5v_control(int enable) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_hs_5v_control(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ ffsll(long long);
int /*<<< orphan*/ link_failure_ffsll();
void test_ffsll(long long x) {
  if (ffsll(x) != ffsll(x))
    link_failure_ffsll();
}


x86 assembly (clang, -O0):
<test_ffsll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ffsll@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ffsll@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1159 <test_ffsll+0x39>
mov    $0x0,%al
call   1040 <link_failure_ffsll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ffsll>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <ffsll@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <ffsll@plt>
cmp    %rax,%r14
jne    1144 <test_ffsll+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_ffsll@plt>

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

LLVM IR (-O2):
define void @test_ffsll(i64 %0) {
%2 = tail call i64 @ffsll(i64 %0)
%3 = tail call i64 @ffsll(i64 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_ffsll()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int f392(int *);
int f393(int *p) { return f392(p); }


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

x86 assembly (clang, -O2):
<f393>:
jmp    1030 <f392@plt>

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

LLVM IR (-O2):
define i32 @f393(i32* %0) {
%2 = tail call i32 @f392(i32* %0)
ret i32 %2
}
/* Variables and functions */
void *mb_correct_addr_and_bit(int *, void *);
int test_and_clear_bit(int, void *);
int mb_test_and_clear_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  return test_and_clear_bit(bit, addr);
}


x86 assembly (clang, -O0):
<mb_test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_and_clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_test_and_clear_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1040 <test_and_clear_bit@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mb_test_and_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %5)
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @test_and_clear_bit(i32 %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @mb_test_and_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @test_and_clear_bit(i32 %5, i8* %4)
ret i32 %6
}
int test_imm_31int16_reg(short val) {
  return ((val) & (-0x31 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_31int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffcf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_31int16_reg>:
test   $0xffcf,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_31int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -49
%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_31int16_reg(i16 signext %0) {
%2 = and i16 %0, -49
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *creat_word(char *s, int num) {
  char *word = malloc((num + 1) * sizeof(char));
  strncpy(word, s, num);
  word[num] = '\0';
  return word;
}


x86 assembly (clang, -O0):
<creat_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat_word>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @creat_word(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @strncpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @creat_word(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
void bputc(char *msg, int *len, char ch) { msg[(*len)++] = ch; }


x86 assembly (clang, -O0):
<bputc>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bputc>:
movslq (%rsi),%rax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bputc(i8* %0, i32* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 %7, i8* %13
ret void
}

LLVM IR (-O2):
define void @bputc(i8* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %2, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Check ...\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Check ...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1d() {
  Assert_real((isxdigit(29) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              150, ("isxdigit should be 0 for 0x1d"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x1d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x96,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x96,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1d\00"
define void @t_isxdigit_0x1d() {
%1 = call i64 @isxdigit(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1d\00"
define void @t_isxdigit_0x1d() {
%1 = tail call i64 @isxdigit(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ShareFreeM1d(double *s) {
  if (s)
    free((void *)s);
  return;
}


x86 assembly (clang, -O0):
<ShareFreeM1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ShareFreeM1d+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareFreeM1d>:
test   %rdi,%rdi
je     111a <ShareFreeM1d+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ShareFreeM1d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double*, double** %2
%7 = bitcast double* %6 to i8*
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ShareFreeM1d(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast double* %0 to i8*
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
void pthread_attr_destroy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_destroy() {
ret void
}
int tun_create(char *dev, int flag) {
  int fd;
  return fd;
}


x86 assembly (clang, -O0):
<tun_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tun_create(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_one(int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *psvec4i_one(struct vec4i *result) {
  vec4i_one((int32_t *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_one>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_one@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_one(%struct.vec4i* %0) {
%2 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %2
%3 = load %struct.vec4i*, %struct.vec4i** %2
%4 = bitcast %struct.vec4i* %3 to i32*
%5 = call i32 @vec4i_one(i32* %4)
%6 = load %struct.vec4i*, %struct.vec4i** %2
ret %struct.vec4i* %6
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_one(%struct.vec4i* returned %0) {
%2 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%3 = tail call i32 @vec4i_one(i32* %2)
ret %struct.vec4i* %0
}
double mean(double a, double b) { return (a + b) / 2; }


x86 assembly (clang, -O0):
<mean>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mean(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 = fadd double %5, %6
%8 = fdiv double %7, 2.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @mean(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
void lgtd_lifx_wire_encode_tags(struct lgtd_lifx_packet_tags *pkt) {
  (void)pkt;
}


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

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

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

LLVM IR (-O2):
%struct.lgtd_lifx_packet_tags = type opaque
define void @lgtd_lifx_wire_encode_tags(%struct.lgtd_lifx_packet_tags* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char);
main() {
  char s[] = "test";
  squeeze(s, 't');
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x74,%esi
call   1030 <squeeze@plt>
lea    -0x5(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x74,%esi
call   1030 <squeeze@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @squeeze(i8* %3, i8 signext 116)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @squeeze(i8* %2, i8 signext 116)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hi");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(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"hi\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strndup(const char *s, size_t n) {
  char *r;
  if (s == 0)
    return 0;
  r = (char *)malloc(n + 1);
  strncpy(r, s, n);
  r[n] = 0;
  return r;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <strndup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    117e <strndup+0x5e>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1151 <strndup+0x31>
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    1153 <strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strncpy(i8* %7, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %7, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %11
}
void handle_USR1(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_USR1(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ keccak_absorb(int /*<<< orphan*/ *, int,
                                 unsigned char const *, unsigned long long,
                                 int);
void shake128_absorb(uint64_t *s, const unsigned char *input,
                     unsigned long long inlen) {
  keccak_absorb(s, 168, input, inlen, 0x1F);
}


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

x86 assembly (clang, -O2):
<shake128_absorb>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0xa8,%esi
mov    $0x1f,%r8d
jmp    1030 <keccak_absorb@plt>

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

LLVM IR (-O2):
define void @shake128_absorb(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @keccak_absorb(i32* %0, i32 168, i8* %1, i64 %2, i32 31)
ret void
}
void free_task(void *task) { return; }


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

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

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

LLVM IR (-O2):
define void @free_task(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char **QuickSortEnhancedString_m(char **, int, int, char *, int);
char **SortStringAlphabetically_m(char **sorted, int sortedTot,
                                  int startIndices, char *indicesPath) {
  return QuickSortEnhancedString_m(sorted, sortedTot, startIndices, indicesPath,
                                   1);
}


x86 assembly (clang, -O0):
<SortStringAlphabetically_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <QuickSortEnhancedString_m@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SortStringAlphabetically_m>:
mov    $0x1,%r8d
jmp    1030 <QuickSortEnhancedString_m@plt>

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

LLVM IR (-O2):
define i8** @SortStringAlphabetically_m(i8** %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i8** @QuickSortEnhancedString_m(i8** %0, i32 %1, i32 %2, i8* %3, i32 1)
ret i8** %5
}
char oled_byte(char in) {
  return ((in & 8) << 3) | ((in & 4) << 2) | ((in & 2) << 1) | (in & 1);
}


x86 assembly (clang, -O0):
<oled_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x8,%eax
shl    $0x3,%eax
movsbl -0x1(%rbp),%ecx
and    $0x4,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
and    $0x2,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_byte>:
lea    0x0(,%rdi,8),%ecx
and    $0x40,%cl
lea    0x0(,%rdi,4),%eax
and    $0x10,%al
lea    (%rdi,%rdi,1),%edx
and    $0x4,%dl
and    $0x1,%dil
or     %dil,%al
or     %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define signext i8 @oled_byte(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 8
%6 = shl i32 %5, 3
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 4
%10 = shl i32 %9, 2
%11 = or i32 %6, %10
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = and i32 %13, 2
%15 = shl i32 %14, 1
%16 = or i32 %11, %15
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = and i32 %18, 1
%20 = or i32 %16, %19
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @oled_byte(i8 signext %0) {
%2 = shl i8 %0, 3
%3 = and i8 %2, 64
%4 = shl i8 %0, 2
%5 = and i8 %4, 16
%6 = shl i8 %0, 1
%7 = and i8 %6, 4
%8 = and i8 %0, 1
%9 = or i8 %5, %8
%10 = or i8 %9, %3
%11 = or i8 %10, %7
ret i8 %11
}
/* Variables and functions */
float max(float, float);
float mymax3(float a, float b, float c) { return max(c, max(a, b)); }


x86 assembly (clang, -O0):
<mymax3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <max@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymax3>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1030 <max@plt>
movaps %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @mymax3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = call float @max(float %8, float %9)
%11 = call float @max(float %7, float %10)
ret float %11
}

LLVM IR (-O2):
define float @mymax3(float %0, float %1, float %2) {
%4 = tail call float @max(float %0, float %1)
%5 = tail call float @max(float %2, float %4)
ret float %5
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
unsigned int ld2(u_int32_t v) {
  unsigned int r, bits;
  for (r = 0, bits = 16; v > 1; bits >>= 1) {
    if (v >= (1U << bits)) {
      v >>= bits;
      r += bits;
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<ld2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    115d <ld2+0x5d>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jb     114a <ld2+0x4a>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114f <ld2+0x4f>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ld2+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1138 <ld2+0x38>
xor    %eax,%eax
mov    $0x10,%ecx
mov    $0x10,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%edx
shr    %cl,%edx
shr    %esi
test   %edx,%edx
cmovne %ecx,%edx
mov    %edx,%ecx
shr    %cl,%edi
add    %edx,%eax
mov    %esi,%ecx
cmp    $0x1,%edi
ja     1120 <ld2+0x20>
ret

LLVM IR (-O0):
define i32 @ld2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 16, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = icmp uge i32 %9, %11
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = ashr i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = add i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = lshr i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @ld2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 16, %1 ]
%5 = phi i32 [ %12, %3 ], [ 0, %1 ]
%6 = phi i32 [ %11, %3 ], [ %0, %1 ]
%7 = lshr i32 %6, %4
%8 = icmp eq i32 %7, 0
%9 = lshr i32 %4, 1
%10 = select i1 %8, i32 0, i32 %4
%11 = lshr i32 %6, %10
%12 = add i32 %10, %5
%13 = icmp ugt i32 %11, 1
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %15
}
int test_imm_3Buint32_reg(unsigned int val) {
  return ((val) & (0x3B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Buint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Buint32_reg(i32 %0) {
%2 = and i32 %0, 59
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XkbSetAutoResetControls() {}


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

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

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

LLVM IR (-O2):
define void @XkbSetAutoResetControls() {
ret void
}
char *f() {}


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

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

LLVM IR (-O0):
define i8* @f() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @f() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(short const, int /*<<< orphan*/ *const);
int pm_writelittleshort(FILE *const ofP, short const s) {
  putc((s >> 0) & 0xff, ofP);
  putc((s >> 8) & 0xff, ofP);
  return 0;
}


x86 assembly (clang, -O0):
<pm_writelittleshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_writelittleshort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pm_writelittleshort(i32* %0, i16 signext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 0
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i16
%10 = load i32*, i32** %3
%11 = call i32 @putc(i16 signext %9, i32* %10)
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i16
%17 = load i32*, i32** %3
%18 = call i32 @putc(i16 signext %16, i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @pm_writelittleshort(i32* nocapture %0, i16 signext %1) {
%3 = and i16 %1, 255
%4 = tail call i32 @putc(i16 signext %3, i32* %0)
%5 = lshr i16 %1, 8
%6 = tail call i32 @putc(i16 signext %5, i32* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_from_montgomery(uintptr_t, uintptr_t);
void fiat_p434_from_montgomery(uint64_t out1[7], const uint64_t arg1[7]) {
  internal_fiat_p434_from_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_p434_from_montgomery>:
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 <internal_fiat_p434_from_montgomery@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p434_from_montgomery>:
jmp    1030 <internal_fiat_p434_from_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p434_from_montgomery(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p434_from_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_from_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p434_from_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open(char *);
int main() {
  open("/root/abc");
  open("/media/xyz");
  open("/mnt/abc");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <open@plt>
lea    0xee3(%rip),%rdi
call   1030 <open@plt>
lea    0xee2(%rip),%rdi
call   1030 <open@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <open@plt>
lea    0xee6(%rip),%rdi
call   1030 <open@plt>
lea    0xee5(%rip),%rdi
call   1030 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/root/abc\00"
@.str.1 = [11 x i8] c"/media/xyz\00"
@.str.2 = [9 x i8] c"/mnt/abc\00"
define i32 @main() {
%1 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/root/abc\00"
@.str.1 = [11 x i8] c"/media/xyz\00"
@.str.2 = [9 x i8] c"/mnt/abc\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void nrf_802154_timer_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_timer_deinit() {
ret void
}
int is_float(s)
char *s;
{
  return (is_integer_part_float(s) || is_fractional_part_float(s) ||
          is_power_float(s));
}


x86 assembly (clang, -O0):
<is_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <is_integer_part_float@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1186 <is_float+0x56>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <is_fractional_part_float@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1186 <is_float+0x56>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <is_power_float@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_float>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <is_integer_part_float@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    1166 <is_float+0x36>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <is_fractional_part_float@plt>
test   %eax,%eax
jne    1166 <is_float+0x36>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <is_power_float@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @is_integer_part_float to i32 (i8*, ...)*)(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @is_fractional_part_float to i32 (i8*, ...)*)(i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @is_power_float to i32 (i8*, ...)*)(i8* %11)
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_float(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_integer_part_float to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_fractional_part_float to i32 (i8*, ...)*)(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_power_float to i32 (i8*, ...)*)(i8* %0)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
main() {
  int i = 33;
  foo(i);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x21,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 33)
ret i32 0
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ handle_IRQ(int, struct pt_regs *);
void ipipe_handle_multi_irq(int irq, struct pt_regs *regs) {
  handle_IRQ(irq, regs);
}


x86 assembly (clang, -O0):
<ipipe_handle_multi_irq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <handle_IRQ@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipipe_handle_multi_irq>:
jmp    1030 <handle_IRQ@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define void @ipipe_handle_multi_irq(i32 %0, %struct.pt_regs* %1) {
%3 = alloca i32
%4 = alloca %struct.pt_regs*
store i32 %0, i32* %3
store %struct.pt_regs* %1, %struct.pt_regs** %4
%5 = load i32, i32* %3
%6 = load %struct.pt_regs*, %struct.pt_regs** %4
%7 = call i32 @handle_IRQ(i32 %5, %struct.pt_regs* %6)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define void @ipipe_handle_multi_irq(i32 %0, %struct.pt_regs* %1) {
%3 = tail call i32 @handle_IRQ(i32 %0, %struct.pt_regs* %1)
ret void
}
float *sum(int a, int b) { return 'a'; }


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

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

LLVM IR (-O0):
define float* @sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret float* inttoptr (i64 97 to float*)
}

LLVM IR (-O2):
define float* @sum(i32 %0, i32 %1) {
ret float* inttoptr (i64 97 to float*)
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void http_write_header_end(char *buffer) { strcat(buffer, "\r\n"); }


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

x86 assembly (clang, -O2):
<http_write_header_end>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @http_write_header_end(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ buffer_read(struct buffer *, char *, int);
char buffer_read_char(struct buffer *__restrict buf) {
  char data;
  buffer_read(buf, &data, sizeof(data));
  return data;
}


x86 assembly (clang, -O0):
<buffer_read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <buffer_read@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_read_char>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <buffer_read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define signext i8 @buffer_read_char(%struct.buffer* noalias %0) {
%2 = alloca %struct.buffer*
%3 = alloca i8
store %struct.buffer* %0, %struct.buffer** %2
%4 = load %struct.buffer*, %struct.buffer** %2
%5 = call i32 @buffer_read(%struct.buffer* %4, i8* %3, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define signext i8 @buffer_read_char(%struct.buffer* noalias %0) {
%2 = alloca i8
%3 = call i32 @buffer_read(%struct.buffer* %0, i8* %2, i32 1)
%4 = load i8, i8* %2
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *reason) {
  fprintf(stderr, "Syntax error (%s)\n", reason);
  fprintf(stderr, "Usage: chroot <directory> [executable]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Syntax error (%s)\0A\00"
@.str.1 = [40 x i8] c"Usage: chroot <directory> [executable]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Syntax error (%s)\0A\00"
@.str.1 = [40 x i8] c"Usage: chroot <directory> [executable]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_action(char *, char *, char *);
void ndsctl_deauth(void) {
  ndsctl_action("deauth", "Client %s deauthenticated.\n",
                "Client %s not found.\n");
}


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

x86 assembly (clang, -O2):
<ndsctl_deauth>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xefe(%rip),%rdx
jmp    1030 <ndsctl_action@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"deauth\00"
@.str.1 = [28 x i8] c"Client %s deauthenticated.\0A\00"
@.str.2 = [22 x i8] c"Client %s not found.\0A\00"
define void @ndsctl_deauth() {
%1 = call i32 @ndsctl_action(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"deauth\00"
@.str.1 = [28 x i8] c"Client %s deauthenticated.\0A\00"
@.str.2 = [22 x i8] c"Client %s not found.\0A\00"
define void @ndsctl_deauth() {
%1 = tail call i32 @ndsctl_action(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}