xunge/DecIR huggingface dataset:
void initialiseStatesAndConstants(double *states, double *variables) {
  states[0] = 123.0;
  states[1] = 0.001 * 789.0;
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 1.230000e+02, double* %6
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 1
store double 7.890000e-01, double* %8
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture readnone %1) {
%3 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 1.230000e+02, double 7.890000e-01>, <2 x double>* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_from_bytes(uintptr_t, uintptr_t);
void fiat_p384_from_bytes(uint32_t out1[12], const uint8_t arg1[48]) {
  internal_fiat_p384_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_from_bytes>:
jmp    1030 <internal_fiat_p384_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_p384_from_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_from_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void printArray(int a[], int n) {
  for (int i = 0; i < n; i++) {
    printf(" %d ", a[i]);
  }
  puts("");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <printArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <printArray+0x16>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <printArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ospeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t cfgetospeed(const struct termios *t) { return (t->c_ospeed); }


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3,
                                  unsigned int imm32) {
  put8(0x8B);
  put8((reg1 << 3) | 0x84);
  put8(reg2 | (reg3 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_reg32_preg32preg32pimm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x84,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_preg32preg32pimm32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
mov    $0x8b,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     $0x84,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %r15d,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_preg32preg32pimm32(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @put8(i32 139)
%10 = load i32, i32* %5
%11 = shl i32 %10, 3
%12 = or i32 %11, 132
%13 = call i32 @put8(i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = shl i32 %15, 3
%17 = or i32 %14, %16
%18 = call i32 @put8(i32 %17)
%19 = load i32, i32* %8
%20 = call i32 @put32(i32 %19)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_preg32preg32pimm32(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @put8(i32 139)
%6 = shl i32 %0, 3
%7 = or i32 %6, 132
%8 = tail call i32 @put8(i32 %7)
%9 = shl i32 %2, 3
%10 = or i32 %9, %1
%11 = tail call i32 @put8(i32 %10)
%12 = tail call i32 @put32(i32 %3)
ret void
}
/* Type definitions */
struct DirEntry {
  int dummy;
};

/* Variables and functions */
int walk_path(char const *, int /*<<< orphan*/, struct DirEntry **,
              int /*<<< orphan*/);
int file_open(const char *path, struct DirEntry **pf) {
  return walk_path(path, 0, pf, 0);
}


x86 assembly (clang, -O0):
<file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <walk_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_open>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <walk_path@plt>

LLVM IR (-O0):
%struct.DirEntry = type { i32 }
define i32 @file_open(i8* %0, %struct.DirEntry** %1) {
%3 = alloca i8*
%4 = alloca %struct.DirEntry**
store i8* %0, i8** %3
store %struct.DirEntry** %1, %struct.DirEntry*** %4
%5 = load i8*, i8** %3
%6 = load %struct.DirEntry**, %struct.DirEntry*** %4
%7 = call i32 @walk_path(i8* %5, i32 0, %struct.DirEntry** %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.DirEntry = type { i32 }
define i32 @file_open(i8* %0, %struct.DirEntry** %1) {
%3 = tail call i32 @walk_path(i8* %0, i32 0, %struct.DirEntry** %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void pwmWrite(int pin, int value) {
  printf("pwmWrite: pin=%d, value=%d\n", pin, value);
}


x86 assembly (clang, -O0):
<pwmWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmWrite>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"pwmWrite: pin=%d, value=%d\0A\00"
define void @pwmWrite(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 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"pwmWrite: pin=%d, value=%d\0A\00"
define void @pwmWrite(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FS_FreeFile(void *buffer) {
  if (buffer) {
    free(buffer);
  }
}


x86 assembly (clang, -O0):
<FS_FreeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <FS_FreeFile+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_FreeFile>:
test   %rdi,%rdi
je     111a <FS_FreeFile+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @FS_FreeFile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_0Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x0B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 11
%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_0Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 720896
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
scalar_t__ is_dir(int /*<<< orphan*/ *);
FILE *open_not_dir(const char *filename) {
  FILE *f = fopen(filename, "r");
  if (f == NULL) {
    return NULL;
  } else {
    if (is_dir(f)) {
      fclose(f);
      return NULL;
    }
  }
  return f;
}


x86 assembly (clang, -O0):
<open_not_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <open_not_dir+0x38>
movq   $0x0,-0x8(%rbp)
jmp    119e <open_not_dir+0x6e>
mov    -0x18(%rbp),%rdi
call   1040 <is_dir@plt>
cmp    $0x0,%rax
je     1191 <open_not_dir+0x61>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    119e <open_not_dir+0x6e>
jmp    1196 <open_not_dir+0x66>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_not_dir>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115a <open_not_dir+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <is_dir@plt>
test   %rax,%rax
je     115c <open_not_dir+0x2c>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32* @open_not_dir(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @is_dir(i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32* [ null, %7 ], [ null, %1 ], [ %2, %4 ]
ret i32* %10
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank0(int);
void m80setParams7EFA(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank0(val << 13);
}


x86 assembly (clang, -O0):
<m80setParams7EFA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xd,%edi
call   1030 <prg8setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m80setParams7EFA>:
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank0@plt>

LLVM IR (-O0):
define void @m80setParams7EFA(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 = shl i32 %6, 13
%8 = call i32 @prg8setBank0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m80setParams7EFA(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank0(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_work2();
void do_work() { do_work2(); }


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

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

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

LLVM IR (-O2):
define void @do_work() {
%1 = tail call i32 (...) @do_work2()
ret void
}
__attribute__((gnu_)) int carmen_imax(int val1, int val2) {
  if (val2 > val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <carmen_imax+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <carmen_imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_imax>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @carmen_imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void exit_next3_xattr(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_next3_xattr() {
ret void
}
unsigned int read32(const unsigned char *in) {
  unsigned int out = in[0];
  out <<= 8;
  out += in[1];
  out <<= 8;
  out += in[2];
  out <<= 8;
  out += in[3];
  return out;
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %3
%15 = add i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = shl i32 %16, 8
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i32, i32* %3
%23 = add i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = shl i32 %24, 8
store i32 %25, i32* %3
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i32, i32* %3
%31 = add i32 %30, %29
store i32 %31, i32* %3
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ bar2();
void *Thread2(void *x) {
  bar2();
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @Thread2(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @bar2()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_undefined_if() {
  printf("Error: there's no defined action for this if branching.\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"Error: there's no defined action for this if branching.\0A\00"
define void @msg_error_undefined_if() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"Error: there's no defined action for this if branching.\00"
define void @msg_error_undefined_if() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned int);
void f3(int size) {
  if (size < 0) {
    void *ptr = malloc((unsigned)size);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114a <f3+0x2a>
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
test   %edi,%edi
js     1125 <f3+0x5>
ret
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @f3(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i8* @malloc(i32 %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_two_factor_term(char *, char const **, int, char *);
void test_div_two_factor_term() {
  const char *tokensv[] = {"2", "/", "3"};
  check_two_factor_term("div_two_factor_term", tokensv, 3, "output_divide");
}


x86 assembly (clang, -O0):
<test_div_two_factor_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x3,%edx
lea    0xeca(%rip),%rcx
call   1030 <check_two_factor_term@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_div_two_factor_term>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%rdi
lea    0xee1(%rip),%rcx
mov    %rsp,%rsi
mov    $0x3,%edx
call   1030 <check_two_factor_term@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"3\00"
@__const.test_div_two_factor_term.tokensv = [3 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [20 x i8] c"div_two_factor_term\00"
@.str.4 = [14 x i8] c"output_divide\00"
define void @test_div_two_factor_term() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @check_two_factor_term(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %3, i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"3\00"
@__const.test_div_two_factor_term.tokensv = [3 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [20 x i8] c"div_two_factor_term\00"
@.str.4 = [14 x i8] c"output_divide\00"
define void @test_div_two_factor_term() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @check_two_factor_term(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %3, i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret void
}
int IS_BLANK_OR_TAB(CH)
char CH;
{ return ((CH == ' ') || (CH == '	')); }


x86 assembly (clang, -O0):
<IS_BLANK_OR_TAB>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <IS_BLANK_OR_TAB+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_BLANK_OR_TAB>:
shl    $0x18,%edi
cmp    $0x20000000,%edi
sete   %al
cmp    $0x9000000,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IS_BLANK_OR_TAB(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @IS_BLANK_OR_TAB(i32 %0) {
%2 = shl i32 %0, 24
%3 = icmp eq i32 %2, 536870912
%4 = icmp eq i32 %2, 150994944
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int my_str_islower(char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] >= 'a' && str[i] <= 'z')
      ;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116f <my_str_islower+0x6f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     1150 <my_str_islower+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jg     1150 <my_str_islower+0x50>
jmp    115c <my_str_islower+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <my_str_islower+0x76>
jmp    1161 <my_str_islower+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_islower+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_islower>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_islower+0x23>
add    $0x1,%rdi
nop
add    $0x9f,%cl
cmp    $0x1a,%cl
jae    1124 <my_str_islower+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_islower+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_islower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -97
%12 = icmp ult i8 %11, 26
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
int test_14(unsigned char *x, int y, int z) { return ((x[0] >> 2) & 16) != 0; }


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

x86 assembly (clang, -O2):
<test_14>:
movzbl (%rdi),%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_14(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 2
%12 = and i32 %11, 16
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_14(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = lshr i8 %4, 6
%6 = and i8 %5, 1
%7 = zext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getPacket();
int /*<<< orphan*/ sendPacket();
void sendResponse() {
  getPacket();
  sendPacket();
}


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

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

LLVM IR (-O0):
define void @sendResponse() {
%1 = call i32 (...) @getPacket()
%2 = call i32 (...) @sendPacket()
ret void
}

LLVM IR (-O2):
define void @sendResponse() {
%1 = tail call i32 (...) @getPacket()
%2 = tail call i32 (...) @sendPacket()
ret void
}
int subOK(int x, int y) {
  int z = y + (~x);
  return (((x ^ y) & (y ^ z)) >> 31) + 1;
}


x86 assembly (clang, -O0):
<subOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
and    %ecx,%eax
sar    $0x1f,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subOK>:
mov    %esi,%ecx
xor    %edi,%ecx
not    %edi
lea    (%rdi,%rsi,1),%eax
xor    %esi,%eax
and    %ecx,%eax
sar    $0x1f,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @subOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
%16 = and i32 %12, %15
%17 = ashr i32 %16, 31
%18 = add nsw i32 %17, 1
ret i32 %18
}

LLVM IR (-O2):
define i32 @subOK(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = add nsw i32 %3, %1
%5 = xor i32 %1, %0
%6 = xor i32 %4, %1
%7 = and i32 %6, %5
%8 = ashr i32 %7, 31
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Variables and functions */
void putc(char c) {
  while (((*(volatile unsigned long *)0x7F005018) & (1 << 14)))
    ;
  (*(volatile unsigned char *)0x7F005020) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
/* Variables and functions */
double sin(double);
double f2(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ IsEven(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
bool IsOdd(unsigned int n) {
  printf("!IsEven(%d)\n", (n));
  return !IsEven(n);
}


x86 assembly (clang, -O0):
<IsOdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <IsEven@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsOdd>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <IsEven@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"!IsEven(%d)\0A\00"
define i32 @IsOdd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @IsEven(i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"!IsEven(%d)\0A\00"
define i32 @IsOdd(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @IsEven(i32 %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrbt(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_regt_op();
void arm_ldrbt_reg() { arm_memio_ldrbt(arm_memio_regt_op()); }


x86 assembly (clang, -O0):
<arm_ldrbt_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_regt_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldrbt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrbt_reg>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_regt_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldrbt@plt>

LLVM IR (-O0):
define void @arm_ldrbt_reg() {
%1 = call i32 (...) @arm_memio_regt_op()
%2 = call i32 @arm_memio_ldrbt(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrbt_reg() {
%1 = tail call i32 (...) @arm_memio_regt_op()
%2 = tail call i32 @arm_memio_ldrbt(i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int count;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
void set_XMappingEvent_count(void *_p, int _v) {
  ((XMappingEvent *)_p)->count = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XMappingEvent_count(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_numeric(long *, long *, double *, void *, void **,
                                      double *, double *);
void umf4num(long Ap[], long Ai[], double Ax[], void **Symbolic, void **Numeric,
             double Control[20], double Info[90]) {
  (void)umfpack_dl_numeric(Ap, Ai, Ax, *Symbolic, Numeric, Control, Info);
}


x86 assembly (clang, -O0):
<umf4num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <umfpack_dl_numeric@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4num>:
mov    (%rcx),%rcx
jmp    1030 <umfpack_dl_numeric@plt>

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

LLVM IR (-O2):
define void @umf4num(i64* %0, i64* %1, double* %2, i8** nocapture %3, i8** %4, double* %5, double* %6) {
%8 = load i8*, i8** %3
%9 = tail call i32 @umfpack_dl_numeric(i64* %0, i64* %1, double* %2, i8* %8, i8** %4, double* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPolygonOffset(float, float);
void PolygonOffset(float f, float ofs) { glPolygonOffset(f, ofs); }


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

x86 assembly (clang, -O2):
<PolygonOffset>:
jmp    1030 <glPolygonOffset@plt>

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

LLVM IR (-O2):
define void @PolygonOffset(float %0, float %1) {
%3 = tail call i32 @glPolygonOffset(float %0, float %1)
ret void
}
char *langEnumControlsJoy2Button() { return "2-button Joystick"; }


x86 assembly (clang, -O0):
<langEnumControlsJoy2Button>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langEnumControlsJoy2Button>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"2-button Joystick\00"
define i8* @langEnumControlsJoy2Button() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"2-button Joystick\00"
define i8* @langEnumControlsJoy2Button() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
void bork(void **data) { (*(unsigned short *)(&(data[37])[927]) = 0); }


x86 assembly (clang, -O0):
<bork>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x128(%rax),%rax
movw   $0x0,0x39f(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bork>:
mov    0x128(%rdi),%rax
movw   $0x0,0x39f(%rax)
ret

LLVM IR (-O0):
define void @bork(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 37
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 927
%7 = bitcast i8* %6 to i16*
store i16 0, i16* %7
ret void
}

LLVM IR (-O2):
define void @bork(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 37
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 927
%5 = bitcast i8* %4 to i16*
store i16 0, i16* %5
ret void
}
/* Variables and functions */
char *nasm_malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *nasm_strcat(const char *one, const char *two) {
  char *rslt;
  int l1 = strlen(one);
  rslt = nasm_malloc(l1 + strlen(two) + 1);
  strcpy(rslt, one);
  strcpy(rslt + l1, two);
  return rslt;
}


x86 assembly (clang, -O0):
<nasm_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%edi
add    %eax,%edi
add    $0x1,%edi
call   1050 <nasm_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_strcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%r12d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r12,%rax,1),%edi
add    $0x1,%edi
call   1050 <nasm_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
movslq %r12d,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @nasm_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %9, %11
%13 = add nsw i32 %12, 1
%14 = call i8* @nasm_malloc(i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8*, i8** %4
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @nasm_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @nasm_malloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = tail call i32 @strcpy(i8* %10, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("python /home/santiago/.xmonad/brightness_adjust.py -");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"python /home/santiago/.xmonad/brightness_adjust.py -\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"python /home/santiago/.xmonad/brightness_adjust.py -\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_printf(char *);
int M115_f(char *s) {
  uart_printf("ok\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"ok\0A\00"
define i32 @M115_f(i8* nocapture readnone %0) {
%2 = tail call i32 @uart_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ filters_set_filter(char *);
void cmd_fset(char *arg) { filters_set_filter(arg); }


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

x86 assembly (clang, -O2):
<cmd_fset>:
jmp    1030 <filters_set_filter@plt>

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

LLVM IR (-O2):
define void @cmd_fset(i8* %0) {
%2 = tail call i32 @filters_set_filter(i8* %0)
ret void
}