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

/* Variables and functions */
char CHAR_BIT;
int /*<<< orphan*/ assert(int);
void set_bit_false(volatile uint8_t *byte, char bit_num) {
  assert(bit_num < CHAR_BIT);
  *byte &= ~(1 << bit_num);
}


x86 assembly (clang, -O0):
<set_bit_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    0x2eb3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_false>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ec0(%rip),%rax
xor    %edi,%edi
cmp    %bl,(%rax)
setg   %dil
call   1030 <assert@plt>
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
and    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@CHAR_BIT = global i8 0
define void @set_bit_false(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8, i8* @CHAR_BIT
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = load i32*, i32** %3
%17 = load volatile i32, i32* %16
%18 = and i32 %17, %15
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i8 0
define void @set_bit_false(i32* %0, i8 signext %1) {
%3 = load i8, i8* @CHAR_BIT
%4 = icmp sgt i8 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = zext i8 %1 to i32
%8 = shl nuw i32 1, %7
%9 = xor i32 %8, -1
%10 = load volatile i32, i32* %0
%11 = and i32 %10, %9
store volatile i32 %11, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *gets(char *);
int /*<<< orphan*/ stdout;
char *_gets(char *s) {
  fflush(stdout);
  return gets(s);
}


x86 assembly (clang, -O0):
<_gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <gets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gets>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <gets@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i8* @_gets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i8*, i8** %2
%6 = call i8* @gets(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
@stdout = global i32 0
define i8* @_gets(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i8* @gets(i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_clear(int);
int /*<<< orphan*/ gpio_direction(int, int);
int /*<<< orphan*/ gpio_set(int);
void DC(unsigned int status) {
  gpio_direction(42, 251);
  if (status)
    gpio_set(42);
  else
    gpio_clear(42);
}


x86 assembly (clang, -O0):
<DC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%edi
mov    $0xfb,%esi
call   1040 <gpio_direction@plt>
cmpl   $0x0,-0x4(%rbp)
je     1163 <DC+0x33>
mov    $0x2a,%edi
call   1050 <gpio_set@plt>
jmp    116d <DC+0x3d>
mov    $0x2a,%edi
call   1030 <gpio_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DC>:
push   %rbx
mov    %edi,%ebx
mov    $0x2a,%edi
mov    $0xfb,%esi
call   1040 <gpio_direction@plt>
mov    $0x2a,%edi
test   %ebx,%ebx
je     1151 <DC+0x21>
pop    %rbx
jmp    1050 <gpio_set@plt>
pop    %rbx
jmp    1030 <gpio_clear@plt>

LLVM IR (-O0):
define void @DC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gpio_direction(i32 42, i32 251)
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @gpio_set(i32 42)
br label %10
8: ; preds = %1
%9 = call i32 @gpio_clear(i32 42)
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @DC(i32 %0) {
%2 = tail call i32 @gpio_direction(i32 42, i32 251)
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @gpio_set(i32 42)
br label %8
6: ; preds = %1
%7 = tail call i32 @gpio_clear(i32 42)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntMasterEnable();
void IrqInterruptEnable(void) { IntMasterEnable(); }


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

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

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

LLVM IR (-O2):
define void @IrqInterruptEnable() {
%1 = tail call i32 (...) @IntMasterEnable()
ret void
}
int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpabuf = type opaque
define i32 @wps_validate_m6_encr(%struct.wpabuf* %0, i32 %1) {
%3 = alloca %struct.wpabuf*
%4 = alloca i32
store %struct.wpabuf* %0, %struct.wpabuf** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m6_encr(%struct.wpabuf* nocapture readnone %0, i32 %1) {
ret i32 0
}
int test_imm_92uint32_reg(unsigned int val) {
  return ((val) & (0x92 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_92uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 146
%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_92uint32_reg(i32 %0) {
%2 = and i32 %0, 146
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __NR_tkill;
int syscall(int /*<<< orphan*/, int, int);
int tkill(int lwpid, int signo) { return syscall(__NR_tkill, lwpid, signo); }


x86 assembly (clang, -O0):
<tkill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkill>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_tkill = global i32 0
define i32 @tkill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @__NR_tkill
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@__NR_tkill = global i32 0
define i32 @tkill(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_tkill
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
char const *get_buffer();
const char *ploop_get_last_error(void) { return get_buffer(); }


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

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

LLVM IR (-O0):
define i8* @ploop_get_last_error() {
%1 = call i8* (...) @get_buffer()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ploop_get_last_error() {
%1 = tail call i8* (...) @get_buffer()
ret i8* %1
}
void print_statisic(void) {}


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

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

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

LLVM IR (-O2):
define void @print_statisic() {
ret void
}
/* Variables and functions */
int atoi(char *);
int CIntChars(char *Sorc) {
  int ret = atoi(Sorc);
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @CIntChars(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int foo5(double b, double c) { return b > c; }


x86 assembly (clang, -O0):
<foo5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo5>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @foo5(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo5(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_4Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Euint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Euint8_mem>:
testb  $0xb2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -78
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int unlockpt(int fd) {
  (void)fd;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @unlockpt(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *make_word(char *text, size_t first, size_t last) {
  size_t length = last - first + 1;
  char *word = malloc((length + 1) * sizeof(char));
  strncpy(word, &(text[first]), length);
  word[length] = '\0';
  return word;
}


x86 assembly (clang, -O0):
<make_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_word>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
sub    %rsi,%rbx
lea    0x1(%rbx),%r12
lea    0x2(%rbx),%rdi
call   1040 <malloc@plt>
mov    %rax,%r13
add    %r14,%r15
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <strncpy@plt>
movb   $0x0,0x1(%r13,%rbx,1)
mov    %r13,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @make_word(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = sub i64 %9, %10
%12 = add i64 %11, 1
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = add i64 %13, 1
%15 = mul i64 %14, 1
%16 = call i8* @malloc(i64 %15)
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = load i8*, i8** %4
%19 = load i64, i64* %5
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i64, i64* %7
%22 = call i32 @strncpy(i8* %17, i8* %20, i64 %21)
%23 = load i8*, i8** %8
%24 = load i64, i64* %7
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8 0, i8* %25
%26 = load i8*, i8** %8
ret i8* %26
}

LLVM IR (-O2):
define i8* @make_word(i8* %0, i64 %1, i64 %2) {
%4 = sub i64 %2, %1
%5 = add i64 %4, 1
%6 = add i64 %4, 2
%7 = tail call i8* @malloc(i64 %6)
%8 = getelementptr inbounds i8, i8* %0, i64 %1
%9 = tail call i32 @strncpy(i8* %7, i8* %8, i64 %5)
%10 = getelementptr inbounds i8, i8* %7, i64 %5
store i8 0, i8* %10
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void epicfail(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @epicfail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int descend(char *, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int tree(char *path, int show_perms) {
  printf("[%s]\n", path);
  return descend(path, show_perms, "");
}


x86 assembly (clang, -O0):
<tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdx
call   1030 <descend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <descend@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @tree(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @descend(i8* %0, i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
void advance_message() {}


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

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

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

LLVM IR (-O2):
define void @advance_message() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_enable(int);
int /*<<< orphan*/ log_init();
void __attribute__((constructor)) nu_init(void) {
  log_init();
  log_enable(1);
}


x86 assembly (clang, -O0):
<nu_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <log_init@plt>
mov    $0x1,%edi
call   1040 <log_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nu_init>:
push   %rax
xor    %eax,%eax
call   1030 <log_init@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <log_enable@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @nu_init, i8* null }]
define void @nu_init() {
%1 = call i32 (...) @log_init()
%2 = call i32 @log_enable(i32 1)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @nu_init, i8* null }]
define void @nu_init() {
%1 = tail call i32 (...) @log_init()
%2 = tail call i32 @log_enable(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ constant_time_ge(unsigned int, unsigned int);
unsigned char constant_time_ge_8(unsigned int a, unsigned int b) {
  return (unsigned char)(constant_time_ge(a, b));
}


x86 assembly (clang, -O0):
<constant_time_ge_8>:
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 <constant_time_ge@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_ge_8>:
push   %rax
call   1030 <constant_time_ge@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @constant_time_ge_8(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 i64 @constant_time_ge(i32 %5, i32 %6)
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @constant_time_ge_8(i32 %0, i32 %1) {
%3 = tail call i64 @constant_time_ge(i32 %0, i32 %1)
%4 = trunc i64 %3 to i8
ret i8 %4
}
int read(char a[]) {
  int ch;
  int count = 0;
  ch = a[count];
  while (ch != '\0' && count < 100) {
    count = count + 1;
    ch = a[count];
  }
  return count;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
je     1137 <read+0x37>
cmpl   $0x64,-0x10(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <read+0x47>
jmp    1164 <read+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xc(%rbp)
jmp    111e <read+0x1e>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
cmpb   $0x0,(%rdi)
je     1125 <read+0x25>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
je     1124 <read+0x24>
cmp    $0x63,%rcx
mov    %rax,%rcx
jb     1110 <read+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @read(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 i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = icmp ult i64 %5, 99
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %6 to i32
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ 0, %1 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ toupper(int);
void upper(char *string) {
  register int i;
  ;
  for (i = 0; i < (int)strlen(string); ++i)
    string[i] = (char)toupper((int)string[i]);
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117c <upper+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <upper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @upper(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i64 [ %12, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i64 @toupper(i32 %9)
%11 = trunc i64 %10 to i8
store i8 %11, i8* %7
%12 = add nuw nsw i64 %6, 1
%13 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%14 = shl i64 %13, 32
%15 = ashr exact i64 %14, 32
%16 = icmp slt i64 %12, %15
br i1 %16, label %5, label %17
17: ; preds = %5, %1
ret void
}
void TimerRTCEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<TimerRTCEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerRTCEnable>:
orq    $0x10,0xc(%rdi)
ret

LLVM IR (-O0):
define void @TimerRTCEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @TimerRTCEnable(i64 %0) {
%2 = add i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_tests();
int /*<<< orphan*/ start_program();
int main() {
  if (0)
    do_tests();
  else
    start_program();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_program()
ret i32 0
}
int putstr(s)
char *s;
{ printf("\"%s\"\n%s\n", s, ""); }


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

x86 assembly (clang, -O2):
<putstr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"\22%s\22\0A%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @putstr(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void func(char **argv) {
  printf("running strcpy...\n");
  char arr[16];
  strcpy(arr, argv[2]);
  return;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"running strcpy...\0A\00"
define void @func(i8** %0) {
%2 = alloca i8**
%3 = alloca [16 x i8]
store i8** %0, i8*** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 2
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %5, i8* %8)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"running strcpy...\00"
define void @func(i8** nocapture %0) {
%2 = alloca [16 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %0, i64 2
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *a, int low, int high) {
  if (low < high) {
    int mid = partition(a, low, high);
    quickSort(a, low, mid - 1);
    quickSort(a, mid + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int vis_comm(int j) { return j * j; }


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

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

LLVM IR (-O0):
define i32 @vis_comm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @vis_comm(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void io_wait() { asm volatile("outb %%al, $0x80" ::"a"(0)); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
xor    %eax,%eax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "outb %al, $$0x80", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ close(int const);
unsigned int strlen(char const *);
unsigned int write(int const, char const *, unsigned int);
int zerossh_pipe_writer(const int *pipe_fd, const char *password) {
  unsigned int pw_len = strlen(password);
  close(pipe_fd[0]);
  while (write(pipe_fd[1], password, pw_len) == pw_len)
    ;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<zerossh_pipe_writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <close@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
jne    1178 <zerossh_pipe_writer+0x48>
jmp    1157 <zerossh_pipe_writer+0x27>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerossh_pipe_writer>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1050 <close@plt>
nopl   0x0(%rax,%rax,1)
mov    0x4(%rbx),%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
cmp    %ebp,%eax
je     1150 <zerossh_pipe_writer+0x20>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @zerossh_pipe_writer(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = load i32, i32* %0
%5 = tail call i32 @close(i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 1
br label %7
7: ; preds = %7, %2
%8 = load i32, i32* %6
%9 = tail call i32 @write(i32 %8, i8* %1, i32 %3)
%10 = icmp eq i32 %9, %3
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(1 != 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharCurDown(void) { printf("\x01B(0\x02E\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0.\1B(B\00"
define void @putLDCharCurDown() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_ssumors(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_ssumors(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_ssumors@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_ssumors@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_ssumors(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_ssumors(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ strncat(char *, char const *, int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void get_path(char *result, const char *fname, const char *d_name) {
  strncpy(result, fname, strlen(fname) + 1);
  strncat(result, "/", 1);
  strncat(result, d_name, strlen(d_name));
}


x86 assembly (clang, -O0):
<get_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x1,%edx
call   1050 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_path>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
lea    0xea5(%rip),%rsi
mov    %r15,%rdi
mov    $0x1,%edx
call   1050 <strncat@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strncat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @get_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = call i32 @strncpy(i8* %7, i8* %8, i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @strncat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %6
%17 = load i8*, i8** %6
%18 = call i32 @strlen(i8* %17)
%19 = call i32 @strncat(i8* %15, i8* %16, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @get_path(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %5)
%7 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @strncat(i8* %0, i8* %2, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int);
void etherprintdevs(int i) { print(" ether%d", i); }


x86 assembly (clang, -O0):
<etherprintdevs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etherprintdevs>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c" ether%d\00"
define void @etherprintdevs(i32 %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int is_quasiquote_start(int c) { return c == '`'; }


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

x86 assembly (clang, -O2):
<is_quasiquote_start>:
xor    %eax,%eax
cmp    $0x60,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_quasiquote_start(i32 %0) {
%2 = icmp eq i32 %0, 96
%3 = zext i1 %2 to i32
ret i32 %3
}
TASK(shutdown) {
  printf("Shutting down...");
  ShutdownOS(0);
  TerminateTask();
}


x86 assembly (clang, -O0):
<TASK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <ShutdownOS@plt>
mov    $0x0,%al
call   1050 <TerminateTask@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TASK>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <ShutdownOS@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <TerminateTask@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Shutting down...\00"
define i32 @TASK(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i32, ...) bitcast (i32 (...)* @ShutdownOS to i32 (i32, ...)*)(i32 0)
%6 = call i32 (...) @TerminateTask()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Shutting down...\00"
define i32 @TASK(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @ShutdownOS to i32 (i32, ...)*)(i32 0)
%4 = tail call i32 (...) @TerminateTask()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mode_new(int);
void term_cmd_mode_set(void) { mode_new(-1); }


x86 assembly (clang, -O0):
<term_cmd_mode_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <mode_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_cmd_mode_set>:
mov    $0xffffffff,%edi
jmp    1030 <mode_new@plt>

LLVM IR (-O0):
define void @term_cmd_mode_set() {
%1 = call i32 @mode_new(i32 -1)
ret void
}

LLVM IR (-O2):
define void @term_cmd_mode_set() {
%1 = tail call i32 @mode_new(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void on_off(unsigned int value) { printf(value ? " (on)\n" : " (off)\n"); }


x86 assembly (clang, -O0):
<on_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee2(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_off>:
test   %edi,%edi
lea    0xeee(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" (on)\0A\00"
@.str.1 = [8 x i8] c" (off)\0A\00"
define void @on_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 @printf(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" (on)\0A\00"
@.str.1 = [8 x i8] c" (off)\0A\00"
define void @on_off(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
void X509_PURPOSE_add(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PURPOSE_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTFRouteToken();
int /*<<< orphan*/ RTFSkipGroup();
void ReadObjGroup(void) {
  RTFSkipGroup();
  RTFRouteToken();
}


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

x86 assembly (clang, -O2):
<ReadObjGroup>:
push   %rax
xor    %eax,%eax
call   1030 <RTFSkipGroup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <RTFRouteToken@plt>

LLVM IR (-O0):
define void @ReadObjGroup() {
%1 = call i32 (...) @RTFSkipGroup()
%2 = call i32 (...) @RTFRouteToken()
ret void
}

LLVM IR (-O2):
define void @ReadObjGroup() {
%1 = tail call i32 (...) @RTFSkipGroup()
%2 = tail call i32 (...) @RTFRouteToken()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world \n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}