xunge/DecIR huggingface dataset:
int test_imm_FDuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xFD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FDuint64_midword_reg>:
test   $0xfd0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FDuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 253
%6 = icmp ne i64 %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_FDuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16580608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_6Dint16_mem(short *val) {
  return ((*val) & (-0x6D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Dint16_mem>:
movzwl (%rdi),%eax
test   $0xff93,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -109
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void NEOMOTE_1_isr_rtc_int1_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @NEOMOTE_1_isr_rtc_int1_Interrupt() {
ret void
}
void outreg(int channel, int reg, unsigned char val) {
  *((volatile unsigned char *)0xBD000000 + (channel * 0x20) + (reg * 0x4)) =
      val;
}


x86 assembly (clang, -O0):
<outreg>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
movslq %eax,%rcx
mov    $0xbd000000,%eax
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outreg>:
movslq %edi,%rax
shl    $0x5,%rax
movslq %esi,%rcx
lea    (%rax,%rcx,4),%rax
mov    $0xbd000000,%ecx
mov    %dl,(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 3170893824 to i8*), i64 %10
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store volatile i8 %7, i8* %15
ret void
}

LLVM IR (-O2):
define void @outreg(i32 %0, i32 %1, i8 zeroext %2) {
%4 = shl nsw i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* inttoptr (i64 3170893824 to i8*), i64 %5
%7 = shl nsw i32 %1, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store volatile i8 %2, i8* %9
ret void
}
/* Variables and functions */
char *defaultDrive();
char *getenv(char *);
char *homeDrive(void) {
  char *s;
  return ((s = getenv("HOMEDRIVE")) && *s) ? s : defaultDrive();
}


x86 assembly (clang, -O0):
<homeDrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     115f <homeDrive+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <homeDrive+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116a <homeDrive+0x4a>
mov    $0x0,%al
call   1040 <defaultDrive@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<homeDrive>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1139 <homeDrive+0x19>
cmpb   $0x0,(%rax)
je     1139 <homeDrive+0x19>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <defaultDrive@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"HOMEDRIVE\00"
define i8* @homeDrive() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %11
4: ; preds = %0
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = load i8*, i8** %1
br label %13
11: ; preds = %4, %0
%12 = call i8* (...) @defaultDrive()
br label %13
13: ; preds = %11, %9
%14 = phi i8* [ %10, %9 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"HOMEDRIVE\00"
define i8* @homeDrive() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = tail call i8* (...) @defaultDrive()
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ %1, %3 ]
ret i8* %9
}
void ADC_init() {}


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

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

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

LLVM IR (-O2):
define void @ADC_init() {
ret void
}
/* Variables and functions */
double pow(int, double);
double phredToDouble(int p) { return 1.0 / pow(10, ((double)p) / 10.0); }


x86 assembly (clang, -O0):
<phredToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phredToDouble>:
push   %rax
cvtsi2sd %edi,%xmm0
divsd  0xee3(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  0xed9(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @phredToDouble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+01
%6 = call double @pow(i32 10, double %5)
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @phredToDouble(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+01
%4 = tail call double @pow(i32 10, double %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
int test_imm_FAuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1073741824000
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int GetMtx(int matrixReg) { return (matrixReg >> 2) & 7; }


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

x86 assembly (clang, -O2):
<GetMtx>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @GetMtx(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 7
ret i32 %3
}
int fun383() { return 383; }


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

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

LLVM IR (-O0):
define i32 @fun383() {
ret i32 383
}

LLVM IR (-O2):
define i32 @fun383() {
ret i32 383
}
/* Variables and functions */
int /*<<< orphan*/ nogo();
void emulate_wait(void) { nogo(); }


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

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

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

LLVM IR (-O2):
define void @emulate_wait() {
%1 = tail call i32 (...) @nogo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
char getcwd_no_buf_no_check_bad() {
  char *cwd = getcwd(NULL, 0);
  char result = cwd[0];
  free(cwd);
  return result;
}


x86 assembly (clang, -O0):
<getcwd_no_buf_no_check_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <getcwd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd_no_buf_no_check_bad>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <getcwd@plt>
mov    (%rax),%bl
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getcwd_no_buf_no_check_bad() {
%1 = alloca i8*
%2 = alloca i8
%3 = call i8* @getcwd(i32* null, i32 0)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %2
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getcwd_no_buf_no_check_bad() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
%2 = load i8, i8* %1
%3 = tail call i32 @free(i8* %1)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int_least32_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int_least32_t(int_least32_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int_least32_t(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct cxl_adapter_h {
  int dummy;
};

/* Variables and functions */
int asprintf(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ cxl_adapter_dev_name(struct cxl_adapter_h *);
int cxl_sysfs_adapter(char **bufp, struct cxl_adapter_h *adapter) {
  return asprintf(bufp,
                  "/sys/class/cxl"
                  "/%s",
                  cxl_adapter_dev_name(adapter));
}


x86 assembly (clang, -O0):
<cxl_sysfs_adapter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cxl_adapter_dev_name@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeb2(%rip),%rsi
call   1030 <asprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cxl_sysfs_adapter>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <cxl_adapter_dev_name@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1030 <asprintf@plt>

LLVM IR (-O0):
%struct.cxl_adapter_h = type { i32 }
@.str = [18 x i8] c"/sys/class/cxl/%s\00"
define i32 @cxl_sysfs_adapter(i8** %0, %struct.cxl_adapter_h* %1) {
%3 = alloca i8**
%4 = alloca %struct.cxl_adapter_h*
store i8** %0, i8*** %3
store %struct.cxl_adapter_h* %1, %struct.cxl_adapter_h** %4
%5 = load i8**, i8*** %3
%6 = load %struct.cxl_adapter_h*, %struct.cxl_adapter_h** %4
%7 = call i32 @cxl_adapter_dev_name(%struct.cxl_adapter_h* %6)
%8 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.cxl_adapter_h = type { i32 }
@.str = [18 x i8] c"/sys/class/cxl/%s\00"
define i32 @cxl_sysfs_adapter(i8** %0, %struct.cxl_adapter_h* %1) {
%3 = tail call i32 @cxl_adapter_dev_name(%struct.cxl_adapter_h* %1)
%4 = tail call i32 @asprintf(i8** %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
bool is_stopword(uint64_t token) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @is_stopword(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putnchar(char, int);
void display_bar() {
  my_putchar('|');
  my_putnchar('-', 20 - 2);
  my_putchar('|');
  my_putchar('\n');
}


x86 assembly (clang, -O0):
<display_bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7c,%edi
call   1040 <my_putchar@plt>
mov    $0x2d,%edi
mov    $0x12,%esi
call   1030 <my_putnchar@plt>
mov    $0x7c,%edi
call   1040 <my_putchar@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_bar>:
push   %rax
mov    $0x7c,%edi
call   1040 <my_putchar@plt>
mov    $0x2d,%edi
mov    $0x12,%esi
call   1030 <my_putnchar@plt>
mov    $0x7c,%edi
call   1040 <my_putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <my_putchar@plt>

LLVM IR (-O0):
define void @display_bar() {
%1 = call i32 @my_putchar(i8 signext 124)
%2 = call i32 @my_putnchar(i8 signext 45, i32 18)
%3 = call i32 @my_putchar(i8 signext 124)
%4 = call i32 @my_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @display_bar() {
%1 = tail call i32 @my_putchar(i8 signext 124)
%2 = tail call i32 @my_putnchar(i8 signext 45, i32 18)
%3 = tail call i32 @my_putchar(i8 signext 124)
%4 = tail call i32 @my_putchar(i8 signext 10)
ret void
}
int is_big_endian(void) {
  int i = 0;
  ((char *)(&i))[0] = 1;
  return (i != 1);
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
store i32 0, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 0
store i8 1, i8* %3
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
void init_data_vptr(void *a, size_t s) {
  char *q = (char *)a;
  int i;
  for (i = 0; i < s; i++) {
    *q = 10;
    q++;
  }
}


x86 assembly (clang, -O0):
<init_data_vptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114a <init_data_vptr+0x4a>
mov    -0x18(%rbp),%rax
movb   $0xa,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <init_data_vptr+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_data_vptr>:
test   %rsi,%rsi
je     1127 <init_data_vptr+0x17>
push   %rax
mov    %rsi,%rdx
mov    $0xa,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @init_data_vptr(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
struct UPnPDevice {
  int dummy;
};

/* Variables and functions */
struct UPnPDevice *CPGetDevice2(struct UPnPDevice *, int, int *);
struct UPnPDevice *CPGetDevice1(struct UPnPDevice *device, int index) {
  int c_Index = -1;
  return CPGetDevice2(device, index, &c_Index);
}


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

x86 assembly (clang, -O2):
<CPGetDevice1>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rdx
call   1030 <CPGetDevice2@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.UPnPDevice = type { i32 }
define %struct.UPnPDevice* @CPGetDevice1(%struct.UPnPDevice* %0, i32 %1) {
%3 = alloca %struct.UPnPDevice*
%4 = alloca i32
%5 = alloca i32
store %struct.UPnPDevice* %0, %struct.UPnPDevice** %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load %struct.UPnPDevice*, %struct.UPnPDevice** %3
%7 = load i32, i32* %4
%8 = call %struct.UPnPDevice* @CPGetDevice2(%struct.UPnPDevice* %6, i32 %7, i32* %5)
ret %struct.UPnPDevice* %8
}

LLVM IR (-O2):
%struct.UPnPDevice = type { i32 }
define %struct.UPnPDevice* @CPGetDevice1(%struct.UPnPDevice* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call %struct.UPnPDevice* @CPGetDevice2(%struct.UPnPDevice* %0, i32 %1, i32* %3)
ret %struct.UPnPDevice* %5
}
int test_imm_C6int64_lowword_reg(long long val) {
  return ((val) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 198
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_normal_solver(int solver) {
  if (solver >= 1 && solver <= 12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_normal_solver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1127 <is_normal_solver+0x27>
cmpl   $0xc,-0x8(%rbp)
jg     1127 <is_normal_solver+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_normal_solver+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_normal_solver>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xc,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_normal_solver(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo726() {}


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

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

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

LLVM IR (-O2):
define void @foo726() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printNewLine();
int /*<<< orphan*/ printNum(int);
int /*<<< orphan*/ sleep(int);
int processA(int argc, char **argv) {
  int counter = 2;
  print("Waitpid process A OK\n");
  while (counter > 0) {
    if (counter % 10 == 0) {
      print("processE: ");
      printNum(counter);
      printNewLine();
      sleep(1);
    }
    counter--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<processA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <print@plt>
cmpl   $0x0,-0x14(%rbp)
jle    11b3 <processA+0x73>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a5 <processA+0x65>
lea    0xe8f(%rip),%rdi
call   1030 <print@plt>
mov    -0x14(%rbp),%edi
call   1040 <printNum@plt>
mov    $0x0,%al
call   1050 <printNewLine@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <processA+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processA>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Waitpid process A OK\0A\00"
@.str.1 = [11 x i8] c"processE: \00"
define i32 @processA(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 2, i32* %5
%6 = call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %5
%12 = srem i32 %11, 10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %5
%17 = call i32 @printNum(i32 %16)
%18 = call i32 (...) @printNewLine()
%19 = call i32 @sleep(i32 1)
br label %20
20: ; preds = %14, %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Waitpid process A OK\0A\00"
define i32 @processA(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wfile_remove_dir_file_by_file(char *, int);
int wfile_remove_dir_1(char *path, int recursive) {
  wfile_remove_dir_file_by_file(path, recursive);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @wfile_remove_dir_1(i8* %0, i32 %1) {
%3 = tail call i32 @wfile_remove_dir_file_by_file(i8* %0, i32 %1)
ret i32 0
}
double m2Ft(const double valueMt) { return valueMt / 0.3048; }


x86 assembly (clang, -O0):
<m2Ft>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m2Ft>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @m2Ft(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.048000e-01
ret double %4
}

LLVM IR (-O2):
define double @m2Ft(double %0) {
%2 = fdiv double %0, 3.048000e-01
ret double %2
}
/* Variables and functions */
int task_flag_asserted(int, int);
int task_root_asserted(int id) { return task_flag_asserted(id, (1 << 6)); }


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

x86 assembly (clang, -O2):
<task_root_asserted>:
mov    $0x40,%esi
jmp    1030 <task_flag_asserted@plt>

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

LLVM IR (-O2):
define i32 @task_root_asserted(i32 %0) {
%2 = tail call i32 @task_flag_asserted(i32 %0, i32 64)
ret i32 %2
}
void MatrixScale4x4(float *matrix, float sx, float sy, float sz) {
  *(matrix + 0) *= sx;
  *(matrix + 5) *= sy;
  *(matrix + 10) *= sz;
}


x86 assembly (clang, -O0):
<MatrixScale4x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x14(%rax),%xmm0
movss  %xmm0,0x14(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x28(%rax),%xmm0
movss  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixScale4x4>:
mulss  (%rdi),%xmm0
movss  %xmm0,(%rdi)
mulss  0x14(%rdi),%xmm1
movss  %xmm1,0x14(%rdi)
mulss  0x28(%rdi),%xmm2
movss  %xmm2,0x28(%rdi)
ret

LLVM IR (-O0):
define void @MatrixScale4x4(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fmul float %12, %9
store float %13, float* %11
%14 = load float, float* %7
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 5
%17 = load float, float* %16
%18 = fmul float %17, %14
store float %18, float* %16
%19 = load float, float* %8
%20 = load float*, float** %5
%21 = getelementptr inbounds float, float* %20, i64 10
%22 = load float, float* %21
%23 = fmul float %22, %19
store float %23, float* %21
ret void
}

LLVM IR (-O2):
define void @MatrixScale4x4(float* nocapture %0, float %1, float %2, float %3) {
%5 = load float, float* %0
%6 = fmul float %5, %1
store float %6, float* %0
%7 = getelementptr inbounds float, float* %0, i64 5
%8 = load float, float* %7
%9 = fmul float %8, %2
store float %9, float* %7
%10 = getelementptr inbounds float, float* %0, i64 10
%11 = load float, float* %10
%12 = fmul float %11, %3
store float %12, float* %10
ret void
}
void g_list_insert_sorted() {}


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

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

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

LLVM IR (-O2):
define void @g_list_insert_sorted() {
ret void
}
void davinci_mux_init(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<davinci_mux_init>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <davinci_mux_init+0x9>
jmp    110e <davinci_mux_init+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @davinci_mux_init() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @davinci_mux_init() {
ret void
}
int getbitat(int num, int idx) { return (num >> idx) & 0x1; }


x86 assembly (clang, -O0):
<getbitat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbitat>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbitat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @getbitat(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct gecko_cmd_packet {
  int dummy;
};

/* Variables and functions */
struct gecko_cmd_packet *gecko_get_event(int /*<<< orphan*/);
struct gecko_cmd_packet *gecko_peek_event(void) {
  return gecko_get_event(0);
}


x86 assembly (clang, -O0):
<gecko_peek_event>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gecko_get_event@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gecko_peek_event>:
xor    %edi,%edi
jmp    1030 <gecko_get_event@plt>

LLVM IR (-O0):
%struct.gecko_cmd_packet = type { i32 }
define %struct.gecko_cmd_packet* @gecko_peek_event() {
%1 = call %struct.gecko_cmd_packet* @gecko_get_event(i32 0)
ret %struct.gecko_cmd_packet* %1
}

LLVM IR (-O2):
%struct.gecko_cmd_packet = type { i32 }
define %struct.gecko_cmd_packet* @gecko_peek_event() {
%1 = tail call %struct.gecko_cmd_packet* @gecko_get_event(i32 0)
ret %struct.gecko_cmd_packet* %1
}
/* Variables and functions */
float __llvm_amdgcn_cos_f32(float);
float __cosf(float x) { return __llvm_amdgcn_cos_f32(x); }


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

x86 assembly (clang, -O2):
<__cosf>:
jmp    1030 <__llvm_amdgcn_cos_f32@plt>

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

LLVM IR (-O2):
define float @__cosf(float %0) {
%2 = tail call float @__llvm_amdgcn_cos_f32(float %0)
ret float %2
}
/* Variables and functions */
int copy_file(char *, char *);
int action_load(char *args[]) { return copy_file(args[1], args[0]); }


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

x86 assembly (clang, -O2):
<action_load>:
mov    (%rdi),%rsi
mov    0x8(%rdi),%rdi
jmp    1030 <copy_file@plt>

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

LLVM IR (-O2):
define i32 @action_load(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = load i8*, i8** %0
%5 = tail call i32 @copy_file(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ int_exchange(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int a = 100;
  int b = 200;
  printf("before a= %d b= %d \n", a, b);
  int_exchange(&a, &b);
  printf("after a= %d b= %d \n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <int_exchange@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x64,0x4(%rsp)
movl   $0xc8,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <int_exchange@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"before a= %d b= %d \0A\00"
@.str.1 = [20 x i8] c"after a= %d b= %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 200, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @int_exchange(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"before a= %d b= %d \0A\00"
@.str.1 = [20 x i8] c"after a= %d b= %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 200, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 100, i32 200)
%6 = call i32 @int_exchange(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_has_bounding_cap(void *c, int capability) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_has_bounding_cap(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int main(void) {
  5 + 5.0;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_hiena_do_layer();
int main() {
  if (test_hiena_do_layer() == -1) {
    fprintf(stderr, "test_hiena_do_layer(); failed.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_hiena_do_layer@plt>
cmp    $0xffffffff,%eax
jne    1154 <main+0x34>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_hiena_do_layer@plt>
cmp    $0xffffffff,%eax
jne    1142 <main+0x22>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"test_hiena_do_layer(); failed.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_hiena_do_layer()
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"test_hiena_do_layer(); failed.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_hiena_do_layer()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void test(double X) { printf("%f %f\n", -0.0 - X, -X); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xorps  0xee9(%rip),%xmm0
lea    0xef2(%rip),%rdi
movaps %xmm0,%xmm1
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%f %f\0A\00"
define void @test(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double -0.000000e+00, %3
%5 = load double, double* %2
%6 = fneg double %5
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %4, double %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define void @test(double %0) {
%2 = fneg double %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %2, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int doInbUsb(int argc, char *argv[]) {
  printf("metodo não implementado");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"metodo n\C3\A3o implementado\00"
define i32 @doInbUsb(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [25 x i8] c"metodo n\C3\A3o implementado\00"
define i32 @doInbUsb(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
unsigned char f48(unsigned char x, unsigned long int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f48>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f48>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f48(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f48(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Type definitions */
struct rbtree_bp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rbtree_bp_clear_callback(struct rbtree_bp *,
                                            int /*<<< orphan*/ *);
void rbtree_bp_clear(struct rbtree_bp *target) {
  rbtree_bp_clear_callback(target, NULL);
}


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

x86 assembly (clang, -O2):
<rbtree_bp_clear>:
xor    %esi,%esi
jmp    1030 <rbtree_bp_clear_callback@plt>

LLVM IR (-O0):
%struct.rbtree_bp = type { i32 }
define void @rbtree_bp_clear(%struct.rbtree_bp* %0) {
%2 = alloca %struct.rbtree_bp*
store %struct.rbtree_bp* %0, %struct.rbtree_bp** %2
%3 = load %struct.rbtree_bp*, %struct.rbtree_bp** %2
%4 = call i32 @rbtree_bp_clear_callback(%struct.rbtree_bp* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.rbtree_bp = type { i32 }
define void @rbtree_bp_clear(%struct.rbtree_bp* %0) {
%2 = tail call i32 @rbtree_bp_clear_callback(%struct.rbtree_bp* %0, i32* null)
ret void
}
int in_range(int x, int y) { return x >= 0 && x < 10 && y < 20; }


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1132 <in_range+0x32>
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1132 <in_range+0x32>
cmpl   $0x14,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    $0xa,%edi
setb   %al
cmp    $0x14,%esi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @in_range(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 10
%4 = icmp slt i32 %1, 20
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void test34_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test34_TestProg_targetInit__I() {
ret void
}
int toggle(int jj) {
  if (jj == 0)
    jj = 1;
  else
    jj = 0;
  return (jj);
}


x86 assembly (clang, -O0):
<toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111d <toggle+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <toggle+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @toggle(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ qSessionAdd(char *, char *);
int qSessionValueInteger(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int qSessionAddInteger(char *name, int valueint) {
  char value[32];
  sprintf(value, "%d", valueint);
  qSessionAdd(name, value);
  return qSessionValueInteger(name);
}


x86 assembly (clang, -O0):
<qSessionAddInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <qSessionAdd@plt>
mov    -0x8(%rbp),%rdi
call   1030 <qSessionValueInteger@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qSessionAddInteger>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xebd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <qSessionAdd@plt>
mov    %rbx,%rdi
call   1030 <qSessionValueInteger@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @qSessionAddInteger(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @qSessionAdd(i8* %0, i8* %4)
%7 = call i32 @qSessionValueInteger(i8* %0)
ret i32 %7
}