xunge/DecIR huggingface dataset:
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ wait3(int *, int /*<<< orphan*/, struct rusage *);
void sigchld_handler() {
  int status;
  struct rusage rusage;
  signal(SIGCHLD, sigchld_handler);
  wait3(&status, WNOHANG, &rusage);
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rsi
call   1040 <signal@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rdx
call   1030 <wait3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rsi
call   1040 <signal@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <wait3@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@SIGCHLD = global i32 0
@WNOHANG = global i32 0
define void @sigchld_handler() {
%1 = alloca i32
%2 = alloca %struct.rusage
%3 = load i32, i32* @SIGCHLD
%4 = call i32 @signal(i32 %3, void (...)* bitcast (void ()* @sigchld_handler to void (...)*))
%5 = load i32, i32* @WNOHANG
%6 = call i32 @wait3(i32* %1, i32 %5, %struct.rusage* %2)
ret void
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@SIGCHLD = global i32 0
@WNOHANG = global i32 0
define void @sigchld_handler() {
%1 = alloca i32
%2 = alloca %struct.rusage
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.rusage* %2 to i8*
%5 = load i32, i32* @SIGCHLD
%6 = tail call i32 @signal(i32 %5, void (...)* bitcast (void ()* @sigchld_handler to void (...)*))
%7 = load i32, i32* @WNOHANG
%8 = call i32 @wait3(i32* %1, i32 %7, %struct.rusage* %2)
ret void
}
int _kill(int a, int b) {
  (void)a;
  (void)b;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_kill(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 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ conncache_term();
void mainserv_term(void) { conncache_term(); }


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

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

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

LLVM IR (-O2):
define void @mainserv_term() {
%1 = tail call i32 (...) @conncache_term()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_spi_transfern(char *, int);
void Write_MFRC522(unsigned char addr, unsigned char val) {
  char buf[2];
  buf[0] = ((addr << 1) & 0x7E);
  buf[1] = val;
  bcm2835_spi_transfern(buf, 2);
}


x86 assembly (clang, -O0):
<Write_MFRC522>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
and    $0x7e,%eax
mov    %al,-0x4(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x2,%esi
call   1030 <bcm2835_spi_transfern@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write_MFRC522>:
push   %rax
add    %dil,%dil
and    $0x7e,%dil
mov    %dil,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <bcm2835_spi_transfern@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @Write_MFRC522(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [2 x i8]
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 1
%9 = and i32 %8, 126
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i8, i8* %4
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call i32 @bcm2835_spi_transfern(i8* %14, i32 2)
ret void
}

LLVM IR (-O2):
define void @Write_MFRC522(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = shl i8 %0, 1
%6 = and i8 %5, 126
store i8 %6, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %1, i8* %7
%8 = call i32 @bcm2835_spi_transfern(i8* %4, i32 2)
ret void
}
int main(void) { return 43; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2b,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 43
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_common(struct atrf_dsc *, int);
int /*<<< orphan*/ set_power_step(struct atrf_dsc *, int, int /*<<< orphan*/);
void init_tx(struct atrf_dsc *dsc, int trim, int power) {
  init_common(dsc, trim);
  set_power_step(dsc, power, 0);
}


x86 assembly (clang, -O0):
<init_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <init_common@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1030 <set_power_step@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tx>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1040 <init_common@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set_power_step@plt>

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
define void @init_tx(%struct.atrf_dsc* %0, i32 %1, i32 %2) {
%4 = alloca %struct.atrf_dsc*
%5 = alloca i32
%6 = alloca i32
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.atrf_dsc*, %struct.atrf_dsc** %4
%8 = load i32, i32* %5
%9 = call i32 @init_common(%struct.atrf_dsc* %7, i32 %8)
%10 = load %struct.atrf_dsc*, %struct.atrf_dsc** %4
%11 = load i32, i32* %6
%12 = call i32 @set_power_step(%struct.atrf_dsc* %10, i32 %11, i32 0)
ret void
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
define void @init_tx(%struct.atrf_dsc* %0, i32 %1, i32 %2) {
%4 = tail call i32 @init_common(%struct.atrf_dsc* %0, i32 %1)
%5 = tail call i32 @set_power_step(%struct.atrf_dsc* %0, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ sysctlbyname(char *, char *, size_t *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
void get_computer_model(char *buffer, size_t size) {
  if (sysctlbyname("hw.model", buffer, &size, NULL, 0) != 0)
    strcpy(buffer, "UnknownMac");
}


x86 assembly (clang, -O0):
<get_computer_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
cmp    $0x0,%rax
je     1165 <get_computer_model+0x45>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_computer_model>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,0x8(%rsp)
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
test   %rax,%rax
je     115a <get_computer_model+0x3a>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"hw.model\00"
@.str.1 = [11 x i8] c"UnknownMac\00"
define void @get_computer_model(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i64 @sysctlbyname(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i64* %4, i32* null, i32 0)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"hw.model\00"
@.str.1 = [11 x i8] c"UnknownMac\00"
define void @get_computer_model(i8* %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = call i64 @sysctlbyname(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i64* %3, i32* null, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
int cmp_int(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }


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

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

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

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int power(int num, int exponent) { return num + exponent; }


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

x86 assembly (clang, -O2):
<power>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @power(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 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ acct(char *);
int main() {
  acct("foobar");
  acct((char *)-1);
  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 <acct@plt>
mov    $0xffffffffffffffff,%rdi
call   1030 <acct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"foobar\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @acct(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @acct(i8* inttoptr (i64 -1 to i8*))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"foobar\00"
define i32 @main() {
%1 = tail call i32 @acct(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @acct(i8* inttoptr (i64 -1 to i8*))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank0(int);
void m65setParams8000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank0(val << 13);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xd,%edi
call   1030 <prg8setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank0@plt>

LLVM IR (-O0):
define void @m65setParams8000(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 = load i32, i32* %4
%7 = shl i32 %6, 13
%8 = call i32 @prg8setBank0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m65setParams8000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank0(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int LOG_CONS;
int LOG_PID;
int /*<<< orphan*/ openlog(char *, int, int);
void xopenlog(BIO *bp, char *name, int level) {
  openlog(name, LOG_PID | LOG_CONS, level);
}


x86 assembly (clang, -O0):
<xopenlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea1(%rip),%rax
or     (%rax),%esi
mov    -0x14(%rbp),%edx
call   1030 <openlog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xopenlog>:
mov    %rsi,%rdi
mov    0x2ec6(%rip),%rax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
define void @xopenlog(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* @LOG_PID
%9 = load i32, i32* @LOG_CONS
%10 = or i32 %8, %9
%11 = load i32, i32* %6
%12 = call i32 @openlog(i8* %7, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
define void @xopenlog(i32* nocapture readnone %0, i8* %1, i32 %2) {
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %5, %4
%7 = tail call i32 @openlog(i8* %1, i32 %6, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nputchar(int /*<<< orphan*/);
int nputs(const char *string) {
  while (*string) {
    nputchar(*string++);
  }
  return 0;
}


x86 assembly (clang, -O0):
<nputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <nputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <nputchar@plt>
jmp    111c <nputs+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @nputchar(i32 %11)
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @nputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @nputchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
int test_any_zero(unsigned x) { return (x != ~0); }


x86 assembly (clang, -O0):
<test_any_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any_zero>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_any_zero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_any_zero(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
void hack_this_function() {}


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

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

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

LLVM IR (-O2):
define void @hack_this_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a(void) { printf("a() called\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"a() called\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void test_failure_detail(char *name, char *detail) {
  printf("failure: %s [%s]\n", name, detail);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"failure: %s [%s]\0A\00"
define void @test_failure_detail(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 i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"failure: %s [%s]\0A\00"
define void @test_failure_detail(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *zfree(void *pnt) {
  free(pnt);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @zfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int number_of_quaddobl_factors(int *nf) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(686, nf, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<number_of_quaddobl_factors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2ae,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_quaddobl_factors>:
mov    %rdi,%rsi
mov    $0x2ae,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @number_of_quaddobl_factors(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 686, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
clock_t clock() { return -1; }


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

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

LLVM IR (-O0):
define i32 @clock() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @clock() {
ret i32 -1
}
void g_value_set_ulong() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_ulong() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disconnectfunction_exec(int);
int /*<<< orphan*/ network_close(int);
int /*<<< orphan*/ socketlist_remove(int);
void close_socket(int s) {
  network_close(s);
  socketlist_remove(s);
  disconnectfunction_exec(s);
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <network_close@plt>
mov    -0x4(%rbp),%edi
call   1050 <socketlist_remove@plt>
mov    -0x4(%rbp),%edi
call   1040 <disconnectfunction_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rbx
mov    %edi,%ebx
call   1030 <network_close@plt>
mov    %ebx,%edi
call   1050 <socketlist_remove@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <disconnectfunction_exec@plt>

LLVM IR (-O0):
define void @close_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @network_close(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @socketlist_remove(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @disconnectfunction_exec(i32 %7)
ret void
}

LLVM IR (-O2):
define void @close_socket(i32 %0) {
%2 = tail call i32 @network_close(i32 %0)
%3 = tail call i32 @socketlist_remove(i32 %0)
%4 = tail call i32 @disconnectfunction_exec(i32 %0)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t nrf_802154_temperature_get(void) { return 20; }


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

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

LLVM IR (-O0):
define i32 @nrf_802154_temperature_get() {
ret i32 20
}

LLVM IR (-O2):
define i32 @nrf_802154_temperature_get() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int /*<<< orphan*/ thr4(int /*<<< orphan*/);
int /*<<< orphan*/ thr5(int /*<<< orphan*/);
int /*<<< orphan*/ thr6(int /*<<< orphan*/);
int /*<<< orphan*/ thr7(int /*<<< orphan*/);
int /*<<< orphan*/ thr8(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  thr1(0);
__CPROVER_ASYNC_1:
  thr2(0);
__CPROVER_ASYNC_2:
  thr3(0);
__CPROVER_ASYNC_3:
  thr4(0);
__CPROVER_ASYNC_4:
  thr5(0);
__CPROVER_ASYNC_5:
  thr6(0);
__CPROVER_ASYNC_6:
  thr7(0);
__CPROVER_ASYNC_7:
  thr8(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1090 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1080 <thr5@plt>
xor    %edi,%edi
call   1060 <thr6@plt>
xor    %edi,%edi
call   10a0 <thr7@plt>
xor    %edi,%edi
call   1070 <thr8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1090 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1080 <thr5@plt>
xor    %edi,%edi
call   1060 <thr6@plt>
xor    %edi,%edi
call   10a0 <thr7@plt>
xor    %edi,%edi
call   1070 <thr8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @thr1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @thr2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @thr3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @thr4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @thr5(i32 0)
br label %12
12: ; preds = %10
%13 = call i32 @thr6(i32 0)
br label %14
14: ; preds = %12
%15 = call i32 @thr7(i32 0)
br label %16
16: ; preds = %14
%17 = call i32 @thr8(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr1(i32 0)
%2 = tail call i32 @thr2(i32 0)
%3 = tail call i32 @thr3(i32 0)
%4 = tail call i32 @thr4(i32 0)
%5 = tail call i32 @thr5(i32 0)
%6 = tail call i32 @thr6(i32 0)
%7 = tail call i32 @thr7(i32 0)
%8 = tail call i32 @thr8(i32 0)
ret i32 0
}
void gtk_text_iter_forward_line() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_line() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ my_strcpy(char *, char *);
int my_strlen(char *);
char *my_strdup(char *src) {
  int size;
  char *cpy;
  size = my_strlen(src);
  if ((cpy = malloc(sizeof(char) * size + 1)) == NULL)
    return (NULL);
  my_strcpy(cpy, src);
  return (cpy);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1176 <my_strdup+0x46>
movq   $0x0,-0x8(%rbp)
jmp    118b <my_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <my_strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <my_strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <my_strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <my_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @my_strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sposv_(char *, int *, int *, float *, int *, float *, int *,
                          int *);
int aa_cla_sposv(char uplo, int n, int nrhs, float *A, int lda, float *B,
                 int ldb) {
  int info = 0;
  sposv_(&uplo, &n, &nrhs, A, &lda, B, &ldb, &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_sposv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    0x10(%rbp),%edi
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x1c(%rbp),%r8
lea    0x10(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sposv_@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_sposv>:
sub    $0x18,%rsp
mov    %dil,0x7(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x7(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
push   %rax
push   %r10
call   1030 <sposv_@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @aa_cla_sposv(i8 signext %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
%13 = alloca float*
%14 = alloca i32
%15 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store float* %3, float** %11
store i32 %4, i32* %12
store float* %5, float** %13
store i32 %6, i32* %14
store i32 0, i32* %15
%16 = load float*, float** %11
%17 = load float*, float** %13
%18 = call i32 @sposv_(i8* %8, i32* %9, i32* %10, float* %16, i32* %12, float* %17, i32* %14, i32* %15)
%19 = load i32, i32* %15
ret i32 %19
}

LLVM IR (-O2):
define i32 @aa_cla_sposv(i8 signext %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %4, i32* %11
store i32 %6, i32* %12
%14 = bitcast i32* %13 to i8*
store i32 0, i32* %13
%15 = call i32 @sposv_(i8* %8, i32* %9, i32* %10, float* %3, i32* %11, float* %5, i32* %12, i32* %13)
%16 = load i32, i32* %13
ret i32 %16
}
void gtk_file_chooser_unselect_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_unselect_filename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("Hello, World!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@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 = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ yyerror(char *);
void zzerr() { yyerror("syntax error"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"syntax error\00"
define void @zzerr() {
%1 = call i32 @yyerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"syntax error\00"
define void @zzerr() {
%1 = tail call i32 @yyerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void nfs4_state_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @nfs4_state_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_barrier();
void *a_ll_p(void volatile *);
int /*<<< orphan*/ a_sc_p(void volatile *, void *);
void *a_cas_p(volatile void *p, void *t, void *s) {
  void *old;
  do {
    old = a_ll_p(p);
    if (old != t) {
      a_barrier();
      break;
    }
  } while (!a_sc_p(p, s));
  return old;
}


x86 assembly (clang, -O0):
<a_cas_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <a_ll_p@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     116b <a_cas_p+0x3b>
mov    $0x0,%al
call   1030 <a_barrier@plt>
jmp    118d <a_cas_p+0x5d>
jmp    1170 <a_cas_p+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <a_sc_p@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <a_cas_p+0x14>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1050 <a_ll_p@plt>
cmp    %r15,%rax
jne    116e <a_cas_p+0x3e>
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <a_sc_p@plt>
test   %eax,%eax
je     1150 <a_cas_p+0x20>
jmp    117b <a_cas_p+0x4b>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <a_barrier@plt>
mov    %rbx,%r15
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %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
br label %8
8: ; preds = %17, %3
%9 = load i8*, i8** %4
%10 = call i8* @a_ll_p(i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = icmp ne i8* %11, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @a_barrier()
br label %23
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i8*, i8** %4
%19 = load i8*, i8** %6
%20 = call i32 @a_sc_p(i8* %18, i8* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br i1 %22, label %8, label %23
23: ; preds = %17, %14
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* readnone %1, i8* %2) {
br label %4
4: ; preds = %9, %3
%5 = tail call i8* @a_ll_p(i8* %0)
%6 = icmp eq i8* %5, %1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (...) @a_barrier()
br label %12
9: ; preds = %4
%10 = tail call i32 @a_sc_p(i8* %0, i8* %2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %9, %7
%13 = phi i8* [ %5, %7 ], [ %1, %9 ]
ret i8* %13
}
int sorting_comparison(const void *elem_a, const void *elem_b) {
  return (*(int *)elem_a - *(int *)elem_b);
}


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

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

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

LLVM IR (-O2):
define i32 @sorting_comparison(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int cstl_func(void) {
  printf("Hello world\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @cstl_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ finish();
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signum) {
  printf("terminated by signal %d\n", signum);
  finish();
  _exit(-1);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <finish@plt>
mov    $0xffffffff,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <finish@plt>
mov    $0xffffffff,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"terminated by signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @finish()
%6 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"terminated by signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @finish()
%4 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f(double, double *);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double x = 4.0;
  double y;
  f(x, &y);
  printf("y = %f\n", y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    %rsp,%rdi
call   1030 <f@plt>
movsd  (%rsp),%xmm0
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"y = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 4.000000e+00, double* %2
%4 = load double, double* %2
%5 = call i32 @f(double %4, double* %3)
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"y = %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @f(double 4.000000e+00, double* %1)
%4 = load double, double* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mulhi_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_mulhi_pi16(__m64 a, __m64 b) { return _mm_mulhi_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_mulhi_pi16>:
jmp    1030 <_mm_mulhi_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_mulhi_pi16(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 = load i32, i32* %4
%7 = call i32 @_mm_mulhi_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_mulhi_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mulhi_pi16(i32 %0, i32 %1)
ret i32 %3
}
void generic_sched_clock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @generic_sched_clock_init() {
ret void
}
int f4(int a, int b, int c, int d) { return (b & c) ^ ((b & c) | (a & d)); }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%edx
and    -0x10(%rbp),%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %esi,%eax
and    %edx,%eax
and    %ecx,%edi
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = and i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %12, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %8
%17 = and i32 %15, %16
%18 = or i32 %14, %17
%19 = xor i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, %1
%6 = and i32 %3, %0
%7 = xor i32 %5, -1
%8 = and i32 %6, %7
ret i32 %8
}
char *stpcpy(register char *__restrict s1, const char *__restrict s2) {
  do {
    *s1++ = *s2++;
  } while (*s2 != '\0');
  return s1;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
add    $0x1,%rsi
nopl   0x0(%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* noalias writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %10, %4 ]
%6 = phi i8* [ %0, %2 ], [ %9, %4 ]
%7 = phi i8* [ %1, %2 ], [ %8, %4 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %6
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
ret i8* %9
}
/* Variables and functions */
char *strsep(char **, char *);
char *get_nick_from_mask(char *mask) {
  char *nick;
  nick = strsep(&mask, "!");
  return nick;
}


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

x86 assembly (clang, -O2):
<get_nick_from_mask>:
push   %rax
mov    %rdi,(%rsp)
lea    0xee4(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strsep@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
define i8* @get_nick_from_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PMULHW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xe5);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


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

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

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

LLVM IR (-O2):
define void @MMX_PMULHW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 229)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}