xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_module_if_do_acct_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_module_if@%p::do_acct (rtpp_module_if_do_acct) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_module_if_do_acct_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_module_if_do_acct_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_module_if@%p::do_acct (rtpp_module_if_do_acct) is invoked after destruction\0A\00"
define void @rtpp_module_if_do_acct_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_module_if@%p::do_acct (rtpp_module_if_do_acct) is invoked after destruction\0A\00"
define void @rtpp_module_if_do_acct_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_uintptr_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_store(int /*<<< orphan*/ *, uintptr_t);
void stdatomic_write_ptr(atomic_uintptr_t *p, void *replacement) {
  atomic_store(p, (uintptr_t)replacement);
}


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

x86 assembly (clang, -O2):
<stdatomic_write_ptr>:
jmp    1030 <atomic_store@plt>

LLVM IR (-O0):
define void @stdatomic_write_ptr(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 i64
%8 = call i32 @atomic_store(i32* %5, i64 %7)
ret void
}

LLVM IR (-O2):
define void @stdatomic_write_ptr(i32* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @atomic_store(i32* %0, i64 %3)
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *nstrdup(const char *str) {
  if (str)
    return strdup(str);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<nstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <nstrdup+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <nstrdup+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @nstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

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


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,%eax
jne    1160 <is_dir+0x40>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1160 <is_dir+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_dir+0x47>
movl   $0x0,-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>
test   %eax,%eax
jne    1144 <is_dir+0x24>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1144 <is_dir+0x24>
pop    %rcx
ret
xor    %eax,%eax
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 i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %15
14: ; preds = %8, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %13
}
const char *db_drop_current_trial_balance_view_sql(void) {
  static const char *query = "DROP VIEW current_trial_balance";
  return query;
}


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

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

LLVM IR (-O0):
@db_drop_current_trial_balance_view_sql.query = internal global i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i32 0, i32 0)
@.str = [32 x i8] c"DROP VIEW current_trial_balance\00"
define i8* @db_drop_current_trial_balance_view_sql() {
%1 = load i8*, i8** @db_drop_current_trial_balance_view_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [32 x i8] c"DROP VIEW current_trial_balance\00"
define i8* @db_drop_current_trial_balance_view_sql() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
void gtk_file_chooser_button_set_width_chars() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_button_set_width_chars() {
ret void
}
void directory_close(struct _directory *_dir) { return; }


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

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

LLVM IR (-O0):
%struct._directory = type opaque
define void @directory_close(%struct._directory* %0) {
%2 = alloca %struct._directory*
store %struct._directory* %0, %struct._directory** %2
ret void
}

LLVM IR (-O2):
%struct._directory = type opaque
define void @directory_close(%struct._directory* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1)
    printf("(2) Hello world from user space\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

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

LLVM IR (-O0):
@.str = [34 x i8] c"(2) Hello world from user space\0D\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [33 x i8] c"(2) Hello world from user space\0D\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %1
}
void limpiar(int **vector, int x) {
  for (int i = 0; i < x; i++) {
    free(vector[i]);
  }
  free(vector);
}


x86 assembly (clang, -O0):
<limpiar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <limpiar+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <limpiar+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpiar>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <limpiar+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <limpiar+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @limpiar(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i32** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int tid = 0;
  unsigned int i, j = 0;
  for (j = 0;; j++) {
    printf("slave%d : j = %d, lim = %d, exit? = %s\n", tid, j, 24,
           (j < 24) ? "true" : "false");
  }
  printf("Done\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xee9(%rip),%r8
lea    0xedd(%rip),%rax
cmp    $0x18,%ecx
cmovb  %rax,%r8
lea    0xea7(%rip),%rdi
mov    $0x18,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf0a(%rip),%r14
lea    0xf08(%rip),%r15
lea    0xed4(%rip),%rbx
xor    %ebp,%ebp
xchg   %ax,%ax
cmp    $0x18,%ebp
mov    %r15,%r8
cmovb  %r14,%r8
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    $0x18,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [40 x i8] c"slave%d : j = %d, lim = %d, exit? = %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %4
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 24
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 24, i8* %11)
br label %13
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add i32 %14, 1
store i32 %15, i32* %4
br label %5
}

LLVM IR (-O2):
@.str = [40 x i8] c"slave%d : j = %d, lim = %d, exit? = %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = icmp ult i32 %2, 24
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 0, i32 %2, i32 24, i8* %4)
%6 = add i32 %2, 1
br label %1
}
void offBit(char *byteSet, int bitSet) {
  *byteSet = (*byteSet & ~(1 << bitSet));
}


x86 assembly (clang, -O0):
<offBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<offBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %al,(%rdi)
ret

