xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void slice(char *hash, int offset) {
  printf("Modified hash = %s\n", (hash + offset));
}


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

x86 assembly (clang, -O2):
<slice>:
movslq %esi,%rsi
add    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Modified hash = %s\0A\00"
define void @slice(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Modified hash = %s\0A\00"
define void @slice(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void delayms(int i) {
  while (i) {
    i--;
  }
}


x86 assembly (clang, -O0):
<delayms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <delayms+0x1f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delayms+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delayms(i32 %0) {
ret void
}
/* Type definitions */
struct addrinfo {
  int /*<<< orphan*/ ai_flags;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};
typedef int /*<<< orphan*/ hints;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ AI_NUMERICSERV;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  struct addrinfo hints, *addr;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_INET6;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_NUMERICSERV;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32 }
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@AI_NUMERICSERV = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.addrinfo
%7 = alloca %struct.addrinfo*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @memset(%struct.addrinfo* %6, i32 0, i32 12)
%9 = load i32, i32* @AF_INET6
%10 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 2
store i32 %9, i32* %10
%11 = load i32, i32* @SOCK_STREAM
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 1
store i32 %11, i32* %12
%13 = load i32, i32* @AI_NUMERICSERV
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 0
store i32 %13, i32* %14
ret i32 0
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32 }
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@AI_NUMERICSERV = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.addrinfo
%4 = bitcast %struct.addrinfo* %3 to i8*
%5 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 12)
ret i32 0
}
char low2up(char car) {
  if (car >= 'A' && car <= 'Z')
    return car;
  else if (car >= 'a' && car <= 'z')
    return car - 'a' + 'A';
  else
    return -1;
}


