xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ rs_alloc(size_t);
double *tintl_alloc_real(size_t size) {
  return (double *)rs_alloc(size * sizeof(double));
}


x86 assembly (clang, -O0):
<tintl_alloc_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <rs_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tintl_alloc_real>:
shl    $0x3,%rdi
jmp    1030 <rs_alloc@plt>

LLVM IR (-O0):
define double* @tintl_alloc_real(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 8
%5 = call i64 @rs_alloc(i64 %4)
%6 = inttoptr i64 %5 to double*
ret double* %6
}

LLVM IR (-O2):
define double* @tintl_alloc_real(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i64 @rs_alloc(i64 %2)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
unsigned char call8(unsigned char uc1, unsigned char uc2) { return uc1 + uc2; }


x86 assembly (clang, -O0):
<call8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call8>:
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define zeroext i8 @call8(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @call8(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %1, %0
ret i8 %3
}
/* Type definitions */
struct random {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct random *);
int /*<<< orphan*/ random_destroy(struct random *);
void random_delete(struct random *__restrict rand) {
  random_destroy(rand);
  free(rand);
}


x86 assembly (clang, -O0):
<random_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <random_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <random_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.random = type { i32 }
define void @random_delete(%struct.random* noalias %0) {
%2 = alloca %struct.random*
store %struct.random* %0, %struct.random** %2
%3 = load %struct.random*, %struct.random** %2
%4 = call i32 @random_destroy(%struct.random* %3)
%5 = load %struct.random*, %struct.random** %2
%6 = call i32 @free(%struct.random* %5)
ret void
}

LLVM IR (-O2):
%struct.random = type { i32 }
define void @random_delete(%struct.random* noalias %0) {
%2 = tail call i32 @random_destroy(%struct.random* %0)
%3 = tail call i32 @free(%struct.random* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put32_le(void *p, uint32_t x) {
  *((uint8_t *)p) = x & 0xff;
  *((uint8_t *)p + 1) = x >> 8 & 0xff;
  *((uint8_t *)p + 2) = x >> 16 & 0xff;
  *((uint8_t *)p + 3) = x >> 24 & 0xff;
}


x86 assembly (clang, -O0):
<put32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32_le>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @put32_le(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 = and i32 %5, 255
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %11, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = load i8*, i8** %3
%19 = bitcast i8* %18 to i32*
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %17, i32* %20
%21 = load i32, i32* %4
%22 = ashr i32 %21, 24
%23 = and i32 %22, 255
%24 = load i8*, i8** %3
%25 = bitcast i8* %24 to i32*
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %23, i32* %26
ret void
}

LLVM IR (-O2):
define void @put32_le(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %1, 16
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = lshr i32 %1, 24
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int LCDPort_In4();
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetRS();
int /*<<< orphan*/ LCDPort_SetRW();
int32_t readData_4BitIntf(void) {
  int32_t rs;
  LCDPort_SetRS();
  LCDPort_SetRW();
  LCDPort_SetCE();
  rs = (LCDPort_In4() & 0x0F) << 4;
  LCDPort_ClearCE();
  LCDPort_SetCE();
  rs |= (LCDPort_In4() & 0x0F);
  LCDPort_ClearCE();
  return rs;
}


x86 assembly (clang, -O0):
<readData_4BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <LCDPort_SetRS@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetRW@plt>
mov    $0x0,%al
call   1050 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1040 <LCDPort_In4@plt>
and    $0xf,%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    $0x0,%al
call   1050 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1040 <LCDPort_In4@plt>
and    $0xf,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readData_4BitIntf>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <LCDPort_SetRS@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetRW@plt>
xor    %eax,%eax
call   1050 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1040 <LCDPort_In4@plt>
shl    $0x4,%eax
movzbl %al,%ebp
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
xor    %eax,%eax
call   1050 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1040 <LCDPort_In4@plt>
mov    %eax,%ebx
and    $0xf,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readData_4BitIntf() {
%1 = alloca i32
%2 = call i32 (...) @LCDPort_SetRS()
%3 = call i32 (...) @LCDPort_SetRW()
%4 = call i32 (...) @LCDPort_SetCE()
%5 = call i32 (...) @LCDPort_In4()
%6 = and i32 %5, 15
%7 = shl i32 %6, 4
store i32 %7, i32* %1
%8 = call i32 (...) @LCDPort_ClearCE()
%9 = call i32 (...) @LCDPort_SetCE()
%10 = call i32 (...) @LCDPort_In4()
%11 = and i32 %10, 15
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = call i32 (...) @LCDPort_ClearCE()
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @readData_4BitIntf() {
%1 = tail call i32 (...) @LCDPort_SetRS()
%2 = tail call i32 (...) @LCDPort_SetRW()
%3 = tail call i32 (...) @LCDPort_SetCE()
%4 = tail call i32 (...) @LCDPort_In4()
%5 = shl i32 %4, 4
%6 = and i32 %5, 240
%7 = tail call i32 (...) @LCDPort_ClearCE()
%8 = tail call i32 (...) @LCDPort_SetCE()
%9 = tail call i32 (...) @LCDPort_In4()
%10 = and i32 %9, 15
%11 = or i32 %10, %6
%12 = tail call i32 (...) @LCDPort_ClearCE()
ret i32 %11
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void read_childproc(int sig) {
  pid_t pid;
  int status;
  pid = waitpid(-1, &status, WNOHANG);
  printf("removed proc id: %d \n", pid);
}


x86 assembly (clang, -O0):
<read_childproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_childproc>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [22 x i8] c"removed proc id: %d \0A\00"
define void @read_childproc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [22 x i8] c"removed proc id: %d \0A\00"
define void @read_childproc(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void security_inode_delete(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @security_inode_delete(%struct.inode* nocapture %0) {
ret void
}
/* Variables and functions */
long long lattice_path_mat(int, int);
int /*<<< orphan*/ printf(char *, long long);
int main() {
  long long int temp = lattice_path_mat(20, 20);
  printf("%lld\n", temp);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i64 @lattice_path_mat(i32 20, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int owTouchByte(int, int);
int owReadByte(int portnum) { return owTouchByte(portnum, 0xFF); }


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

x86 assembly (clang, -O2):
<owReadByte>:
mov    $0xff,%esi
jmp    1030 <owTouchByte@plt>

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

LLVM IR (-O2):
define i32 @owReadByte(i32 %0) {
%2 = tail call i32 @owTouchByte(i32 %0, i32 255)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xe5() {
  Assert_real((isodigit(229) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1150, ("isodigit should be 0 for 0xe5"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xe5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe5,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x47e,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x47e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe5\00"
define void @t_isodigit_0xe5() {
%1 = call i64 @isodigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe5\00"
define void @t_isodigit_0xe5() {
%1 = tail call i64 @isodigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ forever();
int main(void) {
  return 0;
  forever();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void rct_set_ssi2_pll(void) {}


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

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

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

LLVM IR (-O2):
define void @rct_set_ssi2_pll() {
ret void
}
int test_imm_7Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 127
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _mm_popcnt_u32(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int pop = _mm_popcnt_u32(0xf0f0f0f0ULL);
  printf("pop = %d\n", pop);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"pop = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @_mm_popcnt_u32(i32 -252645136)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int isDigit(unsigned char c) {
  if (c >= '0' && c <= '9')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isDigit+0x30>
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isDigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isDigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isDigit(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
signed long int atol(const char *__nptr) {
  signed long int return_value_strtol$1;
  return_value_strtol$1 = strtol(__nptr, ((char **)((void *)0)), 10);
  return return_value_strtol$1;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i8** null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_typename();
main() { test_typename(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_typename@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_typename()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_typename()
ret i32 0
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
void main() {
  int y = 4;
  print("y 4");
  y = y = abs(-y);
  printid(y);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <printid@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"y 4\00"
define void @main() {
%1 = alloca i32
store i32 4, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = sub nsw i32 0, %3
%5 = call i32 @abs(i32 %4)
store i32 %5, i32* %1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printid(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"y 4\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 4)
ret void
}
int daxpy(int N, double DA, double *DX, int INCX, double *DY, int INCY) {
  extern int daxpy_(int *N, double *DA, double *DX, int *INCX, double *DY,
                    int *INCY);
  return daxpy_(&N, &DA, DX, &INCX, DY, &INCY);
}


x86 assembly (clang, -O0):
<daxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
lea    -0x2c(%rbp),%r9
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daxpy>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <daxpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @daxpy(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load double*, double** %9
%14 = load double*, double** %11
%15 = call i32 @daxpy_(i32* %7, double* %8, double* %13, i32* %10, double* %14, i32* %12)
ret i32 %15
}

LLVM IR (-O2):
define i32 @daxpy(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @daxpy_(i32* %7, double* %8, double* %2, i32* %9, double* %4, i32* %10)
ret i32 %11
}
/* Variables and functions */
double fabs(double);
double linear_interpolate(double left, double right, double fvalue) {
  double ratio;
  if (fabs(left - right) < 0.00000001)
    ratio = 0.0;
  else
    ratio = ((fvalue - left) / (right - left));
  return ratio;
}


x86 assembly (clang, -O0):
<linear_interpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xeec(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <linear_interpolate+0x47>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1164 <linear_interpolate+0x64>
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_interpolate>:
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
andpd  0xef0(%rip),%xmm4
xorpd  %xmm3,%xmm3
movsd  0xef4(%rip),%xmm5
ucomisd %xmm4,%xmm5
ja     1132 <linear_interpolate+0x32>
subsd  %xmm0,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @linear_interpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = fcmp olt double %11, 1.000000e-08
br i1 %12, label %13, label %14
13: ; preds = %3
store double 0.000000e+00, double* %7
br label %22
14: ; preds = %3
%15 = load double, double* %6
%16 = load double, double* %4
%17 = fsub double %15, %16
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
store double %21, double* %7
br label %22
22: ; preds = %14, %13
%23 = load double, double* %7
ret double %23
}

LLVM IR (-O2):
define double @linear_interpolate(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, 1.000000e-08
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = fsub double %2, %0
%9 = fsub double %1, %0
%10 = fdiv double %8, %9
br label %11
11: ; preds = %3, %7
%12 = phi double [ %10, %7 ], [ 0.000000e+00, %3 ]
ret double %12
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void tsnorm(struct timespec *ts) {
  while (ts->tv_nsec >= 1000000000) {
    ts->tv_nsec -= 1000000000;
    ts->tv_sec++;
  }
}


x86 assembly (clang, -O0):
<tsnorm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x3b9aca00,(%rax)
jl     1138 <tsnorm+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x3b9aca00,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
jmp    1108 <tsnorm+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsnorm>:
mov    (%rdi),%eax
cmp    $0x3b9aca00,%eax
jl     1148 <tsnorm+0x48>
mov    0x4(%rdi),%ecx
cmp    $0x773593ff,%eax
mov    $0x773593ff,%edx
cmovl  %eax,%edx
neg    %edx
add    %eax,%edx
add    $0x3b9ac9ff,%edx
shr    $0x9,%edx
imul   $0x44b83,%rdx,%rdx
shr    $0x27,%rdx
imul   $0xc4653600,%edx,%esi
add    %esi,%eax
add    $0xc4653600,%eax
add    %edx,%ecx
add    $0x1,%ecx
mov    %eax,(%rdi)
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @tsnorm(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 1000000000
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1000000000
store i32 %12, i32* %10
%13 = load %struct.timespec*, %struct.timespec** %2
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @tsnorm(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 999999999
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add nuw i32 %3, 999999999
%9 = call i32 @llvm.smin.i32(i32 %3, i32 1999999999)
%10 = sub nuw i32 %8, %9
%11 = udiv i32 %10, 1000000000
%12 = mul nsw i32 %11, -1000000000
%13 = add i32 %7, %11
%14 = add nsw i32 %3, -1000000000
%15 = add nsw i32 %12, %14
%16 = add i32 %13, 1
store i32 %15, i32* %2
store i32 %16, i32* %6
br label %17
17: ; preds = %5, %1
ret void
}
int aebl_sensors_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @aebl_sensors_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @aebl_sensors_init() {
ret i32 0
}
void runZeroDiv() {
  int a = 1;
  int b = 0;
  a = a / b;
}


x86 assembly (clang, -O0):
<runZeroDiv>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @runZeroDiv() {
ret void
}
void SysCtlUSBPLLDisable(void) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FB820))) &= ~(0x00000004 | 0x00000002);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlUSBPLLDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x400fb820,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffff9,%rcx
mov    $0x400fb820,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlUSBPLLDisable>:
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
andq   $0xfffffffffffffff9,0x400fb820
40 f9
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @SysCtlUSBPLLDisable() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %2, i64* %1
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1074772000 to i64*)
%4 = and i64 %3, -7
store volatile i64 %4, i64* inttoptr (i64 1074772000 to i64*)
%5 = load i64, i64* %1
store volatile i64 %5, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlUSBPLLDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 1074772000 to i64*)
%3 = and i64 %2, -7
store volatile i64 %3, i64* inttoptr (i64 1074772000 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Options:\n"
         "-d: decrypt the given string. If this is not present, defaults to "
         "encryptions\n"
         "-p: four hex digit plaintext/ciphertext to encrypt/decrypt\n"
         "-k: eight hext digit key to be used in encryption/decryption\n");
  abort();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [208 x i8] c"Options:\0A-d: decrypt the given string. If this is not present, defaults to encryptions\0A-p: four hex digit plaintext/ciphertext to encrypt/decrypt\0A-k: eight hext digit key to be used in encryption/decryption\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [207 x i8] c"Options:\0A-d: decrypt the given string. If this is not present, defaults to encryptions\0A-p: four hex digit plaintext/ciphertext to encrypt/decrypt\0A-k: eight hext digit key to be used in encryption/decryption\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([207 x i8], [207 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
regx0reg1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[x0]) = r1; }


x86 assembly (clang, -O0):
<regx0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x6(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0reg1_set>:
movslq %edx,%rax
mov    %sil,(%r8,%rax,1)
ret

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

LLVM IR (-O2):
define i32 @regx0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture readnone %5) {
%7 = trunc i32 %1 to i8
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 %7, i8* %9
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int main(int argc, char **argv) {
  for (;;) {
    baz();
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <baz@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <baz@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @baz()
br label %3
}
void ff_thread_decode_frame() {}


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

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

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

LLVM IR (-O2):
define void @ff_thread_decode_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *memmem(char *, int, char *, int);
int main(void) {
  char b = 1, c = 1;
  return memmem(&b, 1, &c, 1) == NULL ? 1 : 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x1,-0x6(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%ecx
lea    -0x6(%rbp),%rdx
mov    %ecx,%esi
call   1030 <memmem@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x1,0x7(%rsp)
movb   $0x1,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rdx
mov    $0x1,%esi
mov    $0x1,%ecx
call   1030 <memmem@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
store i8 1, i8* %3
%4 = call i32* @memmem(i8* %2, i32 1, i8* %3, i32 1)
%5 = icmp eq i32* %4, null
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 1, i8* %1
store i8 1, i8* %2
%3 = call i32* @memmem(i8* %1, i32 1, i8* %2, i32 1)
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ isspace(int);
char *skip_space(char *ptr) {
  while (*ptr && isspace((int)*ptr)) {
    ptr++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_space+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_space+0x47>
jmp    1168 <skip_space+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_space+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_space+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_error_is_set(const void *e) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_error_is_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_error_is_set>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_is_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_is_set(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
char getURL() {
  char url[50];
  printf("What is the URL of this website?\n");
  scanf("%s", url);
  return url;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"What is the URL of this website?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @getURL() {
%1 = alloca [50 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = ptrtoint i8* %5 to i8
ret i8 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [33 x i8] c"What is the URL of this website?\00"
define signext i8 @getURL() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = ptrtoint [50 x i8]* %1 to i64
%6 = trunc i64 %5 to i8
ret i8 %6
}
long double _Complex mul_long_double_rc(long double a, long double _Complex b) {
  return a * b;
}


x86 assembly (clang, -O0):
<mul_long_double_rc>:
push   %rbp
mov    %rsp,%rbp
lea    0x20(%rbp),%rax
fldt   0x10(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fmul   %st(2),%st
fxch   %st(2)
fmulp  %st,%st(1)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_long_double_rc>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fldt   0x28(%rsp)
fxch   %st(1)
fmul   %st(2),%st
fxch   %st(1)
fmulp  %st,%st(2)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @mul_long_double_rc(x86_fp80 %0, { x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 0
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 1
%9 = load x86_fp80, x86_fp80* %8
%10 = fmul x86_fp80 %5, %7
%11 = fmul x86_fp80 %5, %9
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %10, x86_fp80* %12
store x86_fp80 %11, x86_fp80* %13
%14 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %14
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @mul_long_double_rc(x86_fp80 %0, { x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fmul x86_fp80 %4, %0
%8 = fmul x86_fp80 %6, %0
%9 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %7, 0
%10 = insertvalue { x86_fp80, x86_fp80 } %9, x86_fp80 %8, 1
ret { x86_fp80, x86_fp80 } %10
}
void pcan_device_node_destroy(struct pcandev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pcandev = type opaque
define void @pcan_device_node_destroy(%struct.pcandev* nocapture %0) {
ret void
}
mwrite(fd, address, bytes) int fd;
char *address;
register int bytes;
{
  if (write(fd, address, bytes) != bytes && bytes != 0)
    error(1, "Write error", ((char *)0));
}


x86 assembly (clang, -O0):
<mwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     116d <mwrite+0x4d>
cmpl   $0x0,-0x14(%rbp)
je     116d <mwrite+0x4d>
mov    $0x1,%edi
lea    0xe9e(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mwrite>:
push   %rbx
mov    %edx,%ebx
xor    %eax,%eax
call   1030 <write@plt>
test   %ebx,%ebx
je     1147 <mwrite+0x27>
cmp    %ebx,%eax
je     1147 <mwrite+0x27>
lea    0xec7(%rip),%rsi
mov    $0x1,%edi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <error@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Write error\00"
define i32 @mwrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
%5 = icmp ne i32 %4, %2
%6 = icmp ne i32 %2, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* null)
br label %10
10: ; preds = %8, %3
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_data_write(int /*<<< orphan*/);
int8_t hd44780_write_data_to_cg_or_ddram(uint8_t data) {
  return (hd44780_ll_data_write(data));
}


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

x86 assembly (clang, -O2):
<hd44780_write_data_to_cg_or_ddram>:
jmp    1030 <hd44780_ll_data_write@plt>

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

LLVM IR (-O2):
define i32 @hd44780_write_data_to_cg_or_ddram(i32 %0) {
%2 = tail call i32 @hd44780_ll_data_write(i32 %0)
ret i32 %2
}
signed long int long_min(signed long int a, signed long int b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<long_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <long_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <long_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @long_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}