xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **pstr) {
  if (pstr && *pstr) {
    free(*pstr);
    *pstr = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <ft_strdel+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <ft_strdel+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  c = gcd(98, 56);
  printf("%d\n", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 98, i32 56)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void dnormzero(unsigned a[2]) {
  if (a[0] == 0x80000000 && a[1] == 0)
    a[0] = 0;
}


x86 assembly (clang, -O0):
<dnormzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x80000000,(%rax)
jne    1130 <dnormzero+0x30>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    1130 <dnormzero+0x30>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnormzero>:
cmpl   $0x80000000,(%rdi)
jne    110e <dnormzero+0xe>
cmpl   $0x0,0x4(%rdi)
je     110f <dnormzero+0xf>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @dnormzero(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -2147483648
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 0, i32* %14
br label %15
15: ; preds = %12, %7, %1
ret void
}

LLVM IR (-O2):
define void @dnormzero(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -2147483648
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i32 0, i32* %0
br label %9
9: ; preds = %8, %4, %1
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int dmbSafeClose(int fd) {
  register int ret;
  do {
    ret = close(fd);
  } while (ret == -1 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<dmbSafeClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    114f <dmbSafeClose+0x3f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <dmbSafeClose+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmbSafeClose>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1144 <dmbSafeClose+0x34>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <dmbSafeClose+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @dmbSafeClose(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_CPSR();
int /*<<< orphan*/ set_CPSR_c(int);
void enable_interrupts(void) {
  uint32_t temp;
  temp = get_CPSR();
  set_CPSR_c(temp & ~0x80);
}


x86 assembly (clang, -O0):
<enable_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_CPSR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffff7f,%edi
call   1040 <set_CPSR_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_interrupts>:
push   %rax
xor    %eax,%eax
call   1030 <get_CPSR@plt>
and    $0xffffff7f,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <set_CPSR_c@plt>

LLVM IR (-O0):
define void @enable_interrupts() {
%1 = alloca i32
%2 = call i32 (...) @get_CPSR()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -129
%5 = call i32 @set_CPSR_c(i32 %4)
ret void
}

LLVM IR (-O2):
define void @enable_interrupts() {
%1 = tail call i32 (...) @get_CPSR()
%2 = and i32 %1, -129
%3 = tail call i32 @set_CPSR_c(i32 %2)
ret void
}
int item_prod(unsigned short item) { return item & 0x7ff; }


x86 assembly (clang, -O0):
<item_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x7ff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @item_prod(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 2047
ret i32 %5
}

LLVM IR (-O2):
define i32 @item_prod(i16 zeroext %0) {
%2 = and i16 %0, 2047
%3 = zext i16 %2 to i32
ret i32 %3
}
void RTAvlrUIntPtrGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrUIntPtrGet() {
ret void
}
/* Variables and functions */
scalar_t__ exp(double);
int /*<<< orphan*/ link_failure_exp();
void test_exp(double d) {
  if (exp(d) != exp(d))
    link_failure_exp();
}


x86 assembly (clang, -O0):
<test_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_exp+0x3c>
mov    $0x0,%al
call   1030 <link_failure_exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exp>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <exp@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
cmp    %rax,%rbx
jne    1149 <test_exp+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_exp@plt>

LLVM IR (-O0):
define void @test_exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @exp(double %3)
%5 = load double, double* %2
%6 = call i64 @exp(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_exp()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_exp(double %0) {
%2 = tail call i64 @exp(double %0)
%3 = tail call i64 @exp(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_exp()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_WriteToReg(int, int, unsigned char);
void MAG3110_Set_CTRL_REG2(unsigned char reg_value) {
  I2C_WriteToReg(0x0E, 0x11, reg_value);
}


x86 assembly (clang, -O0):
<MAG3110_Set_CTRL_REG2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe,%edi
mov    $0x11,%esi
movzbl -0x1(%rbp),%edx
call   1030 <I2C_WriteToReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG3110_Set_CTRL_REG2>:
mov    %edi,%edx
mov    $0xe,%edi
mov    $0x11,%esi
jmp    1030 <I2C_WriteToReg@plt>

LLVM IR (-O0):
define void @MAG3110_Set_CTRL_REG2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @I2C_WriteToReg(i32 14, i32 17, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @MAG3110_Set_CTRL_REG2(i8 zeroext %0) {
%2 = tail call i32 @I2C_WriteToReg(i32 14, i32 17, i8 zeroext %0)
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
__u64 rta_getattr_u64(const struct rtattr *rta) {
  __u64 tmp;
  memcpy(&tmp,
         ((void *)(((char *)(rta)) +
                   ((((sizeof(struct rtattr)) + 4 - 1) & ~(4 - 1)) + (0)))),
         sizeof(__u64));
  return tmp;
}


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

x86 assembly (clang, -O2):
<rta_getattr_u64>:
push   %rax
lea    0x4(%rdi),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u64(%struct.rtattr* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %0, i64 1
%5 = bitcast %struct.rtattr* %4 to i8*
%6 = call i32 @memcpy(i32* %2, i8* %5, i32 4)
%7 = load i32, i32* %2
ret i32 %7
}
int Operand_mr0_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_mr0_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_mr0_encode>:
xor    %eax,%eax
cmpl   $0x4,(%rdi)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @Operand_mr0_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PERL_SYS_TERM();
__attribute__((swift_name("PERL_SYS_TERM()"))) void sPerl_sys_term(void) {
  PERL_SYS_TERM();
}


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

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

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

LLVM IR (-O2):
define void @sPerl_sys_term() {
%1 = tail call i32 (...) @PERL_SYS_TERM()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  scanf("%c", &c);
  printf("%c", ((122 - c)) + 97);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
mov    $0x7a,%esi
sub    %eax,%esi
add    $0x61,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%eax
mov    $0xdb,%esi
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 122, %4
%6 = add nsw i32 %5, 97
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 219, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
#define EOF 128
int handle_eof(int ret) {
  switch (ret) {
  case EOF:
    return -1;
    break;
  case 0:
    return 0;
    break;
  default:
    return -2;
    break;
  }
  return -2;
}


x86 assembly (clang, -O0):
<handle_eof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1139 <handle_eof+0x39>
jmp    111a <handle_eof+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1145 <handle_eof+0x45>
jmp    112d <handle_eof+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <handle_eof+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    114c <handle_eof+0x4c>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_eof>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    (%rax,%rax,1),%ecx
add    $0xfffffffe,%ecx
cmp    $0x80,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @handle_eof(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 128, label %5
i32 0, label %6
]
5: ; preds = %1
store i32 -1, i32* %2
br label %8
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 -2, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @handle_eof(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 0, i32 -2
%4 = icmp eq i32 %0, 128
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ PrintTty(int, int, char *);
void Prompt1(char *msg) {
  PrintTty(2, 10, "                                                         ");
  PrintTty(2, 10, msg);
}


x86 assembly (clang, -O0):
<Prompt1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
lea    0xed3(%rip),%rdx
call   1030 <PrintTty@plt>
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <PrintTty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Prompt1>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdx
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <PrintTty@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <PrintTty@plt>

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

LLVM IR (-O2):
@.str = [58 x i8] c" \00"
define void @Prompt1(i8* %0) {
%2 = tail call i32 @PrintTty(i32 2, i32 10, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @PrintTty(i32 2, i32 10, i8* %0)
ret void
}
int test_imm_52uint8_reg(unsigned char val) {
  return ((val) & (0x52 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_52uint8_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, 82
%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_52uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 82
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_http_get_with_status() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_http_get_with_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_http_get_with_status>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_http_get_with_status() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_http_get_with_status() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int test(void) {
  int sockfd = 4;
  struct sockaddr addr;
  socklen_t addrlen;
  return getsockname(sockfd, &addr, &addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <getsockname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
mov    $0x4,%edi
call   1030 <getsockname@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
store i32 4, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @getsockname(i32 %4, %struct.sockaddr* %2, i32* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca %struct.sockaddr
%2 = alloca i32
%3 = bitcast %struct.sockaddr* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getsockname(i32 4, %struct.sockaddr* %1, i32* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, char *, char *);
int main() {
  execlp("expr", "expr", "4", "+", "5", (char *)0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xed3(%rip),%rcx
lea    0xece(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    %rsi,%rdi
call   1030 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xedc(%rip),%r8
mov    %rdi,%rsi
xor    %r9d,%r9d
call   1030 <execlp@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"expr\00"
@.str.1 = [2 x i8] c"4\00"
@.str.2 = [2 x i8] c"+\00"
@.str.3 = [2 x i8] c"5\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int testmatch_test_1(void *setup_ctxt) {
  printf("  (c) testmatch_test_1\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<testmatch_test_1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [23 x i8] c" (c) testmatch_test_1\00"
define i32 @testmatch_test_1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void strRemove0D0A(char *s) {
  int i = 0;
  while ((s[i] != 0) && (s[i] != 0x0D) && (s[i] != 0x0A))
    i++;
  s[i] = 0;
}


x86 assembly (clang, -O0):
<strRemove0D0A>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1158 <strRemove0D0A+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0xd(%rbp)
je     1158 <strRemove0D0A+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1168 <strRemove0D0A+0x68>
jmp    1176 <strRemove0D0A+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strRemove0D0A+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strRemove0D0A>:
xor    %eax,%eax
mov    $0x2401,%ecx
jmp    1114 <strRemove0D0A+0x14>
nopl   0x0(%rax)
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0xd,%rdx
ja     1110 <strRemove0D0A+0x10>
bt     %rdx,%rcx
jae    1110 <strRemove0D0A+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @strRemove0D0A(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 13, label %8
i8 10, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2, %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
ssize_t send(int sockfd, const void *buf, size_t len, int flags) {
  return sendto(sockfd, buf, len, flags, NULL, 0);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @sendto(i32 %9, i8* %10, i64 %11, i32 %12, i32* null, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
int swap_long_from_little(void *);
float swap_float_from_little(void *f) {
  union {
    int i;
    float fl;
  } temp;
  temp.i = swap_long_from_little(f);
  return temp.fl;
}


x86 assembly (clang, -O0):
<swap_float_from_little>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <swap_long_from_little@plt>
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_float_from_little>:
push   %rax
call   1030 <swap_long_from_little@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @swap_float_from_little(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @swap_long_from_little(i8* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @swap_float_from_little(i8* %0) {
%2 = tail call i32 @swap_long_from_little(i8* %0)
%3 = bitcast i32 %2 to float
ret float %3
}
void test25(void) {
  int a;
  int b;
  int c;
  if (a - b) {
  }
}


x86 assembly (clang, -O0):
<test25>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1118 <test25+0x18>
jmp    1118 <test25+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test25() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = sub nsw i32 %4, %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @test25() {
ret void
}
/* Type definitions */
struct stat {
  int st_size;
  int /*<<< orphan*/ st_mode;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
off_t fsize(const char *path) {
  struct stat st;
  if (stat(path, &st) == 0) {
    return S_ISDIR(st.st_mode) ? 0 : st.st_size;
  }
  return -1;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1170 <fsize+0x50>
mov    -0x14(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     115f <fsize+0x3f>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <fsize+0x45>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <fsize+0x57>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <fsize+0x18>
pop    %rcx
ret
mov    0x4(%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1136 <fsize+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i32 @fsize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 1
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
%13 = select i1 %10, i32 %12, i32 0
br label %14
14: ; preds = %1, %6
%15 = phi i32 [ %13, %6 ], [ -1, %1 ]
ret i32 %15
}
/* Variables and functions */
int i2c_write_array(unsigned char, char *, int);
int i2c_write_byte(unsigned char addr, char ch) {
  return i2c_write_array(addr, &ch, 1);
}


x86 assembly (clang, -O0):
<i2c_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <i2c_write_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <i2c_write_array@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2c_write_byte(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @i2c_write_array(i8 zeroext %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @i2c_write_byte(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @i2c_write_array(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *submissionSetPart(struct sqlConnection *, int, char *);
char *bioImageContributors(struct sqlConnection *conn, int id) {
  return submissionSetPart(conn, id, "contributors");
}


x86 assembly (clang, -O0):
<bioImageContributors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <submissionSetPart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bioImageContributors>:
lea    0xee9(%rip),%rdx
jmp    1030 <submissionSetPart@plt>

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

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"contributors\00"
define i8* @bioImageContributors(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @submissionSetPart(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
char char_fetch_add_relaxed(char *ptr, int value) {
  return __atomic_fetch_add(ptr, value, 0);
}


x86 assembly (clang, -O0):
<char_fetch_add_relaxed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
lock xadd %al,(%rcx)
mov    %al,-0xe(%rbp)
movsbl -0xe(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_fetch_add_relaxed>:
mov    %esi,%eax
lock xadd %al,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @char_fetch_add_relaxed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i8, i8* %5
%11 = atomicrmw add i8* %7, i8 %10 monotonic
store i8 %11, i8* %6
%12 = load i8, i8* %6
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @char_fetch_add_relaxed(i8* nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = atomicrmw add i8* %0, i8 %3 monotonic
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int size = sizeof(pid_t);
  printf("sizeof(pid_t) = %d\n", size);
}


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"sizeof(pid_t) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int strtol(char *, int /*<<< orphan*/ *, int);
int dec2num(char *str) {
  if (str == NULL)
    return 0;
  return strtol(str, NULL, 10);
}


x86 assembly (clang, -O0):
<dec2num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <dec2num+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1148 <dec2num+0x38>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2num>:
test   %rdi,%rdi
je     1121 <dec2num+0x11>
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dec2num(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strtol(i8* %8, i32* null, i32 10)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @dec2num(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void msm_cpr_pm_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_cpr_pm_suspend() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void bitmap64_print(int64_t *bitmap, FILE *out) {
  fprintf(out, "Bitmap 64:\t");
  fprintf(out, "%lld\t", *bitmap);
  fprintf(out, "\n");
}


x86 assembly (clang, -O0):
<bitmap64_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap64_print>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    (%r14),%edx
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Bitmap 64:\09\00"
@.str.1 = [6 x i8] c"%lld\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @bitmap64_print(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %4
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Bitmap 64:\09\00"
@.str.1 = [6 x i8] c"%lld\09\00"
define void @bitmap64_print(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %1)
%4 = load i32, i32* %0
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @fputc(i32 10, i32* %1)
ret void
}
/* Type definitions */
struct tun_t {
  int dummy;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
int tun_route(struct tun_t *, struct in_addr *, struct in_addr *,
              struct in_addr *, int /*<<< orphan*/);
int tun_addroute(struct tun_t *this, struct in_addr *dst,
                 struct in_addr *gateway, struct in_addr *mask) {
  return tun_route(this, dst, gateway, mask, 0);
}


x86 assembly (clang, -O0):
<tun_addroute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <tun_route@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_addroute>:
xor    %r8d,%r8d
jmp    1030 <tun_route@plt>

LLVM IR (-O0):
%struct.tun_t = type { i32 }
%struct.in_addr = type { i32 }
define i32 @tun_addroute(%struct.tun_t* %0, %struct.in_addr* %1, %struct.in_addr* %2, %struct.in_addr* %3) {
%5 = alloca %struct.tun_t*
%6 = alloca %struct.in_addr*
%7 = alloca %struct.in_addr*
%8 = alloca %struct.in_addr*
store %struct.tun_t* %0, %struct.tun_t** %5
store %struct.in_addr* %1, %struct.in_addr** %6
store %struct.in_addr* %2, %struct.in_addr** %7
store %struct.in_addr* %3, %struct.in_addr** %8
%9 = load %struct.tun_t*, %struct.tun_t** %5
%10 = load %struct.in_addr*, %struct.in_addr** %6
%11 = load %struct.in_addr*, %struct.in_addr** %7
%12 = load %struct.in_addr*, %struct.in_addr** %8
%13 = call i32 @tun_route(%struct.tun_t* %9, %struct.in_addr* %10, %struct.in_addr* %11, %struct.in_addr* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.tun_t = type { i32 }
%struct.in_addr = type { i32 }
define i32 @tun_addroute(%struct.tun_t* %0, %struct.in_addr* %1, %struct.in_addr* %2, %struct.in_addr* %3) {
%5 = tail call i32 @tun_route(%struct.tun_t* %0, %struct.in_addr* %1, %struct.in_addr* %2, %struct.in_addr* %3, i32 0)
ret i32 %5
}
int HashFunction(char *key, int size) {
  unsigned int simpleValue = 7121;
  unsigned int sum = 0;
  int i = 0;
  while (key[i] != '\0') {
    sum = (sum + key[i] * simpleValue) % size;
    simpleValue *= simpleValue;
    i++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<HashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1bd1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116a <HashFunction+0x6a>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <HashFunction+0x20>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashFunction>:
mov    (%rdi),%al
test   %al,%al
je     113d <HashFunction+0x3d>
add    $0x1,%rdi
mov    $0x1bd1,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%eax
imul   %ecx,%eax
add    %edx,%eax
xor    %edx,%edx
div    %esi
imul   %ecx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1120 <HashFunction+0x20>
mov    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HashFunction(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %15, %5 ], [ 0, %2 ]
%7 = phi i8 [ %17, %5 ], [ %3, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = phi i32 [ %14, %5 ], [ 7121, %2 ]
%10 = sext i8 %7 to i32
%11 = mul i32 %9, %10
%12 = add i32 %11, %8
%13 = urem i32 %12, %1
%14 = mul i32 %9, %9
%15 = add nuw nsw i64 %6, 1
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %5, %2
%20 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %20
}
char DINT_TO_SINT(int var) {
  char newvar;
  if (var > 127)
    newvar = 127;
  else if (var < -127)
    newvar = -127;
  else
    newvar = (char)var;
  return newvar;
}


x86 assembly (clang, -O0):
<DINT_TO_SINT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jle    111a <DINT_TO_SINT+0x1a>
movb   $0x7f,-0x5(%rbp)
jmp    1138 <DINT_TO_SINT+0x38>
cmpl   $0xffffff81,-0x4(%rbp)
jge    112d <DINT_TO_SINT+0x2d>
movb   $0x81,-0x5(%rbp)
jmp    1133 <DINT_TO_SINT+0x33>
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
jmp    1138 <DINT_TO_SINT+0x38>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DINT_TO_SINT>:
cmp    $0xffffff82,%edi
mov    $0xffffff81,%ecx
cmovge %edi,%ecx
cmp    $0x7f,%ecx
mov    $0x7f,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @DINT_TO_SINT(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 127, i8* %3
br label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, -127
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 -127, i8* %3
br label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
br label %14
14: ; preds = %11, %10
br label %15
15: ; preds = %14, %6
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @DINT_TO_SINT(i32 %0) {
%2 = icmp sgt i32 %0, -127
%3 = select i1 %2, i32 %0, i32 -127
%4 = icmp slt i32 %3, 127
%5 = select i1 %4, i32 %3, i32 127
%6 = trunc i32 %5 to i8
ret i8 %6
}