x86 assembly (clang, -O0):
<low2up>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     112f <low2up+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     112f <low2up+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115f <low2up+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     115b <low2up+0x5b>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     115b <low2up+0x5b>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    115f <low2up+0x5f>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<low2up>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @low2up(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %28
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 97
%25 = add nsw i32 %24, 65
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %28
27: ; preds = %17, %13
store i8 -1, i8* %2
br label %28
28: ; preds = %27, %21, %11
%29 = load i8, i8* %2
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @low2up(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 26
%6 = add i8 %0, -32
%7 = select i1 %5, i8 %6, i8 -1
%8 = select i1 %3, i8 %0, i8 %7
ret i8 %8
}
float ScaleToEllipse(float Theta, float d) { return d * 50.0; }


x86 assembly (clang, -O0):
<ScaleToEllipse>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleToEllipse>:
movaps %xmm1,%xmm0
mulss  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ScaleToEllipse(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fmul double %6, 5.000000e+01
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @ScaleToEllipse(float %0, float %1) {
%3 = fmul float %1, 5.000000e+01
ret float %3
}
/* Variables and functions */
double atan(double);
double theta(double x, double y) { return atan(y / x); }


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

x86 assembly (clang, -O2):
<theta>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @theta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double %5, %6
%8 = call double @atan(double %7)
ret double %8
}

LLVM IR (-O2):
define double @theta(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = tail call double @atan(double %3)
ret double %4
}
unsigned int call_debug(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_debug() {
ret i32 0
}
int f() {
  static int x = 17;
  return x++;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@f.x = internal global i32 17
define i32 @f() {
%1 = load i32, i32* @f.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.x
ret i32 %1
}

LLVM IR (-O2):
@f.x = internal unnamed_addr global i32 17
define i32 @f() {
%1 = load i32, i32* @f.x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.x
ret i32 %1
}
/* Variables and functions */
double BitsEntropy(int const *const, int);
double HuffmanCost(int const *const, int);
double PopulationCost(const int *const population, int length) {
  return BitsEntropy(population, length) + HuffmanCost(population, length);
}


x86 assembly (clang, -O0):
<PopulationCost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <BitsEntropy@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <HuffmanCost@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopulationCost>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <BitsEntropy@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <HuffmanCost@plt>
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @PopulationCost(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 double @BitsEntropy(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call double @HuffmanCost(i32* %8, i32 %9)
%11 = fadd double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @PopulationCost(i32* %0, i32 %1) {
%3 = tail call double @BitsEntropy(i32* %0, i32 %1)
%4 = tail call double @HuffmanCost(i32* %0, i32 %1)
%5 = fadd double %3, %4
ret double %5
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CloseBreezeSimulation(int);
int /*<<< orphan*/ printf(char *);
void BrzBinaryFuncConstR_ackup(struct comp *comp, int port) {
  printf("BrzBinaryFuncConstR_ackup: This code should never be reached\n");
  CloseBreezeSimulation(2);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstR_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <CloseBreezeSimulation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstR_ackup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <CloseBreezeSimulation@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
@.str = [62 x i8] c"BrzBinaryFuncConstR_ackup: This code should never be reached\0A\00"
define void @BrzBinaryFuncConstR_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @CloseBreezeSimulation(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
@str = [61 x i8] c"BrzBinaryFuncConstR_ackup: This code should never be reached\00"
define void @BrzBinaryFuncConstR_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @CloseBreezeSimulation(i32 2)
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int c_moveu() { return fputs("M", stdout); }


x86 assembly (clang, -O0):
<c_moveu>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_moveu>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1BM\00"
@stdout = global i32 0
define i32 @c_moveu() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1BM\00"
@stdout = global i32 0
define i32 @c_moveu() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ func();
int main(int argc, char **argv) {
  int i;
  i = 1;
  i = 2;
  i = 3;
  func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x14(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ off(int);
int /*<<< orphan*/ on(int);
void onOff(int pin) {
  on(pin);
  delay(500);
  off(pin);
}


x86 assembly (clang, -O0):
<onOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <on@plt>
mov    $0x1f4,%edi
call   1040 <delay@plt>
mov    -0x4(%rbp),%edi
call   1030 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onOff>:
push   %rbx
mov    %edi,%ebx
call   1050 <on@plt>
mov    $0x1f4,%edi
call   1040 <delay@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <off@plt>

LLVM IR (-O0):
define void @onOff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @on(i32 %3)
%5 = call i32 @delay(i32 500)
%6 = load i32, i32* %2
%7 = call i32 @off(i32 %6)
ret void
}

LLVM IR (-O2):
define void @onOff(i32 %0) {
%2 = tail call i32 @on(i32 %0)
%3 = tail call i32 @delay(i32 500)
%4 = tail call i32 @off(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int tracker_cmd(int, char *, unsigned char *);
void tracker_upload(char *host, unsigned char *fh) {
  int sfd = tracker_cmd(1, host, fh);
  close(sfd);
}


x86 assembly (clang, -O0):
<tracker_upload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <tracker_cmd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracker_upload>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <tracker_cmd@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @tracker_upload(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @tracker_cmd(i32 1, i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
define void @tracker_upload(i8* %0, i8* %1) {
%3 = tail call i32 @tracker_cmd(i32 1, i8* %0, i8* %1)
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_msleep() {
  printf("NOT IMPLEMENTED:"
         "pa_msleep"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"NOT IMPLEMENTED:pa_msleep\0A\00"
define i32 @pa_msleep() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [26 x i8] c"NOT IMPLEMENTED:pa_msleep\00"
define i32 @pa_msleep() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main(void) { foo("hello"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = call i32 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ AI_V4MAPPED;
int ahosts_ex(int /*<<< orphan*/, int /*<<< orphan*/, int, char **);
int ahostsv6(int argc, char *argv[]) {
  return ahosts_ex(AF_INET6, AI_V4MAPPED, argc, argv);
}


x86 assembly (clang, -O0):
<ahostsv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <ahosts_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahostsv6>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ahosts_ex@plt>

LLVM IR (-O0):
@AF_INET6 = global i32 0
@AI_V4MAPPED = global i32 0
define i32 @ahostsv6(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @AF_INET6
%6 = load i32, i32* @AI_V4MAPPED
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @ahosts_ex(i32 %5, i32 %6, i32 %7, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@AI_V4MAPPED = global i32 0
define i32 @ahostsv6(i32 %0, i8** %1) {
%3 = load i32, i32* @AF_INET6
%4 = load i32, i32* @AI_V4MAPPED
%5 = tail call i32 @ahosts_ex(i32 %3, i32 %4, i32 %0, i8** %1)
ret i32 %5
}
int conta_digitos(unsigned long int num1, int num2) {
  int i, contador;
  while (num1 != 0) {
    if ((num1 % 10) == num2) {
      contador += 1;
    }
    num1 = num1 / 10;
  }
  return contador;
}


x86 assembly (clang, -O0):
<conta_digitos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <conta_digitos+0x51>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
movslq -0xc(%rbp),%rax
cmp    %rax,%rdx
jne    113a <conta_digitos+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110b <conta_digitos+0xb>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conta_digitos>:
test   %rdi,%rdi
je     114e <conta_digitos+0x4e>
mov    %rdi,%rcx
movslq %esi,%r9
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
xor    %eax,%eax
cmp    %r9,%rdi
sete   %al
add    %eax,%esi
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <conta_digitos+0x20>
mov    %esi,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @conta_digitos(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ undef, %4 ], [ %12, %6 ]
%8 = phi i64 [ %0, %4 ], [ %13, %6 ]
%9 = urem i64 %8, 10
%10 = icmp eq i64 %9, %5
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = udiv i64 %8, 10
%14 = icmp ult i64 %8, 10
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i32 [ undef, %2 ], [ %12, %6 ]
ret i32 %16
}
float psnd_chan2sec(float chan, float sw) {
  if (sw != 0.0)
    return (chan - 1.0) / sw;
  return 0.0;
}


x86 assembly (clang, -O0):
<psnd_chan2sec>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112f <psnd_chan2sec+0x2f>
jp     112f <psnd_chan2sec+0x2f>
jmp    115f <psnd_chan2sec+0x5f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1167 <psnd_chan2sec+0x67>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnd_chan2sec>:
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    110d <psnd_chan2sec+0xd>
jnp    1128 <psnd_chan2sec+0x28>
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  0xee4(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @psnd_chan2sec(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fsub double %11, 1.000000e+00
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = fdiv double %12, %14
%16 = fptrunc double %15 to float
store float %16, float* %3
br label %18
17: ; preds = %2
store float 0.000000e+00, float* %3
br label %18
18: ; preds = %17, %9
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @psnd_chan2sec(float %0, float %1) {
%3 = fcmp une float %1, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = fpext float %1 to double
%6 = fpext float %0 to double
%7 = fadd double %6, -1.000000e+00
%8 = fdiv double %7, %5
%9 = fptrunc double %8 to float
br label %10
10: ; preds = %2, %4
%11 = phi float [ %9, %4 ], [ 0.000000e+00, %2 ]
ret float %11
}
/* Variables and functions */
char *balloc(size_t);
scalar_t__ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *dl_strdup(const char *s) {
  size_t len = strlen(s) + 1;
  char *newstr = balloc(len);
  return newstr ? (char *)memcpy(newstr, s, len) : NULL;
}


x86 assembly (clang, -O0):
<dl_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <balloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1180 <dl_strdup+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    118b <dl_strdup+0x5b>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    118b <dl_strdup+0x5b>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1030 <balloc@plt>
test   %rax,%rax
je     115f <dl_strdup+0x2f>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
jmp    1161 <dl_strdup+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dl_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @balloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i64 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = inttoptr i64 %17 to i8*
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %13
%21 = phi i8* [ %18, %13 ], [ null, %19 ]
ret i8* %21
}

LLVM IR (-O2):
define i8* @dl_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @balloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i64 @memcpy(i8* %5, i8* %0, i64 %4)
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %1, %7
%11 = phi i8* [ %9, %7 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ bar(double);
void foo(double x) { bar(-x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @bar(double %4)
ret void
}

LLVM IR (-O2):
define void @foo(double %0) {
%2 = fneg double %0
%3 = tail call i32 @bar(double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Car_Set(int);
int /*<<< orphan*/ Car_SetAxles(int /*<<< orphan*/, int);
int /*<<< orphan*/ Car_SetAxlesWeight(int /*<<< orphan*/, int);
void Car_SetCarAxlesWeight(int carnum, int i, int Weight) {
  Car_SetAxlesWeight(Car_SetAxles(Car_Set(carnum), i), Weight);
}


x86 assembly (clang, -O0):
<Car_SetCarAxlesWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <Car_SetAxles@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <Car_SetAxlesWeight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Car_SetCarAxlesWeight>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <Car_SetAxles@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Car_SetAxlesWeight@plt>

LLVM IR (-O0):
define void @Car_SetCarAxlesWeight(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @Car_Set(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @Car_SetAxles(i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @Car_SetAxlesWeight(i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @Car_SetCarAxlesWeight(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Car_Set(i32 %0)
%5 = tail call i32 @Car_SetAxles(i32 %4, i32 %1)
%6 = tail call i32 @Car_SetAxlesWeight(i32 %5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int server_access_val();
int server_priv_val();
int main(int argc, char **argv) {
  int i = server_priv_val();
  int j = server_access_val();
  printf("%d %d\n", i, j);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <server_priv_val@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <server_access_val@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @server_priv_val()
%4 = tail call i32 (...) @server_access_val()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int, int, int,
                                int /*<<< orphan*/);
void msg_clear_redundant_link(struct tipc_msg *m) {
  msg_set_bits(m, 5, 12, 0x1, 0);
}


x86 assembly (clang, -O0):
<msg_clear_redundant_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0xc,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_clear_redundant_link>:
mov    $0x5,%esi
mov    $0xc,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <msg_set_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define void @msg_clear_redundant_link(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_set_bits(%struct.tipc_msg* %3, i32 5, i32 12, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_clear_redundant_link(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 5, i32 12, i32 1, i32 0)
ret void
}
void outw(short port, short val) {
  __asm__ volatile("outw %0,%1" : : "a"(val), "d"(port));
  return;
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x2(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outw(i16 signext %0, i16 signext %1) {
tail call void asm sideeffect "outw $0,$1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_pin_direction(uint8_t address, uint8_t pin) {
  return get_pin(address, pin, 0x00, 0x01);
}


x86 assembly (clang, -O0):
<get_pin_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <get_pin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pin_direction>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <get_pin@plt>

LLVM IR (-O0):
define i32 @get_pin_direction(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 @get_pin(i32 %5, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_pin_direction(i32 %0, i32 %1) {
%3 = tail call i32 @get_pin(i32 %0, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void ref_int32_t(int32_t arg, int32_t *result) { *result = arg; }


x86 assembly (clang, -O0):
<ref_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_int32_t>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ref_int32_t(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
void __DELETE_java_util_AbstractSet(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_AbstractSet(i8* nocapture %0, i8* nocapture %1) {
ret void
}
long int longint_ignoring_signedchar(long int x, signed char y) { return x; }


x86 assembly (clang, -O0):
<longint_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longint_ignoring_signedchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longint_ignoring_signedchar(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longint_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
int test_imm_01int16_reg(short val) {
  return ((val) & (-0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffff,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_01int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -1
%6 = icmp ne i32 %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_01int16_reg(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void sb(void) { asm volatile("sfence\n\t" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @sb() {
tail call void asm sideeffect "sfence\0A\09", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void print_ffMatrix(Matrix_p, x_size, y_size) long x_size, y_size;
double *Matrix_p;
{
  int i;
  for (i = 0; i < y_size; ++i)
    print_ffArray(Matrix_p + (x_size * i), x_size);
  return;
}


x86 assembly (clang, -O0):
<print_ffMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1169 <print_ffMatrix+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <print_ffArray@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <print_ffMatrix+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ffMatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
jle    1146 <print_ffMatrix+0x36>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x0(,%rsi,8),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <print_ffArray@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <print_ffMatrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @print_ffMatrix(double* %0, i64 %1, i64 %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store double* %0, double** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i32 0, i32* %7
br label %8
8: ; preds = %22, %3
%9 = load i32, i32* %7
%10 = sext i32 %9 to i64
%11 = load i64, i64* %6
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = load double*, double** %4
%15 = load i64, i64* %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = mul nsw i64 %15, %17
%19 = getelementptr inbounds double, double* %14, i64 %18
%20 = load i64, i64* %5
%21 = call i32 (double*, i64, ...) bitcast (i32 (...)* @print_ffArray to i32 (double*, i64, ...)*)(double* %19, i64 %20)
br label %22
22: ; preds = %13
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @print_ffMatrix(double* %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = mul nsw i64 %6, %1
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = tail call i32 (double*, i64, ...) bitcast (i32 (...)* @print_ffArray to i32 (double*, i64, ...)*)(double* %8, i64 %1)
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void do_stuff(int count) {
  int *ref = malloc(count * sizeof(int));
  free(ref);
}


x86 assembly (clang, -O0):
<do_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stuff>:
push   %rax
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @do_stuff(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @do_stuff(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = tail call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_file_clean(int /*<<< orphan*/, char *);
void file_clean(void) { do_file_clean(0, "file clean"); }


x86 assembly (clang, -O0):
<file_clean>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <do_file_clean@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_clean>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <do_file_clean@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"file clean\00"
define void @file_clean() {
%1 = call i32 @do_file_clean(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"file clean\00"
define void @file_clean() {
%1 = tail call i32 @do_file_clean(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int onpoints(int point, int *p, int n) {
  if (point <= n)
    return (*(p - 1 + point));
  else
    return (point);
}


x86 assembly (clang, -O0):
<onpoints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     112e <onpoints+0x2e>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    -0x4(%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <onpoints+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onpoints>:
mov    %edi,%eax
cmp    %edx,%edi
jg     110c <onpoints+0xc>
cltq
mov    -0x4(%rsi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @onpoints(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = getelementptr inbounds i32, i32* %1, i64 -1
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ %0, %3 ]
ret i32 %11
}
/* Variables and functions */
unsigned char copro_mc6809nc_read(unsigned int);
unsigned char get_memb(unsigned int addr) { return copro_mc6809nc_read(addr); }


x86 assembly (clang, -O0):
<get_memb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <copro_mc6809nc_read@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_memb>:
jmp    1030 <copro_mc6809nc_read@plt>

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

LLVM IR (-O2):
define zeroext i8 @get_memb(i32 %0) {
%2 = tail call zeroext i8 @copro_mc6809nc_read(i32 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void AddRoundKey(uint32_t *state, uint32_t *key) {
  int idx;
  for (idx = 0; idx < 4; idx++)
    state[idx] ^= key[idx];
}


x86 assembly (clang, -O0):
<AddRoundKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <AddRoundKey+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <AddRoundKey+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddRoundKey>:
mov    (%rsi),%eax
xor    %eax,(%rdi)
mov    0x4(%rsi),%eax
xor    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
xor    %eax,0x8(%rdi)
mov    0xc(%rsi),%eax
xor    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @AddRoundKey(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = xor i32 %9, %7
store i32 %10, i32* %8
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = xor i32 %14, %12
store i32 %15, i32* %13
%16 = getelementptr inbounds i32, i32* %1, i64 3
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %0, i64 3
%19 = load i32, i32* %18
%20 = xor i32 %19, %17
store i32 %20, i32* %18
ret void
}