xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct TYPE_3__ {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct itimerval {
  TYPE_2__ it_value;
  TYPE_1__ it_interval;
};

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int setitimer(int /*<<< orphan*/, struct itimerval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ x_perror(char *);
void tge_timer_stop(void) {
  struct itimerval itv = {
      .it_interval.tv_sec = 0,
      .it_interval.tv_usec = 0,
      .it_value.tv_sec = 0,
      .it_value.tv_usec = 0,
  };
  if (setitimer(ITIMER_REAL, &itv, NULL) == -1) {
    x_perror("failed to set itimer");
  }
}


x86 assembly (clang, -O0):
<tge_timer_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <setitimer@plt>
cmp    $0xffffffff,%eax
jne    1173 <tge_timer_stop+0x43>
lea    0xe92(%rip),%rdi
call   1030 <x_perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tge_timer_stop>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1040 <setitimer@plt>
cmp    $0xffffffff,%eax
je     1148 <tge_timer_stop+0x28>
add    $0x18,%rsp
ret
lea    0xeb1(%rip),%rdi
add    $0x18,%rsp
jmp    1030 <x_perror@plt>

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@ITIMER_REAL = global i32 0
@.str = [21 x i8] c"failed to set itimer\00"
define void @tge_timer_stop() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @setitimer(i32 %3, %struct.itimerval* %1, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @x_perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@ITIMER_REAL = global i32 0
@.str = [21 x i8] c"failed to set itimer\00"
define void @tge_timer_stop() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @setitimer(i32 %3, %struct.itimerval* %1, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @x_perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
int do_445() { return 445; }


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

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

LLVM IR (-O0):
define i32 @do_445() {
ret i32 445
}

LLVM IR (-O2):
define i32 @do_445() {
ret i32 445
}
/* Variables and functions */
int /*<<< orphan*/ BMP_drawBitmapData(unsigned char const *, unsigned short,
                                      unsigned short, unsigned short,
                                      unsigned short, unsigned long);
void BMP_loadBitmapData(const unsigned char *image, unsigned short x,
                        unsigned short y, unsigned short w, unsigned short h,
                        unsigned long pitch) {
  BMP_drawBitmapData(image, x, y, w, h, pitch);
}


x86 assembly (clang, -O0):
<BMP_loadBitmapData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dx,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %ax,-0x10(%rbp)
mov    %r9,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%si
mov    -0xc(%rbp),%dx
mov    -0xe(%rbp),%cx
mov    -0x10(%rbp),%ax
mov    -0x18(%rbp),%r9
movzwl %si,%esi
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %ax,%r8d
call   1030 <BMP_drawBitmapData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_loadBitmapData>:
jmp    1030 <BMP_drawBitmapData@plt>

LLVM IR (-O0):
define void @BMP_loadBitmapData(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i64
store i8* %0, i8** %7
store i16 %1, i16* %8
store i16 %2, i16* %9
store i16 %3, i16* %10
store i16 %4, i16* %11
store i64 %5, i64* %12
%13 = load i8*, i8** %7
%14 = load i16, i16* %8
%15 = load i16, i16* %9
%16 = load i16, i16* %10
%17 = load i16, i16* %11
%18 = load i64, i64* %12
%19 = call i32 @BMP_drawBitmapData(i8* %13, i16 zeroext %14, i16 zeroext %15, i16 zeroext %16, i16 zeroext %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @BMP_loadBitmapData(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4, i64 %5) {
%7 = tail call i32 @BMP_drawBitmapData(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4, i64 %5)
ret void
}
void X509_REQ_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_new() {
ret void
}
int intincreasing(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


x86 assembly (clang, -O0):
<intincreasing>:
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
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @intincreasing(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intincreasing(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
double convert_to_degrees(double radians) {
  double converter = 180.0 / 3.14159265;
  return radians * converter;
}


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

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

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

LLVM IR (-O2):
define double @convert_to_degrees(double %0) {
%2 = fmul double %0, 0x404CA5DC1AF05A77
ret double %2
}
void chaz_ConfWriterRuby_add_local_include(const char *header) { (void)header; }


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

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

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

LLVM IR (-O2):
define void @chaz_ConfWriterRuby_add_local_include(i8* nocapture %0) {
ret void
}
void BN_GF2m_add(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_add() {
ret void
}
/* Variables and functions */
char *ckmalloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *savestr(const char *s) {
  char *p;
  size_t len;
  len = strlen(s);
  p = ckmalloc(len + 1);
  memcpy(p, s, len + 1);
  return p;
}


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

x86 assembly (clang, -O2):
<savestr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1040 <ckmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @savestr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @ckmalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
void delay(n) {
  int i;
  for (i = 0; i < n; i++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
char *strndup(char *, int);
int main(int argc, char *argv[]) {
  char *str =
      strndup("Return a malloc'd copy of at most N bytes of STRING.", 20);
  printf("%s\n", str);
  printf("%lu\n", strlen(str));
  free(str);
  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    0xea3(%rip),%rdi
mov    $0x14,%esi
call   1060 <strndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
mov    $0x14,%esi
call   1060 <strndup@plt>
mov    %rax,%rbx
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Return a malloc'd copy of at most N bytes of STRING.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @strndup(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 20)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %6
%11 = call i8* @strlen(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Return a malloc'd copy of at most N bytes of STRING.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(21) i8* @strndup(i8* dereferenceable(53) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i8* @strlen(i8* %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *swedish_ISO_8859_1_create_env(void) {
  return SN_create_env(0, 2, 0);
}


x86 assembly (clang, -O0):
<swedish_ISO_8859_1_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swedish_ISO_8859_1_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @swedish_ISO_8859_1_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @swedish_ISO_8859_1_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}
/* Variables and functions */
int /*<<< orphan*/ mod2();
void mod1(void) { mod2(); }


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

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

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

LLVM IR (-O2):
define void @mod1() {
%1 = tail call i32 (...) @mod2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharOR(void) { printf("\x01B(0\x06B\x01B(B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B(0k\1B(B\00"
define void @putLDCharOR() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0k\1B(B\00"
define void @putLDCharOR() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void greatest_usage(const char *name) {
  fprintf(stdout,
          "Usage: %s [-hlfv] [-s SUITE] [-t TEST]\n"
          "  -h        print this Help\n"
          "  -l        List suites and their tests, then exit\n"
          "  -f        Stop runner after first failure\n"
          "  -v        Verbose output\n"
          "  -s SUITE  only run suites containing string SUITE\n"
          "  -t TEST   only run tests containing string TEST\n",
          name);
}


x86 assembly (clang, -O0):
<greatest_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):
<greatest_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [292 x i8] c"Usage: %s [-hlfv] [-s SUITE] [-t TEST]\0A -h print this Help\0A -l List suites and their tests, then exit\0A -f Stop runner after first failure\0A -v Verbose output\0A -s SUITE only run suites containing string SUITE\0A -t TEST only run tests containing string TEST\0A\00"
define void @greatest_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [292 x i8] c"Usage: %s [-hlfv] [-s SUITE] [-t TEST]\0A -h print this Help\0A -l List suites and their tests, then exit\0A -f Stop runner after first failure\0A -v Verbose output\0A -s SUITE only run suites containing string SUITE\0A -t TEST only run tests containing string TEST\0A\00"
define void @greatest_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ vsprintf(char *, char const *, int /*<<< orphan*/);
int vsnprintf(char *s, size_t n, const char *fmt, va_list args) {
  (void)vsprintf(s, fmt, args);
  return strlen(s);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vsprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
push   %rbx
mov    %rdi,%rbx
mov    %rdx,%rsi
mov    %ecx,%edx
call   1040 <vsprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsprintf(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @strlen(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsprintf(i8* %0, i8* %2, i32 %3)
%6 = tail call i32 @strlen(i8* %0)
ret i32 %6
}
int mem_read32(const unsigned char *p) {
  unsigned int r = 0;
  r |= (unsigned int)(*(p + 0));
  r |= (unsigned int)(*(p + 1)) << 8;
  r |= (unsigned int)(*(p + 2)) << 16;
  r |= (unsigned int)(*(p + 3)) << 24;
  return r;
}


x86 assembly (clang, -O0):
<mem_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mem_read32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 16
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 24
%29 = load i32, i32* %3
%30 = or i32 %29, %28
store i32 %30, i32* %3
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @mem_read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
float min(float f1, float f2) { return f1 > f2 ? f2 : f1; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <min+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <min+0x36>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
br label %12
10: ; preds = %2
%11 = load float, float* %3
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void simple_check(int x) { assert(x < 3); }


x86 assembly (clang, -O0):
<simple_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_check>:
xor    %eax,%eax
cmp    $0x3,%edi
setl   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @simple_check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @simple_check(i32 %0) {
%2 = icmp slt i32 %0, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
void arithmetic_init_mod(void) { int x = 1 % 1; }


x86 assembly (clang, -O0):
<arithmetic_init_mod>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ UINT16_C(int);
uint16_t pci_find_classcode(uint32_t dev_class) { return UINT16_C(0xffff); }


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

x86 assembly (clang, -O2):
<pci_find_classcode>:
mov    $0xffff,%edi
jmp    1030 <UINT16_C@plt>

LLVM IR (-O0):
define i32 @pci_find_classcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @UINT16_C(i32 65535)
ret i32 %3
}

LLVM IR (-O2):
define i32 @pci_find_classcode(i32 %0) {
%2 = tail call i32 @UINT16_C(i32 65535)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void dispval(char *val) { printf("Value: %s\n", val); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Value: %s\0A\00"
define void @dispval(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  int i = 0;
  int res = 0;
  goto L1;
  for (i = 0; i < 10; i++) {
    goto L1;
    return 42;
  L1:
    res++;
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    112d <main+0x2d>
cmpl   $0xa,-0x8(%rbp)
jge    1144 <main+0x44>
jmp    112d <main+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <main+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(764, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_start_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2fc,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_start_Laurent_system>:
mov    $0x2fc,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_start_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 764, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 764, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ttlfull;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
int url_isttl(char word[], char ttl[]) {
  char ttlfull[6];
  snprintf(ttlfull, sizeof(ttlfull), ".%s/", ttl);
  if (strstr((word + 7), ttlfull) == NULL) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<url_isttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x1e(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x6,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rdi
add    $0x7,%rdi
lea    -0x1e(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
jne    1170 <url_isttl+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1177 <url_isttl+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_isttl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
lea    0x2(%rsp),%r14
mov    %r14,%rdi
mov    $0x6,%esi
call   1030 <snprintf@plt>
add    $0x7,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c".%s/\00"
define i32 @url_isttl(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [6 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = call i32 @snprintf(i8* %7, i32 6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 7
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%13 = call i32* @strstr(i8* %11, i8* %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c".%s/\00"
define i32 @url_isttl(i8* %0, i8* %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = getelementptr inbounds i8, i8* %0, i64 7
%7 = call i32* @strstr(i8* %6, i8* %4)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}
int compare(int x, int y) {
  x = y;
  return (3);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1) {
ret i32 3
}
unsigned int get_num_afterswapping_even_odd_bits(unsigned int num) {
  unsigned int odd_bits_set = num & 0xaaaaaaaa;
  unsigned int even_bits_set = num & 0x55555555;
  odd_bits_set >>= 1;
  even_bits_set <<= 1;
  return (odd_bits_set | even_bits_set);
}


x86 assembly (clang, -O0):
<get_num_afterswapping_even_odd_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_afterswapping_even_odd_bits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
and    $0xd5555555,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @get_num_afterswapping_even_odd_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -1431655766
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 1431655765
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = lshr i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = shl i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_num_afterswapping_even_odd_bits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = shl i32 %0, 1
%5 = and i32 %4, -1431655766
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ zip(int *, int *);
int main(void) {
  int myarray1[] = {24, 37, 142, 205};
  int myarray2[] = {2, 4, 6, 8};
  zip(myarray1, myarray2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <zip@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <zip@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.myarray1 = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
@__const.main.myarray2 = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast [4 x i32]* %3 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = call i32 @zip(i32* %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myarray1 = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
@__const.main.myarray2 = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @zip(i32* %5, i32* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('a');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Variables and functions */
double log(double);
double sin(double);
double mercator(double x) { return 0.5 * log((1.0 + sin(x)) / (1.0 - sin(x))); }


x86 assembly (clang, -O0):
<mercator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mercator>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
addsd  0xec9(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0xeb0(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
mulsd  0xe9d(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @mercator(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = fadd double 1.000000e+00, %4
%6 = load double, double* %2
%7 = call double @sin(double %6)
%8 = fsub double 1.000000e+00, %7
%9 = fdiv double %5, %8
%10 = call double @log(double %9)
%11 = fmul double 5.000000e-01, %10
ret double %11
}

LLVM IR (-O2):
define double @mercator(double %0) {
%2 = tail call double @sin(double %0)
%3 = fadd double %2, 1.000000e+00
%4 = tail call double @sin(double %0)
%5 = fsub double 1.000000e+00, %4
%6 = fdiv double %3, %5
%7 = tail call double @log(double %6)
%8 = fmul double %7, 5.000000e-01
ret double %8
}
int sgx_thread_set_untrusted_event_ocall(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sgx_thread_set_untrusted_event_ocall() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
float *malloc(int);
int main() {
  float *test = malloc(sizeof(float) * 3);
  test[1] = 9;
  free(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0xeb7(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
movl   $0x41100000,0x4(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
store i32 0, i32* %1
%3 = call float* @malloc(i32 12)
store float* %3, float** %2
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 1
store float 9.000000e+00, float* %5
%6 = load float*, float** %2
%7 = call i32 @free(float* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float* @malloc(i32 12)
%2 = getelementptr inbounds float, float* %1, i64 1
store float 9.000000e+00, float* %2
%3 = tail call i32 @free(float* %1)
ret i32 0
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ret;
#pragma omp parallel
#pragma omp master
  { ret = foo(8); }
  printf("%i\n", ret);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
__attribute__((visibility("default"))) void MoveScreen(int xpos, int ypos) {}


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

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

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

LLVM IR (-O2):
define void @MoveScreen(i32 %0, i32 %1) {
ret void
}
unsigned int get_4_le(const unsigned char *ptr) {
  return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
}


x86 assembly (clang, -O0):
<get_4_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_4_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_4_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int RGBclamp(int);
int YCrCb2R(int Y, int Cr, int Cb) {
  return RGBclamp((500 + 1164 * (Y - 16) + 1596 * (Cr - 128)) / 1000);
}


x86 assembly (clang, -O0):
<YCrCb2R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x10,%eax
imul   $0x48c,%eax,%eax
add    $0x1f4,%eax
mov    -0x8(%rbp),%ecx
sub    $0x80,%ecx
imul   $0x63c,%ecx,%ecx
add    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <RGBclamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YCrCb2R>:
imul   $0x48c,%edi,%eax
imul   $0x63c,%esi,%ecx
add    %ecx,%eax
add    $0xfffc9b34,%eax
cltq
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <RGBclamp@plt>

LLVM IR (-O0):
define i32 @YCrCb2R(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 16
%9 = mul nsw i32 1164, %8
%10 = add nsw i32 500, %9
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 128
%13 = mul nsw i32 1596, %12
%14 = add nsw i32 %10, %13
%15 = sdiv i32 %14, 1000
%16 = call i32 @RGBclamp(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @YCrCb2R(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 1164
%5 = mul i32 %1, 1596
%6 = add i32 %4, -222412
%7 = add i32 %6, %5
%8 = sdiv i32 %7, 1000
%9 = tail call i32 @RGBclamp(i32 %8)
ret i32 %9
}
int strEqual(char str1[], char str2[]) {
  for (; *str1 == *str2 && *str1 != '\0'; str1++, str2++)
    ;
  return *str2 == *str1;
}


x86 assembly (clang, -O0):
<strEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <strEqual+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strEqual+0x47>
jmp    1169 <strEqual+0x69>
jmp    114c <strEqual+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strEqual+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strEqual>:
mov    (%rdi),%cl
mov    (%rsi),%dl
test   %cl,%cl
je     1134 <strEqual+0x34>
cmp    %dl,%cl
jne    1134 <strEqual+0x34>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
movzbl (%rsi,%rax,1),%edx
test   %cl,%cl
je     1134 <strEqual+0x34>
add    $0x1,%rax
cmp    %dl,%cl
je     1120 <strEqual+0x20>
xor    %eax,%eax
cmp    %cl,%dl
sete   %al
ret

LLVM IR (-O0):
define i32 @strEqual(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %21, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %26
20: ; preds = %18
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %5
26: ; preds = %18
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %29, %32
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @strEqual(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = icmp eq i8 %20, %19
%22 = zext i1 %21 to i32
ret i32 %22
}
unsigned kol_system_mem() { asm("int $0x40" ::"a"(18), "b"(17)); }


x86 assembly (clang, -O0):
<kol_system_mem>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x12,%eax
mov    $0x11,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_system_mem>:
push   %rbx
mov    $0x12,%eax
mov    $0x11,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_system_mem() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 18, i32 17)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void volatile_store_u64(uint64_t *dest, uint64_t val) {
  *((volatile uint64_t *)dest) = val;
}


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

x86 assembly (clang, -O2):
<volatile_store_u64>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_store_u64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_store_u64(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}