xunge/DecIR huggingface dataset:
void f(int *a) {
  int i;
  for (i = 0; i < 10; i++)
    a[i]++;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1138 <f+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <f+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
addl   $0x1,0x20(%rdi)
addl   $0x1,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %0, i64 8
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
%14 = getelementptr inbounds i32, i32* %0, i64 9
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __stpncpy(char *, char const *, size_t);
char *strncpy(char *restrict d, const char *restrict s, size_t n) {
  __stpncpy(d, s, n);
  return d;
}


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

x86 assembly (clang, -O2):
<strncpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__stpncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* noalias returned %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 @__stpncpy(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
int audio_cmd_to_gain_x1000(int cmd) {
  int gain_x1000 = (cmd - 145) * 375;
  return gain_x1000;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x91,%eax
imul   $0x177,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
imul   $0x177,%edi,%eax
add    $0xffff2b99,%eax
ret

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

LLVM IR (-O2):
define i32 @audio_cmd_to_gain_x1000(i32 %0) {
%2 = mul i32 %0, 375
%3 = add i32 %2, -54375
ret i32 %3
}
/* Variables and functions */
int getValue(char);
int getByte(char *buffer) {
  int high, low;
  high = getValue(buffer[0]);
  low = getValue(buffer[1]);
  if ((high == -1) || (low == -1)) {
    return -1;
  }
  return ((high << 4) + low);
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <getValue@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <getValue@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     114f <getByte+0x3f>
cmpl   $0xffffffff,-0x18(%rbp)
jne    115b <getByte+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <getByte+0x57>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <getValue@plt>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <getValue@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
add    %eax,%ecx
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
cmp    $0xffffffff,%ebp
cmove  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getByte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @getValue(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @getValue(i8 signext %5)
%7 = icmp eq i32 %3, -1
%8 = icmp eq i32 %6, -1
%9 = select i1 %7, i1 true, i1 %8
%10 = shl i32 %3, 4
%11 = add nsw i32 %6, %10
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
unsigned blend_multiply32(register unsigned color1, register unsigned color2) {
  return (
      (((((color1 >> 16) * (color2 >> 16)) >> 8)) << 16) |
      ((((((color1 & 0xFF00) >> 8) * ((color2 & 0xFF00) >> 8)) >> 8)) << 8) |
      ((((color1 & 0xFF) * (color2 & 0xFF)) >> 8)));
}


x86 assembly (clang, -O0):
<blend_multiply32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
mov    -0x8(%rbp),%edx
and    $0xff00,%edx
shr    $0x8,%edx
imul   %edx,%ecx
shr    $0x8,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%edx
and    $0xff,%edx
imul   %edx,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_multiply32>:
mov    %esi,%ecx
movzbl %ch,%edx
movzbl %cl,%eax
shr    $0x10,%ecx
movzbl %dil,%r8d
shr    $0x8,%edi
movzbl %dil,%esi
and    $0xffff00,%edi
imul   %ecx,%edi
and    $0xffff0000,%edi
imul   %esi,%edx
and    $0xff00,%edx
imul   %r8d,%eax
shr    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @blend_multiply32(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 = lshr i32 %5, 16
%7 = load i32, i32* %4
%8 = lshr i32 %7, 16
%9 = mul i32 %6, %8
%10 = lshr i32 %9, 8
%11 = shl i32 %10, 16
%12 = load i32, i32* %3
%13 = and i32 %12, 65280
%14 = lshr i32 %13, 8
%15 = load i32, i32* %4
%16 = and i32 %15, 65280
%17 = lshr i32 %16, 8
%18 = mul i32 %14, %17
%19 = lshr i32 %18, 8
%20 = shl i32 %19, 8
%21 = or i32 %11, %20
%22 = load i32, i32* %3
%23 = and i32 %22, 255
%24 = load i32, i32* %4
%25 = and i32 %24, 255
%26 = mul i32 %23, %25
%27 = lshr i32 %26, 8
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @blend_multiply32(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16776960
%6 = mul i32 %5, %3
%7 = and i32 %6, -65536
%8 = and i32 %4, 255
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = mul nuw nsw i32 %10, %8
%12 = and i32 %11, 65280
%13 = and i32 %0, 255
%14 = and i32 %1, 255
%15 = mul nuw nsw i32 %14, %13
%16 = lshr i32 %15, 8
%17 = or i32 %16, %7
%18 = or i32 %17, %12
ret i32 %18
}
/* Type definitions */
struct inclist {
  int dummy;
};
struct filepointer {
  int dummy;
};

/* Variables and functions */
scalar_t__ cppsetup(char *, char *, struct filepointer *, struct inclist *);
int zero_value(char *filename, char *exp, struct filepointer *filep,
               struct inclist *file_red) {
  if (cppsetup(filename, exp, filep, file_red))
    return (17);
  else
    return (0);
}


x86 assembly (clang, -O0):
<zero_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <cppsetup@plt>
cmp    $0x0,%rax
je     1153 <zero_value+0x43>
movl   $0x11,-0x4(%rbp)
jmp    115a <zero_value+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_value>:
push   %rax
call   1030 <cppsetup@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x11,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.filepointer = type { i32 }
%struct.inclist = type { i32 }
define i32 @zero_value(i8* %0, i8* %1, %struct.filepointer* %2, %struct.inclist* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.filepointer*
%9 = alloca %struct.inclist*
store i8* %0, i8** %6
store i8* %1, i8** %7
store %struct.filepointer* %2, %struct.filepointer** %8
store %struct.inclist* %3, %struct.inclist** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load %struct.filepointer*, %struct.filepointer** %8
%13 = load %struct.inclist*, %struct.inclist** %9
%14 = call i64 @cppsetup(i8* %10, i8* %11, %struct.filepointer* %12, %struct.inclist* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 17, i32* %5
br label %18
17: ; preds = %4
store i32 0, i32* %5
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.filepointer = type { i32 }
%struct.inclist = type { i32 }
define i32 @zero_value(i8* %0, i8* %1, %struct.filepointer* %2, %struct.inclist* %3) {
%5 = tail call i64 @cppsetup(i8* %0, i8* %1, %struct.filepointer* %2, %struct.inclist* %3)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 17
ret i32 %7
}
int isspace(int c) {
  switch (c) {
  case ' ':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1147 <isspace+0x47>
jmp    1140 <isspace+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 12, label %5
i32 10, label %5
i32 13, label %5
i32 9, label %5
i32 11, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
br label %7
7: ; preds = %6
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void barrier_read(void) { __asm__ volatile("lfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @barrier_read() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void scr_init() {}


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

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

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

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

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int dflt_close(void *fp) { return fclose((FILE *)fp); }


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

x86 assembly (clang, -O2):
<dflt_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @dflt_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret i32 %3
}
int sort(const void *xzeiger, const void *yzeiger) {
  return (*(int *)xzeiger - *(int *)yzeiger);
}


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

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

LLVM IR (-O0):
define i32 @sort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int ld_bgt_mm1(long double *a1, long double *a2) {
  return (__builtin_isgreater(*a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bgt_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_mm1>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_mm1(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp ogt x86_fp80 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bgt_mm1(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp ogt x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void ExttJobAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttJobAuxTable() {
ret void
}
void swap(int *i, int *j) {
  int temp = *i;
  *i = *j;
  *j = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef scalar_t__ rlim_t;

/* Variables and functions */
scalar_t__ tp_utils_limitisunlimited(scalar_t__);
bool tp_utils_valueexceedslimit(rlim_t value, rlim_t limit) {
  if (tp_utils_limitisunlimited(limit)) {
    return false;
  }
  return limit < value;
}


x86 assembly (clang, -O0):
<tp_utils_valueexceedslimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <tp_utils_limitisunlimited@plt>
cmp    $0x0,%rax
je     113f <tp_utils_valueexceedslimit+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1152 <tp_utils_valueexceedslimit+0x42>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_utils_valueexceedslimit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <tp_utils_limitisunlimited@plt>
test   %rax,%rax
sete   %al
cmp    %r14,%rbx
setl   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @tp_utils_valueexceedslimit(i64 %0, i64 %1) {
%3 = tail call i64 @tp_utils_limitisunlimited(i64 %1)
%4 = icmp eq i64 %3, 0
%5 = icmp slt i64 %1, %0
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int rand();
int rand_generator(int min_n, int max_n) {
  return rand() % (max_n - min_n + 1) + min_n;
}


x86 assembly (clang, -O0):
<rand_generator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_generator>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_generator(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_generator(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
char const getRandFloat();
char getRandChar() {
  const char start = 'A';
  const char end = '~';
  const char range = end - start;
  char c = 32 + getRandFloat() * range;
  return c;
}


x86 assembly (clang, -O0):
<getRandChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x1(%rbp)
movb   $0x7e,-0x2(%rbp)
movb   $0x3d,-0x3(%rbp)
mov    $0x0,%al
call   1030 <getRandFloat@plt>
movsbl %al,%eax
imul   $0x3d,%eax,%eax
add    $0x20,%eax
mov    %al,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandChar>:
push   %rax
xor    %eax,%eax
call   1030 <getRandFloat@plt>
movzbl %al,%eax
imul   $0x3d,%eax,%eax
add    $0x20,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getRandChar() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 65, i8* %1
store i8 126, i8* %2
store i8 61, i8* %3
%5 = call signext i8 (...) @getRandFloat()
%6 = sext i8 %5 to i32
%7 = mul nsw i32 %6, 61
%8 = add nsw i32 32, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @getRandChar() {
%1 = tail call signext i8 (...) @getRandFloat()
%2 = mul i8 %1, 61
%3 = add i8 %2, 32
ret i8 %3
}
int test_imm_D1int16_mem(short *val) {
  return ((*val) & (-0xD1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -209
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct mm_t {
  int dummy;
};

/* Variables and functions */
struct mm_t *mm_get(int);
int main() { struct mm_t *mm = mm_get(3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <mm_get@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mm_t = type { i32 }
define i32 @main() {
%1 = alloca %struct.mm_t*
%2 = call %struct.mm_t* @mm_get(i32 3)
store %struct.mm_t* %2, %struct.mm_t** %1
ret i32 0
}

LLVM IR (-O2):
%struct.mm_t = type { i32 }
define i32 @main() {
%1 = tail call %struct.mm_t* @mm_get(i32 3)
ret i32 0
}
int fetchFromMemory(int address) {}


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

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

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

LLVM IR (-O2):
define i32 @fetchFromMemory(i32 %0) {
ret i32 undef
}
void uDMAEnable(void) {
  (*((volatile unsigned long *)(0x400FF004))) = 0x00000001;
}


x86 assembly (clang, -O0):
<uDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400ff004,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAEnable>:
movq   $0x1,0x400ff004
ret

LLVM IR (-O0):
define void @uDMAEnable() {
store volatile i64 1, i64* inttoptr (i64 1074786308 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAEnable() {
store volatile i64 1, i64* inttoptr (i64 1074786308 to i64*)
ret void
}
int test_imm_15int64_midword_reg(long long val) {
  return ((val >> 16) & (0x15 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_15int64_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, 21
%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_15int64_midword_reg(i64 %0) {
%2 = and i64 %0, 1376256
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double signum(z)
double z;
{
  if (z < 0.0)
    return (-1.0);
  if (z > 0.0)
    return (1.0);
  return (0.0);
}


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <signum+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <signum+0x55>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <signum+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <signum+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm3,%xmm1
movsd  0xeda(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @signum(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double -1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %12
11: ; preds = %7
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @signum(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
unsigned char atoi(char *);
int printf(char *, unsigned int);
int main(int ac, char **argv) {
  unsigned char c1 = atoi(&argv[1][2]);
  unsigned int i1 = (c1 >> 4) ^ (c1 & 0x0f);
  return printf("i1 = %u\n", i1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
add    $0x2,%rdi
call   1040 <atoi@plt>
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
sar    $0x4,%eax
movzbl -0x11(%rbp),%ecx
and    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
add    $0x2,%rdi
call   1040 <atoi@plt>
movzbl %al,%esi
mov    %esi,%eax
shr    $0x4,%eax
and    $0xf,%esi
xor    %eax,%esi
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"i1 = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = call zeroext i8 @atoi(i8* %11)
store i8 %12, i8* %6
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = ashr i32 %14, 4
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = and i32 %17, 15
%19 = xor i32 %15, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"i1 = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = tail call zeroext i8 @atoi(i8* %5)
%7 = zext i8 %6 to i32
%8 = lshr i32 %7, 4
%9 = and i32 %7, 15
%10 = xor i32 %8, %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 %11
}
int ub_dentry_charge(struct dentry *d) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @ub_dentry_charge(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
void foo(unsigned u, int i, unsigned char uc, signed char sc) {
  __builtin_printf("%d\n", u);
  __builtin_printf("%u\n", i);
  __builtin_printf("%c\n", sc);
  __builtin_printf("%c\n", uc);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xa(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x9(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%esi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define void @foo(i32 %0, i32 %1, i8 zeroext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8, i8* %8
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define void @foo(i32 %0, i32 %1, i8 zeroext %2, i8 signext %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = sext i8 %3 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = zext i8 %2 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_string(char *string) { printf("Our string is: %s\n", string); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Our string is: %s\0A\00"
define void @show_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Our string is: %s\0A\00"
define void @show_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *n) {
  list_replace(old, n);
  INIT_LIST_HEAD(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
void pci_rcec_init(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_rcec_init(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int pd_socket_int_option(struct PdSocket *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
int pd_socket_keep_alive(struct PdSocket *sock, int on) {
  return pd_socket_int_option(sock, SOL_SOCKET, SO_KEEPALIVE, on);
}


x86 assembly (clang, -O0):
<pd_socket_keep_alive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1030 <pd_socket_int_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_keep_alive>:
mov    %esi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
jmp    1030 <pd_socket_int_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @pd_socket_keep_alive(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_KEEPALIVE
%8 = load i32, i32* %4
%9 = call i32 @pd_socket_int_option(%struct.PdSocket* %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @pd_socket_keep_alive(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_KEEPALIVE
%5 = tail call i32 @pd_socket_int_option(%struct.PdSocket* %0, i32 %3, i32 %4, i32 %1)
ret i32 %5
}
void gtk_tool_item_rebuild_menu() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_rebuild_menu() {
ret void
}
void starttimer_(const unsigned int *handle) { return; }


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

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

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

LLVM IR (-O2):
define void @starttimer_(i32* nocapture %0) {
ret void
}
adrx0reg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1144 <adrx0reg1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <adrx0reg1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0reg1>:
movslq %edx,%rax
movswl 0x989680(%rax,%rax,1),%ecx
movswl %si,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setge  %al
ret

LLVM IR (-O0):
define i32 @adrx0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i16, i16* %9
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adrx0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = shl i32 %1, 16
%12 = ashr exact i32 %11, 16
%13 = icmp sge i32 %12, %10
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_negotiate_fds(void *bus,
                                                                int b) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_negotiate_fds(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void ff_hevc_put_hevc_uni_epel_v6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v6_10_sse4() {
ret void
}
void exit(int status) {}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ close(int);
void serial_close(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<serial_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <serial_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_close>:
test   %edi,%edi
js     1119 <serial_close+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @serial_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int f(int);
int main(void) {
  int x;
  int tmp;
  int tmp___0;
  {
    tmp = x;
    x++;
    tmp___0 = f(x);
    return (tmp + tmp___0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 undef
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void subtract(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  double j = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, (j - i));
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1050 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @subtract(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call double @topDynArr(%struct.DynArr* %5)
store double %6, double* %3
%7 = load %struct.DynArr*, %struct.DynArr** %2
%8 = call i32 @popDynArr(%struct.DynArr* %7)
%9 = load %struct.DynArr*, %struct.DynArr** %2
%10 = call double @topDynArr(%struct.DynArr* %9)
store double %10, double* %4
%11 = load %struct.DynArr*, %struct.DynArr** %2
%12 = call i32 @popDynArr(%struct.DynArr* %11)
%13 = load %struct.DynArr*, %struct.DynArr** %2
%14 = load double, double* %4
%15 = load double, double* %3
%16 = fsub double %14, %15
%17 = call i32 @pushDynArr(%struct.DynArr* %13, double %16)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @subtract(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call double @topDynArr(%struct.DynArr* %0)
%5 = tail call i32 @popDynArr(%struct.DynArr* %0)
%6 = fsub double %4, %2
%7 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %6)
ret void
}
int sub(int a, int b) { return b - a; }


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

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

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

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}