xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void draw_back(int frame, char *image) {
  (void)frame;
  memset(image, 'B', 8 * 80);
}


x86 assembly (clang, -O0):
<draw_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x42,%esi
mov    $0x280,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_back>:
mov    %rsi,%rdi
mov    $0x42,%esi
mov    $0x280,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @draw_back(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @memset(i8* %6, i8 signext 66, i32 640)
ret void
}

LLVM IR (-O2):
define void @draw_back(i32 %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i8 signext 66, i32 640)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS]\n"
          "\n"
          "sigwaitinfo(1) is a good template to begin with a new CLI\n"
          "in C, based on a basic skeleton using sigwaitinfo(3p) as\n"
          "main loop.\n"
          "\n"
          "Options:\n"
          " -h or --help          Display this message.\n"
          " -V or --version       Display the version.\n"
          "\n"
          "Signals:\n"
          "SIGTERM                Terminate.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [291 x i8] c"Usage: %s [OPTIONS]\0A\0Asigwaitinfo(1) is a good template to begin with a new CLI\0Ain C, based on a basic skeleton using sigwaitinfo(3p) as\0Amain loop.\0A\0AOptions:\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\0ASignals:\0ASIGTERM Terminate.\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [291 x i8] c"Usage: %s [OPTIONS]\0A\0Asigwaitinfo(1) is a good template to begin with a new CLI\0Ain C, based on a basic skeleton using sigwaitinfo(3p) as\0Amain loop.\0A\0AOptions:\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\0ASignals:\0ASIGTERM Terminate.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msgeln(char *msg) { printf("%s\n", msg); }


