xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawnattr_setschedpolicy(posix_spawnattr_t *attr, int policy) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawnattr_setschedpolicy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_setschedpolicy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_setschedpolicy(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_setschedpolicy(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake2s_file(unsigned char *, int /*<<< orphan*/ *,
                            unsigned char const *, size_t);
unsigned char *hash_file_blake2s_key(unsigned char *out, FILE *fp,
                                     const unsigned char *key, size_t key_len) {
  return blake2s_file(out, fp, key, key_len);
}


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

x86 assembly (clang, -O2):
<hash_file_blake2s_key>:
jmp    1030 <blake2s_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake2s_key(i8* %0, i32* %1, i8* %2, i64 %3) {
%5 = tail call i8* @blake2s_file(i8* %0, i32* %1, i8* %2, i64 %3)
ret i8* %5
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ var(double const *, size_t);
double std(const double *A, size_t N) { return sqrt(var(A, N)); }


x86 assembly (clang, -O0):
<std>:
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 <var@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std>:
push   %rax
call   1030 <var@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @std(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = call i32 @var(double* %5, i64 %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @std(double* %0, i64 %1) {
%3 = tail call i32 @var(double* %0, i64 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
void rop3_153_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D ^ S;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_153_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_153_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
or     %esi,%edx
or     %dl,%cl
not    %cl
and    %dl,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_153_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8, i8* %6
%26 = zext i8 %25 to i32
%27 = xor i32 %26, -1
%28 = and i32 %24, %27
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = or i32 %28, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_153_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %6
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Type definitions */
struct irc_in_addr {
  int dummy;
};

/* Variables and functions */
char const *ircd_ntoa_masked_r(char *, struct irc_in_addr const *,
                               unsigned char);
const char *ircd_ntoa_masked(const struct irc_in_addr *in, unsigned char bits) {
  static char buf[45 + 4];
  return ircd_ntoa_masked_r(buf, in, bits);
}


x86 assembly (clang, -O0):
<ircd_ntoa_masked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f13(%rip),%rdi
movzbl -0x9(%rbp),%edx
call   1030 <ircd_ntoa_masked_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ircd_ntoa_masked>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0x2f24(%rip),%rdi
jmp    1030 <ircd_ntoa_masked_r@plt>

LLVM IR (-O0):
%struct.irc_in_addr = type { i32 }
@ircd_ntoa_masked.buf = internal global [49 x i8] zeroinitializer
define i8* @ircd_ntoa_masked(%struct.irc_in_addr* %0, i8 zeroext %1) {
%3 = alloca %struct.irc_in_addr*
%4 = alloca i8
store %struct.irc_in_addr* %0, %struct.irc_in_addr** %3
store i8 %1, i8* %4
%5 = load %struct.irc_in_addr*, %struct.irc_in_addr** %3
%6 = load i8, i8* %4
%7 = call i8* @ircd_ntoa_masked_r(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @ircd_ntoa_masked.buf, i64 0, i64 0), %struct.irc_in_addr* %5, i8 zeroext %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.irc_in_addr = type { i32 }
@ircd_ntoa_masked.buf = internal global [49 x i8] zeroinitializer
define i8* @ircd_ntoa_masked(%struct.irc_in_addr* %0, i8 zeroext %1) {
%3 = tail call i8* @ircd_ntoa_masked_r(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @ircd_ntoa_masked.buf, i64 0, i64 0), %struct.irc_in_addr* %0, i8 zeroext %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SeriesSum(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int times = 0;
  fflush(stdin);
  scanf("%d", &times);
  puts(SeriesSum(times));
  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)
movl   $0x0,-0x14(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe8e(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <SeriesSum@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xea2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <SeriesSum@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\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
store i32 0, i32* %6
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %6
%11 = call i32 @SeriesSum(i32 %10)
%12 = call i32 @puts(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @SeriesSum(i32 %8)
%10 = call i32 @puts(i32 %9)
ret i32 0
}
void xmlkeys_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @xmlkeys_init() {
ret void
}
/* Variables and functions */
size_t ft_strlen(char const *);
char *ft_strncpy(char *, char const *, size_t);
scalar_t__ malloc(size_t);
char *ft_strdup(const char *s1) {
  char *dup;
  size_t len;
  len = ft_strlen(s1);
  dup = (char *)(malloc(len + 1));
  if (!dup)
    return (NULL);
  dup = ft_strncpy(dup, s1, len + 1);
  return (dup);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <ft_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1193 <ft_strdup+0x63>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1050 <ft_strncpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <ft_strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1165 <ft_strdup+0x35>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ft_strncpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i64 @ft_strlen(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = tail call i8* @ft_strncpy(i8* %7, i8* %0, i64 %3)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %10
}
int main() {
  unsigned short arg = 0x1234;
  unsigned short out = 0;
  __asm__("bsfw %%ax, %%cx" : "=c"(out) : "a"(arg));
  return (out == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x1234,-0x6(%rbp)
movw   $0x0,-0x8(%rbp)
mov    -0x6(%rbp),%ax
bsf    %ax,%cx
mov    %cx,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1234,%ax
bsf    %ax,%cx
xor    %eax,%eax
cmp    $0x2,%cx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 4660, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = call i16 asm "bsfw %ax, %cx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i16 asm "bsfw %ax, %cx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 4660)
%2 = icmp eq i16 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ testHf();
int /*<<< orphan*/ testHf1();
int /*<<< orphan*/ testHf2();
void testHfs() {
  testHf1();
  testHf2();
  testHf();
}


x86 assembly (clang, -O0):
<testHfs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testHf1@plt>
mov    $0x0,%al
call   1050 <testHf2@plt>
mov    $0x0,%al
call   1030 <testHf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHfs>:
push   %rax
xor    %eax,%eax
call   1040 <testHf1@plt>
xor    %eax,%eax
call   1050 <testHf2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <testHf@plt>

LLVM IR (-O0):
define void @testHfs() {
%1 = call i32 (...) @testHf1()
%2 = call i32 (...) @testHf2()
%3 = call i32 (...) @testHf()
ret void
}

LLVM IR (-O2):
define void @testHfs() {
%1 = tail call i32 (...) @testHf1()
%2 = tail call i32 (...) @testHf2()
%3 = tail call i32 (...) @testHf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
int insufficient_usr(const char *kind, const char *usage) {
  fprintf(stderr, "USR for '%s' requires: %s\n", kind, usage);
  return 1;
}


x86 assembly (clang, -O0):
<insufficient_usr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insufficient_usr>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"USR for '%s' requires: %s\0A\00"
define i32 @insufficient_usr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"USR for '%s' requires: %s\0A\00"
define i32 @insufficient_usr(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ld_a_c_relative();
void opcode_f2() { ld_a_c_relative(); }


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

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

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

LLVM IR (-O2):
define void @opcode_f2() {
%1 = tail call i32 (...) @ld_a_c_relative()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void err_sys(char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ vyatta_if_write_accept_local(char const *);
int /*<<< orphan*/ vyatta_if_write_arp_filter(char const *);
int /*<<< orphan*/ vyatta_if_write_ipv6_disable(char const *);
int /*<<< orphan*/ vyatta_if_write_link_filter(char const *);
void vyatta_if_write_sysctl_values(const char *ifname) {
  vyatta_if_write_accept_local(ifname);
  vyatta_if_write_arp_filter(ifname);
  vyatta_if_write_link_filter(ifname);
  vyatta_if_write_ipv6_disable(ifname);
}


x86 assembly (clang, -O0):
<vyatta_if_write_sysctl_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vyatta_if_write_accept_local@plt>
mov    -0x8(%rbp),%rdi
call   1060 <vyatta_if_write_arp_filter@plt>
mov    -0x8(%rbp),%rdi
call   1050 <vyatta_if_write_link_filter@plt>
mov    -0x8(%rbp),%rdi
call   1030 <vyatta_if_write_ipv6_disable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vyatta_if_write_sysctl_values>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vyatta_if_write_accept_local@plt>
mov    %rbx,%rdi
call   1060 <vyatta_if_write_arp_filter@plt>
mov    %rbx,%rdi
call   1050 <vyatta_if_write_link_filter@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <vyatta_if_write_ipv6_disable@plt>

LLVM IR (-O0):
define void @vyatta_if_write_sysctl_values(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @vyatta_if_write_accept_local(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @vyatta_if_write_arp_filter(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @vyatta_if_write_link_filter(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @vyatta_if_write_ipv6_disable(i8* %9)
ret void
}

LLVM IR (-O2):
define void @vyatta_if_write_sysctl_values(i8* %0) {
%2 = tail call i32 @vyatta_if_write_accept_local(i8* %0)
%3 = tail call i32 @vyatta_if_write_arp_filter(i8* %0)
%4 = tail call i32 @vyatta_if_write_link_filter(i8* %0)
%5 = tail call i32 @vyatta_if_write_ipv6_disable(i8* %0)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t clamp_999(int16_t value) {
  if (value < -999)
    value = -999;
  if (value > 999)
    value = 999;
  return value;
}


x86 assembly (clang, -O0):
<clamp_999>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffc19,-0x4(%rbp)
jge    111b <clamp_999+0x1b>
movl   $0xfffffc19,-0x4(%rbp)
cmpl   $0x3e7,-0x4(%rbp)
jle    112f <clamp_999+0x2f>
movl   $0x3e7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_999>:
cmp    $0xfffffc1a,%edi
mov    $0xfffffc19,%ecx
cmovge %edi,%ecx
cmp    $0x3e7,%ecx
mov    $0x3e7,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp_999(i32 %0) {
%2 = icmp sgt i32 %0, -999
%3 = select i1 %2, i32 %0, i32 -999
%4 = icmp slt i32 %3, 999
%5 = select i1 %4, i32 %3, i32 999
ret i32 %5
}
const char *_Locale_time_default(char *__DUMMY_PAR) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_time_default(i8* nocapture readnone %0) {
ret i8* null
}
const char *stress_2_get_title(void) {
  return "Create / overwrite a large deleted file";
}


x86 assembly (clang, -O0):
<stress_2_get_title>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"Create / overwrite a large deleted file\00"
define i8* @stress_2_get_title() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [40 x i8] c"Create / overwrite a large deleted file\00"
define i8* @stress_2_get_title() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}
void TIM8_TRG_COM_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM8_TRG_COM_IRQHandler() {
ret void
}
unsigned long hash(char *str) {
  unsigned long v = 0L;
  for (; *str; str++) {
    v = ((v << 7) + *str);
  }
  return v;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <hash+0x45>
mov    -0x10(%rbp),%rax
shl    $0x7,%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x7,%rax
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 7
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i64
%14 = add i64 %10, %13
store i64 %14, i64* %3
br label %15
15: ; preds = %8
%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 i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i64 %6, 7
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%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, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
int shift_in_move(char *delayedMoves, char newMove) {
  for (int i = 0; i < 9; i++) {
    delayedMoves[i] = delayedMoves[i + 1];
  }
  delayedMoves[9] = newMove;
  return 0;
}


x86 assembly (clang, -O0):
<shift_in_move>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    1148 <shift_in_move+0x48>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <shift_in_move+0x15>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x9(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_in_move>:
mov    0x1(%rdi),%rax
mov    %rax,(%rdi)
mov    0x9(%rdi),%al
mov    %al,0x8(%rdi)
mov    %sil,0x9(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @shift_in_move(i8* nocapture %0, i8 signext %1) {
%3 = getelementptr i8, i8* %0, i64 1
%4 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %1, i8* %4
ret i32 0
}
unsigned long long f(unsigned long long a) { return a & 0xffffffffULL; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967295
ret i64 %4
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = and i64 %0, 4294967295
ret i64 %2
}
void ARGBSubtractRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSubtractRow_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(long long, int);
long long int fn1(long long int x) {
  bar(x, 1);
  return x;
}


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

x86 assembly (clang, -O2):
<fn1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <bar@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @fn1(i64 returned %0) {
%2 = tail call i32 @bar(i64 %0, i32 1)
ret i64 %0
}
/* Variables and functions */
__attribute__((pure)) char *str_skip_space(char *restrict str) {
  if (!str)
    return NULL;
  while ((*str == ' ') || (*str == '\t'))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<str_skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <str_skip_space+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1173 <str_skip_space+0x73>
jmp    1125 <str_skip_space+0x25>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     114a <str_skip_space+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <str_skip_space+0x5a>
jmp    116b <str_skip_space+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1125 <str_skip_space+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_skip_space>:
test   %rdi,%rdi
je     1122 <str_skip_space+0x22>
mov    %rdi,%rax
jmp    1114 <str_skip_space+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <str_skip_space+0x10>
cmp    $0x9,%cl
je     1110 <str_skip_space+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @str_skip_space(i8* noalias %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 %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %25
7: ; preds = %1
br label %8
8: ; preds = %20, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %8
23: ; preds = %18
%24 = load i8*, i8** %3
store i8* %24, i8** %2
br label %25
25: ; preds = %23, %6
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @str_skip_space(i8* noalias %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
void XkbGetUpdatedMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetUpdatedMap() {
ret void
}
unsigned int binarize(unsigned int yCbCr422) {
  if (((yCbCr422 >> 24) & 0xff) <= 40 && ((yCbCr422 >> 8) & 0xff) <= 40)
    return 0x107F107F;
  else
    return 0x10001000;
}


x86 assembly (clang, -O0):
<binarize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
cmp    $0x28,%eax
ja     113b <binarize+0x3b>
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
cmp    $0x28,%eax
ja     113b <binarize+0x3b>
movl   $0x107f107f,-0x4(%rbp)
jmp    1142 <binarize+0x42>
movl   $0x10001000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binarize>:
mov    %edi,%eax
and    $0xff00,%eax
cmp    $0x2900,%eax
mov    $0x107f107f,%eax
mov    $0x10001000,%ecx
cmovae %ecx,%eax
cmp    $0x29000000,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @binarize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = lshr i32 %4, 24
%6 = and i32 %5, 255
%7 = icmp ule i32 %6, 40
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = icmp ule i32 %11, 40
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 276762751, i32* %2
br label %15
14: ; preds = %8, %1
store i32 268439552, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @binarize(i32 %0) {
%2 = icmp ult i32 %0, 687865856
%3 = and i32 %0, 65280
%4 = icmp ult i32 %3, 10496
%5 = and i1 %2, %4
%6 = select i1 %5, i32 276762751, i32 268439552
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_spew_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_spew_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spew_char>:
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_spew_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
int(scsi_status_is_good)(int status) {
  int tmp;
  {
    status &= 254;
    if (status == 0) {
      tmp = 1;
    } else {
      if (status == 16) {
        tmp = 1;
      } else {
        if (status == 20) {
          tmp = 1;
        } else {
          if (status == 34) {
            tmp = 1;
          } else {
            tmp = 0;
          }
        }
      }
    }
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<scsi_status_is_good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1128 <scsi_status_is_good+0x28>
movl   $0x1,-0x8(%rbp)
jmp    1180 <scsi_status_is_good+0x80>
cmpl   $0x10,-0x4(%rbp)
jne    113e <scsi_status_is_good+0x3e>
movl   $0x1,-0x8(%rbp)
jmp    117b <scsi_status_is_good+0x7b>
cmpl   $0x14,-0x4(%rbp)
jne    1154 <scsi_status_is_good+0x54>
movl   $0x1,-0x8(%rbp)
jmp    1176 <scsi_status_is_good+0x76>
cmpl   $0x22,-0x4(%rbp)
jne    116a <scsi_status_is_good+0x6a>
movl   $0x1,-0x8(%rbp)
jmp    1171 <scsi_status_is_good+0x71>
movl   $0x0,-0x8(%rbp)
jmp    1176 <scsi_status_is_good+0x76>
jmp    117b <scsi_status_is_good+0x7b>
jmp    1180 <scsi_status_is_good+0x80>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_status_is_good>:
mov    %edi,%eax
and    $0xfe,%al
cmp    $0x22,%al
ja     1124 <scsi_status_is_good+0x24>
mov    $0x1,%eax
and    $0xfe,%edi
movabs $0x400110001,%rcx
bt     %rdi,%rcx
jae    1124 <scsi_status_is_good+0x24>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @scsi_status_is_good(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, -2
switch i8 %3, label %4 [
i8 0, label %5
i8 16, label %5
i8 20, label %5
i8 34, label %5
]
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %4
%6 = phi i32 [ 0, %4 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
void test2(void) {
  int input_sec = 75;
  int sec, min, hr;
  calculate_sec(input_sec, &sec, &min, &hr);
  assert(hr == 0);
  assert(min == 1);
  assert(sec == 15);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4b,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <calculate_sec@plt>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0xf,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0x4b,%edi
call   1030 <calculate_sec@plt>
xor    %edi,%edi
cmpl   $0x0,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0xf,0x14(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 75, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @calculate_sec(i32 %5, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @calculate_sec(i32 75, i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 15
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}
int _mpysu(int src1, unsigned int src2) {
  return (short)src1 * (unsigned short)src2;
}


x86 assembly (clang, -O0):
<_mpysu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    -0x8(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpysu>:
movswl %di,%ecx
movzwl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_mpysu(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 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
%10 = zext i16 %9 to i32
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_mpysu(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = and i32 %1, 65535
%6 = mul nsw i32 %4, %5
ret i32 %6
}
void(insw)(int port, void *addr, unsigned long count) {
  {
    ;
    return;
  }
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @insw(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
ret void
}

LLVM IR (-O2):
define void @insw(i32 %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void szl_poll_poll_del(void *priv) { close((int)(intptr_t)priv); }


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

x86 assembly (clang, -O2):
<szl_poll_poll_del>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @szl_poll_poll_del(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @szl_poll_poll_del(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @close(i32 %3)
ret void
}
int test_imm_D5int32_reg(int val) { return ((val) & (0xD5 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_D5int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 213
%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_D5int32_reg(i32 %0) {
%2 = and i32 %0, 213
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void perimeterComputation() { printf("\n COMPUTE PERIMETER OF:"); }


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"\0A COMPUTE PERIMETER OF:\00"
define void @perimeterComputation() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int install_oct(char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<install_oct>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @install_oct(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *string_copy(char *s1, const char *s2) { return strcpy(s1, s2); }


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

x86 assembly (clang, -O2):
<string_copy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @string_copy(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* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @string_copy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
void foo(void(__attribute__((ms_abi)) * fn)(int)) { fn(0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
xor    %ecx,%ecx
call   *-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x28,%rsp
xor    %ecx,%ecx
call   *%rdi
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define void @foo(void (i32)* nocapture %0) {
tail call win64cc void %0(i32 0)
ret void
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
ptrdiff_t field_pos(const void *base, const void *field) {
  return ((const unsigned char *)field) - ((const unsigned char *)base);
}


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

x86 assembly (clang, -O2):
<field_pos>:
mov    %rsi,%rax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @field_pos(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @field_pos(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mp_decode_strbinl(char const **);
const char *mp_decode_strbin(const char **data, uint32_t *len) {
  assert(len != NULL);
  *len = mp_decode_strbinl(data);
  const char *str = *data;
  *data += *len;
  return str;
}


x86 assembly (clang, -O0):
<mp_decode_strbin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mp_decode_strbinl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_strbin>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <mp_decode_strbinl@plt>
mov    %eax,(%r14)
mov    (%rbx),%rcx
cltq
add    %rcx,%rax
mov    %rax,(%rbx)
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mp_decode_strbin(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 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %3
%11 = call i32 @mp_decode_strbinl(i8** %10)
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
store i8* %14, i8** %5
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = sext i32 %16 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8* %20, i8** %17
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @mp_decode_strbin(i8** %0, i32* writeonly %1) {
%3 = icmp ne i32* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @mp_decode_strbinl(i8** %0)
store i32 %6, i32* %1
%7 = load i8*, i8** %0
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %0
ret i8* %7
}