xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
scalar_t__ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          void *(*)(void *), void *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void xpthread_create(pthread_t *thread, const pthread_attr_t *attr,
                     void *(*start_routine)(void *), void *arg) {
  if (pthread_create(thread, attr, start_routine, arg) < 0)
    errx(1, "pthread_create: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<xpthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <pthread_create@plt>
cmp    $0x0,%rax
jge    1188 <xpthread_create+0x58>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe7d(%rip),%rsi
call   1030 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpthread_create>:
push   %rax
call   1040 <pthread_create@plt>
test   %rax,%rax
js     113d <xpthread_create+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeae(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_create: %s\00"
@errno = global i32 0
define void @xpthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i64 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @errno
%9 = tail call i32 @strerror(i32 %8)
%10 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
int rx_char();
int /*<<< orphan*/ rx_rdy();
int getDebugChar() {
  while (!rx_rdy())
    ;
  return rx_char();
}


x86 assembly (clang, -O0):
<getDebugChar>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <getDebugChar+0x9>
mov    $0x0,%al
call   1040 <rx_rdy@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <getDebugChar+0x25>
jmp    114a <getDebugChar+0x2a>
jmp    1129 <getDebugChar+0x9>
mov    $0x0,%al
call   1030 <rx_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDebugChar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rx_rdy@plt>
test   %eax,%eax
je     1130 <getDebugChar+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rx_char@plt>

LLVM IR (-O0):
define i32 @getDebugChar() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @rx_rdy()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 (...) @rx_char()
ret i32 %7
}

LLVM IR (-O2):
define i32 @getDebugChar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rx_rdy()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @rx_char()
ret i32 %5
}
/* Variables and functions */
int unlink(char const *);
int octave_unlink_wrapper(const char *nm) { return unlink(nm); }


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

x86 assembly (clang, -O2):
<octave_unlink_wrapper>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @octave_unlink_wrapper(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef float int16_t;

/* Variables and functions */
float ConvertSampleInt16ToFloat(int16_t sample) { return sample / 32768.0f; }


x86 assembly (clang, -O0):
<ConvertSampleInt16ToFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ConvertSampleInt16ToFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 3.276800e+04
ret float %4
}

LLVM IR (-O2):
define float @ConvertSampleInt16ToFloat(float %0) {
%2 = fmul float %0, 0x3F00000000000000
ret float %2
}
/* Variables and functions */
char *bazelSays();
int /*<<< orphan*/ printf(char *, char *);
void simpleFun(void) { printf("simpleFun: %s", bazelSays()); }


x86 assembly (clang, -O0):
<simpleFun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bazelSays@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleFun>:
push   %rax
xor    %eax,%eax
call   1030 <bazelSays@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"simpleFun: %s\00"
define void @simpleFun() {
%1 = call i8* (...) @bazelSays()
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"simpleFun: %s\00"
define void @simpleFun() {
%1 = tail call i8* (...) @bazelSays()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct llcp_pdu_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct llcp_pdu_buf *);
void llcp_free_pdu_buf(struct llcp_pdu_buf *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<llcp_free_pdu_buf>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.llcp_pdu_buf = type { i32 }
define void @llcp_free_pdu_buf(%struct.llcp_pdu_buf* nocapture %0) {
%2 = tail call i32 @free(%struct.llcp_pdu_buf* %0)
ret void
}
int test_imm_C0uint16_mem(unsigned short *val) {
  return ((*val) & (0xC0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C0uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 192
%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_C0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 192
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ put_str_packet(char *);
void rsp_trap() { put_str_packet("S05"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"S05\00"
define void @rsp_trap() {
%1 = call i32 @put_str_packet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"S05\00"
define void @rsp_trap() {
%1 = tail call i32 @put_str_packet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_66(void) {
  if ((*(uint32_t *)0x10000130ul == 0xAul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xa,%rax
jne    1134 <errata_66+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_66+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_66+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_66() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_66() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *);
int readDataTypeF(FILE *f, int *data) { return fscanf(f, "%d ", data); }


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

x86 assembly (clang, -O2):
<readDataTypeF>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fscanf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @readDataTypeF(i32* nocapture %0, i32* %1) {
%3 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ATIMER_ISR();
int /*<<< orphan*/ EEPROM_ISR();
void EEPROM_ATIMER_ISR(void) {
  EEPROM_ISR();
  ATIMER_ISR();
}


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

x86 assembly (clang, -O2):
<EEPROM_ATIMER_ISR>:
push   %rax
xor    %eax,%eax
call   1030 <EEPROM_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ATIMER_ISR@plt>

LLVM IR (-O0):
define void @EEPROM_ATIMER_ISR() {
%1 = call i32 (...) @EEPROM_ISR()
%2 = call i32 (...) @ATIMER_ISR()
ret void
}

LLVM IR (-O2):
define void @EEPROM_ATIMER_ISR() {
%1 = tail call i32 (...) @EEPROM_ISR()
%2 = tail call i32 (...) @ATIMER_ISR()
ret void
}
void benchSVML256_SPNontrig() {}


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

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

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

LLVM IR (-O2):
define void @benchSVML256_SPNontrig() {
ret void
}
void ADCSampLenSet(unsigned long ulBase, unsigned long ulChannel,
                   unsigned long ulSampTime) {
  ;
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010 - (ulChannel / 10) * 4))) |=
      (ulSampTime << ((ulChannel % 10) * 3));
}


x86 assembly (clang, -O0):
<ADCSampLenSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x30(%rbp),%rax
imul   $0x3,%rdx,%rcx
shl    %cl,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
shl    $0x2,%rcx
sub    %rcx,%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSampLenSet>:
mov    %rdx,%r8
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rsi,%rax
mul    %rcx
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    (%rsi,%rsi,2),%ecx
shl    %cl,%r8
shl    $0x2,%rdx
sub    %rdx,%rdi
or     %r8,0x10(%rdi)
ret

LLVM IR (-O0):
define void @ADCSampLenSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = urem i64 %8, 10
%10 = mul i64 %9, 3
%11 = shl i64 %7, %10
%12 = load i64, i64* %4
%13 = add i64 %12, 16
%14 = load i64, i64* %5
%15 = udiv i64 %14, 10
%16 = mul i64 %15, 4
%17 = sub i64 %13, %16
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = or i64 %19, %11
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @ADCSampLenSet(i64 %0, i64 %1, i64 %2) {
%4 = urem i64 %1, 10
%5 = mul nuw nsw i64 %4, 3
%6 = shl i64 %2, %5
%7 = add i64 %0, 16
%8 = udiv i64 %1, 10
%9 = mul nsw i64 %8, -4
%10 = add i64 %7, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %6
store volatile i64 %13, i64* %11
ret void
}
int pygame_scrap_contains(char *type) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pygame_scrap_contains(i8* nocapture readnone %0) {
ret i32 0
}
int wsh_cache_data_flush(const void *restrict addr_p, unsigned int length) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @wsh_cache_data_flush(i8* noalias %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @wsh_cache_data_flush(i8* noalias nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long red_mask;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_red_mask(void *_p, unsigned long _v) {
  ((XImage *)_p)->red_mask = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XImage_red_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_red_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ is_lws(char const);
char *__skip_lws(const char *s) {
  while (is_lws(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<__skip_lws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_lws@plt>
cmp    $0x0,%rax
je     1143 <__skip_lws+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <__skip_lws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skip_lws>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_lws@plt>
test   %rax,%rax
jne    1120 <__skip_lws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__skip_lws(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @is_lws(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @__skip_lws(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_lws(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
void ScaleRowDown38_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_Any_NEON() {
ret void
}
/* Variables and functions */
int lookup_bool_variable(char *);
int transient_mark_mode(void) {
  return lookup_bool_variable("transient-mark-mode");
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"transient-mark-mode\00"
define i32 @transient_mark_mode() {
%1 = call i32 @lookup_bool_variable(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"transient-mark-mode\00"
define i32 @transient_mark_mode() {
%1 = tail call i32 @lookup_bool_variable(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ vxge_get_stats_common();
int /*<<< orphan*/ vxge_get_stats_driver(int /*<<< orphan*/);
int /*<<< orphan*/ vxge_get_stats_mrpcim();
void vxge_get_stats_all(void) {
  vxge_get_stats_mrpcim();
  vxge_get_stats_common();
  vxge_get_stats_driver(0);
}


x86 assembly (clang, -O0):
<vxge_get_stats_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <vxge_get_stats_mrpcim@plt>
mov    $0x0,%al
call   1050 <vxge_get_stats_common@plt>
xor    %edi,%edi
call   1040 <vxge_get_stats_driver@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vxge_get_stats_all>:
push   %rax
xor    %eax,%eax
call   1030 <vxge_get_stats_mrpcim@plt>
xor    %eax,%eax
call   1050 <vxge_get_stats_common@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <vxge_get_stats_driver@plt>

LLVM IR (-O0):
define void @vxge_get_stats_all() {
%1 = call i32 (...) @vxge_get_stats_mrpcim()
%2 = call i32 (...) @vxge_get_stats_common()
%3 = call i32 @vxge_get_stats_driver(i32 0)
ret void
}

LLVM IR (-O2):
define void @vxge_get_stats_all() {
%1 = tail call i32 (...) @vxge_get_stats_mrpcim()
%2 = tail call i32 (...) @vxge_get_stats_common()
%3 = tail call i32 @vxge_get_stats_driver(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Extraction/integrity check tool for camera configuration.\n"
                  "Usage: confextract [-cx] <input file> -o <output dir>\n"
                  "\t-c <file>        perform integrity check of <file>\n"
                  "\t-x <file>        extract <file>. Default destination is "
                  "current working dir\n"
                  "\t-o <output file>  output to <output file>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [285 x i8] c"Extraction/integrity check tool for camera configuration.\0AUsage: confextract [-cx] <input file> -o <output dir>\0A\09-c <file> perform integrity check of <file>\0A\09-x <file> extract <file>. Default destination is current working dir\0A\09-o <output file> output to <output file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [285 x i8] c"Extraction/integrity check tool for camera configuration.\0AUsage: confextract [-cx] <input file> -o <output dir>\0A\09-c <file> perform integrity check of <file>\0A\09-x <file> extract <file>. Default destination is current working dir\0A\09-o <output file> output to <output file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0))
ret void
}
int isupper(int c) { return 'A' <= c && c <= 'Z'; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isupper+0x24>
cmpl   $0x5a,-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):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
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 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ ne_span(unsigned long);
void ne_span_test(void **state) {
  assert_int_equal(ne_span(1ul), 0x8040201008040201ul ^ 1ul);
}


x86 assembly (clang, -O0):
<ne_span_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <ne_span@plt>
mov    %eax,%edi
mov    $0x8040200,%esi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_span_test>:
push   %rax
mov    $0x1,%edi
call   1030 <ne_span@plt>
mov    %eax,%edi
mov    $0x8040200,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @ne_span_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @ne_span(i64 1)
%4 = call i32 @assert_int_equal(i32 %3, i32 134480384)
ret void
}

LLVM IR (-O2):
define void @ne_span_test(i8** nocapture readnone %0) {
%2 = tail call i32 @ne_span(i64 1)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 134480384)
ret void
}
int f1(void) {
  int v1i, v1j, v1k, v1l = 0;
  v1i = 6;
  v1j = 8;
#pragma omp parallel private (v1k) firstprivate (v1j) shared (v1i) reduction (+:v1l)
  {
    v1k = v1i + v1j;
    {
      int v1m = 1;
      v1l = v1m;
    }
  }
  return v1l;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x10(%rbp)
movl   $0x6,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 1
}
void foo705() {}


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

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

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

LLVM IR (-O2):
define void @foo705() {
ret void
}
int main() {
  int a = 0;
  int b = 1;
  int c = 2;
  while (1) {
    printf("a=%d b=%d c=%d *c=%d=%08x\n", a, b, c, &c, &c);
    c++;
    sleep(3);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%r9
mov    %r9,%r8
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x10(%rbp)
mov    $0x3,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
jmp    1144 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x2,0x4(%rsp)
mov    $0x2,%ecx
lea    0xec8(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %rbx,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <printf@plt>
addl   $0x1,0x4(%rsp)
mov    $0x3,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
mov    0x4(%rsp),%ecx
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [27 x i8] c"a=%d b=%d c=%d *c=%d=%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ %9, %3 ], [ 2, %0 ]
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 %4, i32* %1, i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 3)
%9 = load i32, i32* %1
br label %3
}
unsigned int inb(short port) {
  unsigned char ret = 0;
  __asm__ volatile("inb %1,%0" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @inb(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 0, i8* %3
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @inb(i16 signext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i8 %2 to i32
ret i32 %3
}
void dummy_out(int *nr, double *xold, double *x, double *y, double *cont,
               int *lrc, int *n, double *rpar, int *ipar, int *irtrn) {
  *irtrn = 0;
}


x86 assembly (clang, -O0):
<dummy_out>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x28(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_out>:
mov    0x20(%rsp),%rax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @dummy_out(i32* %0, double* %1, double* %2, double* %3, double* %4, i32* %5, i32* %6, double* %7, i32* %8, i32* %9) {
%11 = alloca i32*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca double*
%19 = alloca i32*
%20 = alloca i32*
store i32* %0, i32** %11
store double* %1, double** %12
store double* %2, double** %13
store double* %3, double** %14
store double* %4, double** %15
store i32* %5, i32** %16
store i32* %6, i32** %17
store double* %7, double** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
%21 = load i32*, i32** %20
store i32 0, i32* %21
ret void
}

LLVM IR (-O2):
define void @dummy_out(i32* nocapture readnone %0, double* nocapture readnone %1, double* nocapture readnone %2, double* nocapture readnone %3, double* nocapture readnone %4, i32* nocapture readnone %5, i32* nocapture readnone %6, double* nocapture readnone %7, i32* nocapture readnone %8, i32* nocapture writeonly %9) {
store i32 0, i32* %9
ret void
}
void test_31_1(short *mem) { __atomic_or_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_31_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
or     %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_31_1+0x5d>
jmp    1125 <test_31_1+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
or     %cx,%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_31_1>:
lock orw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_31_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw or i16* %5, i16 %6 acq_rel
%8 = or i16 %7, %6
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_31_1(i16* nocapture %0) {
%2 = atomicrmw or i16* %0, i16 1 acq_rel
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wprintw(int /*<<< orphan*/ *, char const *, long);
int l_wprintw(WINDOW *win, const char *fmt, long i) {
  return (wprintw(win, fmt, i));
}


x86 assembly (clang, -O0):
<l_wprintw>:
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 <wprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_wprintw>:
jmp    1030 <wprintw@plt>

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

LLVM IR (-O2):
define i32 @l_wprintw(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @wprintw(i32* %0, i8* %1, i64 %2)
ret i32 %4
}
int test_edge(float time, float low, float high) {
  return time < low || time > high;
}


x86 assembly (clang, -O0):
<test_edge>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0xd(%rbp)
ja     113a <test_edge+0x3a>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_edge>:
ucomiss %xmm0,%xmm1
seta   %al
ucomiss %xmm2,%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test_edge(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load float, float* %4
%12 = load float, float* %6
%13 = fcmp ogt float %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ true, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_edge(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  int ch;
  while ((ch = fgetc(stdin)) != EOF) {
    printf("%c", ch);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ebc(%rip),%r14
mov    (%r14),%edi
call   1040 <fgetc@plt>
mov    0x2ea5(%rip),%r15
cmp    (%r15),%eax
je     1167 <main+0x47>
lea    0xeb9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r14),%edi
call   1040 <fgetc@plt>
cmp    (%r15),%eax
jne    1150 <main+0x30>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %2, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdin
%9 = tail call i32 @fgetc(i32 %8)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
ret i32 1
}
void gtk_clipboard_get_owner() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_get_owner() {
ret void
}
/* Variables and functions */
int addnumbers(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int total;
  total = addnumbers(5, 7);
  printf("total = %d\n", total);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"total = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @addnumbers(i32 5, i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int gcd(int u, int v) {
  int t;
  while (v != 0) {
    t = u % v;
    u = v;
    v = t;
  }
  return u;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
int gethostname(name, len)
char *name;
int len;
{
  strcpy(name, "");
  return 0;
}


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

x86 assembly (clang, -O2):
<gethostname>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @gethostname(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 = call i8* @strcpy(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @gethostname(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret i32 0
}
void pause(void) { __builtin_ia32_pause(); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void @llvm.x86.sse2.pause()
ret void
}
double write_stress_errors(double *force) { return 0.0; }


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

x86 assembly (clang, -O2):
<write_stress_errors>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @write_stress_errors(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @write_stress_errors(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
void *perform_work(void *argument) {
  while (*((volatile int *)argument)) {
  }
  return NULL;
}


x86 assembly (clang, -O0):
<perform_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
je     111c <perform_work+0x1c>
jmp    1108 <perform_work+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perform_work>:
cmpl   $0x0,(%rdi)
jne    1100 <perform_work>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @perform_work(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load volatile i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @perform_work(i8* %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %3, %1
%4 = load volatile i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i8* null
}
/* Variables and functions */
int rom_present(char *);
int s3_virge_988_available(void) {
  return rom_present(L"roms/video/s3virge/diamondstealth3000.vbi");
}


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

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

LLVM IR (-O0):
@.str = [42 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 118, i32 105, i32 114, i32 103, i32 101, i32 47, i32 100, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 115, i32 116, i32 101, i32 97, i32 108, i32 116, i32 104, i32 51, i32 48, i32 48, i32 48, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_virge_988_available() {
%1 = call i32 @rom_present(i8* bitcast ([42 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [42 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 118, i32 105, i32 114, i32 103, i32 101, i32 47, i32 100, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 115, i32 116, i32 101, i32 97, i32 108, i32 116, i32 104, i32 51, i32 48, i32 48, i32 48, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_virge_988_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([42 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t empty_function() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @empty_function() {
ret i32 0
}
/* Variables and functions */
char VCNL4000_readCmd(int);
int /*<<< orphan*/ VCNL4000_writeCmd(int, int);
int /*<<< orphan*/ usleep(int);
int getAmbientLightMeasure() {
  char c = 0;
  VCNL4000_writeCmd(0x80 + 0x0, 1 << 4);
  usleep(500);
  c = VCNL4000_readCmd(0x80 + 0x5);
  int result = (int)c << 8;
  c = VCNL4000_readCmd(0x80 + 0x6);
  result |= (int)c;
  return result;
}


x86 assembly (clang, -O0):
<getAmbientLightMeasure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x80,%edi
mov    $0x10,%esi
call   1040 <VCNL4000_writeCmd@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
mov    $0x85,%edi
call   1030 <VCNL4000_readCmd@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x86,%edi
call   1030 <VCNL4000_readCmd@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAmbientLightMeasure>:
push   %rbx
mov    $0x80,%edi
mov    $0x10,%esi
call   1040 <VCNL4000_writeCmd@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
mov    $0x85,%edi
call   1030 <VCNL4000_readCmd@plt>
movsbl %al,%ebx
shl    $0x8,%ebx
mov    $0x86,%edi
call   1030 <VCNL4000_readCmd@plt>
movsbl %al,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getAmbientLightMeasure() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
%3 = call i32 @VCNL4000_writeCmd(i32 128, i32 16)
%4 = call i32 @usleep(i32 500)
%5 = call signext i8 @VCNL4000_readCmd(i32 133)
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 8
store i32 %8, i32* %2
%9 = call signext i8 @VCNL4000_readCmd(i32 134)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = load i32, i32* %2
%13 = or i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @getAmbientLightMeasure() {
%1 = tail call i32 @VCNL4000_writeCmd(i32 128, i32 16)
%2 = tail call i32 @usleep(i32 500)
%3 = tail call signext i8 @VCNL4000_readCmd(i32 133)
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = tail call signext i8 @VCNL4000_readCmd(i32 134)
%7 = sext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ func3();
void func2(void *ptr) { func3(); }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <func3@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @func3()
ret void
}

LLVM IR (-O2):
define void @func2(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @func3()
ret void
}
unsigned int UARTCharsAvail(unsigned int baseAdd) {
  unsigned int retVal = 0;
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) & (0x00000001u)) {
    retVal = 1;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<UARTCharsAvail>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112b <UARTCharsAvail+0x2b>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharsAvail>:
add    $0x14,%edi
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @UARTCharsAvail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = add i32 %4, 20
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @UARTCharsAvail(i32 %0) {
%2 = add i32 %0, 20
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}