xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xb4() {
  Assert_real((isascii(180) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              905, ("isascii should be 0 for 0xb4"));
}


x86 assembly (clang, -O0):
<t_isascii_0xb4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb4,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x389,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xb4>:
push   %rax
mov    $0xb4,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x389,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xb4\00"
define void @t_isascii_0xb4() {
%1 = call i64 @isascii(i32 180)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xb4\00"
define void @t_isascii_0xb4() {
%1 = tail call i64 @isascii(i32 180)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatserror(char *);
void editEndsPrematurely() { fatserror("edit script ends prematurely"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"edit script ends prematurely\00"
define void @editEndsPrematurely() {
%1 = call i32 @fatserror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"edit script ends prematurely\00"
define void @editEndsPrematurely() {
%1 = tail call i32 @fatserror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int sizeofint() { return sizeof(int); }


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

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

LLVM IR (-O0):
define i32 @sizeofint() {
ret i32 4
}

LLVM IR (-O2):
define i32 @sizeofint() {
ret i32 4
}
/* Variables and functions */
char *U_EMR_CORE5(int);
char *U_EMRSAVEDC_set(void) { return (U_EMR_CORE5(33)); }


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

x86 assembly (clang, -O2):
<U_EMRSAVEDC_set>:
mov    $0x21,%edi
jmp    1030 <U_EMR_CORE5@plt>

LLVM IR (-O0):
define i8* @U_EMRSAVEDC_set() {
%1 = call i8* @U_EMR_CORE5(i32 33)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRSAVEDC_set() {
%1 = tail call i8* @U_EMR_CORE5(i32 33)
ret i8* %1
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
extern void psb_intel_opregion_init(struct drm_device *dev) {}


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define void @psb_intel_opregion_init(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
ret void
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define void @psb_intel_opregion_init(%struct.drm_device* nocapture %0) {
ret void
}
/* Type definitions */
struct vmem_32 {
  int dummy;
};
struct page_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ page_index(struct page_table *);
int /*<<< orphan*/ uninstall_temp_page(int /*<<< orphan*/);
void unmap_page_table(struct vmem_32 *vmem32, struct page_table *pt) {
  uninstall_temp_page(page_index(pt));
}


x86 assembly (clang, -O0):
<unmap_page_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <page_index@plt>
mov    %eax,%edi
call   1040 <uninstall_temp_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmap_page_table>:
push   %rax
mov    %rsi,%rdi
call   1030 <page_index@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <uninstall_temp_page@plt>

LLVM IR (-O0):
%struct.vmem_32 = type { i32 }
%struct.page_table = type { i32 }
define void @unmap_page_table(%struct.vmem_32* %0, %struct.page_table* %1) {
%3 = alloca %struct.vmem_32*
%4 = alloca %struct.page_table*
store %struct.vmem_32* %0, %struct.vmem_32** %3
store %struct.page_table* %1, %struct.page_table** %4
%5 = load %struct.page_table*, %struct.page_table** %4
%6 = call i32 @page_index(%struct.page_table* %5)
%7 = call i32 @uninstall_temp_page(i32 %6)
ret void
}

LLVM IR (-O2):
%struct.vmem_32 = type { i32 }
%struct.page_table = type { i32 }
define void @unmap_page_table(%struct.vmem_32* nocapture readnone %0, %struct.page_table* %1) {
%3 = tail call i32 @page_index(%struct.page_table* %1)
%4 = tail call i32 @uninstall_temp_page(i32 %3)
ret void
}
int trans_3_x(int x, int y) { return -x; }


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

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

LLVM IR (-O0):
define i32 @trans_3_x(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 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @trans_3_x(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ msg(char *, char *);
void usage(char *me) { msg("Usage %s <addr> <timeout>", me); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Usage %s <addr> <timeout>\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage %s <addr> <timeout>\00"
define void @usage(i8* %0) {
%2 = tail call i32 @msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned int _parse_integer(char const *, unsigned int, unsigned long long *);
char *_parse_integer_fixup_radix(char const *, unsigned int *);
unsigned long long simple_strtoull_patch(const char *cp, char **endp,
                                         unsigned int base) {
  unsigned long long result;
  unsigned int rv;
  cp = _parse_integer_fixup_radix(cp, &base);
  rv = _parse_integer(cp, base, &result);
  return result;
}


x86 assembly (clang, -O0):
<simple_strtoull_patch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <_parse_integer_fixup_radix@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1040 <_parse_integer@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtoull_patch>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <_parse_integer_fixup_radix@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
call   1040 <_parse_integer@plt>
mov    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @simple_strtoull_patch(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i8* @_parse_integer_fixup_radix(i8* %9, i32* %6)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = call i32 @_parse_integer(i8* %11, i32 %12, i64* %7)
store i32 %13, i32* %8
%14 = load i64, i64* %7
ret i64 %14
}

LLVM IR (-O2):
define i64 @simple_strtoull_patch(i8* %0, i8** nocapture readnone %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
store i32 %2, i32* %4
%6 = bitcast i64* %5 to i8*
%7 = call i8* @_parse_integer_fixup_radix(i8* %0, i32* %4)
%8 = load i32, i32* %4
%9 = call i32 @_parse_integer(i8* %7, i32 %8, i64* %5)
%10 = load i64, i64* %5
ret i64 %10
}
int setup() {
  for (int i = 0; i < 1; i++) {
  }
  int j;
  for (int k = 0; k < 1; k++) {
  }
  int a;
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1128 <setup+0x28>
jmp    111a <setup+0x1a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <setup+0xb>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    114c <setup+0x4c>
jmp    113e <setup+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <setup+0x2f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setup() {
ret i32 undef
}
int main(void) {
  int a = 0;
  do {
    break;
  } while (a);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void rcrvn_(n, geom) int *n;
float geom[][3];
{ rcrvn((long)*n, geom); }


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

x86 assembly (clang, -O2):
<rcrvn_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <rcrvn@plt>

LLVM IR (-O0):
define void @rcrvn_(i32* %0, [3 x float]* %1) {
%3 = alloca i32*
%4 = alloca [3 x float]*
store i32* %0, i32** %3
store [3 x float]* %1, [3 x float]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [3 x float]*, [3 x float]** %4
%9 = call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @rcrvn to i32 (i64, [3 x float]*, ...)*)(i64 %7, [3 x float]* %8)
ret void
}

LLVM IR (-O2):
define void @rcrvn_(i32* nocapture %0, [3 x float]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @rcrvn to i32 (i64, [3 x float]*, ...)*)(i64 %4, [3 x float]* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutInitWindowSize(int, int);
void glutInitWindowSize(int width, int height) {
  fn_glutInitWindowSize(width, height);
}


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

x86 assembly (clang, -O2):
<glutInitWindowSize>:
jmp    1030 <fn_glutInitWindowSize@plt>

LLVM IR (-O0):
define void @glutInitWindowSize(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 @fn_glutInitWindowSize(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @glutInitWindowSize(i32 %0, i32 %1) {
%3 = tail call i32 @fn_glutInitWindowSize(i32 %0, i32 %1)
ret void
}
void swap(void *v[], int i, int j) {
  void *tmp = v[i];
  v[i] = v[j];
  v[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8**, i8*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %17, i8** %21
%22 = load i8*, i8** %7
%23 = load i8**, i8*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
store i8* %22, i8** %26
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dim(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmDim(char *str) { printColor(dim(str)); }


x86 assembly (clang, -O0):
<cmDim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dim@plt>
mov    %eax,%edi
call   1030 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmDim>:
push   %rax
call   1040 <dim@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmDim(i8* %0) {
%2 = tail call i32 @dim(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool DESDataReadNonBlocking(uint32_t ui32Base, uint32_t *pui32Dest) {
  ;
  if ((0x00000001 & ((*((volatile uint32_t *)(ui32Base + 0x00000020))))) == 0) {
    return (false);
  }
  pui32Dest[0] = (*((volatile uint32_t *)(0x44038000 + 0x00000028)));
  pui32Dest[1] = (*((volatile uint32_t *)(0x44038000 + 0x0000002C)));
  return (true);
}


x86 assembly (clang, -O0):
<DESDataReadNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    112d <DESDataReadNonBlocking+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    114f <DESDataReadNonBlocking+0x4f>
mov    $0x44038028,%eax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x4403802c,%eax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESDataReadNonBlocking>:
movslq %edi,%rcx
xor    %eax,%eax
testl  $0x1,0x20(%rcx)
je     1126 <DESDataReadNonBlocking+0x26>
mov    0x44038028,%eax
mov    %eax,(%rsi)
mov    0x4403802c,%eax
mov    %eax,0x4(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @DESDataReadNonBlocking(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 32
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 1, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %21
14: ; preds = %2
%15 = load volatile i32, i32* inttoptr (i64 1141080104 to i32*)
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load volatile i32, i32* inttoptr (i64 1141080108 to i32*)
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
store i32 1, i32* %3
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @DESDataReadNonBlocking(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 32
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load volatile i32, i32* inttoptr (i64 1141080104 to i32*)
store i32 %10, i32* %1
%11 = load volatile i32, i32* inttoptr (i64 1141080108 to i32*)
%12 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %11, i32* %12
br label %13
13: ; preds = %2, %9
%14 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %14
}
int lt_it(int suc, int value) { return suc < value; }


x86 assembly (clang, -O0):
<lt_it>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_it>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt_it(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt_it(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ getuid();
int test_isRoot() {
  if (getuid() != 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test_isRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
je     1135 <test_isRoot+0x25>
movl   $0x0,-0x4(%rbp)
jmp    113c <test_isRoot+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isRoot>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_isRoot() {
%1 = alloca i32
%2 = call i64 (...) @getuid()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_isRoot() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ crypt(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("Parameter number error.\n");
    return 1;
  }
  printf("%s\n", (char *)crypt(argv[1], argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     115a <main+0x3a>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1187 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <crypt@plt>
mov    %rax,%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <crypt@plt>
mov    %rax,%rdi
xor    %ebx,%ebx
jmp    1146 <main+0x26>
mov    $0x1,%ebx
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Parameter number error.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @crypt(i8* %13, i8* %16)
%18 = inttoptr i64 %17 to i8*
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
store i32 0, i32* %3
br label %20
20: ; preds = %10, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@str = [24 x i8] c"Parameter number error.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i64 @crypt(i8* %6, i8* %8)
%10 = inttoptr i64 %9 to i8*
br label %11
11: ; preds = %2, %4
%12 = phi i8* [ %10, %4 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), %2 ]
%13 = phi i32 [ 0, %4 ], [ 1, %2 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) %12)
ret i32 %13
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_lim(int limit) {
  int divisor = RAND_MAX / (limit + 1);
  int retval;
  do {
    retval = rand() / divisor;
  } while (retval > limit);
  return retval;
}


x86 assembly (clang, -O0):
<rand_lim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1130 <rand_lim+0x20>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_lim>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1130 <rand_lim+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_lim(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %5, %7
store i32 %8, i32* %3
br label %9
9: ; preds = %13, %1
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %13
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_lim(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = sdiv i32 %6, %4
%8 = icmp sgt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i;
  int a;
  for (i = 0; i < 5; i++) {
    a = 2 * i;
  }
  __print_int(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1147 <main+0x37>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 8)
ret i32 0
}
vdinit(aspect, justif) float *aspect;
int *justif;
{ viinit(aspect, justif); }


x86 assembly (clang, -O0):
<vdinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <viinit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vdinit(float* %0, i32* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
%6 = load float*, float** %4
%7 = load i32*, i32** %5
%8 = call i32 (float*, i32*, ...) bitcast (i32 (...)* @viinit to i32 (float*, i32*, ...)*)(float* %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @vdinit(float* %0, i32* %1) {
%3 = tail call i32 (float*, i32*, ...) bitcast (i32 (...)* @viinit to i32 (float*, i32*, ...)*)(float* %0, i32* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ jp_hl();
void opcode_e9() { jp_hl(); }


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

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

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

LLVM IR (-O2):
define void @opcode_e9() {
%1 = tail call i32 (...) @jp_hl()
ret void
}
int c_mult(int a, int b) { return (b * a); }


x86 assembly (clang, -O0):
<c_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @c_mult(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void I2CMasterEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000002;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterEnable>:
andq   $0xfffffffffffffffd,(%rdi)
orq    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 0
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 1
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @I2CMasterEnable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -3
store volatile i64 %4, i64* %2
%5 = load volatile i64, i64* %2
%6 = or i64 %5, 1
store volatile i64 %6, i64* %2
ret void
}
/* Type definitions */
struct main_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ main_cmdline_parser_required2(struct main_args_info *, char const *,
                                         int /*<<< orphan*/);
int main_cmdline_parser_required(struct main_args_info *args_info,
                                 const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (main_cmdline_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<main_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <main_cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <main_cmdline_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_cmdline_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <main_cmdline_parser_required2@plt>
test   %rax,%rax
jle    112f <main_cmdline_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.main_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main_cmdline_parser_required(%struct.main_args_info* %0, i8* %1) {
%3 = alloca %struct.main_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.main_args_info* %0, %struct.main_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.main_args_info*, %struct.main_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @main_cmdline_parser_required2(%struct.main_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.main_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main_cmdline_parser_required(%struct.main_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @main_cmdline_parser_required2(%struct.main_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
char *hash_plugin_summary(void) { return ("sha384 \t\tSHA-384 plugin"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"sha384 \09\09SHA-384 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"sha384 \09\09SHA-384 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
void swap(char *a, char *b) {
  char c = *a;
  *a = *b;
  *b = c;
}


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

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

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void init_8259A() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x4);
  outb(0xA1, 0x2);
  outb(0x21, 0x1);
  outb(0xA1, 0x1);
  outb(0x21, 0xFF);
  outb(0xA1, 0xFF);
}


x86 assembly (clang, -O0):
<init_8259A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_8259A>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @init_8259A() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 255)
%10 = call i32 @outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @init_8259A() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 255)
%10 = tail call i32 @outb(i32 161, i32 255)
ret void
}
/* Variables and functions */
char *strstr(char const *, char *);
int num_lines(const char *buf) {
  const char *p;
  int count = 0;
  p = buf;
  while (p != NULL) {
    p = strstr(p, "\r\n");
    if (p != NULL) {
      count++;
      p += 2;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<num_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116f <num_lines+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <num_lines+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <num_lines+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_lines>:
test   %rdi,%rdi
je     115b <num_lines+0x4b>
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffff,%ebp
lea    0xedc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rsi
call   1030 <strstr@plt>
lea    0x2(%rax),%rdi
add    $0x1,%ebp
test   %rax,%rax
jne    1130 <num_lines+0x20>
cmp    $0x1,%rax
mov    $0x1,%al
adc    $0x0,%al
movzbl %al,%eax
and    $0x1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @num_lines(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i8* [ %8, %3 ], [ %0, %1 ]
%6 = tail call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
%8 = getelementptr inbounds i8, i8* %6, i64 2
%9 = xor i1 %7, true
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %4, %10
br i1 %7, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %13
}
/* Type definitions */
struct histogram {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hist_add(struct histogram *, size_t, int);
void hist_inc(struct histogram *hist, size_t idx) { hist_add(hist, idx, 1); }


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

x86 assembly (clang, -O2):
<hist_inc>:
mov    $0x1,%edx
jmp    1030 <hist_add@plt>

LLVM IR (-O0):
%struct.histogram = type { i32 }
define void @hist_inc(%struct.histogram* %0, i64 %1) {
%3 = alloca %struct.histogram*
%4 = alloca i64
store %struct.histogram* %0, %struct.histogram** %3
store i64 %1, i64* %4
%5 = load %struct.histogram*, %struct.histogram** %3
%6 = load i64, i64* %4
%7 = call i32 @hist_add(%struct.histogram* %5, i64 %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.histogram = type { i32 }
define void @hist_inc(%struct.histogram* %0, i64 %1) {
%3 = tail call i32 @hist_add(%struct.histogram* %0, i64 %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glEnd();
extern void glEnd(void) { ptr_glEnd(); }


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

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

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

LLVM IR (-O2):
define void @glEnd() {
%1 = tail call i32 (...) @ptr_glEnd()
ret void
}
unsigned xrop3_89_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_89_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_89_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
or     %ecx,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_89_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
%9 = xor i32 %8, 255
ret i32 %9
}
int terminate_string_at_newline(char *s) {
  for (; *s; s++) {
    if (*s == '\n') {
      *s = 0;
      return 0;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<terminate_string_at_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <terminate_string_at_newline+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <terminate_string_at_newline+0x38>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1155 <terminate_string_at_newline+0x55>
jmp    113d <terminate_string_at_newline+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <terminate_string_at_newline+0x8>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate_string_at_newline>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <terminate_string_at_newline+0x11>
cmp    $0xa,%al
je     1117 <terminate_string_at_newline+0x17>
add    $0x1,%rdi
jmp    1100 <terminate_string_at_newline>
mov    $0xffffffff,%eax
ret
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @terminate_string_at_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
void os_setupAlarmInterval(int start, int period) {}


x86 assembly (clang, -O0):
<os_setupAlarmInterval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @os_setupAlarmInterval(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__46__IO__makeInput();
void Msp430Adc12ImplP__Port66__makeInput(void) {
  HplMsp430GeneralIOP__46__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port66__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__46__IO__makeInput()
ret void
}
int delay(ms) {
  int i, j;
  for (; i <= ms; i++)
    for (j = 199; j <= 199; j--)
      ;
  return 0;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114d <delay+0x4d>
movl   $0xc7,-0xc(%rbp)
cmpl   $0xc7,-0xc(%rbp)
jg     113a <delay+0x3a>
jmp    112c <delay+0x2c>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <delay+0x1a>
jmp    113f <delay+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1107 <delay+0x7>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
store i32 199, i32* %4
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 199
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %10
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
ret i32 0
}

LLVM IR (-O2):