xunge/DecIR huggingface dataset:
int right_child(int index) { return (index << 1) + 2; }


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

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @right_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @right_child(i32 %0) {
%2 = shl i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int strcasecmp(const char *s1, const char *s2) {
  return strncasecmp(s1, s2, (size_t)-1);
}


x86 assembly (clang, -O0):
<strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <strncasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp>:
mov    $0xffffffffffffffff,%rdx
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 -1)
ret i32 %3
}
void topicEncodeUInt256(void) {}


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

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

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

LLVM IR (-O2):
define void @topicEncodeUInt256() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comportement_philosophe(int);
int /*<<< orphan*/ fin_tache();
void tache_philosophe3(void) {
  comportement_philosophe(3);
  fin_tache();
}


x86 assembly (clang, -O0):
<tache_philosophe3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <comportement_philosophe@plt>
mov    $0x0,%al
call   1030 <fin_tache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tache_philosophe3>:
push   %rax
mov    $0x3,%edi
call   1040 <comportement_philosophe@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fin_tache@plt>

LLVM IR (-O0):
define void @tache_philosophe3() {
%1 = call i32 @comportement_philosophe(i32 3)
%2 = call i32 (...) @fin_tache()
ret void
}

LLVM IR (-O2):
define void @tache_philosophe3() {
%1 = tail call i32 @comportement_philosophe(i32 3)
%2 = tail call i32 (...) @fin_tache()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ le16toh(int /*<<< orphan*/);
uint16_t readw(void *a) {
  uint16_t *p = a;
  return le16toh(*p);
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <le16toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
mov    (%rdi),%edi
jmp    1030 <le16toh@plt>

LLVM IR (-O0):
define i32 @readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @le16toh(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @readw(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @le16toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ syserror(int, char *);
void ActionLS2LMP(char *lsfilename, char *lmpfilename, int action) {
  syserror(20000 + 30, "LMP");
}


x86 assembly (clang, -O0):
<ActionLS2LMP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x4e3e,%edi
lea    0xed1(%rip),%rsi
call   1030 <syserror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActionLS2LMP>:
lea    0xee9(%rip),%rsi
mov    $0x4e3e,%edi
jmp    1030 <syserror@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"LMP\00"
define void @ActionLS2LMP(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @syserror(i32 20030, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"LMP\00"
define void @ActionLS2LMP(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @syserror(i32 20030, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntEnable(scalar_t__);
int /*<<< orphan*/ IntRegister(scalar_t__, void (*)());
scalar_t__ _SysExcIntNumberGet();
void SysExcIntRegister(void (*pfnHandler)(void)) {
  uint32_t ui32Int;
  ui32Int = _SysExcIntNumberGet();
  ASSERT(ui32Int != 0);
  IntRegister(ui32Int, pfnHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<SysExcIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <_SysExcIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ASSERT@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x10(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysExcIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <_SysExcIntNumberGet@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <ASSERT@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @SysExcIntRegister(void ()* %0) {
%2 = alloca void ()*
%3 = alloca i64
store void ()* %0, void ()** %2
%4 = call i64 (...) @_SysExcIntNumberGet()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i64, i64* %3
%10 = load void ()*, void ()** %2
%11 = bitcast void ()* %10 to void (...)*
%12 = call i32 @IntRegister(i64 %9, void (...)* %11)
%13 = load i64, i64* %3
%14 = call i32 @IntEnable(i64 %13)
ret void
}

LLVM IR (-O2):
define void @SysExcIntRegister(void ()* %0) {
%2 = tail call i64 (...) @_SysExcIntNumberGet()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = bitcast void ()* %0 to void (...)*
%7 = tail call i32 @IntRegister(i64 %2, void (...)* %6)
%8 = tail call i32 @IntEnable(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  char our_string[] = "Rhinozeros";
  int length = 0;
  while (our_string[length] != '\0') {
    length += 1;
  }
  printf("'%s' is %d chars long.\n", our_string, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0xf(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1165 <main+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <main+0x35>
lea    -0xf(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x72657a6f6e696852,%rax
7a 65 72
mov    %rax,0x8(%rsp)
movl   $0x736f72,0xf(%rsp)
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,0x9(%rsp,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1130 <main+0x20>
lea    0xec9(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.our_string = [11 x i8] c"Rhinozeros\00"
@.str = [24 x i8] c"'%s' is %d chars long.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, 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 %15
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.our_string = [11 x i8] c"Rhinozeros\00"
@.str = [24 x i8] c"'%s' is %d chars long.\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 1, %0 ], [ %8, %3 ]
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %10)
ret i32 0
}
void rop3_57_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

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

LLVM IR (-O2):
define void @rop3_57_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hfp_subevent_codecs_connection_complete_get_status(const uint8_t *event) {
  return event[3];
}


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

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

LLVM IR (-O0):
define i32 @hfp_subevent_codecs_connection_complete_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hfp_subevent_codecs_connection_complete_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_91uint8_reg(unsigned char val) {
  return ((val) & (-0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91uint8_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, -145
%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_91uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 111
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int field_name() {}


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

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

LLVM IR (-O0):
define i32 @field_name() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @field_name() {
ret i32 undef
}
int islower(int c) { return (c >= 0x61 && c <= 0x7A); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int nrf_read_register(int, char *, char *);
int nrf_get_lost_retries_count(int *count, char *retstatus) {
  int ret;
  char obstxreg;
  ret = nrf_read_register(0x08, &obstxreg, retstatus);
  *count = (int)(obstxreg & 0x0F);
  return ret;
}


x86 assembly (clang, -O0):
<nrf_get_lost_retries_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x8,%edi
lea    -0x15(%rbp),%rsi
call   1030 <nrf_read_register@plt>
mov    %eax,-0x14(%rbp)
movsbl -0x15(%rbp),%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_get_lost_retries_count>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x8,%edi
call   1030 <nrf_read_register@plt>
movzbl 0xf(%rsp),%ecx
and    $0xf,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrf_get_lost_retries_count(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @nrf_read_register(i32 8, i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = and i32 %10, 15
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @nrf_get_lost_retries_count(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8
%4 = call i32 @nrf_read_register(i32 8, i8* %3, i8* %1)
%5 = load i8, i8* %3
%6 = and i8 %5, 15
%7 = zext i8 %6 to i32
store i32 %7, i32* %0
ret i32 %4
}
int fn(int a, int b) {
  if ((a + 1) && (a + 1))
    return a;
  if ((a + 1) || (a + 1))
    return b;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1133 <fn+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1133 <fn+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <fn+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jne    1151 <fn+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1157 <fn+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int futex_op(int *, int /*<<< orphan*/, int, struct timespec const *,
             int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wait(int *addr, int val, const struct timespec *timeout) {
  return futex_op(addr, FUTEX_WAIT, val, timeout, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <futex_op@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex_op@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
define i32 @futex_wait(i32* %0, i32 %1, %struct.timespec* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.timespec*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.timespec* %2, %struct.timespec** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* @FUTEX_WAIT
%9 = load i32, i32* %5
%10 = load %struct.timespec*, %struct.timespec** %6
%11 = call i32 @futex_op(i32* %7, i32 %8, i32 %9, %struct.timespec* %10, i32* null, i32 0)
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
define i32 @futex_wait(i32* %0, i32 %1, %struct.timespec* %2) {
%4 = load i32, i32* @FUTEX_WAIT
%5 = tail call i32 @futex_op(i32* %0, i32 %4, i32 %1, %struct.timespec* %2, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *realloc(void *, size_t);
void *xmalloc(size_t);
void *xrealloc(void *ptr, size_t sz) {
  void *p;
  if (!ptr)
    return xmalloc(sz);
  p = realloc(ptr, sz);
  if (!p)
    exit(3);
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <xrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    118b <xrealloc+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1183 <xrealloc+0x53>
mov    $0x3,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
test   %rdi,%rdi
je     1142 <xrealloc+0x12>
call   1040 <realloc@plt>
test   %rax,%rax
je     114b <xrealloc+0x1b>
pop    %rcx
ret
mov    %rsi,%rdi
pop    %rax
jmp    1030 <xmalloc@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i64, i64* %5
%11 = call i8* @xmalloc(i64 %10)
store i8* %11, i8** %3
br label %22
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i8* @realloc(i8* %13, i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %12
%19 = call i32 @exit(i32 3)
unreachable
20: ; preds = %12
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %20, %9
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @xmalloc(i64 %1)
br label %11
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @exit(i32 3)
unreachable
11: ; preds = %6, %4
%12 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %12
}
void pthread_cleanup_push(void (*routine)(void *), void *arg) {
  printf("%s() Not IMPLEMENTED\n", __FUNCTION__);
}


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

x86 assembly (clang, -O2):
<pthread_cleanup_push>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%s() Not IMPLEMENTED\0A\00"
@__FUNCTION__.pthread_cleanup_push = [21 x i8] c"pthread_cleanup_push\00"
define void @pthread_cleanup_push(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.pthread_cleanup_push, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s() Not IMPLEMENTED\0A\00"
@__FUNCTION__.pthread_cleanup_push = [21 x i8] c"pthread_cleanup_push\00"
define void @pthread_cleanup_push(void (i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.pthread_cleanup_push, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedSignedness9(unsigned a) {
  int min = 0;
  clang_analyzer_eval(a < min);
  clang_analyzer_eval((a + 2) < min);
  clang_analyzer_eval((a + 2U) < min);
}


x86 assembly (clang, -O0):
<mixedSignedness9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedSignedness9>:
push   %rax
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedSignedness9(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp ult i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
%9 = load i32, i32* %2
%10 = add i32 %9, 2
%11 = load i32, i32* %3
%12 = icmp ult i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i32, i32* %2
%16 = add i32 %15, 2
%17 = load i32, i32* %3
%18 = icmp ult i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @clang_analyzer_eval(i32 %19)
ret void
}

LLVM IR (-O2):
define void @mixedSignedness9(i32 %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 0)
%3 = tail call i32 @clang_analyzer_eval(i32 0)
%4 = tail call i32 @clang_analyzer_eval(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stop(void) { printf("goodbye world!\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"goodbye world!\0A\00"
define void @stop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"goodbye world!\00"
define void @stop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_19uint16_reg(unsigned short val) {
  return ((val) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_19uint16_reg(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, 25
%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_19uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 25
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("\nUsage : %s keyEncapsulation-file pubkey-file privkey-file "
         "psec-param-file rand_file\n",
         program_name);
}


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

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

LLVM IR (-O0):
@.str = [86 x i8] c"\0AUsage : %s keyEncapsulation-file pubkey-file privkey-file psec-param-file rand_file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"\0AUsage : %s keyEncapsulation-file pubkey-file privkey-file psec-param-file rand_file\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int c_clearline() { return fputs("[2K", stdout); }


x86 assembly (clang, -O0):
<c_clearline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_clearline>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define i32 @c_clearline() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define i32 @c_clearline() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
unsigned int char2hex(char);
unsigned int base16_decode(char *token) {
  token++;
  unsigned int result = 0;
  for (; *token != '\0'; token++) {
    result = result * 16 + char2hex(*token);
  }
  return result;
}


x86 assembly (clang, -O0):
<base16_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <base16_decode+0x5f>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <char2hex@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <base16_decode+0x1f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base16_decode>:
push   %rbp
push   %rbx
push   %rax
mov    0x1(%rdi),%al
test   %al,%al
je     114a <base16_decode+0x3a>
mov    %rdi,%rbx
add    $0x2,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
shl    $0x4,%ebp
movsbl %al,%edi
call   1030 <char2hex@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <base16_decode+0x20>
jmp    114c <base16_decode+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @base16_decode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
store i32 0, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i32, i32* %3
%13 = mul i32 %12, 16
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call i32 @char2hex(i8 signext %15)
%17 = add i32 %13, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %11
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @base16_decode(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i8* [ %12, %5 ], [ %2, %1 ]
%8 = phi i32 [ %11, %5 ], [ 0, %1 ]
%9 = shl i32 %8, 4
%10 = tail call i32 @char2hex(i8 signext %6)
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i32 [ 0, %1 ], [ %11, %5 ]
ret i32 %16
}
int termios_tcflowoffi(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflowoffi(i32 %0) {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int state;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_state(void *_p, unsigned _v) {
  ((XButtonEvent *)_p)->state = (unsigned)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XButtonEvent_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void g_list_remove_link() {}


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

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

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

LLVM IR (-O2):
define void @g_list_remove_link() {
ret void
}
int ysj(char a, char b) {
  int a_int = 1;
  int b_int = 1;
  if (a == '-' || a == '+')
    a_int = 0;
  if (b == '-' || b == '+')
    b_int = 0;
  return b_int - a_int;
}


x86 assembly (clang, -O0):
<ysj>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
je     1138 <ysj+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
jne    113f <ysj+0x3f>
movl   $0x0,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2d,%eax
je     1159 <ysj+0x59>
movsbl -0x2(%rbp),%eax
cmp    $0x2b,%eax
jne    1160 <ysj+0x60>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ysj>:
add    $0xd5,%dil
and    $0xfd,%dil
add    $0xd5,%sil
xor    %eax,%eax
test   $0xfd,%sil
setne  %al
cmp    $0x1,%dil
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ysj(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 1, i32* %5
store i32 1, i32* %6
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 43
br i1 %13, label %14, label %15
14: ; preds = %10, %2
store i32 0, i32* %5
br label %15
15: ; preds = %14, %10
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 43
br i1 %22, label %23, label %24
23: ; preds = %19, %15
store i32 0, i32* %6
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @ysj(i8 signext %0, i8 signext %1) {
%3 = icmp ne i8 %0, 45
%4 = icmp ne i8 %0, 43
%5 = and i1 %3, %4
%6 = sext i1 %5 to i32
%7 = icmp ne i8 %1, 45
%8 = icmp ne i8 %1, 43
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
%11 = add nsw i32 %10, %6
ret i32 %11
}
/* Variables and functions */
char tolower(char);
void lcase(char *line, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    line[i] = tolower(line[i]);
  }
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <lcase+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <lcase+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <lcase+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <lcase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @lcase(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call signext i8 @tolower(i8 signext %15)
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @lcase(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_line(int *p, int len) {
  int i = 0;
  while (i < len)
    printf("%c", p[i++]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_line+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <print_line+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <print_line+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
add    $0x1,%rbx
call   1030 <putchar@plt>
cmp    %rbx,%r15
jne    1130 <print_line+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_line(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %6
18: ; preds = %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @print_line(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 @putchar(i32 %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
long long give_me_sum(long long a, long long b) { return a + b; }


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

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

LLVM IR (-O0):
define i64 @give_me_sum(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @give_me_sum(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int ENOMEM;
int pthread_rwlock_always_fail_ENOMEM(pthread_rwlock_t *rwlock) {
  return ENOMEM;
}


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

x86 assembly (clang, -O2):
<pthread_rwlock_always_fail_ENOMEM>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32 @pthread_rwlock_always_fail_ENOMEM(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOMEM
ret i32 %3
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @pthread_rwlock_always_fail_ENOMEM(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOMEM
ret i32 %2
}
/* Type definitions */
struct dns_rr {
  int dummy;
};
struct dns_packet {
  int dummy;
};
struct dns_ns {
  int dummy;
};
struct dns_cname {
  int dummy;
};

/* Variables and functions */
int dns_ns_parse(struct dns_ns *, struct dns_rr *, struct dns_packet *);
int dns_cname_parse(struct dns_cname *cname, struct dns_rr *rr,
                    struct dns_packet *P) {
  return dns_ns_parse((struct dns_ns *)cname, rr, P);
}


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

x86 assembly (clang, -O2):
<dns_cname_parse>:
jmp    1030 <dns_ns_parse@plt>

LLVM IR (-O0):
%struct.dns_cname = type { i32 }
%struct.dns_rr = type { i32 }
%struct.dns_packet = type { i32 }
%struct.dns_ns = type { i32 }
define i32 @dns_cname_parse(%struct.dns_cname* %0, %struct.dns_rr* %1, %struct.dns_packet* %2) {
%4 = alloca %struct.dns_cname*
%5 = alloca %struct.dns_rr*
%6 = alloca %struct.dns_packet*
store %struct.dns_cname* %0, %struct.dns_cname** %4
store %struct.dns_rr* %1, %struct.dns_rr** %5
store %struct.dns_packet* %2, %struct.dns_packet** %6
%7 = load %struct.dns_cname*, %struct.dns_cname** %4
%8 = bitcast %struct.dns_cname* %7 to %struct.dns_ns*
%9 = load %struct.dns_rr*, %struct.dns_rr** %5
%10 = load %struct.dns_packet*, %struct.dns_packet** %6
%11 = call i32 @dns_ns_parse(%struct.dns_ns* %8, %struct.dns_rr* %9, %struct.dns_packet* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.dns_cname = type { i32 }
%struct.dns_rr = type { i32 }
%struct.dns_packet = type { i32 }
%struct.dns_ns = type { i32 }
define i32 @dns_cname_parse(%struct.dns_cname* %0, %struct.dns_rr* %1, %struct.dns_packet* %2) {
%4 = bitcast %struct.dns_cname* %0 to %struct.dns_ns*
%5 = tail call i32 @dns_ns_parse(%struct.dns_ns* %4, %struct.dns_rr* %1, %struct.dns_packet* %2)
ret i32 %5
}
void call(void (*back)(char *)) { back("Hello!"); }


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xeed(%rip),%rdi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
mov    %rdi,%rax
lea    0xef6(%rip),%rdi
jmp    *%rax

LLVM IR (-O0):
@.str = [7 x i8] c"Hello!\00"
define void @call(void (i8*)* %0) {
%2 = alloca void (i8*)*
store void (i8*)* %0, void (i8*)** %2
%3 = load void (i8*)*, void (i8*)** %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
define void @call(void (i8*)* nocapture %0) {
tail call void %0(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ _sysconfig(int);
int __getdtablesize(void) { return (int)_sysconfig(4); }


x86 assembly (clang, -O0):
<__getdtablesize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <_sysconfig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getdtablesize>:
mov    $0x4,%edi
jmp    1030 <_sysconfig@plt>

LLVM IR (-O0):
define i32 @__getdtablesize() {
%1 = call i64 @_sysconfig(i32 4)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @__getdtablesize() {
%1 = tail call i64 @_sysconfig(i32 4)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime_r(struct tm const *, char *);
char *asctime(const struct tm *timeptr) {
  static char buf[25];
  return asctime_r(timeptr, buf);
}


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

x86 assembly (clang, -O2):
<asctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <asctime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@asctime.buf = internal global [25 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i8* @asctime_r(%struct.tm* %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@asctime.buf = internal global [25 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = tail call i8* @asctime_r(%struct.tm* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define void @set_XSelectionEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}