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

/* Variables and functions */
int mbtowc(int /*<<< orphan*/ *, char const *, size_t);
int mblen(const char *s, size_t n) { return (mbtowc((wchar_t *)NULL, s, n)); }


x86 assembly (clang, -O0):
<mblen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbtowc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mblen>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <mbtowc@plt>

LLVM IR (-O0):
define i32 @mblen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @mbtowc(i32* null, i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = tail call i32 @mbtowc(i32* null, i8* %0, i64 %1)
ret i32 %3
}
int hashFunc(char *url) { return url[0]; }


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

x86 assembly (clang, -O2):
<hashFunc>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hashFunc(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 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hashFunc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kputs(char const *);
void panic(const char *s) {
  kputs("PANIC:");
  kputs(s);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <kputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <kputs@plt>
jmp    1131 <panic+0x21>

x86 assembly (clang, -O2):
<panic>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <kputs@plt>
mov    %rbx,%rdi
call   1030 <kputs@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <panic+0x20>

LLVM IR (-O0):
@.str = [7 x i8] c"PANIC:\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @kputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @kputs(i8* %4)
br label %6
6: ; preds = %1, %6
br label %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"PANIC:\00"
define void @panic(i8* %0) {
%2 = tail call i32 @kputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @kputs(i8* %0)
br label %4
4: ; preds = %1, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ addGlitter(int);
int /*<<< orphan*/ rainbow();
void rainbowWithGlitter() {
  rainbow();
  addGlitter(80);
}


x86 assembly (clang, -O0):
<rainbowWithGlitter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rainbow@plt>
mov    $0x50,%edi
call   1040 <addGlitter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rainbowWithGlitter>:
push   %rax
xor    %eax,%eax
call   1030 <rainbow@plt>
mov    $0x50,%edi
pop    %rax
jmp    1040 <addGlitter@plt>

LLVM IR (-O0):
define void @rainbowWithGlitter() {
%1 = call i32 (...) @rainbow()
%2 = call i32 @addGlitter(i32 80)
ret void
}

LLVM IR (-O2):
define void @rainbowWithGlitter() {
%1 = tail call i32 (...) @rainbow()
%2 = tail call i32 @addGlitter(i32 80)
ret void
}
int unipiDigitalRead(int pin) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unipiDigitalRead(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int main() {
  int dizi[4 * 1024] = {0};
  printf("%p icerisinde %d degeri var.\n", &dizi[0], dizi[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4010(%rbp),%rdi
xor    %esi,%esi
mov    $0x4000,%edx
call   1040 <memset@plt>
lea    -0x4010(%rbp),%rsi
mov    -0x4010(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x4010,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"%p icerisinde %d degeri var.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i32]
store i32 0, i32* %1
%3 = bitcast [4096 x i32]* %2 to i8*
%4 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"%p icerisinde %d degeri var.\0A\00"
define i32 @main() {
%1 = alloca [4096 x i32]
%2 = bitcast [4096 x i32]* %1 to i8*
%3 = getelementptr inbounds [4096 x i32], [4096 x i32]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %3, i32 0)
ret i32 0
}
int func(int n) {
  if (n > 0) {
    return n - 1;
  }
  return n + 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111f <func+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <func+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
lea    (%rdi,%rax,2),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 1, i32 -1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
pid_t fork(void) {
  pid_t ret = fork();
  printf("[*] fork() == %d\n", ret);
  return ret;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
push   %rax
call   1040 <fork@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"[*] fork() == %d\0A\00"
define i32 @fork() {
%1 = tail call i32 @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 undef
}
void southcluster_log_state(void) {}


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

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

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

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

/* Variables and functions */
time_t GPS_Math_Utime_To_Gtime(time_t v) { return v - 631065600; }


x86 assembly (clang, -O0):
<GPS_Math_Utime_To_Gtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x259d4c00,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Utime_To_Gtime>:
lea    -0x259d4c00(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @GPS_Math_Utime_To_Gtime(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 631065600
ret i64 %4
}

LLVM IR (-O2):
define i64 @GPS_Math_Utime_To_Gtime(i64 %0) {
%2 = add nsw i64 %0, -631065600
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ setgroups(int, int /*<<< orphan*/ *);
int main(void) {
  gid_t g = 0;
  setgroups(1, &g);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <setgroups@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @setgroups(i32 1, i32* %1)
ret i32 0
}
void tlmu_delete(struct tlmu *t) {}


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

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

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

LLVM IR (-O2):
%struct.tlmu = type opaque
define void @tlmu_delete(%struct.tlmu* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void resume(int signo) { printf("Caught SIGPIPE!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Caught SIGPIPE!\0A\00"
define void @resume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Caught SIGPIPE!\00"
define void @resume(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i8086rep(int /*<<< orphan*/);
void i8086_repne() { i8086rep(0); }


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

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

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

LLVM IR (-O2):
define void @i8086_repne() {
%1 = tail call i32 @i8086rep(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
const char *_indentation(int in_amount) {
  const char *whitespace = "                                                   "
                           "                                  ";
  static char buffer[100];
  strcpy(buffer, whitespace);
  buffer[in_amount * 4] = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<_indentation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2f0f(%rip),%rdi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
movslq %eax,%rcx
lea    0x2efa(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2eef(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_indentation>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f23(%rip),%r14
lea    0xedc(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,4)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [86 x i8] c" \00"
@_indentation.buffer = internal global [100 x i8] zeroinitializer
define i8* @_indentation(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 %8
store i8 0, i8* %9
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [86 x i8] c" \00"
@_indentation.buffer = internal global [100 x i8] zeroinitializer
define i8* @_indentation(i32 %0) {
%2 = tail call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 0), i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = shl nsw i32 %0, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 %4
store i8 0, i8* %5
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_indentation.buffer, i64 0, i64 0)
}
char getAuthor() {
  char author[50];
  printf("What is the author's name (ex: Lastname, Firstname)?\n");
  scanf("%s", author);
  return author;
}


x86 assembly (clang, -O0):
<getAuthor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x40(%rbp),%rax
movsbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAuthor>:
push   %rbx
sub    $0x40,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %ebx,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"What is the author's name (ex: Lastname, Firstname)?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @getAuthor() {
%1 = alloca [50 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = ptrtoint i8* %5 to i8
ret i8 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [53 x i8] c"What is the author's name (ex: Lastname, Firstname)?\00"
define signext i8 @getAuthor() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = ptrtoint [50 x i8]* %1 to i64
%6 = trunc i64 %5 to i8
ret i8 %6
}
int math_isnan(float n) { return (n != n); }


x86 assembly (clang, -O0):
<math_isnan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_isnan>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @math_isnan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp une float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @math_isnan(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int fun_call_base_2(int x, int y) {
  printf("x = %d, y = %d\n", x, y);
  return x + y + 5;
}


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

x86 assembly (clang, -O2):
<fun_call_base_2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
lea    (%rbx,%r14,1),%eax
add    $0x5,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @fun_call_base_2(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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 5
ret i32 %11
}

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @fun_call_base_2(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add i32 %0, 5
%5 = add i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int write(int, char const *, unsigned int);
int buffer_unixwrite(int fd, const char *buf, unsigned int len) {
  return write(fd, buf, len);
}


x86 assembly (clang, -O0):
<buffer_unixwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_unixwrite>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @buffer_unixwrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @buffer_unixwrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ factorial(int);
float estimateE(int n) {
  float estimate = 2.0;
  while (n > 1) {
    estimate += (1.0 / (float)(factorial(n)));
    n--;
  }
  return estimate;
}


x86 assembly (clang, -O0):
<estimateE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1173 <estimateE+0x63>
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <estimateE+0x18>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimateE>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     1173 <estimateE+0x63>
mov    %edi,%ebx
movss  0xedc(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm0,0xc(%rsp)
mov    %ebx,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    -0x1(%rbx),%eax
cmp    $0x2,%ebx
mov    %eax,%ebx
ja     1130 <estimateE+0x20>
jmp    117b <estimateE+0x6b>
movss  0xe85(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @estimateE(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 2.000000e+00, float* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @factorial(i32 %8)
%10 = sitofp i64 %9 to float
%11 = fpext float %10 to double
%12 = fdiv double 1.000000e+00, %11
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fadd double %14, %12
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %17, -1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @estimateE(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %15
3: ; preds = %1, %3
%4 = phi float [ %12, %3 ], [ 2.000000e+00, %1 ]
%5 = phi i32 [ %13, %3 ], [ %0, %1 ]
%6 = tail call i64 @factorial(i32 %5)
%7 = sitofp i64 %6 to float
%8 = fpext float %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = fpext float %4 to double
%11 = fadd double %9, %10
%12 = fptrunc double %11 to float
%13 = add nsw i32 %5, -1
%14 = icmp ugt i32 %5, 2
br i1 %14, label %3, label %15
15: ; preds = %3, %1
%16 = phi float [ 2.000000e+00, %1 ], [ %12, %3 ]
ret float %16
}
void foo521(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo521(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int close(short);
int /*<<< orphan*/ shutdown(short, int /*<<< orphan*/);
int socketClose(short socket) {
  shutdown(socket, SHUT_RDWR);
  return close(socket);
}


x86 assembly (clang, -O0):
<socketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%esi
movswl %ax,%edi
call   1030 <shutdown@plt>
movswl -0x2(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketClose>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define i32 @socketClose(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = load i32, i32* @SHUT_RDWR
%5 = call i32 @shutdown(i16 signext %3, i32 %4)
%6 = load i16, i16* %2
%7 = call i32 @close(i16 signext %6)
ret i32 %7
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define i32 @socketClose(i16 signext %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @shutdown(i16 signext %0, i32 %2)
%4 = tail call i32 @close(i16 signext %0)
ret i32 %4
}
void s3c_rtc_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_rtc_setname(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_2_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_uint16_be(const uint8_t *src, uint32_t offs,
                                      uint16_t *dst) {
  uint16_t tmp = ivory_serialize_unpack_prim_2_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_uint16_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_2_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_uint16_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_2_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ivory_serialize_unpack_uint16_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_2_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ intcmp(char *, char *);
int binary_gt(char *s1, char *s2) { return intcmp(s1, s2) > 0; }


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

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

LLVM IR (-O0):
define i32 @binary_gt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @intcmp(i8* %5, i8* %6)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @binary_gt(i8* %0, i8* %1) {
%3 = tail call i64 @intcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void activity_tour_configuration_stop() {}


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

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

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

LLVM IR (-O2):
define void @activity_tour_configuration_stop() {
ret void
}
long double roundl(long double x) {
  long double res;
  __asm__ __volatile__("frndint" : "=t"(res) : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<roundl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
frndint
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundl>:
fldt   0x8(%rsp)
frndint
ret

LLVM IR (-O0):
define x86_fp80 @roundl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @roundl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
void op_undef(void *_a, void *_b) {}


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

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

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

LLVM IR (-O2):
define void @op_undef(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_08int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08int64_highword_mem>:
testb  $0x8,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_08int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 34359738368
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int puts(char *);
int main(void) { return puts("hi"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int test_imm_22uint8_reg(unsigned char val) {
  return ((val) & (0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 34
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tapRename(char *ipath, char *oname, char *nname) {
  printf("Not developed yet\n");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Not developed yet\0A\00"
define void @tapRename(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Not developed yet\00"
define void @tapRename(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int pathcon_nm5_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathcon_nm5_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathcon_nm5_n_in() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] v w\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<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>
mov    0x2ea4(%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):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedf(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [options] v w\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [options] v w\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b_output(char *);
int main(void) {
  b_output("Hello world, from C!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello world, from C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @b_output(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello world, from C!\0A\00"
define i32 @main() {
%1 = tail call i32 @b_output(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void set_bit(int nr, volatile unsigned long *addr) {
  asm volatile("btsl %1,%0"
               : "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
bts    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @set_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btsl $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_and_sint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("%s = %s & %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_and_sint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s & %s;\00"
define void @__func_and_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s & %s;\00"
define void @__func_and_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void libpt_print_banner(void) {
  printf("libpt (c) 2016-2018 Ilya Kaliman\n");
  printf("Fast Coupled Cluster Triples Corrections\n");
  printf("https://github.com/ilyak/libpt\n");
}


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

x86 assembly (clang, -O2):
<libpt_print_banner>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"libpt (c) 2016-2018 Ilya Kaliman\0A\00"
@.str.1 = [42 x i8] c"Fast Coupled Cluster Triples Corrections\0A\00"
@.str.2 = [32 x i8] c"https://github.com/ilyak/libpt\0A\00"
define void @libpt_print_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"libpt (c) 2016-2018 Ilya Kaliman\00"
@str.3 = [41 x i8] c"Fast Coupled Cluster Triples Corrections\00"
@str.4 = [31 x i8] c"https://github.com/ilyak/libpt\00"
define void @libpt_print_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
ret void
}
int test_imm_B4uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xb4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4uint64_highword_reg>:
movabs $0xb400000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B4uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 773094113280
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gadd(uint8_t a, uint8_t b) { return a ^ b; }


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

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

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

LLVM IR (-O2):
define i32 @gadd(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int sf_close(int fd) {
  int res = 0;
  do {
    res = close(fd);
  } while (res < 0 && errno == EINTR);
  return res;
}


x86 assembly (clang, -O0):
<sf_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1156 <sf_close+0x46>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1122 <sf_close+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
test   %eax,%eax
jns    1143 <sf_close+0x33>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <sf_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @sf_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i64, i64* @errno
%12 = load i64, i64* @EINTR
%13 = icmp eq i64 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @sf_close(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp slt i32 %3, 0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
long min_size_long() {
  long d, d_p, step;
  step = d = d_p = 0;
  d = (-1);
  while (d < 0) {
    d_p = d;
    d = d * 10;
  }
  d = d_p;
  step = d;
  while (step < (-1)) {
    step = step / 10;
    while (d < 0) {
      d_p = d;
      d = d + step;
    }
    d = d_p;
  }
  return d;
}


x86 assembly (clang, -O0):
<min_size_long>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
cmpq   $0x0,-0x8(%rbp)
jge    1145 <min_size_long+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0xa,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <min_size_long+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jge    11a3 <min_size_long+0xa3>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1196 <min_size_long+0x96>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <min_size_long+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <min_size_long+0x55>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_size_long>:
movabs $0x7538dcfb76180000,%rax
dc 38 75
ret

LLVM IR (-O0):
define i64 @min_size_long() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 0, i64* %2
store i64 0, i64* %1
store i64 0, i64* %3
store i64 -1, i64* %1
br label %4
4: ; preds = %7, %0
%5 = load i64, i64* %1
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* %1
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = mul nsw i64 %9, 10
store i64 %10, i64* %1
br label %4
11: ; preds = %4
%12 = load i64, i64* %2
store i64 %12, i64* %1
%13 = load i64, i64* %1
store i64 %13, i64* %3
br label %14
14: ; preds = %28, %11
%15 = load i64, i64* %3
%16 = icmp slt i64 %15, -1
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i64, i64* %3
%19 = sdiv i64 %18, 10
store i64 %19, i64* %3
br label %20
20: ; preds = %23, %17
%21 = load i64, i64* %1
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i64, i64* %1
store i64 %24, i64* %2
%25 = load i64, i64* %1
%26 = load i64, i64* %3
%27 = add nsw i64 %25, %26
store i64 %27, i64* %1
br label %20
28: ; preds = %20
%29 = load i64, i64* %2
store i64 %29, i64* %1
br label %14
30: ; preds = %14
%31 = load i64, i64* %1
ret i64 %31
}

LLVM IR (-O2):
define i64 @min_size_long() {
ret i64 8446744073709551616
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
unsigned int hawkc_number_of_digits(time_t t) {
  unsigned int count = 0;
  while (t != 0) {
    t /= 10;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<hawkc_number_of_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <hawkc_number_of_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <hawkc_number_of_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hawkc_number_of_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <hawkc_number_of_digits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <hawkc_number_of_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @hawkc_number_of_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}