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

/* Variables and functions */
uint8_t update_byte(uint8_t byte, uint8_t bit, uint8_t value) {
  if (value == 0) {
    return (byte &= ~(1 << bit));
  } else {
    return (byte |= 1 << bit);
  }
}


x86 assembly (clang, -O0):
<update_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113e <update_byte+0x3e>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1159 <update_byte+0x59>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_byte>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
test   %rdx,%rdx
je     1115 <update_byte+0x15>
cltq
or     %rdi,%rax
ret
not    %eax
cltq
and    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @update_byte(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = trunc i64 %1 to i32
%6 = shl nuw i32 1, %5
br i1 %4, label %7, label %11
7: ; preds = %3
%8 = xor i32 %6, -1
%9 = sext i32 %8 to i64
%10 = and i64 %9, %0
br label %14
11: ; preds = %3
%12 = sext i32 %6 to i64
%13 = or i64 %12, %0
br label %14
14: ; preds = %11, %7
%15 = phi i64 [ %10, %7 ], [ %13, %11 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ matNf_getRow(float *, float const *, int const, int);
void mat4f_getRow(float result[4], const float m[16], const int row) {
  matNf_getRow(result, m, row, 4);
}


x86 assembly (clang, -O0):
<mat4f_getRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%ecx
call   1030 <matNf_getRow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_getRow>:
mov    $0x4,%ecx
jmp    1030 <matNf_getRow@plt>

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

LLVM IR (-O2):
define void @mat4f_getRow(float* %0, float* %1, i32 %2) {
%4 = tail call i32 @matNf_getRow(float* %0, float* %1, i32 %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int /*<<< orphan*/);
char *strupper(char *dst, char *src) {
  char *start = dst;
  while (*src != '\0')
    *dst++ = toupper(*src++);
  *dst = '\0';
  return start;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <strupper+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1128 <strupper+0x18>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rsi),%al
mov    %rdi,%rbx
test   %al,%al
je     114a <strupper+0x3a>
mov    %rsi,%r15
add    $0x1,%r15
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
movzbl (%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    1130 <strupper+0x20>
movb   $0x0,(%rbx)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = tail call i32 @toupper(i32 %9)
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i8* [ %0, %2 ], [ %13, %5 ]
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void xstrncpy(char *dest, const char *src, size_t n) {
  strncpy(dest, src, n - 1);
  dest[n - 1] = 0;
}


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

x86 assembly (clang, -O2):
<xstrncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @xstrncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = sub i64 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i64 %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @xstrncpy(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hilo(unsigned long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, unsigned long);
int main(void) {
  unsigned long n = 1 << 8 | 2;
  unsigned long m;
  m = n >> 8 & 0xff;
  m |= n & 0xff;
  printf("got 0x%lx, expected 0x%lx\n", hilo(n), m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x102,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <hilo@plt>
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x102,%edi
call   1040 <hilo@plt>
lea    0xece(%rip),%rdi
mov    $0x3,%edx
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"got 0x%lx, expected 0x%lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 258, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 8
%6 = and i64 %5, 255
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = and i64 %7, 255
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = call i32 @hilo(i64 %11)
%13 = load i64, i64* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %12, i64 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"got 0x%lx, expected 0x%lx\0A\00"
define i32 @main() {
%1 = tail call i32 @hilo(i64 258)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i64 3)
ret i32 0
}
void device_rename(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<device_rename>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_rename>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.device_rename = [14 x i8] c"device_rename\00"
define void @device_rename() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.device_rename, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.device_rename = [14 x i8] c"device_rename\00"
define void @device_rename() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.device_rename, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ integer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int *, size_t, int, int /*<<< orphan*/ *);
size_t Mem_FwriteInt(int integer, FILE *fp) {
  size_t nbytes;
  nbytes = fwrite(&integer, (size_t)1, sizeof(integer), fp);
  return nbytes;
}


x86 assembly (clang, -O0):
<Mem_FwriteInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_FwriteInt>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @Mem_FwriteInt(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 @fwrite(i32* %3, i64 1, i32 4, i32* %1)
ret i64 %4
}
/* Variables and functions */
int func2();
int __attribute__((visibility("default"))) func() { return func2(); }


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

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

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

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 (...) @func2()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ stdout_put_char(unsigned int);
void print_string(unsigned string[]) {
  unsigned i = 0;
  while (string[i]) {
    stdout_put_char(string[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpl   $0x0,(%rax,%rcx,4)
je     1151 <print_string+0x41>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <stdout_put_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1141 <print_string+0x31>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <stdout_put_char@plt>
mov    %ebp,%eax
mov    (%rbx,%rax,4),%edi
add    $0x1,%ebp
test   %edi,%edi
jne    1130 <print_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_string(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 @stdout_put_char(i32 %5)
%8 = add i32 %6, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool is_dir(const char *path) {
  struct stat statbuf;
  if (stat(path, &statbuf) != 0)
    return 0;
  return S_ISDIR(statbuf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <is_dir+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_dir+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_dir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ log_close();
int /*<<< orphan*/ log_open(char const *, char const *, int);
void log_reopen(const char *restrict name, const char *restrict file,
                int flags) {
  log_close();
  log_open(name, file, flags);
}


x86 assembly (clang, -O0):
<log_reopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <log_close@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <log_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_reopen>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <log_close@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <log_open@plt>

LLVM IR (-O0):
define void @log_reopen(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (...) @log_close()
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @log_open(i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @log_reopen(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = tail call i32 (...) @log_close()
%5 = tail call i32 @log_open(i8* %0, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ c2_data_write(int /*<<< orphan*/, int);
int /*<<< orphan*/ wait_busy();
void fpdat_write(uint8_t value) {
  c2_data_write(value, 1);
  wait_busy();
}


x86 assembly (clang, -O0):
<fpdat_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <c2_data_write@plt>
mov    $0x0,%al
call   1030 <wait_busy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpdat_write>:
push   %rax
mov    $0x1,%esi
call   1040 <c2_data_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <wait_busy@plt>

LLVM IR (-O0):
define void @fpdat_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @c2_data_write(i32 %3, i32 1)
%5 = call i32 (...) @wait_busy()
ret void
}

LLVM IR (-O2):
define void @fpdat_write(i32 %0) {
%2 = tail call i32 @c2_data_write(i32 %0, i32 1)
%3 = tail call i32 (...) @wait_busy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/, int);
int dup_one(int fd) {
  int newfd;
  newfd = fcntl(fd, F_DUPFD, 3);
  return newfd;
}


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

x86 assembly (clang, -O2):
<dup_one>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    $0x3,%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @dup_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_DUPFD
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 3)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @dup_one(i32 %0) {
%2 = load i32, i32* @F_DUPFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 3)
ret i32 %3
}
void _delay_us(int i) {}


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

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

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

LLVM IR (-O2):
define void @_delay_us(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome() {
  printf("This program will generate a word search based on user input.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"This program will generate a word search based on user input.\0A\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"This program will generate a word search based on user input.\0A\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int streq(const char *s1, const char *s2) { return (strcmp(s1, s2) == 0); }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ show_linux_cpu();
int /*<<< orphan*/ show_linux_scheduler();
void show_cpu(void) {
  show_linux_cpu();
  show_linux_scheduler();
}


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

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

LLVM IR (-O0):
define void @show_cpu() {
%1 = call i32 (...) @show_linux_cpu()
%2 = call i32 (...) @show_linux_scheduler()
ret void
}

LLVM IR (-O2):
define void @show_cpu() {
%1 = tail call i32 (...) @show_linux_cpu()
%2 = tail call i32 (...) @show_linux_scheduler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bored() {
  printf("bored ");
  bored();
}


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

x86 assembly (clang, -O2):
<bored>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <bored+0x10>

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

LLVM IR (-O2):
@.str = [7 x i8] c"bored \00"
define void @bored() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %1
}
char *dec_to_bin(int number) {
  int i;
  int k;
  int n = number;
  char *erg;
  for (i = 31; i >= 0; i--) {
    k = n >> i;
    if (k & 1)
      erg[31 - i] = '1';
    else
      erg[31 - i] = '0';
  }
}


x86 assembly (clang, -O0):
<dec_to_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1f,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1176 <dec_to_bin+0x76>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1150 <dec_to_bin+0x50>
mov    -0x20(%rbp),%rax
mov    $0x1f,%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x31,(%rax,%rcx,1)
jmp    1163 <dec_to_bin+0x63>
mov    -0x20(%rbp),%rax
mov    $0x1f,%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x30,(%rax,%rcx,1)
jmp    1168 <dec_to_bin+0x68>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <dec_to_bin+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i8* @dec_to_bin(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
%8 = load i32, i32* %3
store i32 %8, i32* %6
store i32 31, i32* %4
br label %9
9: ; preds = %32, %1
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %35
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %12
%20 = load i8*, i8** %7
%21 = load i32, i32* %4
%22 = sub nsw i32 31, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
store i8 49, i8* %24
br label %31
25: ; preds = %12
%26 = load i8*, i8** %7
%27 = load i32, i32* %4
%28 = sub nsw i32 31, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
store i8 48, i8* %30
br label %31
31: ; preds = %25, %19
br label %32
32: ; preds = %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, -1
store i32 %34, i32* %4
br label %9
35: ; preds = %9
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned char *, int, int);
void foo(unsigned char *a, int i) {
#pragma omp ordered simd
  bar(a, i, 64);
}


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x40,%edx
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @foo(i8* %0, i32 %1) {
%3 = tail call i32 @bar(i8* %0, i32 %1, i32 64)
ret void
}
void calcularVetor(int vetor[]) {}


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

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

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

LLVM IR (-O2):
define void @calcularVetor(i32* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int open(char const *, int);
int r_open2(const char *path, int oflag) {
  int retval;
  while (retval = open(path, oflag), retval == -1 && errno == EINTR)
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_open2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1157 <r_open2+0x47>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1167 <r_open2+0x57>
jmp    116c <r_open2+0x5c>
jmp    111f <r_open2+0xf>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_open2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ebd(%rip),%r14
mov    0x2eae(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <open@plt>
cmp    $0xffffffff,%eax
jne    1147 <r_open2+0x37>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_open2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_open2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @open(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i64, i64* @errno
%14 = load i64, i64* @EINTR
%15 = icmp eq i64 %13, %14
br label %16
16: ; preds = %12, %6
%17 = phi i1 [ false, %6 ], [ %15, %12 ]
br i1 %17, label %18, label %19
18: ; preds = %16
br label %6
19: ; preds = %16
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_open2(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @open(i8* %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int ht_hash(int const, int const, int const);
int ht_get_hash(const int k, const int num_buckets, const int attempt,
                const int prime_1, const int prime_2) {
  const int hash_a = ht_hash(k, prime_1, num_buckets);
  const int hash_b = ht_hash(k, prime_2, num_buckets);
  return (hash_a + (attempt * (hash_b + 1))) % num_buckets;
}


x86 assembly (clang, -O0):
<ht_get_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <ht_hash@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <ht_hash@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_get_hash>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r15d
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %ecx,%esi
mov    %ebp,%edx
call   1030 <ht_hash@plt>
mov    %eax,%r12d
mov    %ebx,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <ht_hash@plt>
add    $0x1,%eax
imul   %r14d,%eax
add    %r12d,%eax
cltd
idiv   %ebp
mov    %edx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ht_get_hash(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %6
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = call i32 @ht_hash(i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %11
%17 = load i32, i32* %6
%18 = load i32, i32* %10
%19 = load i32, i32* %7
%20 = call i32 @ht_hash(i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %12
%21 = load i32, i32* %11
%22 = load i32, i32* %8
%23 = load i32, i32* %12
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 %22, %24
%26 = add nsw i32 %21, %25
%27 = load i32, i32* %7
%28 = srem i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ht_get_hash(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @ht_hash(i32 %0, i32 %3, i32 %1)
%7 = tail call i32 @ht_hash(i32 %0, i32 %4, i32 %1)
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %8, %2
%10 = add nsw i32 %9, %6
%11 = srem i32 %10, %1
ret i32 %11
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ send_int_to_srv(int);
int get_state() {
  send_int_to_srv(0x13);
  return get_data_int();
}


x86 assembly (clang, -O0):
<get_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_state>:
push   %rax
mov    $0x13,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_data_int@plt>

LLVM IR (-O0):
define i32 @get_state() {
%1 = call i32 @send_int_to_srv(i32 19)
%2 = call i32 (...) @get_data_int()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_state() {
%1 = tail call i32 @send_int_to_srv(i32 19)
%2 = tail call i32 (...) @get_data_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ make_manual(int);
void latex_manual_() {
  make_manual(2);
  return;
}


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

x86 assembly (clang, -O2):
<latex_manual_>:
mov    $0x2,%edi
jmp    1030 <make_manual@plt>

LLVM IR (-O0):
define void @latex_manual_() {
%1 = call i32 @make_manual(i32 2)
ret void
}

LLVM IR (-O2):
define void @latex_manual_() {
%1 = tail call i32 @make_manual(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (int i = 0; i < 7; i++)
    printf("hello");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int isascii(int c) { return 0 <= c && c <= '\177'; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1121 <isascii+0x21>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned int, int /*<<< orphan*/ *);
void write4LE(FILE *fp, unsigned int val) {
  putc(val & 0xff, fp);
  putc((val >> 8) & 0xff, fp);
  putc((val >> 16) & 0xff, fp);
  putc((val >> 24) & 0xff, fp);
}


x86 assembly (clang, -O0):
<write4LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
shr    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write4LE(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = call i32 @putc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = call i32 @putc(i32 %11, i32* %12)
%14 = load i32, i32* %4
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = call i32 @putc(i32 %16, i32* %17)
%19 = load i32, i32* %4
%20 = lshr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = call i32 @putc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @write4LE(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @putc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @putc(i32 %6, i32* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @putc(i32 %9, i32* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 @putc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
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):
<error>:
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 @error(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 @error(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 */
char *gp_strdup(char *);
int /*<<< orphan*/ int_warn(int, char *);
int do_system_func(const char *cmd, char **output) {
  int_warn((-1), "system() requires support for pipes");
  *output = gp_strdup("");
  return 0;
}


x86 assembly (clang, -O0):
<do_system_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
lea    0xec4(%rip),%rsi
call   1040 <int_warn@plt>
lea    0xedb(%rip),%rdi
call   1030 <gp_strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_system_func>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
mov    $0xffffffff,%edi
call   1040 <int_warn@plt>
lea    0xee7(%rip),%rdi
call   1030 <gp_strdup@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"system() requires support for pipes\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @do_system_func(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 @int_warn(i32 -1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i8* @gp_strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8**, i8*** %4
store i8* %6, i8** %7
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"system() requires support for pipes\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @do_system_func(i8* nocapture readnone %0, i8** nocapture writeonly %1) {
%3 = tail call i32 @int_warn(i32 -1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @gp_strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %1
ret i32 0
}
char *element_radio_button_get_heading(char *heading, char *name) {
  if (heading)
    return heading;
  else
    return name;
}


x86 assembly (clang, -O0):
<element_radio_button_get_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1124 <element_radio_button_get_heading+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <element_radio_button_get_heading+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_radio_button_get_heading>:
mov    %rsi,%rax
test   %rdi,%rdi
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @element_radio_button_get_heading(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* %1, i8* %0
ret i8* %4
}
/* Variables and functions */
int WIFEXITED(int);
int wifexited(int status) { return WIFEXITED(status); }


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

x86 assembly (clang, -O2):
<wifexited>:
jmp    1030 <WIFEXITED@plt>

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

LLVM IR (-O2):
define i32 @wifexited(i32 %0) {
%2 = tail call i32 @WIFEXITED(i32 %0)
ret i32 %2
}
/* Variables and functions */
int genRand();
int nrand(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int i = 1;
  for (; i < 61; i++) {
    printf("Full random %d\n", genRand());
    printf("Range random %d\n", nrand(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3d,-0x14(%rbp)
jge    1190 <main+0x60>
mov    $0x0,%al
call   1040 <genRand@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1030 <nrand@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xebf(%rip),%r14
lea    0xec8(%rip),%r15
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <genRand@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %ebx,%edi
call   1030 <nrand@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x3d,%ebx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Full random %d\0A\00"
@.str.1 = [17 x i8] c"Range random %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 61
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = call i32 (...) @genRand()
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @nrand(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Full random %d\0A\00"
@.str.1 = [17 x i8] c"Range random %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %9, %3 ]
%5 = tail call i32 (...) @genRand()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @nrand(i32 %4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 61
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sethostname(char *, int);
void bufferAccessOutOfBounds() {
  char buf[2];
  sethostname(buf, 2);
  sethostname(buf, 4);
}


x86 assembly (clang, -O0):
<bufferAccessOutOfBounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <sethostname@plt>
lea    -0x2(%rbp),%rdi
mov    $0x4,%esi
call   1030 <sethostname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferAccessOutOfBounds>:
push   %rbx
sub    $0x10,%rsp
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <sethostname@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <sethostname@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @bufferAccessOutOfBounds() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @sethostname(i8* %2, i32 2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @sethostname(i8* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @bufferAccessOutOfBounds() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @sethostname(i8* %2, i32 2)
%4 = call i32 @sethostname(i8* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bfdcfg_clr_pid();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void bfdcfg_handle_term() {
  bfdcfg_clr_pid();
  exit(0);
}


x86 assembly (clang, -O0):
<bfdcfg_handle_term>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bfdcfg_clr_pid@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bfdcfg_handle_term>:
push   %rax
xor    %eax,%eax
call   1030 <bfdcfg_clr_pid@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @bfdcfg_handle_term() {
%1 = call i32 (...) @bfdcfg_clr_pid()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @bfdcfg_handle_term() {
%1 = tail call i32 (...) @bfdcfg_clr_pid()
%2 = tail call i32 @exit(i32 0)
unreachable
}