xunge/DecIR huggingface dataset:
unsigned long SwapEndianL(unsigned long l) {
  char *ch = (char *)&l, tmp;
  {
    tmp = ch[1];
    ch[1] = ch[2];
    ch[2] = tmp;
  };
  {
    tmp = ch[0];
    ch[0] = ch[3];
    ch[3] = tmp;
  };
  return l;
}


x86 assembly (clang, -O0):
<SwapEndianL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapEndianL>:
mov    %edi,%ecx
shr    $0x18,%ecx
movabs $0xffffffff00000000,%rax
ff ff ff
and    %rdi,%rax
mov    %edi,%edx
shl    $0x18,%edx
or     %rax,%rdx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %rdx,%rax
shr    $0x8,%rdi
and    $0xff00,%edi
or     %rdi,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @SwapEndianL(i64 %0) {
%2 = lshr i64 %0, 24
%3 = and i64 %0, -4294967296
%4 = shl i64 %0, 24
%5 = and i64 %4, 4278190080
%6 = or i64 %5, %3
%7 = shl i64 %0, 8
%8 = and i64 %7, 16711680
%9 = or i64 %6, %8
%10 = lshr i64 %0, 8
%11 = and i64 %10, 65280
%12 = or i64 %9, %11
%13 = and i64 %2, 255
%14 = or i64 %12, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void greet(char *who) { printf("hello, %s\n", who); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"hello, %s\0A\00"
define void @greet(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct MIDIClock {
  int dummy;
};

/* Variables and functions */
struct MIDIClock *_get_global_clock();
int MIDIClockGetGlobalClock(struct MIDIClock **clock) {
  *clock = _get_global_clock();
  return 0;
}


x86 assembly (clang, -O0):
<MIDIClockGetGlobalClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_get_global_clock@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDIClockGetGlobalClock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_get_global_clock@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.MIDIClock = type { i32 }
define i32 @MIDIClockGetGlobalClock(%struct.MIDIClock** %0) {
%2 = alloca %struct.MIDIClock**
store %struct.MIDIClock** %0, %struct.MIDIClock*** %2
%3 = call %struct.MIDIClock* (...) @_get_global_clock()
%4 = load %struct.MIDIClock**, %struct.MIDIClock*** %2
store %struct.MIDIClock* %3, %struct.MIDIClock** %4
ret i32 0
}

LLVM IR (-O2):
%struct.MIDIClock = type { i32 }
define i32 @MIDIClockGetGlobalClock(%struct.MIDIClock** nocapture writeonly %0) {
%2 = tail call %struct.MIDIClock* (...) @_get_global_clock()
store %struct.MIDIClock* %2, %struct.MIDIClock** %0
ret i32 0
}
void gtk_calendar_select_day() {}


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

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

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

LLVM IR (-O2):
define void @gtk_calendar_select_day() {
ret void
}
int fib(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
main() {
  int myprintf(char *, ...);
  myprintf("%d %s %d %f", 2, "hello", 5, 7.2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
mov    $0x2,%esi
lea    0xeed(%rip),%rdx
mov    $0x5,%ecx
movsd  0xecc(%rip),%xmm0
mov    $0x1,%al
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xef5(%rip),%rdx
movsd  0xed9(%rip),%xmm0
mov    $0x2,%esi
mov    $0x5,%ecx
mov    $0x1,%al
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %s %d %f\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5, double 7.200000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %s %d %f\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5, double 7.200000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ArrayExpressionTooLong(long p_position) {
  _Error(p_position, "Array expressions can have at most 127 keys");
}


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

x86 assembly (clang, -O2):
<Error_ArrayExpressionTooLong>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Array expressions can have at most 127 keys\00"
define void @Error_ArrayExpressionTooLong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Array expressions can have at most 127 keys\00"
define void @Error_ArrayExpressionTooLong(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, int);
void sprint_mov_data_to_Rn(char *str, unsigned char n, uint8_t data) {
  sprintf(str,
          "MOV   R%X, #"
          "0x%02X"
          "                 ",
          n, data);
}


x86 assembly (clang, -O0):
<sprint_mov_data_to_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xeca(%rip),%rsi
movzbl %al,%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_mov_data_to_Rn>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV R%X,x%02X \00"
define void @sprint_mov_data_to_Rn(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV R%X,x%02X \00"
define void @sprint_mov_data_to_Rn(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i32 %2)
ret void
}
/* Variables and functions */
bool odd(int n) { return n & 1; }


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

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

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

LLVM IR (-O2):
define i32 @odd(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Escribe un número\n");
  scanf("%d", &x);
  printf("Tu número es %d, pero yo te voy a decir Hello World porque soy "
         "tontito :3\n",
         x);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Escribe un n\C3\BAmero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [76 x i8] c"Tu n\C3\BAmero es %d, pero yo te voy a decir Hello World porque soy tontito :3\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [76 x i8] c"Tu n\C3\BAmero es %d, pero yo te voy a decir Hello World porque soy tontito :3\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [19 x i8] c"Escribe un n\C3\BAmero\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Type definitions */
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
typedef int canid_t;

/* Variables and functions */
int can_send_frame(int, struct can_frame *);
int can_send_reset(int fd, canid_t addr) {
  struct can_frame msg;
  msg.can_id = addr | 1 << 31;
  msg.can_dlc = 8;
  msg.data[0] = 0x06;
  return can_send_frame(fd, &msg);
}


x86 assembly (clang, -O0):
<can_send_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x18(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <can_send_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.can_frame = type { i32, i32, i32* }
define i32 @can_send_reset(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.can_frame
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = or i32 %6, -2147483648
%8 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 1
store i32 8, i32* %9
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 2
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 6, i32* %12
%13 = load i32, i32* %3
%14 = call i32 @can_send_frame(i32 %13, %struct.can_frame* %5)
ret i32 %14
}

LLVM IR (-O2):
void batadv_nc_mesh_free(struct batadv_priv *bat_priv) {}


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_nc_mesh_free(%struct.batadv_priv* nocapture %0) {
ret void
}
adrx0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <adrx0adr1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <adrx0adr1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edi,%rcx
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load double, double* inttoptr (i64 11111111 to double*)
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adrx0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = load double, double* inttoptr (i64 11111111 to double*)
%11 = fcmp ole double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int ntohl(int);
int get_integer(char **msg) {
  int x;
  memcpy(&x, *msg, 4);
  (*msg) += 4;
  return ntohl(x);
}


x86 assembly (clang, -O0):
<get_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_integer>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
addq   $0x4,(%rbx)
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_integer(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 @memcpy(i32* %3, i8* %5, i32 4)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 4
store i8* %9, i8** %7
%10 = load i32, i32* %3
%11 = call i32 @ntohl(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_integer(i8** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8*, i8** %0
%5 = call i32 @memcpy(i32* %2, i8* %4, i32 4)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8* %7, i8** %0
%8 = load i32, i32* %2
%9 = call i32 @ntohl(i32 %8)
ret i32 %9
}
/* Variables and functions */
int form_getv(char const *, char *, unsigned int *);
int form_getu(const char *name, unsigned int *var) {
  return form_getv(name, "%u", var);
}


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

x86 assembly (clang, -O2):
<form_getu>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <form_getv@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @form_getu(i8* %0, i32* %1) {
%3 = tail call i32 @form_getv(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  int t = 10;
  printf("You may think it's cold at %d...", +t);
  printf("\nBut it's way more cold at %d!", -t);
  puts("\n\tBrrrr..");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"You may think it's cold at %d...\00"
@.str.1 = [31 x i8] c"\0ABut it's way more cold at %d!\00"
@.str.2 = [10 x i8] c"\0A\09Brrrr..\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 0, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"You may think it's cold at %d...\00"
@.str.1 = [31 x i8] c"\0ABut it's way more cold at %d!\00"
@.str.2 = [10 x i8] c"\0A\09Brrrr..\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 -10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _log_closefile();
void log_close() { _log_closefile(); }


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

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

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

LLVM IR (-O2):
define void @log_close() {
%1 = tail call i32 (...) @_log_closefile()
ret void
}
int sys$schdwk(unsigned int *pidadr, void *prcnam, signed long long *daytim,
               signed long long *reptim) {
  return ({
    unsigned long resultvar;
    register long int _a4 asm("r10") = (long)(reptim);
    register long int _a3 asm("rdx") = (long)(daytim);
    register long int _a2 asm("rsi") = (long)(prcnam);
    register long int _a1 asm("rdi") = (long)(pidadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(17), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$schdwk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r10
mov    $0x11,%rax
int    $0x81
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$schdwk>:
mov    %rcx,%r10
mov    $0x11,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$schdwk"(i32* %0, i8* %1, i64* %2, i64* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%15 = load i64*, i64** %8
%16 = ptrtoint i64* %15 to i64
store i64 %16, i64* %10
%17 = load i64*, i64** %7
%18 = ptrtoint i64* %17 to i64
store i64 %18, i64* %11
%19 = load i8*, i8** %6
%20 = ptrtoint i8* %19 to i64
store i64 %20, i64* %12
%21 = load i32*, i32** %5
%22 = ptrtoint i32* %21 to i64
store i64 %22, i64* %13
%23 = load i64, i64* %13
%24 = load i64, i64* %12
%25 = load i64, i64* %11
%26 = load i64, i64* %10
%27 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 17, i64 %23, i64 %24, i64 %25, i64 %26)
store i64 %27, i64* %9
%28 = load i64, i64* %9
store i64 %28, i64* %14
%29 = load i64, i64* %14
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @"sys$schdwk"(i32* %0, i8* %1, i64* %2, i64* %3) {
%5 = ptrtoint i64* %3 to i64
%6 = ptrtoint i64* %2 to i64
%7 = ptrtoint i8* %1 to i64
%8 = ptrtoint i32* %0 to i64
%9 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 17, i64 %8, i64 %7, i64 %6, i64 %5)
%10 = trunc i64 %9 to i32
ret i32 %10
}
float get_percentage(float start, float end, float mid) {
  return (mid - start) / (end - start);
}


x86 assembly (clang, -O0):
<get_percentage>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_percentage>:
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @get_percentage(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fdiv float %9, %12
ret float %13
}

LLVM IR (-O2):
define float @get_percentage(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
ret float %6
}
/* Variables and functions */
char *strerror(int errnum) {
  (void)errnum;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @strerror(i32 %0) {
ret i8* null
}
/* Variables and functions */
scalar_t__ strlen(char *);
int str_is_empty(char *s) { return !s || *s == '\0' || strlen(s) == 0; }


x86 assembly (clang, -O0):
<str_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <str_is_empty+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1154 <str_is_empty+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_empty>:
test   %rdi,%rdi
je     110e <str_is_empty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @str_is_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
char *test_read_2_element() { return 0; }


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

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

LLVM IR (-O0):
define i8* @test_read_2_element() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test_read_2_element() {
ret i8* null
}
void orgfx_wait(unsigned int reg_spaces) {
  while (*((volatile unsigned int *)((0xB8000000 + 0x04))) & (1 << 0))
    ;
}


x86 assembly (clang, -O0):
<orgfx_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xb8000004,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     111f <orgfx_wait+0x1f>
jmp    1107 <orgfx_wait+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_wait>:
mov    $0xb8000004,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rax),%ecx
test   $0x1,%cl
jne    1110 <orgfx_wait+0x10>
ret

LLVM IR (-O0):
define void @orgfx_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 3087007748 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @orgfx_wait(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3087007748 to i32*)
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
getpagesize() { return 4096; }


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

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

LLVM IR (-O0):
define i32 @getpagesize() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @getpagesize() {
ret i32 4096
}
void Destroy_WorkStealQueue() {}


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

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

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

LLVM IR (-O2):
define void @Destroy_WorkStealQueue() {
ret void
}
void rop3_135_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_135_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_135_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
and    %sil,%cl
xor    %dl,%cl
not    %cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_135_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, %2
%7 = xor i8 %6, -1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %9, %7
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_usr2(int sig) {
  printf("SIGUSR2 started.\n");
  printf("SIGUSR2 ended.\n");
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"SIGUSR2 started.\00"
@str.2 = [15 x i8] c"SIGUSR2 ended.\00"
define void @sig_usr2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int kill(int pid, int sig) {
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ param;

/* Variables and functions */
int fill_normal_config_req(unsigned char *, int, int, int, unsigned char *);
int fill_diode_control_cmd(unsigned char *buf, int turn_on) {
  unsigned char param[0x2] = {0x0, turn_on ? 0x1 : 0x0};
  return fill_normal_config_req(buf, 0x30, 0x1, sizeof(param), param);
}


x86 assembly (clang, -O0):
<fill_diode_control_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xe(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xe(%rbp),%r8
mov    $0x30,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_diode_control_cmd>:
push   %rax
movb   $0x0,0x6(%rsp)
test   %esi,%esi
setne  0x7(%rsp)
lea    0x6(%rsp),%r8
mov    $0x30,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fill_diode_control_cmd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [2 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call i32 @fill_normal_config_req(i8* %13, i32 48, i32 1, i32 2, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @fill_diode_control_cmd(i8* %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%6 = icmp ne i32 %1, 0
%7 = zext i1 %6 to i8
store i8 %7, i8* %5
%8 = call i32 @fill_normal_config_req(i8* %0, i32 48, i32 1, i32 2, i8* %4)
ret i32 %8
}
void RTReqQueueCallV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqQueueCallV() {
ret void
}
void uint16_to_buff(unsigned long val, unsigned char *buff, unsigned int *off) {
  buff[*off + 0] = (val >> 8) & 0xff;
  buff[*off + 1] = val & 0xff;
  *off += 2;
}


x86 assembly (clang, -O0):
<uint16_to_buff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x0,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_to_buff>:
mov    %rdi,%rax
mov    (%rdx),%ecx
mov    %ah,(%rsi,%rcx,1)
mov    (%rdx),%ecx
add    $0x1,%ecx
mov    %al,(%rsi,%rcx,1)
addl   $0x2,(%rdx)
ret

LLVM IR (-O0):
define void @uint16_to_buff(i64 %0, i8* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i64, i64* %4
%8 = lshr i64 %7, 8
%9 = and i64 %8, 255
%10 = trunc i64 %9 to i8
%11 = load i8*, i8** %5
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = add i32 %13, 0
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 %10, i8* %16
%17 = load i64, i64* %4
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %5
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = add i32 %22, 1
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %20, i64 %24
store i8 %19, i8* %25
%26 = load i32*, i32** %6
%27 = load i32, i32* %26
%28 = add i32 %27, 2
store i32 %28, i32* %26
ret void
}

LLVM IR (-O2):
define void @uint16_to_buff(i64 %0, i8* nocapture writeonly %1, i32* nocapture %2) {
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 %5, i8* %8
%9 = trunc i64 %0 to i8
%10 = load i32, i32* %2
%11 = add i32 %10, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
store i8 %9, i8* %13
%14 = load i32, i32* %2
%15 = add i32 %14, 2
store i32 %15, i32* %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
void set_XFocusChangeEvent_send_event(void *_p, int _v) {
  ((XFocusChangeEvent *)_p)->send_event = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XFocusChangeEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int levenshtein(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
int main(int argc, const char *argv[]) {
  ;
  int distance = levenshtein(argv[1], argv[2]);
  printf("edit-distance <%s,%s> = %d\n", argv[1], argv[2], distance);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <levenshtein@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <levenshtein@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdx
lea    0xec0(%rip),%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"edit-distance <%s,%s> = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @levenshtein(i8* %9, i8* %12)
store i32 %13, i32* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %19, i32 %20)
%22 = load i32, i32* @EXIT_SUCCESS
ret i32 %22
}

LLVM IR (-O2):
@.str = [28 x i8] c"edit-distance <%s,%s> = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @levenshtein(i8* %4, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %7)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_input(char ***, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void prompt(char ***s) {
  printf("Enter your input: ");
  fflush(stdout);
  read_input(s, 256, stdin);
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1050 <read_input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
pop    %rbx
jmp    1050 <read_input@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Enter your input: \00"
@stdout = global i32 0
@stdin = global i32 0
define void @prompt(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i8***, i8**** %2
%7 = load i32, i32* @stdin
%8 = call i32 @read_input(i8*** %6, i32 256, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter your input: \00"
@stdout = global i32 0
@stdin = global i32 0
define void @prompt(i8*** %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @read_input(i8*** %0, i32 256, i32 %5)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIOADCTriggerDisable(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000530))) &= (~ui8Pins);
}


x86 assembly (clang, -O0):
<GPIOADCTriggerDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x530(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x530(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOADCTriggerDisable>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x530(%rdi)
ret

LLVM IR (-O0):
define void @GPIOADCTriggerDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 1328
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOADCTriggerDisable(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = xor i64 %4, -1
%6 = add nsw i64 %0, 1328
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}