x86 assembly (clang, -O0):
<msgeln>:
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):
<msgeln>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @msgeln(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usb_notify_bulk_in();
int /*<<< orphan*/ usb_notify_bulk_out();
int /*<<< orphan*/ usb_notify_ep0();
void usb_shutdown(void) {
  usb_notify_bulk_in();
  usb_notify_bulk_out();
  usb_notify_ep0();
}


x86 assembly (clang, -O0):
<usb_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usb_notify_bulk_in@plt>
mov    $0x0,%al
call   1050 <usb_notify_bulk_out@plt>
mov    $0x0,%al
call   1040 <usb_notify_ep0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_shutdown>:
push   %rax
xor    %eax,%eax
call   1030 <usb_notify_bulk_in@plt>
xor    %eax,%eax
call   1050 <usb_notify_bulk_out@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <usb_notify_ep0@plt>

LLVM IR (-O0):
define void @usb_shutdown() {
%1 = call i32 (...) @usb_notify_bulk_in()
%2 = call i32 (...) @usb_notify_bulk_out()
%3 = call i32 (...) @usb_notify_ep0()
ret void
}

LLVM IR (-O2):
define void @usb_shutdown() {
%1 = tail call i32 (...) @usb_notify_bulk_in()
%2 = tail call i32 (...) @usb_notify_bulk_out()
%3 = tail call i32 (...) @usb_notify_ep0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_SUI();
void do0xD6() { _I8080_SUI(); }


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

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

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

LLVM IR (-O2):
define void @do0xD6() {
%1 = tail call i32 (...) @_I8080_SUI()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2SWclkConfigure(uint32_t ui32Base, bool boolMaster, bool boolWCLKInvert) {
  ;
  ;
  uint8_t ui8ClkSource = (uint8_t)boolMaster + 0x01;
  (*((volatile unsigned char *)(0x40021000 + 0x00000000))) =
      ((ui8ClkSource << 0) | (boolWCLKInvert << 2));
}


x86 assembly (clang, -O0):
<I2SWclkConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x0,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    $0x40021000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SWclkConfigure>:
add    $0x1,%esi
shl    $0x2,%edx
or     %esi,%edx
mov    %dl,0x40021000
ret

LLVM IR (-O0):
define void @I2SWclkConfigure(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* %5
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = shl i32 %10, 0
%12 = load i32, i32* %6
%13 = shl i32 %12, 2
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store volatile i8 %15, i8* inttoptr (i64 1073876992 to i8*)
ret void
}

LLVM IR (-O2):
define void @I2SWclkConfigure(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = shl i32 %2, 2
%6 = or i32 %5, %4
%7 = trunc i32 %6 to i8
store volatile i8 %7, i8* inttoptr (i64 1073876992 to i8*)
ret void
}
/* Type definitions */
typedef unsigned int wint_t;

/* Variables and functions */
int EOF;
int wctob(wint_t c) {
  if (c < 128U)
    return c;
  return EOF;
}


x86 assembly (clang, -O0):
<wctob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jae    111f <wctob+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <wctob+0x2b>
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctob>:
mov    %edi,%eax
cmp    $0x80,%edi
jb     1113 <wctob+0x13>
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @wctob(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 128
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* @EOF
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @wctob(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = load i32, i32* @EOF
%4 = select i1 %2, i32 %0, i32 %3
ret i32 %4
}
int long_cmp(void *v1, void *v2) {
  long a = *((long *)v1), b = *((long *)v2);
  if (a == b) {
    return 0;
  }
  return a > b ? 1 : -1;
}


x86 assembly (clang, -O0):
<long_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <long_cmp+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <long_cmp+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @long_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp sgt i64 %19, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 -1
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @long_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
OP(ed, f0) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int fun1275() { return 1275; }


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

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

LLVM IR (-O0):
define i32 @fun1275() {
ret i32 1275
}

LLVM IR (-O2):
define i32 @fun1275() {
ret i32 1275
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int compare(const void *a, const void *b) {
  return (*(uint32_t *)a - *(uint32_t *)b);
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void MotifGlobalInitialize() {}


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

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

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

LLVM IR (-O2):
define void @MotifGlobalInitialize() {
ret void
}
void exchange_report_ocall() {}


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

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

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

LLVM IR (-O2):
define void @exchange_report_ocall() {
ret void
}
/* Variables and functions */
long long round(double);
void round_l_d(double *source, long long *dest) { *dest = round(*source); }


x86 assembly (clang, -O0):
<round_l_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <round@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_l_d>:
push   %rbx
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
call   1030 <round@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @round_l_d(double* %0, i64* %1) {
%3 = alloca double*
%4 = alloca i64*
store double* %0, double** %3
store i64* %1, i64** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call i64 @round(double %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @round_l_d(double* nocapture %0, i64* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @round(double %3)
store i64 %4, i64* %1
ret void
}
int test_imm_9Cuint8_reg(unsigned char val) {
  return ((val) & (-0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cuint8_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, -156
%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_9Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 100
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo035() {}


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

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

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

LLVM IR (-O2):
define void @foo035() {
ret void
}
/* Type definitions */
struct fd_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fd_state *);
void free_fd_state(struct fd_state *state) {
  if (state != NULL)
    free(state);
}


x86 assembly (clang, -O0):
<free_fd_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_fd_state+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_fd_state>:
test   %rdi,%rdi
je     111a <free_fd_state+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fd_state = type { i32 }
define void @free_fd_state(%struct.fd_state* %0) {
%2 = alloca %struct.fd_state*
store %struct.fd_state* %0, %struct.fd_state** %2
%3 = load %struct.fd_state*, %struct.fd_state** %2
%4 = icmp ne %struct.fd_state* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.fd_state*, %struct.fd_state** %2
%7 = call i32 @free(%struct.fd_state* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.fd_state = type { i32 }
define void @free_fd_state(%struct.fd_state* %0) {
%2 = icmp eq %struct.fd_state* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.fd_state* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char erasechar();
char wrap_erasechar(void) { return erasechar(); }


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

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

LLVM IR (-O0):
define signext i8 @wrap_erasechar() {
%1 = call signext i8 (...) @erasechar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @wrap_erasechar() {
%1 = tail call signext i8 (...) @erasechar()
ret i8 %1
}
void ff_hevc_put_hevc_bi_w_epel_h24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h24_12_sse4() {
ret void
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_timeout(struct state *, int, int /*<<< orphan*/, int);
int sleep_item(struct state *ss, int tag) {
  if (tag > 0) {
    set_timeout(ss, tag, 0, 0x1);
    return 0x0;
  }
  return 0x1;
}


x86 assembly (clang, -O0):
<sleep_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1148 <sleep_item+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <set_timeout@plt>
movl   $0x0,-0x4(%rbp)
jmp    114f <sleep_item+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_item>:
push   %rbx
test   %esi,%esi
jle    1125 <sleep_item+0x15>
xor    %ebx,%ebx
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <set_timeout@plt>
jmp    112a <sleep_item+0x1a>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.state = type { i32 }
define i32 @sleep_item(%struct.state* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.state*
%5 = alloca i32
store %struct.state* %0, %struct.state** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.state*, %struct.state** %4
%10 = load i32, i32* %5
%11 = call i32 @set_timeout(%struct.state* %9, i32 %10, i32 0, i32 1)
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.state = type { i32 }
define i32 @sleep_item(%struct.state* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @set_timeout(%struct.state* %0, i32 %1, i32 0, i32 1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ serial_close();
extern void gps_off(void) { serial_close(); }


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

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

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

LLVM IR (-O2):
define void @gps_off() {
%1 = tail call i32 (...) @serial_close()
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
char *print_fpureg(int reg, char *output) {
  int len;
  len = sprintf(output, "$fpr%02d", reg);
  return output + len;
}


x86 assembly (clang, -O0):
<print_fpureg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fpureg>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"$fpr%02d\00"
define i8* @print_fpureg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
ret i8* %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"$fpr%02d\00"
define i8* @print_fpureg(i32 %0, i8* writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, double, float);
void bar(int x) { foo(x, x ? 1.0 : 12.5, 1.0f); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
movsd  0xedc(%rip),%xmm0
movsd  0xedc(%rip),%xmm1
movsd  %xmm1,-0x18(%rbp)
cmp    $0x0,%eax
movsd  %xmm0,-0x10(%rbp)
jne    1151 <bar+0x41>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xee2(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movss  0xee5(%rip),%xmm1
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, double 1.000000e+00, double 1.250000e+01
%8 = call i32 @foo(i32 %3, double %7, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, double 1.250000e+01, double 1.000000e+00
%4 = tail call i32 @foo(i32 %0, double %3, float 1.000000e+00)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x_root;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
int get_XPointerMovedEvent_x_root(void *_p) {
  return (int)((XPointerMovedEvent *)_p)->x_root;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XPointerMovedEvent_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void vulnerable_function() {
  char buf[128];
  read(STDIN_FILENO, buf, 256);
}


x86 assembly (clang, -O0):
<vulnerable_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    -0x80(%rbp),%rsi
mov    $0x100,%edx
call   1030 <read@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vulnerable_function>:
sub    $0x88,%rsp
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x100,%edx
call   1030 <read@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @vulnerable_function() {
%1 = alloca [128 x i8]
%2 = load i32, i32* @STDIN_FILENO
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @read(i32 %2, i8* %3, i32 256)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @vulnerable_function() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %2, i32 256)
ret void
}
int test_imm_FBint64_lowword_reg(long long val) {
  return ((val) & (0xFB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FBint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 251
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void m_setrts(fd) int fd;
{}


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

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

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

LLVM IR (-O2):
define void @m_setrts(i32 %0) {
ret void
}
unsigned int extractl(int word, int pos, int num) {
  return (((unsigned int)word >> (pos + 1 - num)) & ~(~0 << num));
}


x86 assembly (clang, -O0):
<extractl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractl>:
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @extractl(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = lshr i32 %7, %11
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @extractl(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sub i32 %4, %2
%6 = lshr i32 %0, %5
%7 = shl nsw i32 -1, %2
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}
int get1c(fd)
int fd;
{
  char c;
  if (read(fd, &c, 1) == 1)
    return (c & 0377);
  return (-1);
}


x86 assembly (clang, -O0):
<get1c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1148 <get1c+0x38>
movsbl -0x9(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <get1c+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get1c>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get1c(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* %4, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = and i32 %10, 255
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @get1c(i32 %0) {
%2 = alloca i8
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
int __ocl_select_int_int(int a, int b, int c) { return c ? b : a; }


x86 assembly (clang, -O0):
<__ocl_select_int_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1122 <__ocl_select_int_int+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <__ocl_select_int_int+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_select_int_int>:
mov    %edi,%eax
test   %edx,%edx
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @__ocl_select_int_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 %0, i32 %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void tmotion(int x, int y) { printf("Tablet motion x = %d, y = %d\n", x, y); }


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

x86 assembly (clang, -O2):
<tmotion>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Tablet motion x = %d, y = %d\0A\00"
define void @tmotion(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 ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Tablet motion x = %d, y = %d\0A\00"
define void @tmotion(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c;
  for (c = 0; c <= 255; c++) {
    printf("\n  %d %c", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0A %d %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0A %d %c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int ff_get_fourcc(const char *s) {
  return (s[0]) + (s[1] << 8) + (s[2] << 16) + (s[3] << 24);
}


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

x86 assembly (clang, -O2):
<ff_get_fourcc>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ff_get_fourcc(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
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = add nsw i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ff_get_fourcc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = add nsw i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl nsw i32 %11, 16
%13 = add nsw i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = add nsw i32 %13, %17
ret i32 %18
}
_Bool test3(int e, int f) { return e ? 0 : f; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <test3+0x1e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <test3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
test   %edi,%edi
sete   %cl
test   %esi,%esi
setne  %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @test3(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 0, %7 ], [ %9, %8 ]
%12 = icmp ne i32 %11, 0
ret i1 %12
}

LLVM IR (-O2):
define zeroext i1 @test3(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
ret i1 %5
}
void d2i_ASN1_bytes(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_bytes() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return (isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <isxdigit+0x5d>
cmpl   $0x61,-0x4(%rbp)
jl     114e <isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <isxdigit+0x57>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 102
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 70
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ local_print_greetings();
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    local_print_greetings();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <local_print_greetings@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <local_print_greetings@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @local_print_greetings()
%4 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @local_print_greetings()
%3 = tail call i32 @sleep(i32 1)
br label %1
}
int isdecr(int num) {
  int prev;
  prev = 0;
  while (num) {
    if (prev > (num % 10))
      return 0;
    prev = num % 10;
    num /= 10;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isdecr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1161 <isdecr+0x61>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
cmp    %edx,%eax
jle    1140 <isdecr+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1168 <isdecr+0x68>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110e <isdecr+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdecr>:
mov    $0x1,%eax
test   %edi,%edi
je     1141 <isdecr+0x41>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r8d
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%ecx
cmp    %ecx,%r8d
jg     1142 <isdecr+0x42>
add    $0x9,%edi
cmp    $0x12,%edi
mov    %edx,%edi
ja     1110 <isdecr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isdecr(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %6, %9 ], [ 0, %1 ]
%5 = phi i32 [ %7, %9 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = icmp sgt i32 %4, %6
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %9, %1
%13 = phi i32 [ 1, %1 ], [ 1, %9 ], [ 0, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void handleTrap(pid_t pid) {}


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

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

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

LLVM IR (-O2):
define void @handleTrap(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t scale(uint8_t x, uint8_t scale_factor) {
  return ((uint16_t)x * (uint16_t)scale_factor) >> 8;
}


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

x86 assembly (clang, -O2):
<scale>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @scale(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 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 8
ret i32 %8
}

LLVM IR (-O2):
define i32 @scale(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 8
ret i32 %4
}
/* Variables and functions */
int floor(int);
int uniformrng();
int integerrng(int a, int b) { return a + floor(uniformrng() * (b - a + 1)); }


x86 assembly (clang, -O0):
<integerrng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <uniformrng@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
imul   %eax,%edi
call   1040 <floor@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integerrng>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <uniformrng@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <floor@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @integerrng(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 = call i32 (...) @uniformrng()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %6, %10
%12 = call i32 @floor(i32 %11)
%13 = add nsw i32 %5, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @integerrng(i32 %0, i32 %1) {
%3 = tail call i32 (...) @uniformrng()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = tail call i32 @floor(i32 %6)
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fibseq(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned n;
  printf("Enter a number:\n");
  scanf(" %u%*c", &n);
  fibseq(n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [7 x i8] c" %u%*c\00"
@str = [16 x i8] c"Enter a number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fibseq(i32 %5)
ret i32 0
}
int lib6() { return 42; }


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

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

LLVM IR (-O0):
define i32 @lib6() {
ret i32 42
}

LLVM IR (-O2):
define i32 @lib6() {
ret i32 42
}
void bk(int motor) {}


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

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

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

LLVM IR (-O2):
define void @bk(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_cpl(FILE *stream) {
  fprintf(stream, "CPL   A                         ");
}


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

x86 assembly (clang, -O2):
<fprint_cpl>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"CPL A \00"
define void @fprint_cpl(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}