xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
void *allocvector(size_t size) {
  void *V;
  if ((V = (void *)malloc((size_t)size)) == NULL) {
    fprintf(stderr, "Error: couldn't allocate V in allocvector.\n");
    exit(-1);
  }
  memset(V, 0, size);
  return V;
}


x86 assembly (clang, -O0):
<allocvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1182 <allocvector+0x42>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     116c <allocvector+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Error: couldn't allocate V in allocvector.\0A\00"
define i8* @allocvector(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i64, i64* %2
%15 = call i32 @memset(i8* %13, i32 0, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Error: couldn't allocate V in allocvector.\0A\00"
define i8* @allocvector(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = tail call i32 @memset(i8* %3, i32 0, i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
int file_exists(const char *path) {
  if (access(path, F_OK) != -1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <file_exists+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <file_exists+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
uint32_t add(int32_t a, int32_t b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleSpeedDown() { printf(" ----- <SpeedDown> -----> "); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c" ----- <SpeedDown> -----> \00"
define void @handleSpeedDown() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c" ----- <SpeedDown> -----> \00"
define void @handleSpeedDown() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void COMP7_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @COMP7_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void end() { puts("Dealloc module resources..\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Dealloc module resources..\0A\00"
define void @end() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Dealloc module resources..\0A\00"
define void @end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
void gdk_x11_display_grab() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_display_grab() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int printf(char *);
int main() {
  int ret;
  ret = printf("Hello, World\n");
  if (ret == -1) {
    perror("Error: ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1154 <main+0x34>
lea    0xebf(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
cmp    $0xffffffff,%eax
je     1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
lea    0xed1(%rip),%rdi
call   1040 <perror@plt>
jmp    1132 <main+0x12>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
@.str.1 = [8 x i8] c"Error: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World\0A\00"
@.str.1 = [8 x i8] c"Error: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
const char *Mark_Name(void) { return "Mark"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Mark\00"
define i8* @Mark_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Mark\00"
define i8* @Mark_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x7c() {
  Assert_real((isdigit(124) == 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_isdigit.c",
              625, ("isdigit should be 0 for |"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for |\00"
define void @t_isdigit_0x7c() {
%1 = tail call i64 @isdigit(i32 124)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 625, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char const);
int isvalid(const char *begin, const char *end) {
  return begin != end && isalnum(*begin);
}


x86 assembly (clang, -O0):
<isvalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
je     1149 <isvalid+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
setne  %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):
<isvalid>:
cmp    %rsi,%rdi
je     112e <isvalid+0x1e>
push   %rax
movsbl (%rdi),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isvalid(i8* %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = tail call i64 @isalnum(i8 signext %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
unsigned int vector_index_of_sorted(struct vector const *, void const *);
bool vector_contains_sorted(const struct vector *__restrict vec,
                            const void *data) {
  return vector_index_of_sorted(vec, data) != (unsigned int)-1;
}


x86 assembly (clang, -O0):
<vector_contains_sorted>:
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 <vector_index_of_sorted@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_contains_sorted>:
push   %rax
call   1030 <vector_index_of_sorted@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.vector = type { i32 }
define i32 @vector_contains_sorted(%struct.vector* noalias %0, i8* %1) {
%3 = alloca %struct.vector*
%4 = alloca i8*
store %struct.vector* %0, %struct.vector** %3
store i8* %1, i8** %4
%5 = load %struct.vector*, %struct.vector** %3
%6 = load i8*, i8** %4
%7 = call i32 @vector_index_of_sorted(%struct.vector* %5, i8* %6)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define i32 @vector_contains_sorted(%struct.vector* noalias %0, i8* %1) {
%3 = tail call i32 @vector_index_of_sorted(%struct.vector* %0, i8* %1)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XUnmapEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XUnmapEvent_display(void *_p, void *_v) {
  ((XUnmapEvent *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XUnmapEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XUnmapEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
double wrap(double pixel_value) {
  double wrapped_pixel_value;
  if (pixel_value > 3.1415926535897932384626433832795)
    wrapped_pixel_value = pixel_value - (2 * 3.1415926535897932384626433832795);
  else if (pixel_value < -3.1415926535897932384626433832795)
    wrapped_pixel_value = pixel_value + (2 * 3.1415926535897932384626433832795);
  else
    wrapped_pixel_value = pixel_value;
  return wrapped_pixel_value;
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <wrap+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <wrap+0x74>
movsd  0xec5(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1165 <wrap+0x65>
movsd  0xeba(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116f <wrap+0x6f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <wrap+0x74>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
ucomisd 0xef8(%rip),%xmm0
jbe    1113 <wrap+0x13>
addsd  0xf06(%rip),%xmm0
ret
movsd  0xeed(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1129 <wrap+0x29>
addsd  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wrap(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0x400921FB54442D18
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fsub double %7, 0x401921FB54442D18
store double %8, double* %3
br label %18
9: ; preds = %1
%10 = load double, double* %2
%11 = fcmp olt double %10, 0xC00921FB54442D18
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %2
%14 = fadd double %13, 0x401921FB54442D18
store double %14, double* %3
br label %17
15: ; preds = %9
%16 = load double, double* %2
store double %16, double* %3
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %6
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @wrap(double %0) {
%2 = fcmp ogt double %0, 0x400921FB54442D18
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 0xC01921FB54442D18
br label %9
5: ; preds = %1
%6 = fcmp olt double %0, 0xC00921FB54442D18
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = fadd double %0, 0x401921FB54442D18
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
unsigned int determineNumOfColors(unsigned int bitplaneDepth) {
  switch (bitplaneDepth) {
  case 1:
    return 2;
  case 2:
    return 4;
  case 3:
    return 8;
  case 4:
    return 16;
  case 5:
    return 32;
  case 6:
    return 64;
  case 7:
    return 128;
  case 8:
    return 256;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<determineNumOfColors>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1190 <determineNumOfColors+0x90>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x4,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x8,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x10,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x20,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x40,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x80,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x100,-0x4(%rbp)
jmp    1197 <determineNumOfColors+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<determineNumOfColors>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <determineNumOfColors+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @determineNumOfColors(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
]
5: ; preds = %1
store i32 2, i32* %2
br label %14
6: ; preds = %1
store i32 4, i32* %2
br label %14
7: ; preds = %1
store i32 8, i32* %2
br label %14
8: ; preds = %1
store i32 16, i32* %2
br label %14
9: ; preds = %1
store i32 32, i32* %2
br label %14
10: ; preds = %1
store i32 64, i32* %2
br label %14
11: ; preds = %1
store i32 128, i32* %2
br label %14
12: ; preds = %1
store i32 256, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@switch.table.determineNumOfColors = [8 x i32] [i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256]
define i32 @determineNumOfColors(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.determineNumOfColors, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int _close(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
void CG_MakeItemFindable(int i) {}


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

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

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

LLVM IR (-O2):
define void @CG_MakeItemFindable(i32 %0) {
ret void
}
double sum0() { return 6; }


x86 assembly (clang, -O0):
<sum0>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum0>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sum0() {
ret double 6.000000e+00
}

LLVM IR (-O2):
define double @sum0() {
ret double 6.000000e+00
}
/* Variables and functions */
int strlen(char *);
char *corta_string(char *apuntador) {
  if (strlen(apuntador) > 1)
    return apuntador + 1;
  else
    return "¡peligro! te vas a quedar sin caracteres\n";
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jle    113f <corta_string+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114a <corta_string+0x3a>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%rbx
cmp    $0x2,%eax
lea    0xed9(%rip),%rax
cmovge %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\C2\A1peligro! te vas a quedar sin caracteres\0A\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %10, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"\C2\A1peligro! te vas a quedar sin caracteres\0A\00"
define i8* @corta_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = select i1 %3, i8* %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float tf;
  printf("Fahrenheit(oF): ");
  scanf("%f", &tf);
  printf("Celsius: %.2f oC", 5.0 * (tf - 32.0) / 9.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeae(%rip),%xmm0
mulsd  0xeae(%rip),%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Fahrenheit(oF): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [17 x i8] c"Celsius: %.2f oC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fsub double %6, 3.200000e+01
%8 = fmul double 5.000000e+00, %7
%9 = fdiv double %8, 9.000000e+00
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Fahrenheit(oF): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [17 x i8] c"Celsius: %.2f oC\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fadd double %6, -3.200000e+01
%8 = fmul double %7, 5.000000e+00
%9 = fdiv double %8, 9.000000e+00
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}
void __NOP(void) { asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @__NOP() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr, "buildkeymap [-o binkeymapfile] asciisrcfile\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 = [45 x i8] c"buildkeymap [-o binkeymapfile] asciisrcfile\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"buildkeymap [-o binkeymapfile] asciisrcfile\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_CARDREADER_SC8IN1(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_CARDREADER_SC8IN1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_CARDREADER_SC8IN1>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_CARDREADER_SC8IN1() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_CARDREADER_SC8IN1() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef long uint32_t;
struct etimer {
  int dummy;
};

/* Variables and functions */
int timer_elapsed_milliseconds(struct etimer *, long);
bool timer_elapsed_minutes(struct etimer *t, uint32_t interval) {
  interval *= 1000L;
  interval *= 60L;
  return timer_elapsed_milliseconds(t, interval);
}


x86 assembly (clang, -O0):
<timer_elapsed_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0x3c,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <timer_elapsed_milliseconds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_minutes>:
imul   $0xea60,%rsi,%rsi
jmp    1030 <timer_elapsed_milliseconds@plt>

LLVM IR (-O0):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_minutes(%struct.etimer* %0, i64 %1) {
%3 = alloca %struct.etimer*
%4 = alloca i64
store %struct.etimer* %0, %struct.etimer** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = mul nsw i64 %7, 60
store i64 %8, i64* %4
%9 = load %struct.etimer*, %struct.etimer** %3
%10 = load i64, i64* %4
%11 = call i32 @timer_elapsed_milliseconds(%struct.etimer* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_minutes(%struct.etimer* %0, i64 %1) {
%3 = mul i64 %1, 60000
%4 = tail call i32 @timer_elapsed_milliseconds(%struct.etimer* %0, i64 %3)
ret i32 %4
}
int foo(int x) { return x * 10; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t Settings_GetDirectionPinMask(uint8_t axis_idx) {
  if (axis_idx == 0) {
    return (1 << 0);
  }
  if (axis_idx == 1) {
    return (1 << 1);
  }
  if (axis_idx == 2) {
    return (1 << 2);
  }
  if (axis_idx == 3) {
    return (1 << 3);
  }
  return (1 << 4);
}


x86 assembly (clang, -O0):
<Settings_GetDirectionPinMask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Settings_GetDirectionPinMask+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <Settings_GetDirectionPinMask+0x66>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <Settings_GetDirectionPinMask+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1166 <Settings_GetDirectionPinMask+0x66>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <Settings_GetDirectionPinMask+0x49>
movl   $0x4,-0x4(%rbp)
jmp    1166 <Settings_GetDirectionPinMask+0x66>
cmpl   $0x3,-0x8(%rbp)
jne    115f <Settings_GetDirectionPinMask+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    1166 <Settings_GetDirectionPinMask+0x66>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Settings_GetDirectionPinMask>:
mov    $0x10,%eax
cmp    $0x3,%edi
ja     1117 <Settings_GetDirectionPinMask+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.Settings_GetDirectionPinMask = [4 x i32] [i32 1, i32 2, i32 4, i32 8]
define i32 @Settings_GetDirectionPinMask(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.Settings_GetDirectionPinMask, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 16, %1 ]
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short y;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_ink_extent_y(void *_p, short _v) {
  ((XFontSetExtents *)_p)->max_ink_extent.y = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_ink_extent_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_ink_extent_y>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontSetExtents_max_ink_extent_y(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontSetExtents_max_ink_extent_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
int arch_spin_trylock(unsigned long *lock) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_spin_trylock(i64* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ get_output_iconv();
int /*<<< orphan*/ iconv_close(int /*<<< orphan*/);
char *string_do_convert(char const *, int /*<<< orphan*/);
char *string_from_utf8(const char *in) {
  iconv_t ic = get_output_iconv();
  char *ret = string_do_convert(in, ic);
  iconv_close(ic);
  return ret;
}


x86 assembly (clang, -O0):
<string_from_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_output_iconv@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <string_do_convert@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <iconv_close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_from_utf8>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_output_iconv@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <string_do_convert@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <iconv_close@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_from_utf8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i32 (...) @get_output_iconv()
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @string_do_convert(i8* %6, i32 %7)
store i8* %8, i8** %4
%9 = load i32, i32* %3
%10 = call i32 @iconv_close(i32 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @string_from_utf8(i8* %0) {
%2 = tail call i32 (...) @get_output_iconv()
%3 = tail call i8* @string_do_convert(i8* %0, i32 %2)
%4 = tail call i32 @iconv_close(i32 %2)
ret i8* %3
}
int terminates(int c) { return '\0' == c || '=' == c; }


x86 assembly (clang, -O0):
<terminates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
je     1125 <terminates+0x25>
mov    $0x3d,%eax
cmp    -0x4(%rbp),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminates>:
test   %edi,%edi
sete   %al
cmp    $0x3d,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @terminates(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp eq i32 %0, 61
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void g_string_prepend_c() {}


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

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

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

LLVM IR (-O2):
define void @g_string_prepend_c() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_cmpgt_epi8(__m128i A, __m128i B) {
  return _mm_cmpgt_epi8(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpgt_epi8>:
jmp    1030 <_mm_cmpgt_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpgt_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_epi8(i32 %0, i32 %1)
ret i32 %3
}
int dh_roundup(int x, int n) {
  x = (x + n - 1) / n;
  return x * n;
}


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

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

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

LLVM IR (-O2):
define i32 @dh_roundup(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
void Object__dtor(struct Object__private *this) { (void)this; }


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

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

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

LLVM IR (-O2):
%struct.Object__private = type opaque
define void @Object__dtor(%struct.Object__private* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int n;
  scanf("%d", &n);
  printf("%d", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void zcb_onError(int error, char *errtext, char *lastchars) {
  printf("onError( %d, %s ) @ %s\n", error, errtext, lastchars);
}


x86 assembly (clang, -O0):
<zcb_onError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcb_onError>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"onError( %d, %s ) @ %s\0A\00"
define void @zcb_onError(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"onError( %d, %s ) @ %s\0A\00"
define void @zcb_onError(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void putEscapeChar(unsigned int c) { printf("\\%03d", c & 0xff); }


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

x86 assembly (clang, -O2):
<putEscapeChar>:
movzbl %dil,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\\%03d\00"
define void @putEscapeChar(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
main() {
  int x[5] = {1, 2};
  int k[] = {1, 2, 3};
  char y[2] = {1, 2, 3, 4};
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xee8(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    0xee2(%rip),%ax
mov    %ax,-0x2e(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [5 x i32] [i32 1, i32 2, i32 0, i32 0, i32 0]
@__const.main.k = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.y = [2 x i8] c"\01\02"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [3 x i32]
%3 = alloca [2 x i8]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
%6 = bitcast [2 x i8]* %3 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ index(char const *, char);
int absolute_program(const char *string) {
  return ((char *)index(string, '/') != (char *)((void *)0));
}


x86 assembly (clang, -O0):
<absolute_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <index@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute_program>:
push   %rax
mov    $0x2f,%esi
call   1030 <index@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @absolute_program(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @index(i8* %3, i8 signext 47)
%5 = inttoptr i64 %4 to i8*
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @absolute_program(i8* %0) {
%2 = tail call i64 @index(i8* %0, i8 signext 47)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void gtk_scroll_step_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scroll_step_get_type() {
ret void
}
void function(int a, int b, int c) {
  char buffer1[5];
  char buffer2[10];
}


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

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

LLVM IR (-O0):
define void @function(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i8]
%8 = alloca [10 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @function(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yylex();
void main() { yylex(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @yylex()
ret void
}