LLVM IR (-O0):
define void @offBit(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 i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
%11 = and i32 %7, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @offBit(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = shl nuw i32 1, %1
%5 = trunc i32 %4 to i8
%6 = xor i8 %5, -1
%7 = and i8 %3, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom(void *p) {
  if (!p) {
    fprintf(stderr, "\e[1;31mFatal: Out of memory\e[0m\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <oom+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oom>:
test   %rdi,%rdi
je     1126 <oom+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"\1B[1;31mFatal: Out of memory\1B[0m\0A\00"
define void @oom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"\1B[1;31mFatal: Out of memory\1B[0m\0A\00"
define void @oom(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_get_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc(619, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_quaddobl_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_quaddobl_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000002,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 2, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 619, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 2, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 619, i32* %6, i32* %3, double* %1)
ret i32 %8
}
int ctox(char *p) {
  char c = *p;
  c = c - '0';
  if ((int)c > 9)
    c = c + '0' - 'A' + 10;
  return ((int)c) & 0xf;
}


x86 assembly (clang, -O0):
<ctox>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jle    1138 <ctox+0x38>
movsbl -0x9(%rbp),%eax
add    $0x30,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctox>:
mov    (%rdi),%al
lea    -0x30(%rax),%ecx
add    $0x9,%al
cmp    $0xa,%cl
movzbl %al,%edx
movzbl %cl,%eax
cmovge %edx,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @ctox(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp sgt i8 %3, 9
%5 = add i8 %2, 9
%6 = select i1 %4, i8 %5, i8 %3
%7 = and i8 %6, 15
%8 = zext i8 %7 to i32
ret i32 %8
}
int test_imm_C4int64_lowword_reg(long long val) {
  return ((val) & (0xC4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C4int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 196
%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_C4int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 196
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_D4int64_lowword_reg(long long val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 212
%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_D4int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 212
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ getit(int, char **, int, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void newer(int argc, char *argv[]) {
  if (getit(argc, argv, -1, "w")) {
    printf("Local file \"%s\" is newer than remote file \"%s\"\n", argv[2],
           argv[1]);
  }
}


x86 assembly (clang, -O0):
<newer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
call   1040 <getit@plt>
cmp    $0x0,%rax
je     116d <newer+0x4d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newer>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rcx
mov    $0xffffffff,%edx
call   1040 <getit@plt>
test   %rax,%rax
je     114f <newer+0x2f>
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rsi
lea    0xeb9(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [48 x i8] c"Local file \22%s\22 is newer than remote file \22%s\22\0A\00"
define void @newer(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 = call i64 @getit(i32 %5, i8** %6, i32 -1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %15)
br label %17
17: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [48 x i8] c"Local file \22%s\22 is newer than remote file \22%s\22\0A\00"
define void @newer(i32 %0, i8** %1) {
%3 = tail call i64 @getit(i32 %0, i8** %1, i32 -1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %9)
br label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
double fabs(double);
__attribute__((unused)) int eq_double(double d1, double d2) {
  return d1 == d2 || fabs(d1 - d2) < fabs(d1) * 1.5 / 4096.0;
}


x86 assembly (clang, -O0):
<eq_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    112e <eq_double+0x2e>
jp     112e <eq_double+0x2e>
jmp    1175 <eq_double+0x75>
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xed1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movaps 0xec1(%rip),%xmm2
pand   %xmm2,%xmm0
movsd  0xead(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe99(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_double>:
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
jne    110e <eq_double+0xe>
jp     110e <eq_double+0xe>
ret
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd 0xee2(%rip),%xmm1
andpd  %xmm1,%xmm0
mulsd  0xee6(%rip),%xmm0
andpd  %xmm1,%xmm2
mulsd  0xee2(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm2,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @eq_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = call double @llvm.fabs.f64(double %11)
%13 = load double, double* %3
%14 = call double @llvm.fabs.f64(double %13)
%15 = fmul double %14, 1.500000e+00
%16 = fdiv double %15, 4.096000e+03
%17 = fcmp olt double %12, %16
br label %18
18: ; preds = %8, %2
%19 = phi i1 [ true, %2 ], [ %17, %8 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @eq_double(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = fsub double %0, %1
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = tail call double @llvm.fabs.f64(double %0)
%8 = fmul double %7, 1.500000e+00
%9 = fmul double %8, 0x3F30000000000000
%10 = fcmp olt double %6, %9
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2
%13 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ TCSBRK;
int /*<<< orphan*/ TCSBRKP;
int ioctl(int, int /*<<< orphan*/, int);
int tcsendbreak(int fd, int duration) {
  if (duration > 0)
    return ioctl(fd, TCSBRKP, (duration + 99) / 100);
  else
    return ioctl(fd, TCSBRK, 0);
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1151 <tcsendbreak+0x41>
mov    -0x8(%rbp),%edi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%eax
add    $0x63,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <ioctl@plt>
mov    %eax,-0x4(%rbp)
jmp    1167 <tcsendbreak+0x57>
mov    -0x8(%rbp),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsendbreak>:
test   %esi,%esi
jle    1132 <tcsendbreak+0x22>
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
add    $0x63,%esi
imul   $0x51eb851f,%rsi,%rdx
shr    $0x25,%rdx
mov    %eax,%esi
jmp    1030 <ioctl@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@TCSBRKP = global i32 0
@TCSBRK = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* @TCSBRKP
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 99
%13 = sdiv i32 %12, 100
%14 = call i32 @ioctl(i32 %9, i32 %10, i32 %13)
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* @TCSBRK
%18 = call i32 @ioctl(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@TCSBRKP = global i32 0
@TCSBRK = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @TCSBRKP
%6 = add nuw nsw i32 %1, 99
%7 = udiv i32 %6, 100
%8 = tail call i32 @ioctl(i32 %0, i32 %5, i32 %7)
br label %12
9: ; preds = %2
%10 = load i32, i32* @TCSBRK
%11 = tail call i32 @ioctl(i32 %0, i32 %10, i32 0)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %8, %4 ], [ %11, %9 ]
ret i32 %13
}
int dosys(cmd, path)
char *cmd;
char *path;
{ return system(cmd); }


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

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

LLVM IR (-O0):
define i32 @dosys(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 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @dosys(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
ret i32 %3
}
/* Type definitions */
struct sockaddr_in6 {
  int sin6_scope_id;
  int /*<<< orphan*/ sin6_family;
};

/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int main(int argc, char **argv) {
  struct sockaddr_in6 sa;
  sa.sin6_family = PF_INET6;
  sa.sin6_scope_id = 23;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x17,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, i32 }
@PF_INET6 = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in6
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @PF_INET6
%8 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %6, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %6, i32 0, i32 0
store i32 23, i32* %9
ret i32 0
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct tms {
  int dummy;
};

/* Variables and functions */
scalar_t__ getpid();
scalar_t__ getuid();
long times(struct tms *);
long seednum() {
  long a, b, c, d;
  struct tms tbuff;
  a = (long)getpid();
  b = (long)getuid();
  d = times(&tbuff);
  c = d ^ ((a + b) << 15);
  return c;
}


x86 assembly (clang, -O0):
<seednum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %rax,-0x10(%rbp)
lea    -0x28(%rbp),%rdi
call   1050 <times@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
shl    $0xf,%rcx
xor    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seednum>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
call   1050 <times@plt>
add    %r14,%rbx
shl    $0xf,%rbx
xor    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i64 @seednum() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.tms
%6 = call i64 (...) @getpid()
store i64 %6, i64* %1
%7 = call i64 (...) @getuid()
store i64 %7, i64* %2
%8 = call i64 @times(%struct.tms* %5)
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = load i64, i64* %1
%11 = load i64, i64* %2
%12 = add nsw i64 %10, %11
%13 = shl i64 %12, 15
%14 = xor i64 %9, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i64 @seednum() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = tail call i64 (...) @getpid()
%4 = tail call i64 (...) @getuid()
%5 = call i64 @times(%struct.tms* %1)
%6 = add nsw i64 %4, %3
%7 = shl i64 %6, 15
%8 = xor i64 %7, %5
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ min;

/* Variables and functions */
int /*<<< orphan*/ printBits(int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int before = 12;
  printf("%d\n", before);
  int after = (before ^ -1) + 1;
  printf("%d\n", after);
  int min = -1;
  printBits(sizeof(min), &min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x10(%rbp)
mov    $0x4,%edi
lea    -0x10(%rbp),%rsi
call   1030 <printBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffff4,%esi
call   1040 <printf@plt>
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xc(%rsp),%rsi
mov    $0x4,%edi
call   1030 <printBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = xor i32 %7, -1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
store i32 -1, i32* %4
%12 = call i32 @printBits(i32 4, i32* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -12)
%4 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%5 = call i32 @printBits(i32 4, i32* %1)
ret i32 0
}
signed char str_isset(const char *s) { return s && s[0] != '\0'; }


x86 assembly (clang, -O0):
<str_isset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <str_isset+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isset>:
test   %rdi,%rdi
je     110c <str_isset+0xc>
cmpb   $0x0,(%rdi)
setne  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @str_isset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @str_isset(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i8
br label %7
7: ; preds = %3, %1
%8 = phi i8 [ 0, %1 ], [ %6, %3 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, ("Usage: %s [ options ] [ <interval> [ <count> ] ]\n"),
          progname);
  fprintf(
      stderr,
      ("Options are:\n"
       "[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\n"
       "[ <device> [ ... ] | ALL ] [ -p [ <device> | ALL ] ]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ]\0A\00"
@.str.1 = [135 x i8] c"Options are:\0A[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\0A[ <device> [ ... ] | ALL ] [ -p [ <device> | ALL ] ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ]\0A\00"
@.str.1 = [135 x i8] c"Options are:\0A[ -c ] [ -d ] [ -N ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ -x ]\0A[ <device> [ ... ] | ALL ] [ -p [ <device> | ALL ] ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
void vivid_cec_bus_free_work(struct vivid_dev *dev) {}


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

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

LLVM IR (-O0):
%struct.vivid_dev = type opaque
define void @vivid_cec_bus_free_work(%struct.vivid_dev* %0) {
%2 = alloca %struct.vivid_dev*
store %struct.vivid_dev* %0, %struct.vivid_dev** %2
ret void
}

LLVM IR (-O2):
%struct.vivid_dev = type opaque
define void @vivid_cec_bus_free_work(%struct.vivid_dev* nocapture %0) {
ret void
}
void swap(struct keydata *v[], int i, int j) {
  struct keydata *temp;
  temp = v[i];
  v[i] = v[j];
  v[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):
%struct.keydata = type opaque
define void @swap(%struct.keydata** %0, i32 %1, i32 %2) {
%4 = alloca %struct.keydata**
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.keydata*
store %struct.keydata** %0, %struct.keydata*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.keydata**, %struct.keydata*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.keydata*, %struct.keydata** %8, i64 %10
%12 = load %struct.keydata*, %struct.keydata** %11
store %struct.keydata* %12, %struct.keydata** %7
%13 = load %struct.keydata**, %struct.keydata*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.keydata*, %struct.keydata** %13, i64 %15
%17 = load %struct.keydata*, %struct.keydata** %16
%18 = load %struct.keydata**, %struct.keydata*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds %struct.keydata*, %struct.keydata** %18, i64 %20
store %struct.keydata* %17, %struct.keydata** %21
%22 = load %struct.keydata*, %struct.keydata** %7
%23 = load %struct.keydata**, %struct.keydata*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds %struct.keydata*, %struct.keydata** %23, i64 %25
store %struct.keydata* %22, %struct.keydata** %26
ret void
}

LLVM IR (-O2):
%struct.keydata = type opaque
define void @swap(%struct.keydata** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds %struct.keydata*, %struct.keydata** %0, i64 %4
%6 = load %struct.keydata*, %struct.keydata** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds %struct.keydata*, %struct.keydata** %0, i64 %7
%9 = load %struct.keydata*, %struct.keydata** %8
store %struct.keydata* %9, %struct.keydata** %5
store %struct.keydata* %6, %struct.keydata** %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FALLOC_FL_PUNCH_HOLE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)FALLOC_FL_PUNCH_HOLE;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@FALLOC_FL_PUNCH_HOLE = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @FALLOC_FL_PUNCH_HOLE
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@FALLOC_FL_PUNCH_HOLE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void mhandle_out_of_memory(char *at) {
  fprintf(stderr, "\nfatal: %s: out of memory\n", at);
  abort();
}


x86 assembly (clang, -O0):
<mhandle_out_of_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<mhandle_out_of_memory>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0Afatal: %s: out of memory\0A\00"
define void @mhandle_out_of_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"\0Afatal: %s: out of memory\0A\00"
define void @mhandle_out_of_memory(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void test1_BlinkMilli_targetInit__E() {}


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

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

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

LLVM IR (-O2):
define void @test1_BlinkMilli_targetInit__E() {
ret void
}
/* Variables and functions */
int runCommand(char *, char *, size_t);
bool env_getOsInfo(char *buff, size_t len) {
  return runCommand("uname -o -r", buff, len);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"uname -o -r\00"
define i32 @env_getOsInfo(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @runCommand(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"uname -o -r\00"
define i32 @env_getOsInfo(i8* %0, i64 %1) {
%3 = tail call i32 @runCommand(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ prince_enc_dec(int /*<<< orphan*/ const *,
                                  int /*<<< orphan*/ const *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/);
void prince_encrypt(const uint8_t in_bytes[8], const uint8_t key_bytes[16],
                    uint8_t out_bytes[8]) {
  prince_enc_dec(in_bytes, key_bytes, out_bytes, 0);
}


x86 assembly (clang, -O0):
<prince_encrypt>:
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
xor    %ecx,%ecx
call   1030 <prince_enc_dec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prince_encrypt>:
xor    %ecx,%ecx
jmp    1030 <prince_enc_dec@plt>

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

LLVM IR (-O2):
define void @prince_encrypt(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @prince_enc_dec(i32* %0, i32* %1, i32* %2, i32 0)
ret void
}