xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_mask_le(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 |= 0x20;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_mask_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_mask_le+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_mask_le+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_mask_le>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_mask_le+0x41>
movsbl 0xf(%rsp),%esi
or     $0x20,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_mask_le() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 32
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_mask_le() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 32
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
void swap(char **s, int i, int j) {
  char *temp = s[i];
  s[i] = s[j];
  s[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ random();
int32_t randValLong(int32_t min, int32_t max) {
  if (min == 0 && max == 0)
    return 0;
  int32_t val = random() % (max - min + 1) + min;
  return val;
}


x86 assembly (clang, -O0):
<randValLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <randValLong+0x33>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <randValLong+0x33>
movq   $0x0,-0x8(%rbp)
jmp    116b <randValLong+0x5b>
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
add    -0x10(%rbp),%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randValLong>:
mov    %rsi,%rax
or     %rdi,%rax
je     1146 <randValLong+0x36>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <random@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1149 <randValLong+0x39>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    114f <randValLong+0x3f>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @randValLong(i64 %0, i64 %1) {
%3 = or i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 (...) @random()
%7 = sub i64 1, %0
%8 = add i64 %7, %1
%9 = srem i64 %6, %8
%10 = add nsw i64 %9, %0
br label %11
11: ; preds = %2, %5
%12 = phi i64 [ %10, %5 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  while (str[len])
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int strmlen(char *s) {
  register int n = 0;
  if (s == NULL)
    return 0;
  for (; *s != 0; ++s)
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<strmlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strmlen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    115b <strmlen+0x5b>
jmp    112b <strmlen+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strmlen+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <strmlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strmlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strmlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strmlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strmlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int printPoints(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ toPoint(int, int);
int main(int argc, char *argv[]) {
  if (printPoints(toPoint(0, 0), toPoint(1000, 1000)) != 1)
    abort();
  else
    exit(0);
  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)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <toPoint@plt>
mov    %eax,-0x14(%rbp)
mov    $0x3e8,%esi
mov    %esi,%edi
call   1040 <toPoint@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <printPoints@plt>
cmp    $0x1,%eax
je     1188 <main+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <toPoint@plt>
mov    %eax,%ebx
mov    $0x3e8,%edi
mov    $0x3e8,%esi
call   1040 <toPoint@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <printPoints@plt>
cmp    $0x1,%eax
jne    1170 <main+0x30>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @toPoint(i32 0, i32 0)
%7 = call i32 @toPoint(i32 1000, i32 1000)
%8 = call i32 @printPoints(i32 %6, i32 %7)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @toPoint(i32 0, i32 0)
%4 = tail call i32 @toPoint(i32 1000, i32 1000)
%5 = tail call i32 @printPoints(i32 %3, i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *dlerror();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char *);
void dlcheck(char const *op, void *ptr) {
  if (!ptr) {
    printf("%s failed: %s\n", op, dlerror());
    exit(1);
  }
}


x86 assembly (clang, -O0):
<dlcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <dlcheck+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlcheck>:
test   %rsi,%rsi
je     1136 <dlcheck+0x6>
ret
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s failed: %s\0A\00"
define void @dlcheck(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i8* (...) @dlerror()
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s failed: %s\0A\00"
define void @dlcheck(i8* %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i8* (...) @dlerror()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
struct memory {
  int dummy;
};

/* Variables and functions */
unsigned char memory_get_d8(struct memory *, unsigned short);
unsigned char memory_get_interrupt_enabled(struct memory *mem) {
  return memory_get_d8(mem, ((unsigned short)0xFFFF));
}


x86 assembly (clang, -O0):
<memory_get_interrupt_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffff,%esi
call   1030 <memory_get_d8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_get_interrupt_enabled>:
mov    $0xffff,%esi
jmp    1030 <memory_get_d8@plt>

LLVM IR (-O0):
%struct.memory = type { i32 }
define zeroext i8 @memory_get_interrupt_enabled(%struct.memory* %0) {
%2 = alloca %struct.memory*
store %struct.memory* %0, %struct.memory** %2
%3 = load %struct.memory*, %struct.memory** %2
%4 = call zeroext i8 @memory_get_d8(%struct.memory* %3, i16 zeroext -1)
ret i8 %4
}

LLVM IR (-O2):
%struct.memory = type { i32 }
define zeroext i8 @memory_get_interrupt_enabled(%struct.memory* %0) {
%2 = tail call zeroext i8 @memory_get_d8(%struct.memory* %0, i16 zeroext -1)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ rem_on();
void v2() {
  *(volatile unsigned long *)((void *)0xfffff400 + 0x34) =
      (1 << (1)) | (1 << (0));
  rem_on();
}


x86 assembly (clang, -O0):
<v2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movq   $0x3,0x34(%rax)
mov    $0x0,%al
call   1030 <rem_on@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2>:
mov    $0xfffff434,%eax
movq   $0x3,(%rax)
xor    %eax,%eax
jmp    1030 <rem_on@plt>

LLVM IR (-O0):
define void @v2() {
store volatile i64 3, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 52) to i64*)
%1 = call i32 (...) @rem_on()
ret void
}

LLVM IR (-O2):
define void @v2() {
store volatile i64 3, i64* inttoptr (i64 4294964276 to i64*)
%1 = tail call i32 (...) @rem_on()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_r4_fma_o_f(double *, double *, double *, long, long);
void fftss_r4_bgl_pl_o_f(double *vi, double *vo, double *wn, long bsize,
                         long blocks) {
  fftss_r4_fma_o_f(vi, vo, wn, bsize, blocks);
}


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

x86 assembly (clang, -O2):
<fftss_r4_bgl_pl_o_f>:
jmp    1030 <fftss_r4_fma_o_f@plt>

LLVM IR (-O0):
define void @fftss_r4_bgl_pl_o_f(double* %0, double* %1, double* %2, i64 %3, i64 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @fftss_r4_fma_o_f(double* %11, double* %12, double* %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fftss_r4_bgl_pl_o_f(double* %0, double* %1, double* %2, i64 %3, i64 %4) {
%6 = tail call i32 @fftss_r4_fma_o_f(double* %0, double* %1, double* %2, i64 %3, i64 %4)
ret void
}
int search_table(int n, int num_table[], int num) {
  int i = 0;
  for (i = 0; i < num; i++) {
    if (num_table[i] == n) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<search_table>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <search_table+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1147 <search_table+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <search_table+0x61>
jmp    114c <search_table+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <search_table+0x1c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_table>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <search_table+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,(%rsi,%rcx,4)
je     111f <search_table+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <search_table+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search_table(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Type definitions */
struct loop_func {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ flash_poll_proc();
void flash_poll_cb(struct loop_func *f) {
  (void)f;
  flash_poll_proc();
}


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

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

LLVM IR (-O0):
%struct.loop_func = type { i32 }
define void @flash_poll_cb(%struct.loop_func* %0) {
%2 = alloca %struct.loop_func*
store %struct.loop_func* %0, %struct.loop_func** %2
%3 = load %struct.loop_func*, %struct.loop_func** %2
%4 = call i32 (...) @flash_poll_proc()
ret void
}

LLVM IR (-O2):
%struct.loop_func = type { i32 }
define void @flash_poll_cb(%struct.loop_func* nocapture readnone %0) {
%2 = tail call i32 (...) @flash_poll_proc()
ret void
}
unsigned int CalculateNMEAChecksum(const char *buf, const char *end) {
  unsigned int ret = 0;
  while (*buf && buf != end) {
    ret ^= (unsigned int)*((unsigned char *)buf);
    ++buf;
  }
  return ret;
}


x86 assembly (clang, -O0):
<CalculateNMEAChecksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1136 <CalculateNMEAChecksum+0x36>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1146 <CalculateNMEAChecksum+0x46>
jmp    1164 <CalculateNMEAChecksum+0x64>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <CalculateNMEAChecksum+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateNMEAChecksum>:
xor    %eax,%eax
cmp    %rsi,%rdi
je     1137 <CalculateNMEAChecksum+0x37>
mov    (%rdi),%cl
test   %cl,%cl
je     1137 <CalculateNMEAChecksum+0x37>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edx
movzbl %cl,%eax
xor    %edx,%eax
cmp    %rsi,%rdi
je     1137 <CalculateNMEAChecksum+0x37>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <CalculateNMEAChecksum+0x20>
ret

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

LLVM IR (-O2):
define i32 @CalculateNMEAChecksum(i8* %0, i8* readnone %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp ne i8* %0, %1
%6 = and i1 %5, %4
br i1 %6, label %7, label %18
7: ; preds = %2, %7
%8 = phi i8 [ %14, %7 ], [ %3, %2 ]
%9 = phi i32 [ %12, %7 ], [ 0, %2 ]
%10 = phi i8* [ %13, %7 ], [ %0, %2 ]
%11 = zext i8 %8 to i32
%12 = xor i32 %9, %11
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
%16 = icmp ne i8* %13, %1
%17 = and i1 %16, %15
br i1 %17, label %7, label %18
18: ; preds = %7, %2
%19 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %19
}
void close_getchr() {}


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

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

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

LLVM IR (-O2):
define void @close_getchr() {
ret void
}
int utf8_continuation_p(char p) { return (p & 0xc0) == 0x80; }


x86 assembly (clang, -O0):
<utf8_continuation_p>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_continuation_p>:
and    $0xc0,%dil
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @utf8_continuation_p(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 192
%6 = icmp eq i32 %5, 128
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @utf8_continuation_p(i8 signext %0) {
%2 = and i8 %0, -64
%3 = icmp eq i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("usage: \n"
         "    ads                 normal usage\n"
         "    ads --daemon        detach and go to background (daemonizing)\n"
         "    ads --debug         debug mode (more output)\n"
         "    \n"
         "note:\n"
         "    you must invoke ads as root!\n\n");
}


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

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

LLVM IR (-O0):
@.str = [206 x i8] c"usage: \0A ads normal usage\0A ads --daemon detach and go to background (daemonizing)\0A ads --debug debug mode (more output)\0A \0Anote:\0A you must invoke ads as root!\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [205 x i8] c"usage: \0A ads normal usage\0A ads --daemon detach and go to background (daemonizing)\0A ads --debug debug mode (more output)\0A \0Anote:\0A you must invoke ads as root!\0A\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([205 x i8], [205 x i8]* @str, i64 0, i64 0))
ret void
}
void freestr(char *s) {}


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

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

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

LLVM IR (-O2):
define void @freestr(i8* nocapture %0) {
ret void
}
double drightlog(double x, double r) {
  return (r * ((2.0 * x) - (3.0 * x * x)));
}


x86 assembly (clang, -O0):
<drightlog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drightlog>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drightlog(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double 3.000000e+00, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double %11)
%13 = fmul double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @drightlog(double %0, double %1) {
%3 = fmul double %0, -3.000000e+00
%4 = fmul double %3, %0
%5 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %4)
%6 = fmul double %5, %1
ret double %6
}
/* Variables and functions */
int iterator();
int /*<<< orphan*/ printf(char *, ...);
int rest_prio(void) {
  int num = iterator();
  if (num < 100) {
    printf("The number of new priorities could be saved is %d.\n",
           (int)(100 - num));
    return 100 - num;
  } else {
    printf("The memory for priorities is full!");
    return 0;
  }
}


x86 assembly (clang, -O0):
<rest_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <iterator@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1162 <rest_prio+0x42>
mov    $0x64,%esi
sub    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <rest_prio+0x57>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest_prio>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <iterator@plt>
cmp    $0x63,%eax
jg     1148 <rest_prio+0x28>
mov    $0x64,%ebx
sub    %eax,%ebx
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1156 <rest_prio+0x36>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"The number of new priorities could be saved is %d.\0A\00"
@.str.1 = [35 x i8] c"The memory for priorities is full!\00"
define i32 @rest_prio() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @iterator()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sub nsw i32 100, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = sub nsw i32 100, %10
store i32 %11, i32* %1
br label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %14
14: ; preds = %12, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [52 x i8] c"The number of new priorities could be saved is %d.\0A\00"
@.str.1 = [35 x i8] c"The memory for priorities is full!\00"
define i32 @rest_prio() {
%1 = tail call i32 (...) @iterator()
%2 = icmp slt i32 %1, 100
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = sub nsw i32 100, %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
6: ; preds = %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %4, %3 ], [ 0, %6 ]
ret i32 %9
}
int XIconifyWindow() {}


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

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

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

LLVM IR (-O2):
define i32 @XIconifyWindow() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeComparator(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000000);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000000);
}


x86 assembly (clang, -O0):
<GPIOPinTypeComparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GPIOPinTypeComparator(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 0)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeComparator(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ puts(char *);
int main(void) {
  fork();
  puts("This message should appear twice.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"This message should appear twice.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"This message should appear twice.\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_h24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h24_12_sse4() {
ret void
}
int cmp(const char *s, const char *t) {
  while (*s == *t) {
    if (*s == 0)
      return (1);
    s++;
    t++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <cmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <cmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1162 <cmp+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <cmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <cmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <cmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <cmp+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ idt_set_entry(int, int /*<<< orphan*/, int, int);
void exceptionHandler(int exception_number, void *exception_address) {
  idt_set_entry(exception_number, (uint32_t)exception_address, 0x8, 0x8E);
}


x86 assembly (clang, -O0):
<exceptionHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    $0x8,%edx
mov    $0x8e,%ecx
call   1030 <idt_set_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exceptionHandler>:
mov    $0x8,%edx
mov    $0x8e,%ecx
jmp    1030 <idt_set_entry@plt>

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

LLVM IR (-O2):
define void @exceptionHandler(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @idt_set_entry(i32 %0, i32 %4, i32 8, i32 142)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int msl_free(void **buf) {
  if (!buf || !*buf) {
    return 0;
  }
  free(*buf);
  *buf = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<msl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <msl_free+0x25>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1141 <msl_free+0x31>
movl   $0x0,-0x4(%rbp)
jmp    115f <msl_free+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msl_free>:
push   %rbx
test   %rdi,%rdi
je     112d <msl_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <msl_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @msl_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int is_loopback_device(const char *path, const char *node) {
  char file[0x200];
  snprintf(file, 0x200, "%s%s/iteration_count", path, node);
  if (access(file, F_OK) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_loopback_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x200,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x220(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
jne    117e <is_loopback_device+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_loopback_device+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_loopback_device>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s%s/iteration_count\00"
@F_OK = global i32 0
define i32 @is_loopback_device(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @snprintf(i8* %7, i32 512, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @F_OK
%13 = call i64 @access(i8* %11, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s%s/iteration_count\00"
@F_OK = global i32 0
define i32 @is_loopback_device(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = load i32, i32* @F_OK
%7 = call i64 @access(i8* %4, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_stack(void *s) {
  if (s == NULL) {
    return;
  } else {
    free(s);
  }
}


x86 assembly (clang, -O0):
<free_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_stack+0x1c>
jmp    1135 <free_stack+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_stack(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct NotificationNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct NotificationNode *);
void notificationNodeDelete(struct NotificationNode *notificationNode) {
  free(notificationNode);
}


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

x86 assembly (clang, -O2):
<notificationNodeDelete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.NotificationNode = type { i32 }
define void @notificationNodeDelete(%struct.NotificationNode* %0) {
%2 = alloca %struct.NotificationNode*
store %struct.NotificationNode* %0, %struct.NotificationNode** %2
%3 = load %struct.NotificationNode*, %struct.NotificationNode** %2
%4 = call i32 @free(%struct.NotificationNode* %3)
ret void
}

LLVM IR (-O2):
%struct.NotificationNode = type { i32 }
define void @notificationNodeDelete(%struct.NotificationNode* nocapture %0) {
%2 = tail call i32 @free(%struct.NotificationNode* %0)
ret void
}
int test_imm_C9uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xc9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C9uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 201
%5 = icmp ne i64 %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_C9uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 201
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((no, noclone)) float floorf(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @floorf(float returned %0) {
ret float %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ pad;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
char get_XColor_pad(void *_p) { return (char)((XColor *)_p)->pad; }


x86 assembly (clang, -O0):
<get_XColor_pad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XColor_pad>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i8 @get_XColor_pad(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @get_XColor_pad(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int f1(int);
int f2(int x) {
  extern int v;
  return f1(x);
}


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = tail call i32 @f1(i32 %0)
ret i32 %2
}