xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttTemplateSetSelect(void) {
  ExtSelect("tTemplateSet",
            "tTemplateSet.uTemplateSet,tTemplateSet.cLabel,tTemplateSet.uOwner,"
            "tTemplateSet.uCreatedBy,tTemplateSet.uCreatedDate,tTemplateSet."
            "uModBy,tTemplateSet.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttTemplateSetSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttTemplateSetSelect>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"tTemplateSet\00"
@.str.1 = [158 x i8] c"tTemplateSet.uTemplateSet,tTemplateSet.cLabel,tTemplateSet.uOwner,tTemplateSet.uCreatedBy,tTemplateSet.uCreatedDate,tTemplateSet.uModBy,tTemplateSet.uModDate\00"
define void @ExttTemplateSetSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"tTemplateSet\00"
@.str.1 = [158 x i8] c"tTemplateSet.uTemplateSet,tTemplateSet.cLabel,tTemplateSet.uOwner,tTemplateSet.uCreatedBy,tTemplateSet.uCreatedDate,tTemplateSet.uModBy,tTemplateSet.uModDate\00"
define void @ExttTemplateSetSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
void RTSemSpinMutexRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemSpinMutexRelease() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int iszerofile(const char *filename) {
  struct stat st;
  return (!stat(filename, &st) && !st.st_size);
}


x86 assembly (clang, -O0):
<iszerofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1145 <iszerofile+0x35>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iszerofile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
or     (%rsp),%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @iszerofile(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ INSSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void INSSettingsUpdated() { UAVObjUpdated(INSSettingsHandle()); }


x86 assembly (clang, -O0):
<INSSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <INSSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<INSSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <INSSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @INSSettingsUpdated() {
%1 = call i32 (...) @INSSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @INSSettingsUpdated() {
%1 = tail call i32 (...) @INSSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: number [# ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: number [# ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: number [# ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
signed int rt_cond_broadcast(union anon$42 *cvp) {
  signed int status = 0;
  status = pthread_cond_broadcast(cvp);
  return status;
}


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

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

LLVM IR (-O0):
%"union.anon$42" = type opaque
define i32 @rt_cond_broadcast(%"union.anon$42"* %0) {
%2 = alloca %"union.anon$42"*
%3 = alloca i32
store %"union.anon$42"* %0, %"union.anon$42"** %2
store i32 0, i32* %3
%4 = load %"union.anon$42"*, %"union.anon$42"** %2
%5 = call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_broadcast to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$42" = type opaque
define i32 @rt_cond_broadcast(%"union.anon$42"* %0) {
%2 = tail call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_broadcast to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %0)
ret i32 %2
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ var(double *, int);
double sd(double arr[], int n) { return sqrt(var(arr, n)); }


x86 assembly (clang, -O0):
<sd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <var@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @sd(double* %0, i32 %1) {
%3 = tail call i32 @var(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
char *ttyname(int fd) {
  __set_errno(ENOSYS);
  return NULL;
}


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i8* @ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i8* @ttyname(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i8* null
}
int LZ5_versionNumber(void) { return (1 * 100 * 100 + 5 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @LZ5_versionNumber() {
ret i32 10500
}

LLVM IR (-O2):
define i32 @LZ5_versionNumber() {
ret i32 10500
}
/* Type definitions */
struct t_fset_option {
  int dummy;
};
struct t_arraylist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fset_option_free(struct t_fset_option *);
void fset_option_free_cb(void *data, struct t_arraylist *arraylist,
                         void *pointer) {
  struct t_fset_option *fset_option;
  (void)data;
  (void)arraylist;
  fset_option = (struct t_fset_option *)pointer;
  fset_option_free(fset_option);
}


x86 assembly (clang, -O0):
<fset_option_free_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fset_option_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fset_option_free_cb>:
mov    %rdx,%rdi
jmp    1030 <fset_option_free@plt>

LLVM IR (-O0):
%struct.t_arraylist = type { i32 }
%struct.t_fset_option = type { i32 }
define void @fset_option_free_cb(i8* %0, %struct.t_arraylist* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.t_arraylist*
%6 = alloca i8*
%7 = alloca %struct.t_fset_option*
store i8* %0, i8** %4
store %struct.t_arraylist* %1, %struct.t_arraylist** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load %struct.t_arraylist*, %struct.t_arraylist** %5
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.t_fset_option*
store %struct.t_fset_option* %11, %struct.t_fset_option** %7
%12 = load %struct.t_fset_option*, %struct.t_fset_option** %7
%13 = call i32 @fset_option_free(%struct.t_fset_option* %12)
ret void
}

LLVM IR (-O2):
%struct.t_arraylist = type { i32 }
%struct.t_fset_option = type { i32 }
define void @fset_option_free_cb(i8* nocapture readnone %0, %struct.t_arraylist* nocapture readnone %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.t_fset_option*
%5 = tail call i32 @fset_option_free(%struct.t_fset_option* %4)
ret void
}
/* Variables and functions */
int rounded_int_division(int, int);
int /*<<< orphan*/ xv_get_output_aspect(int *, int *);
int xv_get_height_for_width(int window_width) {
  int n, d;
  xv_get_output_aspect(&d, &n);
  return rounded_int_division(window_width * n, d);
}


x86 assembly (clang, -O0):
<xv_get_height_for_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <xv_get_output_aspect@plt>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <rounded_int_division@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xv_get_height_for_width>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <xv_get_output_aspect@plt>
imul   0xc(%rsp),%ebx
mov    0x8(%rsp),%esi
mov    %ebx,%edi
call   1030 <rounded_int_division@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xv_get_height_for_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @xv_get_output_aspect(i32* %4, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @rounded_int_division(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @xv_get_height_for_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @xv_get_output_aspect(i32* %3, i32* %2)
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %0
%9 = load i32, i32* %3
%10 = call i32 @rounded_int_division(i32 %8, i32 %9)
ret i32 %10
}
long long bit48() { return 0x0001000000000000LL; }


x86 assembly (clang, -O0):
<bit48>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit48>:
movabs $0x1000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit48() {
ret i64 281474976710656
}

LLVM IR (-O2):
define i64 @bit48() {
ret i64 281474976710656
}
/* Variables and functions */
void *m_peek(int, int /*<<< orphan*/);
void *m_buf(int m) { return m_peek(m, 0); }


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

x86 assembly (clang, -O2):
<m_buf>:
xor    %esi,%esi
jmp    1030 <m_peek@plt>

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

LLVM IR (-O2):
define i8* @m_buf(i32 %0) {
%2 = tail call i8* @m_peek(i32 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ traverse();
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  if (argc < 2)
    usage(*argv);
  setlocale(LC_ALL, "");
  traverse();
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0x0,%al
call   1030 <traverse@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113e <main+0xe>
mov    (%rsi),%rdi
call   1050 <usage@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <setlocale@plt>
xor    %eax,%eax
call   1030 <traverse@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = call i32 @usage(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i32, i32* @LC_ALL
%14 = call i32 @setlocale(i32 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @traverse()
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = load i32, i32* @LC_ALL
%9 = tail call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @traverse()
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ err_exit(char *);
scalar_t__ fchown(int, int /*<<< orphan*/, int /*<<< orphan*/);
void _fchown(int fd, uid_t u, gid_t g) {
  if (fchown(fd, u, g) < 0)
    err_exit("_fchown");
}


x86 assembly (clang, -O0):
<_fchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <fchown@plt>
cmp    $0x0,%rax
jge    1155 <_fchown+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fchown>:
push   %rax
call   1040 <fchown@plt>
test   %rax,%rax
js     112d <_fchown+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"_fchown\00"
define void @_fchown(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @fchown(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_exit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fc8300_read(void *, unsigned short, int, unsigned char *);
int fc8300_cs_get_rssi(void *handle, unsigned short devid, int *rssi) {
  signed char tmp = 0;
  fc8300_read(handle, devid, 0xeb, (unsigned char *)&tmp);
  *rssi = tmp;
  if (tmp < 0)
    *rssi += 1;
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xeb,%edx
lea    -0x19(%rbp),%rcx
movzwl -0xa(%rbp),%esi
call   1030 <fc8300_read@plt>
movsbl -0x19(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jge    1163 <fc8300_cs_get_rssi+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rcx
mov    $0xeb,%edx
call   1030 <fc8300_read@plt>
movsbl 0xf(%rsp),%eax
movzbl %al,%ecx
shr    $0x7,%ecx
add    %eax,%ecx
mov    %ecx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fc8300_cs_get_rssi(i8* %0, i16 zeroext %1, i32* nocapture writeonly %2) {
%4 = alloca i8
store i8 0, i8* %4
%5 = call i32 @fc8300_read(i8* %0, i16 zeroext %1, i32 235, i8* %4)
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = lshr i8 %6, 7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, %7
store i32 %10, i32* %2
ret i32 0
}
void Userdef_BSC_CS4Init(void) {}


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

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

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

LLVM IR (-O2):
define void @Userdef_BSC_CS4Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
scalar_t__ memcpy(int /*<<< orphan*/, char const *, size_t);
int strlen(char const *);
char *xstrdup(const char *str) {
  size_t sz = strlen(str) + 1;
  return (char *)memcpy(malloc(sz), str, sz);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 @malloc(i64 %8)
%10 = load i8*, i8** %2
%11 = load i64, i64* %3
%12 = call i64 @memcpy(i32 %9, i8* %10, i64 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i32 @malloc(i64 %4)
%6 = tail call i64 @memcpy(i32 %5, i8* %0, i64 %4)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
double f5(double x) { return (x + 0.0) - 0.0; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f5(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0.000000e+00
%5 = fsub double %4, 0.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f5(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ setRegStats(int /*<<< orphan*/);
uint8_t cpuSetTMP(uint8_t val) {
  setRegStats(val);
  return val;
}


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

x86 assembly (clang, -O2):
<cpuSetTMP>:
push   %rbx
mov    %edi,%ebx
call   1030 <setRegStats@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cpuSetTMP(i32 returned %0) {
%2 = tail call i32 @setRegStats(i32 %0)
ret i32 %0
}
void gtk_menu_item_activate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_activate() {
ret void
}
long long test_llroundl(long double x) { return __builtin_llroundl(x); }


x86 assembly (clang, -O0):
<test_llroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <llroundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llroundl>:
jmp    1030 <llroundl@plt>

LLVM IR (-O0):
define i64 @test_llroundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @llroundl(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_llroundl(x86_fp80 %0) {
%2 = tail call i64 @llroundl(x86_fp80 %0)
ret i64 %2
}
void thread_started() {}


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

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

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

LLVM IR (-O2):
define void @thread_started() {
ret void
}
double mypow(double x) { return x * x; }


x86 assembly (clang, -O0):
<mypow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mypow>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @mypow(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @mypow(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *thr_fn2(void *arg) {
  printf("thread 2 exiting\n");
  pthread_exit((void *)2);
  return (void *)2;
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"thread 2 exiting\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* inttoptr (i64 2 to i8*)
}

LLVM IR (-O2):
@str = [17 x i8] c"thread 2 exiting\00"
define i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* inttoptr (i64 2 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char *, int);
int /*<<< orphan*/ kill_me(char *);
void impossible_malloc(char *s) {
  ft_putstr_fd("Unable to malloc : ", 2);
  kill_me(s);
}


x86 assembly (clang, -O0):
<impossible_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
mov    -0x8(%rbp),%rdi
call   1040 <kill_me@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impossible_malloc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <kill_me@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Unable to malloc : \00"
define void @impossible_malloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr_fd(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = load i8*, i8** %2
%5 = call i32 @kill_me(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Unable to malloc : \00"
define void @impossible_malloc(i8* %0) {
%2 = tail call i32 @ft_putstr_fd(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @kill_me(i8* %0)
ret void
}
void __actuators_arm_failed_handler(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<__actuators_arm_failed_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__actuators_arm_failed_handler+0x9>
jmp    110e <__actuators_arm_failed_handler+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__actuators_arm_failed_handler() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__actuators_arm_failed_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int);
void g(int *x, int y) { f(x, y); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g(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 @f(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @g(i32* %0, i32 %1) {
%3 = tail call i32 @f(i32* %0, i32 %1)
ret void
}
int gettypecolor(int type) {
  switch (type) {
  case 0:
    return 36;
  case 1:
    return 0;
  case 2:
    return 34;
  case 4:
    return 33;
  case 5:
    return 31;
  case 6:
    return 32;
  case 7:
    return 35;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<gettypecolor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     1180 <gettypecolor+0x80>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x24,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x22,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x21,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x1f,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x20,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x23,-0x4(%rbp)
jmp    1187 <gettypecolor+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettypecolor>:
xor    %eax,%eax
cmp    $0x7,%edi
ja     1114 <gettypecolor+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gettypecolor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
]
5: ; preds = %1
store i32 36, i32* %2
br label %13
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
store i32 34, i32* %2
br label %13
8: ; preds = %1
store i32 33, i32* %2
br label %13
9: ; preds = %1
store i32 31, i32* %2
br label %13
10: ; preds = %1
store i32 32, i32* %2
br label %13
11: ; preds = %1
store i32 35, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.gettypecolor = [8 x i32] [i32 36, i32 0, i32 34, i32 0, i32 33, i32 31, i32 32, i32 35]
define i32 @gettypecolor(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.gettypecolor, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t const);
void *xrealloc(void *ptr, const size_t size) {
  if (!(ptr = realloc(ptr, size))) {
    perror("realloc");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1175 <xrealloc+0x45>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
int inflight(struct usocket *sock) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.usocket = type opaque
define i32 @inflight(%struct.usocket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ MEM_32bits();
int /*<<< orphan*/ MEM_readLE32(void const *);
int /*<<< orphan*/ MEM_readLE64(void const *);
size_t MEM_readLEST(const void *memPtr) {
  if (MEM_32bits())
    return (size_t)MEM_readLE32(memPtr);
  else
    return (size_t)MEM_readLE64(memPtr);
}


x86 assembly (clang, -O0):
<MEM_readLEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <MEM_32bits@plt>
cmp    $0x0,%rax
je     1161 <MEM_readLEST+0x31>
mov    -0x10(%rbp),%rdi
call   1050 <MEM_readLE32@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    1170 <MEM_readLEST+0x40>
mov    -0x10(%rbp),%rdi
call   1040 <MEM_readLE64@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM_readLEST>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <MEM_32bits@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114a <MEM_readLEST+0x1a>
call   1050 <MEM_readLE32@plt>
jmp    114f <MEM_readLEST+0x1f>
call   1040 <MEM_readLE64@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @MEM_readLEST(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @MEM_32bits()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @MEM_readLE32(i8* %7)
%9 = sext i32 %8 to i64
store i64 %9, i64* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @MEM_readLE64(i8* %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %10, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @MEM_readLEST(i8* %0) {
%2 = tail call i64 (...) @MEM_32bits()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @MEM_readLE32(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @MEM_readLE64(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ log_allocation(char *, size_t, void *);
void *real_valloc(size_t);
void *valloc(size_t size) {
  void *ptr = real_valloc(size);
  log_allocation("valloc", size, ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<valloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <real_valloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1040 <log_allocation@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <real_valloc@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <log_allocation@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"valloc\00"
define i8* @valloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @real_valloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = call i32 @log_allocation(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"valloc\00"
define i8* @valloc(i64 %0) {
%2 = tail call i8* @real_valloc(i64 %0)
%3 = tail call i32 @log_allocation(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %2)
ret i8* %2
}
const char *volume_tostr(int volume) {
  switch (volume) {
  case 0:
    return "quiet";
  case 1:
    return "normal";
  case 2:
    return "loud";
  }
  return "unknown";
}


x86 assembly (clang, -O0):
<volume_tostr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <volume_tostr+0x3c>
jmp    111a <volume_tostr+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <volume_tostr+0x4c>
jmp    112b <volume_tostr+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <volume_tostr+0x5c>
jmp    116c <volume_tostr+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <volume_tostr+0x77>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <volume_tostr+0x77>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <volume_tostr+0x77>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume_tostr>:
cmp    $0x2,%edi
ja     1117 <volume_tostr+0x17>
movslq %edi,%rax
lea    0xf0d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef4(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"quiet\00"
@.str.1 = [7 x i8] c"normal\00"
@.str.2 = [5 x i8] c"loud\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @volume_tostr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"quiet\00"
@.str.1 = [7 x i8] c"normal\00"
@.str.2 = [5 x i8] c"loud\00"
@.str.3 = [8 x i8] c"unknown\00"
@reltable.volume_tostr = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.volume_tostr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.volume_tostr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.volume_tostr to i64)) to i32)]
define i8* @volume_tostr(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.volume_tostr to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
bool good(int base, unsigned char buf, int n) { return true; }


x86 assembly (clang, -O0):
<good>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @good(i32 %0, i8 zeroext %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
ret i32 1
}

LLVM IR (-O2):
define i32 @good(i32 %0, i8 zeroext %1, i32 %2) {
ret i32 1
}
int test_imm_2Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x2F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Fint64_midword_reg>:
test   $0x2f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3080192
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_88uint32_reg(unsigned int val) {
  return ((val) & (0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_88uint32_reg(i32 %0) {
%2 = and i32 %0, 136
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float min(float, float);
float blendReflect(float base, float blend) {
  return (blend == 1.0f) ? blend : min(base * base / (1.0f - blend), 1.0f);
}


x86 assembly (clang, -O0):
<blendReflect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    114d <blendReflect+0x3d>
jp     114d <blendReflect+0x3d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    117a <blendReflect+0x6a>
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xea1(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xe90(%rip),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendReflect>:
ucomiss 0xee9(%rip),%xmm1
jne    1124 <blendReflect+0x14>
jp     1124 <blendReflect+0x14>
movss  0xedd(%rip),%xmm0
ret
mulss  %xmm0,%xmm0
movss  0xed0(%rip),%xmm2
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
divss  %xmm3,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <min@plt>

LLVM IR (-O0):
define float @blendReflect(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp oeq float %5, 1.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load float, float* %4
br label %17
9: ; preds = %2
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %4
%14 = fsub float 1.000000e+00, %13
%15 = fdiv float %12, %14
%16 = call float @min(float %15, float 1.000000e+00)
br label %17
17: ; preds = %9, %7
%18 = phi float [ %8, %7 ], [ %16, %9 ]
ret float %18
}

LLVM IR (-O2):
define float @blendReflect(float %0, float %1) {
%3 = fcmp oeq float %1, 1.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fmul float %0, %0
%6 = fsub float 1.000000e+00, %1
%7 = fdiv float %5, %6
%8 = tail call float @min(float %7, float 1.000000e+00)
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 1.000000e+00, %2 ]
ret float %10
}
/* Variables and functions */
double exp(double);
double sqrt(int);
double interp2_k_gaussian0(double x, double b) {
  double result = 0.0;
  result = (1.0 / sqrt(2 * (22.0 / 7.0) * b)) * exp((-1.0 * x * x) / (2.0 * b));
  return result;
}


x86 assembly (clang, -O0):
<interp2_k_gaussian0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9c(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe82(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp2_k_gaussian0>:
sub    $0x28,%rsp
movsd  %xmm1,(%rsp)
movaps %xmm0,0x10(%rsp)
movsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  0xebd(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0xeb3(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
xorpd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @interp2_k_gaussian0(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %4
%7 = fmul double 0x4019249249249249, %6
%8 = fptosi double %7 to i32
%9 = call double @sqrt(i32 %8)
%10 = fdiv double 1.000000e+00, %9
%11 = load double, double* %3
%12 = fmul double -1.000000e+00, %11
%13 = load double, double* %3
%14 = fmul double %12, %13
%15 = load double, double* %4
%16 = fmul double 2.000000e+00, %15
%17 = fdiv double %14, %16
%18 = call double @exp(double %17)
%19 = fmul double %10, %18
store double %19, double* %5
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @interp2_k_gaussian0(double %0, double %1) {
%3 = fmul double %1, 0x4019249249249249
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fdiv double 1.000000e+00, %5
%7 = fneg double %0
%8 = fmul double %7, %0
%9 = fmul double %1, 2.000000e+00
%10 = fdiv double %8, %9
%11 = tail call double @exp(double %10)
%12 = fmul double %6, %11
ret double %12
}