xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setresgid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void shell(void) {
  printf("%s\n", "Good job, getting your shell...");
  gid_t gid = getegid();
  setresgid(gid, gid, gid);
  system("/bin/sh -i");
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getegid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <setresgid@plt>
lea    0xeaa(%rip),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getegid@plt>
mov    %eax,%edi
mov    %eax,%esi
mov    %eax,%edx
call   1030 <setresgid@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [32 x i8] c"Good job, getting your shell...\00"
@.str.2 = [11 x i8] c"/bin/sh -i\00"
define void @shell() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @getegid()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @setresgid(i32 %4, i32 %5, i32 %6)
%8 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [32 x i8] c"Good job, getting your shell...\00"
@.str.2 = [11 x i8] c"/bin/sh -i\00"
define void @shell() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @getegid()
%3 = tail call i32 @setresgid(i32 %2, i32 %2, i32 %2)
%4 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int main() {
  int stack[10];
  int head = -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x34(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void initVariant() {}


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

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

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

LLVM IR (-O2):
define void @initVariant() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ descomponer(int);
void printDisplay(int num) { descomponer(num); }


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

x86 assembly (clang, -O2):
<printDisplay>:
jmp    1030 <descomponer@plt>

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

LLVM IR (-O2):
define void @printDisplay(i32 %0) {
%2 = tail call i32 @descomponer(i32 %0)
ret void
}
void initArray(char *a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <initArray+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initArray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initArray>:
test   %esi,%esi
jle    1122 <initArray+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initArray(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void newOutput(FILE *out) {}


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

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

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

LLVM IR (-O2):
define void @newOutput(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int posix_fallocate(int, int /*<<< orphan*/, int);
int falloc(int fd, int len) { return posix_fallocate(fd, 0, len); }


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

x86 assembly (clang, -O2):
<falloc>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <posix_fallocate@plt>

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

LLVM IR (-O2):
define i32 @falloc(i32 %0, i32 %1) {
%3 = tail call i32 @posix_fallocate(i32 %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
size_t write_file(char *file_name, char *contents, size_t size) {}


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

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

LLVM IR (-O0):
define i64 @write_file(i8* %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i64, i64* %4
ret i64 %8
}

LLVM IR (-O2):
define i64 @write_file(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoGreaterEqual(void) { InlineWords(2, 22, 44); }


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

x86 assembly (clang, -O2):
<DoGreaterEqual>:
mov    $0x2,%edi
mov    $0x16,%esi
mov    $0x2c,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoGreaterEqual() {
%1 = call i32 @InlineWords(i32 2, i32 22, i32 44)
ret void
}

LLVM IR (-O2):
define void @DoGreaterEqual() {
%1 = tail call i32 @InlineWords(i32 2, i32 22, i32 44)
ret void
}
/* Variables and functions */
int atoi(char *);
char *getenv(char const *);
int getEnvInt(const char *env, int def) {
  int val;
  char *p;
  p = getenv(env);
  if (p)
    val = atoi(p);
  else
    val = def;
  return val;
}


x86 assembly (clang, -O0):
<getEnvInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <getEnvInt+0x38>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x10(%rbp)
jmp    115e <getEnvInt+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnvInt>:
push   %rbx
mov    %esi,%ebx
call   1030 <getenv@plt>
test   %rax,%rax
je     1136 <getEnvInt+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getEnvInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i8* @getenv(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %5
br label %16
14: ; preds = %2
%15 = load i32, i32* %4
store i32 %15, i32* %5
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @getEnvInt(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
char *remove_row(char ***g, int slice, int index, int pos) {
  return g[slice][index] + pos;
}


x86 assembly (clang, -O0):
<remove_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_row>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rsi
movslq %edx,%rdx
movslq %ecx,%rax
add    (%rsi,%rdx,8),%rax
ret

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

LLVM IR (-O2):
define i8* @remove_row(i8*** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8**, i8*** %0, i64 %5
%7 = load i8**, i8*** %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i8*, i8** %9
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
ret i8* %12
}
int mpeg3_major() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mpeg3_major() {
ret i32 1
}
int my_strlen(char *p) {
  int count = 0;
  while (*p != '\0') {
    p++;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <my_strlen+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111c <my_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
long long fll5(long long j, signed int *b, long long i) { return j + b[i]; }


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

x86 assembly (clang, -O2):
<fll5>:
movslq (%rsi,%rdx,4),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fll5(i64 %0, i32* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i64
store i64 %0, i64* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fll5(i64 %0, i32* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

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


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

x86 assembly (clang, -O2):
<test_mm_avg_epu16>:
jmp    1030 <_mm_avg_epu16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_avg_epu16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_epu16(i32 %0, i32 %1)
ret i32 %3
}
void Map0_HSync() {}


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

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

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

LLVM IR (-O2):
define void @Map0_HSync() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ info_via_proc_pid_stat(struct timespec *, scalar_t__);
void worker(struct timespec *ts, struct timespec *actual) {
  uint64_t deltans;
  deltans = actual->tv_sec * 1000000000 + actual->tv_nsec;
  info_via_proc_pid_stat(ts, deltans);
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3b9aca00,(%rax),%eax
cltq
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <info_via_proc_pid_stat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
movslq (%rsi),%rax
imul   $0x3b9aca00,%rax,%rax
add    0x8(%rsi),%rax
mov    %rax,%rsi
jmp    1030 <info_via_proc_pid_stat@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @worker(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000000
%10 = sext i32 %9 to i64
%11 = load %struct.timespec*, %struct.timespec** %4
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 1
%13 = load i64, i64* %12
%14 = add nsw i64 %10, %13
store i64 %14, i64* %5
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = load i64, i64* %5
%17 = call i32 @info_via_proc_pid_stat(%struct.timespec* %15, i64 %16)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @worker(%struct.timespec* %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %8, %6
%10 = tail call i32 @info_via_proc_pid_stat(%struct.timespec* %0, i64 %9)
ret void
}
void _dot_null(int _x, int _y, int _r, int _g, int _b) { return; }


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

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

LLVM IR (-O0):
define void @_dot_null(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @_dot_null(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
int gbGetValue(int min, int max, int v) {
  return (int)(min + (float)(max - min) *
                         (2.0 * (v / 31.0) - (v / 31.0) * (v / 31.0)));
}


x86 assembly (clang, -O0):
<gbGetValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  0xed3(%rip),%xmm3
divsd  %xmm3,%xmm2
cvtsi2sdl -0xc(%rbp),%xmm3
movsd  0xec2(%rip),%xmm4
divsd  %xmm4,%xmm3
cvtsi2sdl -0xc(%rbp),%xmm4
movsd  0xeb1(%rip),%xmm5
divsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbGetValue>:
cvtsi2sd %edi,%xmm0
sub    %edi,%esi
cvtsi2ss %esi,%xmm1
cvtsi2sd %edx,%xmm2
divsd  0xeea(%rip),%xmm2
cvtss2sd %xmm1,%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm2,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @gbGetValue(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 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = sitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 3.100000e+01
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 3.100000e+01
%20 = load i32, i32* %6
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 3.100000e+01
%23 = fmul double %19, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %16, double %24)
%26 = call double @llvm.fmuladd.f64(double %13, double %25, double %8)
%27 = fptosi double %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @gbGetValue(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = sitofp i32 %2 to double
%9 = fdiv double %8, 3.100000e+01
%10 = fneg double %9
%11 = fmul double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %9, double 2.000000e+00, double %11)
%13 = tail call double @llvm.fmuladd.f64(double %7, double %12, double %4)
%14 = fptosi double %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int c;

/* Variables and functions */
scalar_t__ isalpha(unsigned char);
scalar_t__ isdigit(unsigned char);
char tolower(unsigned char);
int dehex(char c) {
  if (isdigit((unsigned char)c))
    return (((c) - '0'));
  if (isalpha((unsigned char)c))
    return (((tolower((unsigned char)c)) - 'a') + 10);
  return (0);
}


x86 assembly (clang, -O0):
<dehex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1160 <dehex+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <dehex+0x64>
movzbl -0x5(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     118d <dehex+0x5d>
movzbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <dehex+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dehex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movzbl %bpl,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     114e <dehex+0x1e>
movsbl %bpl,%eax
add    $0xffffffd0,%eax
jmp    116b <dehex+0x3b>
mov    %ebx,%edi
call   1050 <isalpha@plt>
test   %rax,%rax
je     1169 <dehex+0x39>
mov    %ebx,%edi
call   1040 <tolower@plt>
movsbl %al,%eax
add    $0xffffffa9,%eax
jmp    116b <dehex+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dehex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %22
11: ; preds = %1
%12 = load i8, i8* %3
%13 = call i64 @isalpha(i8 zeroext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %3
%17 = call signext i8 @tolower(i8 zeroext %16)
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 97
%20 = add nsw i32 %19, 10
store i32 %20, i32* %2
br label %22
21: ; preds = %11
store i32 0, i32* %2
br label %22
22: ; preds = %21, %15, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @dehex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, -48
br label %14
7: ; preds = %1
%8 = tail call i64 @isalpha(i8 zeroext %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call signext i8 @tolower(i8 zeroext %0)
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -87
br label %14
14: ; preds = %7, %10, %4
%15 = phi i32 [ %6, %4 ], [ %13, %10 ], [ 0, %7 ]
ret i32 %15
}
int gcd_loop(int a, int b) {
  int temp_b;
  while (b != 0) {
    temp_b = b;
    b = a % b;
    a = temp_b;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd_loop+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd_loop+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_loop>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd_loop+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_loop+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd_loop(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ retourner(char *);
int main() {
  char *test = "coucou ";
  printf("%s", test);
  retourner(test);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rdi
lea    0xed1(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <retourner@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"coucou \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @retourner(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t dummy_get_temp(uint8_t s) {
  (void)s;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dummy_get_temp(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bgnclosedline();
void bgnclo_() { bgnclosedline(); }


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

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

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

LLVM IR (-O2):
define void @bgnclo_() {
%1 = tail call i32 (...) @bgnclosedline()
ret void
}
int ge(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<ge>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ge>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @ge(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ge(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int GPIODirModeGet(unsigned int baseAdd, unsigned int pinNumber) {
  unsigned int retVal = ((0x1u));
  if (!((*((volatile unsigned int *)(baseAdd + (0x134)))) & (1 << pinNumber))) {
    retVal = ((0x0u));
  }
  return retVal;
}


x86 assembly (clang, -O0):
<GPIODirModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x134,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113b <GPIODirModeGet+0x3b>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODirModeGet>:
mov    %esi,%ecx
add    $0x134,%edi
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GPIODirModeGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %3
%7 = add i32 %6, 308
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = load i32, i32* %4
%12 = shl i32 1, %11
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %2
store i32 0, i32* %5
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @GPIODirModeGet(i32 %0, i32 %1) {
%3 = add i32 %0, 308
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = lshr i32 %6, %1
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_programm_usage() {
  printf("\033[1m\033[37m"
         "Usage: "
         "\033[0m");
  printf("jpg filename.jpg {om} {le}\n");
  printf("{om}= Output Mode. 0=No output, 1=ASCII, 2=HEX, 3=ASCII & HEX\n");
  printf("{le}= Number of chars per line\n\n"
         "\033[0m");
}


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

x86 assembly (clang, -O2):
<print_programm_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\1B[1m\1B[37mUsage: \1B[0m\00"
@.str.1 = [28 x i8] c"jpg filename.jpg {om} {le}\0A\00"
@.str.2 = [63 x i8] c"{om}= Output Mode. 0=No output, 1=ASCII, 2=HEX, 3=ASCII & HEX\0A\00"
@.str.3 = [37 x i8] c"{le}= Number of chars per line\0A\0A\1B[0m\00"
define void @print_programm_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\1B[1m\1B[37mUsage: \1B[0m\00"
@.str.3 = [37 x i8] c"{le}= Number of chars per line\0A\0A\1B[0m\00"
@str = [27 x i8] c"jpg filename.jpg {om} {le}\00"
@str.4 = [62 x i8] c"{om}= Output Mode. 0=No output, 1=ASCII, 2=HEX, 3=ASCII & HEX\00"
define void @print_programm_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
ret void
}
unsigned xrop3_74_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_74_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_74_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_74_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int my_atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (2 != argc) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  printf("%d", my_atoi(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     115e <main+0x3e>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <main+0x62>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1153 <main+0x23>
mov    0x8(%rsi),%rdi
call   1030 <my_atoi@plt>
lea    0xeba(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1164 <main+0x34>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de parametres insuffisants\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 2, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @my_atoi(i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @my_atoi(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ acos(double);
long double cosl(int /*<<< orphan*/);
long double cosacos(double x) { return (cosl(acos(x))); }


x86 assembly (clang, -O0):
<cosacos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <acos@plt>
mov    %eax,%edi
call   1030 <cosl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @cosacos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @acos(double %3)
%5 = call x86_fp80 @cosl(i32 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @cosacos(double %0) {
%2 = tail call i32 @acos(double %0)
%3 = tail call x86_fp80 @cosl(i32 %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArr(int arr[], int m) {
  int i;
  for (i = 0; i < m; i++) {
    printf("%d", arr[i]);
  }
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArr+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArr+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printArr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void reversestring(char *str, int len) {
  register char *a, *z, swap;
  for (a = str, z = str + len - 1; a < z; a++, z--)
    ((swap) = (*a), (*a) = (*z), (*z) = (swap));
  return;
}


x86 assembly (clang, -O0):
<reversestring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116f <reversestring+0x6f>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1126 <reversestring+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversestring>:
movslq %esi,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <reversestring+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%rdi)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rax,%rdi
mov    %rcx,%rdi
jb     1120 <reversestring+0x20>
ret

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

LLVM IR (-O2):
define void @reversestring(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i8* [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = load i8, i8* %8
store i8 %11, i8* %9
store i8 %10, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %12, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  printf("%s\n", "test");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
uint8_t _byte_mod25(uint8_t x) {
  for (unsigned divisor = 200; divisor >= 25; divisor >>= 1) {
    if (x >= divisor) {
      x -= divisor;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<_byte_mod25>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jb     1142 <_byte_mod25+0x42>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     112f <_byte_mod25+0x2f>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <_byte_mod25+0x34>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <_byte_mod25+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_byte_mod25>:
lea    -0xc8(%rdi),%eax
cmp    $0xc8,%edi
cmovb  %edi,%eax
lea    -0x64(%rax),%ecx
cmp    $0x64,%eax
cmovb  %eax,%ecx
lea    -0x32(%rcx),%edx
cmp    $0x32,%ecx
cmovb  %ecx,%edx
lea    -0x19(%rdx),%eax
cmp    $0x19,%edx
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_byte_mod25(i32 %0) {
%2 = icmp ult i32 %0, 200
%3 = select i1 %2, i32 0, i32 -200
%4 = add i32 %3, %0
%5 = icmp ult i32 %4, 100
%6 = select i1 %5, i32 0, i32 -100
%7 = add i32 %6, %4
%8 = icmp ult i32 %7, 50
%9 = select i1 %8, i32 0, i32 -50
%10 = add i32 %9, %7
%11 = icmp ult i32 %10, 25
%12 = select i1 %11, i32 0, i32 -25
%13 = add i32 %12, %10
ret i32 %13
}