xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void show_usage(char *program_name) {
  fprintf(stderr,
          "Usage: %s [INPUT_FILE]\n"
          "\n"
          "If the INPUT_FILE name is not provided, standard input is used.\n"
          "Destination is always the standard output.\n",
          program_name);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [132 x i8] c"Usage: %s [INPUT_FILE]\0A\0AIf the INPUT_FILE name is not provided, standard input is used.\0ADestination is always the standard output.\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [132 x i8] c"Usage: %s [INPUT_FILE]\0A\0AIf the INPUT_FILE name is not provided, standard input is used.\0ADestination is always the standard output.\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Memory_free(void *);
void FS_FreeFile(void *buffer) {
  {
    Memory_free((buffer));
    ((buffer)) = ((void *)0);
  };
}


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

x86 assembly (clang, -O2):
<FS_FreeFile>:
jmp    1030 <Memory_free@plt>

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

LLVM IR (-O2):
define void @FS_FreeFile(i8* %0) {
%2 = tail call i32 @Memory_free(i8* %0)
ret void
}
int cmp_double(const void *x, const void *y) {
  const double xx = *(double *)x;
  const double yy = *(double *)y;
  if (xx < yy)
    return -1;
  else if (xx > yy)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <cmp_double+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <cmp_double+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <cmp_double+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <cmp_double+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_double(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned int my_udiv(unsigned int a, unsigned int b) { return a / b; }


x86 assembly (clang, -O0):
<my_udiv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_udiv>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @my_udiv(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 = udiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_udiv(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ide_set_handlers(int /*<<< orphan*/);
void ide_pri_enable(void) { ide_set_handlers(0); }


x86 assembly (clang, -O0):
<ide_pri_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ide_set_handlers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_pri_enable>:
xor    %edi,%edi
jmp    1030 <ide_set_handlers@plt>

LLVM IR (-O0):
define void @ide_pri_enable() {
%1 = call i32 @ide_set_handlers(i32 0)
ret void
}

LLVM IR (-O2):
define void @ide_pri_enable() {
%1 = tail call i32 @ide_set_handlers(i32 0)
ret void
}
int hicclearsubst(long picnum, long palnum) { return 0; }


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

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

LLVM IR (-O0):
define i32 @hicclearsubst(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @hicclearsubst(i64 %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decrement_memory_test();
int /*<<< orphan*/ decrement_register_pair_test();
int /*<<< orphan*/ decrement_register_test();
int /*<<< orphan*/ increment_memory_test();
int /*<<< orphan*/ increment_register_pair_test();
int /*<<< orphan*/ increment_register_test();
int main(int argc, const char *argv[]) {
  increment_register_test();
  increment_memory_test();
  decrement_register_test();
  decrement_memory_test();
  increment_register_pair_test();
  decrement_register_pair_test();
  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    $0x0,%al
call   1040 <increment_register_test@plt>
mov    $0x0,%al
call   1080 <increment_memory_test@plt>
mov    $0x0,%al
call   1070 <decrement_register_test@plt>
mov    $0x0,%al
call   1030 <decrement_memory_test@plt>
mov    $0x0,%al
call   1060 <increment_register_pair_test@plt>
mov    $0x0,%al
call   1050 <decrement_register_pair_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <increment_register_test@plt>
xor    %eax,%eax
call   1080 <increment_memory_test@plt>
xor    %eax,%eax
call   1070 <decrement_register_test@plt>
xor    %eax,%eax
call   1030 <decrement_memory_test@plt>
xor    %eax,%eax
call   1060 <increment_register_pair_test@plt>
xor    %eax,%eax
call   1050 <decrement_register_pair_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @increment_register_test()
%7 = call i32 (...) @increment_memory_test()
%8 = call i32 (...) @decrement_register_test()
%9 = call i32 (...) @decrement_memory_test()
%10 = call i32 (...) @increment_register_pair_test()
%11 = call i32 (...) @decrement_register_pair_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @increment_register_test()
%4 = tail call i32 (...) @increment_memory_test()
%5 = tail call i32 (...) @decrement_register_test()
%6 = tail call i32 (...) @decrement_memory_test()
%7 = tail call i32 (...) @increment_register_pair_test()
%8 = tail call i32 (...) @decrement_register_pair_test()
ret i32 0
}
void g_io_channel_set_close_on_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_set_close_on_unref() {
ret void
}
void XtRemoveEventTypeHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtRemoveEventTypeHandler() {
ret void
}
void thread_worker(void *arg) {
  int i;
  volatile long *counter = arg;
  for (i = 0; i < 0xFFFFFFFL; i++)
    (*counter)++;
}


x86 assembly (clang, -O0):
<thread_worker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0xfffffff,%rax
jge    1143 <thread_worker+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <thread_worker+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_worker>:
mov    $0xfffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
addq   $0x1,(%rdi)
addq   $0x1,(%rdi)
addq   $0x1,(%rdi)
addq   $0x1,(%rdi)
addq   $0x1,(%rdi)
add    $0xfffffffb,%eax
jne    1110 <thread_worker+0x10>
ret

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

LLVM IR (-O2):
define void @thread_worker(i8* %0) {
%2 = bitcast i8* %0 to i64*
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %15, %3 ]
%5 = load volatile i64, i64* %2
%6 = add nsw i64 %5, 1
store volatile i64 %6, i64* %2
%7 = load volatile i64, i64* %2
%8 = add nsw i64 %7, 1
store volatile i64 %8, i64* %2
%9 = load volatile i64, i64* %2
%10 = add nsw i64 %9, 1
store volatile i64 %10, i64* %2
%11 = load volatile i64, i64* %2
%12 = add nsw i64 %11, 1
store volatile i64 %12, i64* %2
%13 = load volatile i64, i64* %2
%14 = add nsw i64 %13, 1
store volatile i64 %14, i64* %2
%15 = add nuw nsw i32 %4, 5
%16 = icmp eq i32 %15, 268435455
br i1 %16, label %17, label %3
17: ; preds = %3
ret void
}
/* Type definitions */
struct LinearList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ private_LinearList_Insert(struct LinearList *, int);
void LinearList_Insert(struct LinearList *list, int value) {
  if (list == NULL)
    return;
  private_LinearList_Insert(list, value);
  return;
}


x86 assembly (clang, -O0):
<LinearList_Insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <LinearList_Insert+0x1f>
jmp    113b <LinearList_Insert+0x2b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <private_LinearList_Insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.LinearList = type { i32 }
define void @LinearList_Insert(%struct.LinearList* %0, i32 %1) {
%3 = alloca %struct.LinearList*
%4 = alloca i32
store %struct.LinearList* %0, %struct.LinearList** %3
store i32 %1, i32* %4
%5 = load %struct.LinearList*, %struct.LinearList** %3
%6 = icmp eq %struct.LinearList* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load %struct.LinearList*, %struct.LinearList** %3
%10 = load i32, i32* %4
%11 = call i32 @private_LinearList_Insert(%struct.LinearList* %9, i32 %10)
br label %12
12: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.LinearList = type { i32 }
define void @LinearList_Insert(%struct.LinearList* %0, i32 %1) {
%3 = icmp eq %struct.LinearList* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @private_LinearList_Insert(%struct.LinearList* %0, i32 %1)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void cleanup(void) { remove("a.tmp"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"a.tmp\00"
define void @cleanup() {
%1 = call i32 @remove(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"a.tmp\00"
define void @cleanup() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_widget_show_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_show_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyColor(unsigned char, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void menuColor(int item) { keyColor((unsigned char)item, 0, 0); }


x86 assembly (clang, -O0):
<menuColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuColor>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyColor@plt>

LLVM IR (-O0):
define void @menuColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @keyColor(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menuColor(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @keyColor(i8 zeroext %2, i32 0, i32 0)
ret void
}
int HelpItem139(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem139() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t timeval_diff(const struct timeval *a, const struct timeval *b) {
  return 1000000 * (a->tv_sec - b->tv_sec) + (a->tv_usec - b->tv_usec);
}


x86 assembly (clang, -O0):
<timeval_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x10(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_diff>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @timeval_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 1000000, %11
%13 = sext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @timeval_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t get_uint32(unsigned char *data, int offset) {
  uint32_t temp;
  temp = data[offset] | (data[offset + 1] << 8) | (data[offset + 2] << 16) |
         (data[offset + 3] << 24);
  return temp;
}


x86 assembly (clang, -O0):
<get_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint32>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %11, %19
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 16
%29 = or i32 %20, %28
%30 = load i8*, i8** %3
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = shl i32 %36, 24
%38 = or i32 %29, %37
%39 = trunc i32 %38 to i8
store i8 %39, i8* %5
%40 = load i8, i8* %5
ret i8 %40
}

LLVM IR (-O2):
define zeroext i8 @get_uint32(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
float noise1(float);
void noise_ff(float *ret, float f) {
  float r;
  r = noise1(f);
  (*ret) = r;
}


x86 assembly (clang, -O0):
<noise_ff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <noise1@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise_ff>:
push   %rbx
mov    %rdi,%rbx
call   1030 <noise1@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @noise_ff(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca float
store float* %0, float** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = call float @noise1(float %6)
store float %7, float* %5
%8 = load float, float* %5
%9 = load float*, float** %3
store float %8, float* %9
ret void
}

LLVM IR (-O2):
define void @noise_ff(float* nocapture writeonly %0, float %1) {
%3 = tail call float @noise1(float %1)
store float %3, float* %0
ret void
}
void initialize(union ui_state *state) {}


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

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

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

LLVM IR (-O2):
%union.ui_state = type opaque
define void @initialize(%union.ui_state* nocapture %0) {
ret void
}
int fibo(int n) {
  if (n < 2)
    return 1;
  return fibo(n - 1) + fibo(n - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fibo+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibo+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fibo+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibo@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fibo+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ isdigit(int);
char tolower(int);
int isxdigit(int c) {
  return isdigit(c) || (tolower(c) >= 'a' && tolower(c) <= 'z');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1178 <isxdigit+0x58>
mov    -0x4(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x6(%rbp)
jl     1172 <isxdigit+0x52>
mov    -0x4(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isxdigit+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <tolower@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x61,%cl
jl     1135 <isxdigit+0x15>
mov    %ebx,%edi
call   1040 <tolower@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x7b,%cl
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call signext i8 @tolower(i32 %7)
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call signext i8 @tolower(i32 %12)
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 122
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br label %18
18: ; preds = %16, %1
%19 = phi i1 [ true, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call signext i8 @tolower(i32 %0)
%6 = icmp sgt i8 %5, 96
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call signext i8 @tolower(i32 %0)
%9 = icmp slt i8 %8, 123
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ my_init();
int /*<<< orphan*/ show_mallinfo();
int main() {
  my_init();
  char *a = malloc(20);
  a[20] = 20;
  show_mallinfo();
  free(a);
  show_mallinfo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <my_init@plt>
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x14,0x14(%rax)
mov    $0x0,%al
call   1060 <show_mallinfo@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    $0x0,%al
call   1060 <show_mallinfo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <my_init@plt>
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x14,0x14(%rax)
xor    %eax,%eax
call   1060 <show_mallinfo@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
call   1060 <show_mallinfo@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @my_init()
%4 = call i8* @malloc(i32 20)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 20
store i8 20, i8* %6
%7 = call i32 (...) @show_mallinfo()
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = call i32 (...) @show_mallinfo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @my_init()
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = getelementptr inbounds i8, i8* %2, i64 20
store i8 20, i8* %3
%4 = tail call i32 (...) @show_mallinfo()
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 (...) @show_mallinfo()
ret i32 0
}
/* Variables and functions */
int instantiateClassInSpace(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int primitiveBehavior_BasicNew(int receiver, int *arguments) {
  return (instantiateClassInSpace(receiver, 0, 0, 0));
}


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

x86 assembly (clang, -O2):
<primitiveBehavior_BasicNew>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <instantiateClassInSpace@plt>

LLVM IR (-O0):
define i32 @primitiveBehavior_BasicNew(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 = call i32 @instantiateClassInSpace(i32 %5, i32 0, i32 0, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @primitiveBehavior_BasicNew(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @instantiateClassInSpace(i32 %0, i32 0, i32 0, i32 0)
ret i32 %3
}
long oldm(long n, long h, long l) {
  return (2 * h * n + h * h - l * n - 1) / (h * h - l * n);
}


x86 assembly (clang, -O0):
<oldm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
imul   -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
imul   -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
imul   -0x8(%rbp),%rdx
sub    %rdx,%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<oldm>:
mov    %rdx,%rax
imul   %rdi,%rax
imul   %rsi,%rdi
imul   %rsi,%rsi
lea    (%rsi,%rdi,2),%rcx
sub    %rax,%rsi
not    %rax
add    %rcx,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     112e <oldm+0x2e>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @oldm(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = mul nsw i64 2, %7
%9 = load i64, i64* %4
%10 = mul nsw i64 %8, %9
%11 = load i64, i64* %5
%12 = load i64, i64* %5
%13 = mul nsw i64 %11, %12
%14 = add nsw i64 %10, %13
%15 = load i64, i64* %6
%16 = load i64, i64* %4
%17 = mul nsw i64 %15, %16
%18 = sub nsw i64 %14, %17
%19 = sub nsw i64 %18, 1
%20 = load i64, i64* %5
%21 = load i64, i64* %5
%22 = mul nsw i64 %20, %21
%23 = load i64, i64* %6
%24 = load i64, i64* %4
%25 = mul nsw i64 %23, %24
%26 = sub nsw i64 %22, %25
%27 = sdiv i64 %19, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @oldm(i64 %0, i64 %1, i64 %2) {
%4 = shl i64 %0, 1
%5 = mul i64 %4, %1
%6 = mul nsw i64 %1, %1
%7 = add nsw i64 %5, %6
%8 = mul nsw i64 %2, %0
%9 = xor i64 %8, -1
%10 = add i64 %7, %9
%11 = sub nsw i64 %6, %8
%12 = sdiv i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
usage() {
  fprintf(stderr, "Usage: man [section] title\n");
  exit(0);
}


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>
xor    %edi,%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>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: man [section] title\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void gtk_font_selection_dialog_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_selection_dialog_get_type() {
ret void
}
int test_imm_73int8_reg(signed char val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_73int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 115
%6 = icmp ne i32 %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_73int8_reg(i8 signext %0) {
%2 = and i8 %0, 115
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = -2;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffe,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo0();
void main(void) { foo0(); }


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @foo0()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void clear_msg() {
  move(0, 0);
  clrtoeol();
  refresh();
  return;
}


x86 assembly (clang, -O0):
<clear_msg>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1050 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_msg>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
define void @clear_msg() {
%1 = call i32 @move(i32 0, i32 0)
%2 = call i32 (...) @clrtoeol()
%3 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @clear_msg() {
%1 = tail call i32 @move(i32 0, i32 0)
%2 = tail call i32 (...) @clrtoeol()
%3 = tail call i32 (...) @refresh()
ret void
}
int compare_records(char *rec1, char *rec2) {
  if (*rec1 > *rec2) {
    return 1;
  } else if (*rec1 < *rec2) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare_records>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112e <compare_records+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    115c <compare_records+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1150 <compare_records+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <compare_records+0x5c>
jmp    1155 <compare_records+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_records>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setl   %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_records(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp slt i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
void pcp_print_net_eicmp_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_eicmp_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xf5() {
  Assert_real((isbdigit(245) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1230, ("isbdigit should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ce,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf5\00"
define void @t_isbdigit_0xf5() {
%1 = tail call i64 @isbdigit(i32 245)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1230, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double dyad_getTime(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<dyad_getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyad_getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @dyad_getTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @dyad_getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
char signum_char(char i) {
  if (i > 0)
    return 1;
  if (i < 0)
    return (-1);
  return 0;
}


x86 assembly (clang, -O0):
<signum_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    1120 <signum_char+0x20>
movb   $0x1,-0x1(%rbp)
jmp    113a <signum_char+0x3a>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    1136 <signum_char+0x36>
movb   $0xff,-0x1(%rbp)
jmp    113a <signum_char+0x3a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_char>:
mov    %edi,%eax
sar    $0x7,%al
test   %dil,%dil
movzbl %al,%ecx
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @signum_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 -1, i8* %2
br label %14
13: ; preds = %8
store i8 0, i8* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @signum_char(i8 signext %0) {
%2 = ashr i8 %0, 7
%3 = icmp slt i8 %0, 1
%4 = select i1 %3, i8 %2, i8 1
ret i8 %4
}
int set_asic_fw_device_owner_value(unsigned long *reg_value,
                                   unsigned long value) {
  if (value & ~(0xffffffffffffffffULL))
    return 1;
  (*reg_value) = ((*reg_value) & ~((0xffffffffffffffffULL) << 0)) |
                 (((value >> 0) & (0xffffffffffffffffULL)) << 0);
  return 0;
}


x86 assembly (clang, -O0):
<set_asic_fw_device_owner_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
je     112a <set_asic_fw_device_owner_value+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1156 <set_asic_fw_device_owner_value+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
and    $0x0,%rcx
mov    -0x18(%rbp),%rax
shr    $0x0,%rax
and    $0xffffffffffffffff,%rax
shl    $0x0,%rax
or     %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_asic_fw_device_owner_value>:
mov    %rsi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @set_asic_fw_device_owner_value(i64* nocapture writeonly %0, i64 %1) {
store i64 %1, i64* %0
ret i32 0
}
void UI_construct_prompt(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ iswlower(scalar_t__);
wint_t towupper(wint_t c) { return iswlower(c) ? c - 0x20 : c; }


x86 assembly (clang, -O0):
<towupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <iswlower@plt>
cmp    $0x0,%rax
je     1140 <towupper+0x30>
mov    -0x8(%rbp),%rax
sub    $0x20,%rax
mov    %rax,-0x10(%rbp)
jmp    1148 <towupper+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper>:
push   %rbx
mov    %rdi,%rbx
call   1030 <iswlower@plt>
lea    -0x20(%rbx),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @towupper(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @iswlower(i64 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 32
br label %11
9: ; preds = %1
%10 = load i64, i64* %2
br label %11
11: ; preds = %9, %6
%12 = phi i64 [ %8, %6 ], [ %10, %9 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @towupper(i64 %0) {
%2 = tail call i64 @iswlower(i64 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i64 %0, -32
%5 = select i1 %3, i64 %0, i64 %4
ret i64 %5
}