xunge/DecIR huggingface dataset:
int jtp_wrap(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @jtp_wrap() {
ret i32 1
}
/* Variables and functions */
int stress_cache_set_flag(int);
int stress_cache_set_sfence(const char *opt) {
  (void)opt;
  return stress_cache_set_flag((0x08));
}


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

x86 assembly (clang, -O2):
<stress_cache_set_sfence>:
mov    $0x8,%edi
jmp    1030 <stress_cache_set_flag@plt>

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

LLVM IR (-O2):
define i32 @stress_cache_set_sfence(i8* nocapture readnone %0) {
%2 = tail call i32 @stress_cache_set_flag(i32 8)
ret i32 %2
}
void RTTarExtractFiles(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarExtractFiles() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ isolat1ToUpper(scalar_t__);
bool do_permutate(uint8_t localCurrPW[32]) {
  uint8_t tmp;
  tmp = isolat1ToUpper(localCurrPW[0]);
  if (tmp != localCurrPW[0]) {
    localCurrPW[0] = tmp;
    return true;
  } else
    return false;
}


x86 assembly (clang, -O0):
<do_permutate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <isolat1ToUpper@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
je     1154 <do_permutate+0x44>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115b <do_permutate+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_permutate>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <isolat1ToUpper@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    (%rbx),%rcx
je     112e <do_permutate+0x1e>
mov    %rcx,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @do_permutate(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @isolat1ToUpper(i64 %2)
%4 = load i64, i64* %0
%5 = icmp eq i64 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %1
store i64 %3, i64* %0
br label %7
7: ; preds = %1, %6
%8 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void array_free(const char **array) {
  while (*array) {
    free((void *)*array);
    array += 1;
  }
}


x86 assembly (clang, -O0):
<array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1147 <array_free+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <array_free+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <array_free+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <array_free+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @array_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @free(i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int fun1(int);
int fun2(int);
int fun3(int n) {
  fun2(n);
  return fun1(n) + fun2(n);
}


x86 assembly (clang, -O0):
<fun3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fun2@plt>
mov    -0x4(%rbp),%edi
call   1040 <fun1@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fun2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun3>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <fun2@plt>
mov    %ebx,%edi
call   1040 <fun1@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <fun2@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fun3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fun2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @fun1(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @fun2(i32 %7)
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @fun3(i32 %0) {
%2 = tail call i32 @fun2(i32 %0)
%3 = tail call i32 @fun1(i32 %0)
%4 = tail call i32 @fun2(i32 %0)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN2_RX1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @CAN2_RX1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @CAN2_RX1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int main() {
  int a = 0;
  for (int i = 0; i < 5; i = i + 1)
    if (i % 2)
      a = a + 1;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1153 <main+0x53>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1140 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <main+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void gtk_tree_view_set_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_hadjustment() {
ret void
}
/* Variables and functions */
char *g_DUMMY_cons_gets(char *buffer) {
  buffer = buffer;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @g_DUMMY_cons_gets(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ write(int, char *, int);
int direxist(int sock, char *path) {
  DIR *dir;
  char ans[1];
  if ((dir = opendir(path)) == NULL) {
    ans[0] = 'n';
  } else
    ans[0] = 'y';
  write(sock, ans, 1);
  closedir(dir);
  return 1;
}


x86 assembly (clang, -O0):
<direxist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115f <direxist+0x2f>
movb   $0x6e,-0x19(%rbp)
jmp    1163 <direxist+0x33>
movb   $0x79,-0x19(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x18(%rbp),%rdi
call   1050 <closedir@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direxist>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <opendir@plt>
mov    %rax,%rbx
test   %rax,%rax
mov    $0x6e,%eax
mov    $0x79,%ecx
cmove  %eax,%ecx
mov    %cl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1050 <closedir@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @direxist(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [1 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @opendir(i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
store i8 110, i8* %11
br label %14
12: ; preds = %2
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
store i8 121, i8* %13
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
%16 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%17 = call i32 @write(i32 %15, i8* %16, i32 1)
%18 = load i32*, i32** %5
%19 = call i32 @closedir(i32* %18)
ret i32 1
}

LLVM IR (-O2):
define i32 @direxist(i32 %0, i8* nocapture %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @opendir(i8* %1)
%6 = icmp eq i32* %5, null
%7 = select i1 %6, i8 110, i8 121
store i8 %7, i8* %4
%8 = call i32 @write(i32 %0, i8* %4, i32 1)
%9 = tail call i32 @closedir(i32* %5)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ out;

/* Variables and functions */
int /*<<< orphan*/ swap_n(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint16_t be16toh(uint16_t in) {
  uint16_t out;
  swap_n(&in, &out, sizeof(out));
  return out;
}


x86 assembly (clang, -O0):
<be16toh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <swap_n@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @be16toh(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @swap_n(i32* %2, i32* %3, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int dev_open_flags(struct device *, int, int, int);
scalar_t__ vg_write_lock_held();
int dev_open_quiet(struct device *dev) {
  int flags;
  flags = vg_write_lock_held() ? 02 : 00;
  return dev_open_flags(dev, flags, 1, 1);
}


x86 assembly (clang, -O0):
<dev_open_quiet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <vg_write_lock_held@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <dev_open_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_open_quiet>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <vg_write_lock_held@plt>
xor    %esi,%esi
test   %rax,%rax
setne  %sil
add    %esi,%esi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x1,%ecx
pop    %rbx
jmp    1030 <dev_open_flags@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @dev_open_quiet(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca i32
store %struct.device* %0, %struct.device** %2
%4 = call i64 (...) @vg_write_lock_held()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 2, i32 0
store i32 %7, i32* %3
%8 = load %struct.device*, %struct.device** %2
%9 = load i32, i32* %3
%10 = call i32 @dev_open_flags(%struct.device* %8, i32 %9, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @dev_open_quiet(%struct.device* %0) {
%2 = tail call i64 (...) @vg_write_lock_held()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 2
%5 = tail call i32 @dev_open_flags(%struct.device* %0, i32 %4, i32 1, i32 1)
ret i32 %5
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
char *serializeHelper(struct TreeNode *, int *);
char *serialize(struct TreeNode *root) {
  int len = 0;
  return serializeHelper(root, &len);
}


x86 assembly (clang, -O0):
<serialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <serializeHelper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <serializeHelper@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i8* @serialize(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
%3 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %2
store i32 0, i32* %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %2
%5 = call i8* @serializeHelper(%struct.TreeNode* %4, i32* %3)
ret i8* %5
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i8* @serialize(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i8* @serializeHelper(%struct.TreeNode* %0, i32* %2)
ret i8* %4
}
/* Variables and functions */
int countnparval(int /*<<< orphan*/, char *);
int countparval(char *name) { return countnparval(0, name); }


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

x86 assembly (clang, -O2):
<countparval>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <countnparval@plt>

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

LLVM IR (-O2):
define i32 @countparval(i8* %0) {
%2 = tail call i32 @countnparval(i32 0, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int squareOfSum(int);
int sumOfSquare(int);
int main(int argc, char **argv) {
  printf("Algorithm start, please wait...\n");
  int size = 100, difference = 0;
  difference = squareOfSum(size) - sumOfSquare(size);
  printf("Algorithm end.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x64,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <squareOfSum@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <sumOfSquare@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1040 <squareOfSum@plt>
mov    $0x64,%edi
call   1050 <sumOfSquare@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Algorithm start, please wait...\0A\00"
@.str.1 = [16 x i8] c"Algorithm end.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 100, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %5
%9 = call i32 @squareOfSum(i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @sumOfSquare(i32 %10)
%12 = sub nsw i32 %9, %11
store i32 %12, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"Algorithm start, please wait...\00"
@str.2 = [15 x i8] c"Algorithm end.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @squareOfSum(i32 100)
%5 = tail call i32 @sumOfSquare(i32 100)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int count;
  for (count = 14; count < 128;)
    putchar(count++);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    114f <main+0x3f>
mov    -0x14(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
call   1030 <putchar@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe,%edi
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rdi),%ebx
call   1030 <putchar@plt>
mov    %ebx,%edi
cmp    $0x80,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 14, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 128
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
%13 = call i32 @putchar(i32 %11)
br label %7
14: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 14, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @putchar(i32 %4)
%7 = icmp eq i32 %5, 128
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
void intervalDelim2COMMA() {}


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

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

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

LLVM IR (-O2):
define void @intervalDelim2COMMA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_integer(int, char **);
void start_msg(char **msg, int type) {
  put_integer(type, msg);
  (*msg) += 4;
}


x86 assembly (clang, -O0):
<start_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <put_integer@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_msg>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %rbx,%rsi
call   1030 <put_integer@plt>
addq   $0x4,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @start_msg(i8** %0, i32 %1) {
%3 = tail call i32 @put_integer(i32 %1, i8** %0)
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 4
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
float kill_denormal(int /*<<< orphan*/);
int /*<<< orphan*/ sinf(float);
float sin_native(float f) { return kill_denormal(sinf(f)); }


x86 assembly (clang, -O0):
<sin_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,%edi
call   1040 <kill_denormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_native>:
push   %rax
call   1030 <sinf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <kill_denormal@plt>

LLVM IR (-O0):
define float @sin_native(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sinf(float %3)
%5 = call float @kill_denormal(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @sin_native(float %0) {
%2 = tail call i32 @sinf(float %0)
%3 = tail call float @kill_denormal(i32 %2)
ret float %3
}
int vmw_strlen(char *string) {
  int size = 0;
  while (string[size++] != 0)
    ;
  return size - 1;
}


x86 assembly (clang, -O0):
<vmw_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <vmw_strlen+0x33>
jmp    110f <vmw_strlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmw_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <vmw_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @vmw_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b_debug(int idx, int *cells) {
  printf("Brain · Copyright (C) 2016 Brain Labs\nThis program comes with "
         "ABSOLUTELY NO WARRANTY.\nType 'h' for help\nType 'c' for "
         "conditions\nType 'q' for quitting\n");
}


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

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

LLVM IR (-O0):
@.str = [152 x i8] c"Brain \C2\B7 Copyright (C) 2016 Brain Labs\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AType 'h' for help\0AType 'c' for conditions\0AType 'q' for quitting\0A\00"
define void @b_debug(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [151 x i8] c"Brain \C2\B7 Copyright (C) 2016 Brain Labs\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AType 'h' for help\0AType 'c' for conditions\0AType 'q' for quitting\00"
define void @b_debug(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([151 x i8], [151 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) unsigned __int128 t172_5sub(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (signed __int128)(4), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t172_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0xfffffffffffffffc,%rdx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t172_5sub+0x77>
jmp    118e <t172_5sub+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t172_5sub>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %rdi,%r14
add    $0xfffffffffffffffc,%r14
mov    %rsi,%rbx
adc    $0xffffffffffffffff,%rbx
mov    $0x3,%ecx
cmp    %rdi,%rcx
sbb    %rsi,%rax
jl     1138 <t172_5sub+0x28>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t172_5sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %12, i129 4)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t172_5sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -4
%9 = icmp slt i128 %6, 4
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int _nx_round_up_to_multiple(int number, int multiple) {
  return (number + multiple - 1) / multiple * multiple;
}


x86 assembly (clang, -O0):
<_nx_round_up_to_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nx_round_up_to_multiple>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_nx_round_up_to_multiple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_nx_round_up_to_multiple(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
void categorize(struct parse *p, register struct re_guts *g) {}


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

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

LLVM IR (-O0):
%struct.parse = type opaque
%struct.re_guts = type opaque
define void @categorize(%struct.parse* %0, %struct.re_guts* %1) {
%3 = alloca %struct.parse*
%4 = alloca %struct.re_guts*
store %struct.parse* %0, %struct.parse** %3
store %struct.re_guts* %1, %struct.re_guts** %4
ret void
}

LLVM IR (-O2):
%struct.parse = type opaque
%struct.re_guts = type opaque
define void @categorize(%struct.parse* nocapture %0, %struct.re_guts* nocapture %1) {
ret void
}
int b(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @b() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ issafesub(int, int);
int safesub(int x, int y) {
  if (!issafesub(x, y)) {
    error("safesub");
  }
  return x - y;
}


x86 assembly (clang, -O0):
<safesub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <issafesub@plt>
cmp    $0x0,%eax
jne    114e <safesub+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safesub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <issafesub@plt>
test   %eax,%eax
jne    113c <safesub+0x1c>
lea    0xec9(%rip),%rdi
call   1040 <error@plt>
sub    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"safesub\00"
define i32 @safesub(i32 %0, i32 %1) {
%3 = tail call i32 @issafesub(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = sub nsw i32 %0, %1
ret i32 %8
}
void cause_exception(exname, file, lineno, user_arg) char *exname;
char *file;
int lineno;
int user_arg;
{}


x86 assembly (clang, -O0):
<cause_exception>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cause_exception(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @cause_exception(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void newline(void) { fputc('\n', stdout); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @newline() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputc(i8 signext 10, i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @newline() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(i8 signext 10, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void timing_print_head() {
  printf("%-8s %-8s %-8s %-8s %s\n", "min", "max", "mean", "total", "name");
}


x86 assembly (clang, -O0):
<timing_print_head>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xef3(%rip),%rdx
lea    0xef0(%rip),%rcx
lea    0xeee(%rip),%r8
lea    0xeed(%rip),%r9
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timing_print_head>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
lea    0xef7(%rip),%rdx
lea    0xef4(%rip),%rcx
lea    0xef2(%rip),%r8
lea    0xef1(%rip),%r9
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%-8s %-8s %-8s %-8s %s\0A\00"
@.str.1 = [4 x i8] c"min\00"
@.str.2 = [4 x i8] c"max\00"
@.str.3 = [5 x i8] c"mean\00"
@.str.4 = [6 x i8] c"total\00"
@.str.5 = [5 x i8] c"name\00"
define void @timing_print_head() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%-8s %-8s %-8s %-8s %s\0A\00"
@.str.1 = [4 x i8] c"min\00"
@.str.2 = [4 x i8] c"max\00"
@.str.3 = [5 x i8] c"mean\00"
@.str.4 = [6 x i8] c"total\00"
@.str.5 = [5 x i8] c"name\00"
define void @timing_print_head() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}
int should_return_one() { return 0; }


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

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

LLVM IR (-O0):
define i32 @should_return_one() {
ret i32 0
}

LLVM IR (-O2):
define i32 @should_return_one() {
ret i32 0
}
/* Variables and functions */
int drand48();
double exp_domain(void) { return (709 * (2 * drand48() - 1)); }


x86 assembly (clang, -O0):
<exp_domain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
shl    $0x1,%eax
sub    $0x1,%eax
imul   $0x2c5,%eax,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_domain>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
imul   $0x58a,%eax,%eax
add    $0xfffffd3b,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @exp_domain() {
%1 = call i32 (...) @drand48()
%2 = mul nsw i32 2, %1
%3 = sub nsw i32 %2, 1
%4 = mul nsw i32 709, %3
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @exp_domain() {
%1 = tail call i32 (...) @drand48()
%2 = mul i32 %1, 1418
%3 = add i32 %2, -709
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x62() {
  Assert_real((isupper(98) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              495, ("isupper should be 0 for b"));
}


x86 assembly (clang, -O0):
<t_isupper_0x62>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1ef,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x62>:
push   %rax
mov    $0x62,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1ef,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for b\00"
define void @t_isupper_0x62() {
%1 = call i64 @isupper(i32 98)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for b\00"
define void @t_isupper_0x62() {
%1 = tail call i64 @isupper(i32 98)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flush_outbuf();
int /*<<< orphan*/ init();
int /*<<< orphan*/ init_outbuf();
int /*<<< orphan*/ match(int);
void run(int phase) {
  init_outbuf();
  init();
  match(phase);
  flush_outbuf();
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init_outbuf@plt>
mov    $0x0,%al
call   1030 <init@plt>
mov    -0x4(%rbp),%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <flush_outbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <init_outbuf@plt>
xor    %eax,%eax
call   1030 <init@plt>
mov    %ebx,%edi
call   1040 <match@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <flush_outbuf@plt>

LLVM IR (-O0):
define void @run(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @init_outbuf()
%4 = call i32 (...) @init()
%5 = load i32, i32* %2
%6 = call i32 @match(i32 %5)
%7 = call i32 (...) @flush_outbuf()
ret void
}

LLVM IR (-O2):
define void @run(i32 %0) {
%2 = tail call i32 (...) @init_outbuf()
%3 = tail call i32 (...) @init()
%4 = tail call i32 @match(i32 %0)
%5 = tail call i32 (...) @flush_outbuf()
ret void
}
int enclave_open() { return 0; }


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

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

LLVM IR (-O0):
define i32 @enclave_open() {
ret i32 0
}

LLVM IR (-O2):
define i32 @enclave_open() {
ret i32 0
}
int isblank(int c) { return ((c == '\t') || (c == ' ')); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x9,%edi
sete   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = icmp eq i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void admhc_writel_flush(const struct admhcd *ahcd) {}


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

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

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

LLVM IR (-O2):
%struct.admhcd = type opaque
define void @admhc_writel_flush(%struct.admhcd* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void QEIFilterConfigure(uint32_t ui32Base, uint32_t ui32FiltCnt) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000000))) & ~(0x000F0000)) |
       ui32FiltCnt);
}


x86 assembly (clang, -O0):
<QEIFilterConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfff0ffff,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIFilterConfigure>:
movslq %edi,%rax
mov    $0xfff0ffff,%ecx
and    (%rax),%ecx
or     %esi,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @QEIFilterConfigure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -983041
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 0
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @QEIFilterConfigure(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -983041
%7 = or i32 %6, %1
store volatile i32 %7, i32* %4
ret void
}
int get_operand(int x) { return x & 0xfff; }


x86 assembly (clang, -O0):
<get_operand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_operand>:
mov    %edi,%eax
and    $0xfff,%eax
ret

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

LLVM IR (-O2):
define i32 @get_operand(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void startSensor(char *url) {
  FILE *arq;
  arq = fopen(url, "w");
  if (arq != NULL) {
    fwrite("1", sizeof(char), 1, arq);
    fclose(arq);
  }
}


x86 assembly (clang, -O0):
<startSensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117b <startSensor+0x4b>
mov    -0x10(%rbp),%rcx
lea    0xe9c(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <fwrite@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startSensor>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115b <startSensor+0x2b>
mov    %rax,%rbx
mov    $0x31,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @startSensor(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fputc(i32 49, i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %4, %1
ret void
}