xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
int isDir(const char *file_path) {
  struct stat s;
  if (NULL == file_path) {
    return 1;
  }
  stat(file_path, &s);
  return S_ISREG(s.st_mode) ? 0 : 1;
}


x86 assembly (clang, -O0):
<isDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1144 <isDir+0x24>
movl   $0x1,-0x4(%rbp)
jmp    116d <isDir+0x4d>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDir>:
test   %rdi,%rdi
je     1146 <isDir+0x26>
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @stat(i8* %9, %struct.stat* %4)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISREG(i32 %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
store i32 %16, i32* %2
br label %17
17: ; preds = %8, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = call i32 @stat(i8* %0, %struct.stat* %2)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %5
%13 = phi i32 [ %11, %5 ], [ 1, %1 ]
ret i32 %13
}
__attribute__((__format__(__printf__, 1, 2))) void
cpuinfo_log_info(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @cpuinfo_log_info(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void ldtest2(const char *str) { printf("ldtest2 => %s\n", str); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"ldtest2 => %s\0A\00"
define void @ldtest2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"ldtest2 => %s\0A\00"
define void @ldtest2(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_write;
int syscall(int /*<<< orphan*/, int, char *, int);
int write(int fd, char *buf, int len) {
  return syscall(__NR_write, fd, buf, len);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_write = global i32 0
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_write = global i32 0
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @__NR_write
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
float expf(float);
float HMM_ExpF(float Float) {
  ;
  float Result = expf(Float);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_ExpF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_ExpF>:
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @HMM_ExpF(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @expf(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @HMM_ExpF(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int csOpenLibrary(void **library, const char *libraryPath) {
  *library = NULL;
  return -1;
}


x86 assembly (clang, -O0):
<csOpenLibrary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csOpenLibrary>:
movq   $0x0,(%rdi)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @csOpenLibrary(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
store i8* null, i8** %5
ret i32 -1
}

LLVM IR (-O2):
define i32 @csOpenLibrary(i8** nocapture writeonly %0, i8* nocapture readnone %1) {
store i8* null, i8** %0
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void pthread_call(const char *label, int result) {
  if (0 != result) {
    fprintf(stderr, "pthread %s : %s\n", label, strerror(result));
    abort();
  }
}


x86 assembly (clang, -O0):
<pthread_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
je     1183 <pthread_call+0x53>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_call>:
test   %esi,%esi
jne    1135 <pthread_call+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1050 <strerror@plt>
lea    0xeae(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"pthread %s : %s\0A\00"
define void @pthread_call(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 = icmp ne i32 0, %5
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"pthread %s : %s\0A\00"
define void @pthread_call(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i8* @strerror(i32 %1)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret void
}
int calculation(int n, int b, int opr) {
  int sum = 0;
  if (opr == 1) {
    sum = n + b;
  } else if (opr == 0) {
    sum = n - b;
  }
  return sum;
}


x86 assembly (clang, -O0):
<calculation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    112c <calculation+0x2c>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <calculation+0x44>
cmpl   $0x0,-0xc(%rbp)
jne    113f <calculation+0x3f>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <calculation+0x44>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculation>:
test   %edx,%edx
je     1110 <calculation+0x10>
xor    %eax,%eax
cmp    $0x1,%edx
jne    1114 <calculation+0x14>
add    %edi,%esi
mov    %esi,%eax
ret
sub    %esi,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @calculation(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %8 [
i32 1, label %4
i32 0, label %6
]
4: ; preds = %3
%5 = add nsw i32 %1, %0
br label %8
6: ; preds = %3
%7 = sub nsw i32 %0, %1
br label %8
8: ; preds = %3, %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
__attribute__((weak)) void fd_nrf8001_connect_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

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

/* Variables and functions */
uint8_t target_flash_erase_chip(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @target_flash_erase_chip() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ ConcatArgs(int);
int /*<<< orphan*/ G_Say(void *, void *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ Q_stricmp(char *, char *);
int /*<<< orphan*/ trap_Argv(int /*<<< orphan*/, char *, int);
void Svcmd_MessageWrapper(void) {
  char cmd[5];
  trap_Argv(0, cmd, sizeof(cmd));
  if ((Q_stricmp(cmd, "say") == 0)) {
    G_Say(((void *)0), ((void *)0), 0, ConcatArgs(1));
  }
}


x86 assembly (clang, -O0):
<Svcmd_MessageWrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rsi
xor    %edi,%edi
mov    $0x5,%edx
call   1060 <trap_Argv@plt>
lea    -0x5(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <Q_stricmp@plt>
cmp    $0x0,%rax
jne    118c <Svcmd_MessageWrapper+0x4c>
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
mov    %eax,%ecx
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1050 <G_Say@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_MessageWrapper>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1060 <trap_Argv@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <Q_stricmp@plt>
test   %rax,%rax
jne    1184 <Svcmd_MessageWrapper+0x44>
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %eax,%ecx
call   1050 <G_Say@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"say\00"
define void @Svcmd_MessageWrapper() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @trap_Argv(i32 0, i8* %2, i32 5)
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i64 @Q_stricmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @ConcatArgs(i32 1)
%9 = call i32 @G_Say(i8* null, i8* null, i32 0, i32 %8)
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"say\00"
define void @Svcmd_MessageWrapper() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @trap_Argv(i32 0, i8* %2, i32 5)
%4 = call i64 @Q_stricmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @ConcatArgs(i32 1)
%8 = call i32 @G_Say(i8* null, i8* null, i32 0, i32 %7)
br label %9
9: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenScript(char *, int);
void SC_OpenFileCLib(char *name) { OpenScript(name, 3); }


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

x86 assembly (clang, -O2):
<SC_OpenFileCLib>:
mov    $0x3,%esi
jmp    1030 <OpenScript@plt>

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

LLVM IR (-O2):
define void @SC_OpenFileCLib(i8* %0) {
%2 = tail call i32 @OpenScript(i8* %0, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPDATA;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPDATA_it;
OCSP_RESPDATA *OCSP_RESPDATA_new(void) {
  return (OCSP_RESPDATA *)ASN1_item_new(&OCSP_RESPDATA_it);
}


x86 assembly (clang, -O0):
<OCSP_RESPDATA_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_RESPDATA_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@OCSP_RESPDATA_it = global i32 0
define i32* @OCSP_RESPDATA_new() {
%1 = call i64 @ASN1_item_new(i32* @OCSP_RESPDATA_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@OCSP_RESPDATA_it = global i32 0
define i32* @OCSP_RESPDATA_new() {
%1 = tail call i64 @ASN1_item_new(i32* @OCSP_RESPDATA_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", atoi(argv[1]));
  return 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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int test_imm_9Dint16_mem(short *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 157
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xTIO_free(void *p) {
  free(p);
  return;
}


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

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

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

LLVM IR (-O2):
define void @xTIO_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sbox128x(int, void *);
void inv_sbox128(void *w, uint8_t box) { sbox128x(((box & 0x7) | 0x8), w); }


x86 assembly (clang, -O0):
<inv_sbox128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0x7,%edi
or     $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <sbox128x@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_sbox128>:
mov    %rdi,%rax
and    $0x7,%esi
lea    0x8(%rsi),%edi
mov    %rax,%rsi
jmp    1030 <sbox128x@plt>

LLVM IR (-O0):
define void @inv_sbox128(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 = and i32 %5, 7
%7 = or i32 %6, 8
%8 = load i8*, i8** %3
%9 = call i32 @sbox128x(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @inv_sbox128(i8* %0, i32 %1) {
%3 = and i32 %1, 7
%4 = or i32 %3, 8
%5 = tail call i32 @sbox128x(i32 %4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printList();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push(int);
int /*<<< orphan*/ reverse();
int main() {
  push(1);
  push(2);
  push(3);
  push(4);
  printList();
  reverse();
  printf("\n Reversed Linked list \n");
  printList();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1060 <push@plt>
mov    $0x2,%edi
call   1060 <push@plt>
mov    $0x3,%edi
call   1060 <push@plt>
mov    $0x4,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1070 <printList@plt>
mov    $0x0,%al
call   1030 <reverse@plt>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <printList@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <push@plt>
mov    $0x2,%edi
call   1060 <push@plt>
mov    $0x3,%edi
call   1060 <push@plt>
mov    $0x4,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1070 <printList@plt>
xor    %eax,%eax
call   1030 <reverse@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <printList@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A Reversed Linked list \0A\00"
define i32 @main() {
%1 = call i32 @push(i32 1)
%2 = call i32 @push(i32 2)
%3 = call i32 @push(i32 3)
%4 = call i32 @push(i32 4)
%5 = call i32 (...) @printList()
%6 = call i32 (...) @reverse()
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @printList()
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A Reversed Linked list \00"
define i32 @main() {
%1 = tail call i32 @push(i32 1)
%2 = tail call i32 @push(i32 2)
%3 = tail call i32 @push(i32 3)
%4 = tail call i32 @push(i32 4)
%5 = tail call i32 (...) @printList()
%6 = tail call i32 (...) @reverse()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (...) @printList()
%9 = tail call i32 (...) @getchar()
ret i32 0
}
void g_param_spec_ulong() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_ulong() {
ret void
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ log_dnorm(double);
double dnorm(double x) { return exp(log_dnorm(x)); }


x86 assembly (clang, -O0):
<dnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log_dnorm@plt>
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @dnorm(double %0) {
%2 = tail call i32 @log_dnorm(double %0)
%3 = tail call double @exp(i32 %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ dump_ascii(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int pread(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int read_page(int fd, off_t offset) {
  uint8_t buffer[4096];
  if (pread(fd, buffer, sizeof(buffer), offset) == -1) {
    return -1;
  }
  dump_ascii(offset, buffer, sizeof(buffer));
  return 0;
}


x86 assembly (clang, -O0):
<read_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x4010(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x4000,%edx
call   1040 <pread@plt>
cmp    $0xffffffff,%eax
jne    115d <read_page+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <read_page+0x58>
mov    -0xc(%rbp),%edi
lea    -0x4010(%rbp),%rsi
mov    $0x4000,%edx
call   1030 <dump_ascii@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_page>:
push   %rbx
sub    $0x4000,%rsp
mov    %esi,%ebx
mov    %rsp,%rsi
mov    $0x4000,%edx
mov    %ebx,%ecx
call   1040 <pread@plt>
cmp    $0xffffffff,%eax
je     1151 <read_page+0x31>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x4000,%edx
call   1030 <dump_ascii@plt>
xor    %eax,%eax
jmp    1156 <read_page+0x36>
mov    $0xffffffff,%eax
add    $0x4000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_page(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [4096 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = getelementptr inbounds [4096 x i32], [4096 x i32]* %6, i64 0, i64 0
%9 = load i32, i32* %5
%10 = call i32 @pread(i32 %7, i32* %8, i32 16384, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = getelementptr inbounds [4096 x i32], [4096 x i32]* %6, i64 0, i64 0
%16 = call i32 @dump_ascii(i32 %14, i32* %15, i32 16384)
store i32 0, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_page(i32 %0, i32 %1) {
%3 = alloca [4096 x i32]
%4 = bitcast [4096 x i32]* %3 to i8*
%5 = getelementptr inbounds [4096 x i32], [4096 x i32]* %3, i64 0, i64 0
%6 = call i32 @pread(i32 %0, i32* %5, i32 16384, i32 %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @dump_ascii(i32 %1, i32* %5, i32 16384)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 0, %8 ], [ -1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
intmax_t imaxabs(intmax_t i) {
  if (i < 0)
    return -i;
  return i;
}


x86 assembly (clang, -O0):
<imaxabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <imaxabs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <imaxabs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imaxabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imaxabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int canJump(int **, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {2, 0, 0};
  printf("aaa %d\n", canJump(&a, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1030 <canJump@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1030 <canJump@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 2, i32 0, i32 0]
@.str = [8 x i8] c"aaa %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = bitcast [3 x i32]* %1 to i32**
%4 = call i32 @canJump(i32** %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 2, i32 0, i32 0]
@.str = [8 x i8] c"aaa %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = bitcast [3 x i32]* %1 to i32**
%4 = call i32 @canJump(i32** %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ init_child(scalar_t__, char *);
int /*<<< orphan*/ log_info(char *, scalar_t__);
pid_t daemonize(char *working_dir) {
  pid_t process_id;
  process_id = fork();
  if (process_id == 0) {
    log_info("Forked daemon: pid=%ld\n", process_id);
    init_child(process_id, working_dir);
  }
  return process_id;
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <daemonize+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <log_info@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <init_child@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <daemonize+0x2e>
lea    0xeb3(%rip),%rdi
xor    %esi,%esi
call   1030 <log_info@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <init_child@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Forked daemon: pid=%ld\0A\00"
define i64 @daemonize(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = call i64 (...) @fork()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i32 @log_info(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %3
%11 = load i8*, i8** %2
%12 = call i32 @init_child(i64 %10, i8* %11)
br label %13
13: ; preds = %7, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
@.str = [24 x i8] c"Forked daemon: pid=%ld\0A\00"
define i64 @daemonize(i8* %0) {
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @log_info(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 0)
%6 = tail call i32 @init_child(i64 0, i8* %0)
br label %7
7: ; preds = %4, %1
ret i64 %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
egchar1() {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<egchar1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     115b <egchar1+0x3b>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1132 <egchar1+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egchar1>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <egchar1+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <egchar1+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @egchar1() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @putchar(i32 %9)
%11 = call i32 (...) @getchar()
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @egchar1() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 undef
}
/* Variables and functions */
char *u_strcasestr(char const *, char const *);
char *u_strcasestr_filename(const char *haystack, const char *needle) {
  return u_strcasestr(haystack, needle);
}


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

x86 assembly (clang, -O2):
<u_strcasestr_filename>:
jmp    1030 <u_strcasestr@plt>

LLVM IR (-O0):
define i8* @u_strcasestr_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @u_strcasestr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @u_strcasestr_filename(i8* %0, i8* %1) {
%3 = tail call i8* @u_strcasestr(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int getchar();
int /*<<< orphan*/ init_kb_intterupt(struct termios);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_testcancel();
void *enable_pause_feature(void *const restrict kb_config) {
  init_kb_intterupt(*((struct termios *)kb_config));
  bool pause = false, loop = true;
  while (loop) {
    if (getchar() == 32) {
      if (pause) {
        pause = false;
      } else {
        pause = true;
      }
    }
    if (false == true) {
      pthread_testcancel();
      printf("In place\n");
      loop = false;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<enable_pause_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <init_kb_intterupt@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1186 <enable_pause_feature+0x66>
mov    $0x0,%al
call   1030 <getchar@plt>
cmp    $0x20,%eax
jne    1181 <enable_pause_feature+0x61>
cmpl   $0x0,-0xc(%rbp)
je     1175 <enable_pause_feature+0x55>
movl   $0x0,-0xc(%rbp)
jmp    117c <enable_pause_feature+0x5c>
movl   $0x1,-0xc(%rbp)
jmp    1181 <enable_pause_feature+0x61>
jmp    1145 <enable_pause_feature+0x25>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_pause_feature>:
push   %rax
mov    (%rdi),%edi
call   1040 <init_kb_intterupt@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
jmp    1130 <enable_pause_feature+0x10>

LLVM IR (-O0):
%struct.termios = type { i32 }
define i8* @enable_pause_feature(i8* noalias %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to %struct.termios*
%7 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @init_kb_intterupt(i32 %8)
store i32 0, i32* %3
store i32 1, i32* %4
br label %10
10: ; preds = %22, %1
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = call i32 (...) @getchar()
%15 = icmp eq i32 %14, 32
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %3
br label %21
20: ; preds = %16
store i32 1, i32* %3
br label %21
21: ; preds = %20, %19
br label %22
22: ; preds = %21, %13
br label %10
23: ; preds = %10
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @enable_pause_feature(i8* noalias nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @init_kb_intterupt(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @getchar()
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundmpx_chown(const char *path, uid_t owner, gid_t group) {
  return chown(path, owner, group);
}


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

x86 assembly (clang, -O2):
<softboundmpx_chown>:
jmp    1030 <chown@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_chown(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @chown(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void radio_df_cte_tx_aoa_set(uint8_t cte_len) {}


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

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

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

LLVM IR (-O2):
define void @radio_df_cte_tx_aoa_set(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_pmu_sar_override(int);
void set_pmu_img(void) {
  mbus_remote_register_write(0x8, 0x1A,
                             ((0 << 13) | (8 << 9) | (8 << 5) | (16)));
  delay(200);
  mbus_remote_register_write(0x8, 0x16,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (7 << 9) | (7 << 5) | (22)));
  delay(200);
  set_pmu_sar_override(47);
}


x86 assembly (clang, -O0):
<set_pmu_img>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0x1110,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcef6,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x2f,%edi
call   1030 <set_pmu_sar_override@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_img>:
push   %rax
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0x1110,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcef6,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x2f,%edi
pop    %rax
jmp    1030 <set_pmu_sar_override@plt>

LLVM IR (-O0):
define void @set_pmu_img() {
%1 = call i32 @mbus_remote_register_write(i32 8, i32 26, i32 4368)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 8, i32 22, i32 52982)
%4 = call i32 @delay(i32 200)
%5 = call i32 @set_pmu_sar_override(i32 47)
ret void
}

LLVM IR (-O2):
define void @set_pmu_img() {
%1 = tail call i32 @mbus_remote_register_write(i32 8, i32 26, i32 4368)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 8, i32 22, i32 52982)
%4 = tail call i32 @delay(i32 200)
%5 = tail call i32 @set_pmu_sar_override(i32 47)
ret void
}
void av_default_get_category() {}


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

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

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

LLVM IR (-O2):
define void @av_default_get_category() {
ret void
}
/* Variables and functions */
size_t glh_pos(unsigned long int hash, size_t table_size) {
  return hash % table_size;
}


x86 assembly (clang, -O0):
<glh_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glh_pos>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <glh_pos+0x18>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @glh_pos(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = urem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @glh_pos(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void require(bool condition, char *format) {
  if (!condition)
    error(format);
}


x86 assembly (clang, -O0):
<require>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <require+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<require>:
test   %edi,%edi
je     1115 <require+0x5>
ret
mov    %rsi,%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
define void @require(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @error(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @require(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ecdh_computeSharedSecret(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *);
uint8_t ECC_ECDH_computeSharedSecret(uint32_t *privateKey,
                                     uint32_t *publicKey_x,
                                     uint32_t *publicKey_y,
                                     uint32_t *sharedSecret_x,
                                     uint32_t *sharedSecret_y) {
  return (uint8_t)ecdh_computeSharedSecret(
      (uint32_t *)privateKey, (uint32_t *)publicKey_x, (uint32_t *)publicKey_y,
      (uint32_t *)sharedSecret_x, (uint32_t *)sharedSecret_y);
}


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

x86 assembly (clang, -O2):
<ECC_ECDH_computeSharedSecret>:
jmp    1030 <ecdh_computeSharedSecret@plt>

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

LLVM IR (-O2):
define i32 @ECC_ECDH_computeSharedSecret(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @ecdh_computeSharedSecret(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
int f(long *v, long n) {
  for (long i = 0; i < n / 2; i++)
    if (v[i] > v[2 * i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jge    117e <f+0x7e>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
shl    $0x1,%rdx
cmp    (%rcx,%rdx,8),%rax
jle    1168 <f+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1185 <f+0x85>
jmp    116d <f+0x6d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <f+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%eax
cmp    $0x2,%rsi
jl     1154 <f+0x54>
mov    %rsi,%r8
shr    $0x3f,%r8
add    %rsi,%r8
sar    %r8
lea    0x10(%rdi),%rax
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rdx
cmp    %rsi,%r8
je     114c <f+0x4c>
mov    (%rdi,%rdx,8),%r9
lea    0x1(%rdx),%rsi
lea    0x10(%rax),%rcx
cmp    (%rax),%r9
mov    %rcx,%rax
jle    1130 <f+0x30>
xor    %eax,%eax
cmp    %r8,%rdx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @f(i64* nocapture %0, i64 %1) {
%3 = sdiv i64 %1, 2
%4 = icmp sgt i64 %1, 1
br i1 %4, label %5, label %19
5: ; preds = %2, %8
%6 = phi i64 [ %15, %8 ], [ 1, %2 ]
%7 = icmp eq i64 %6, %3
br i1 %7, label %16, label %8
8: ; preds = %5
%9 = getelementptr inbounds i64, i64* %0, i64 %6
%10 = load i64, i64* %9
%11 = shl nuw nsw i64 %6, 1
%12 = getelementptr inbounds i64, i64* %0, i64 %11
%13 = load i64, i64* %12
%14 = icmp sgt i64 %10, %13
%15 = add nuw nsw i64 %6, 1
br i1 %14, label %16, label %5
16: ; preds = %5, %8
%17 = icmp sge i64 %6, %3
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %16, %2
%20 = phi i32 [ 1, %2 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void before() { printf("Hello"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @before, i8* null }]
define void @before() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @before, i8* null }]
define void @before() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}