xunge/DecIR huggingface dataset:
void pinmux_init_device_debugfs(struct dentry *devroot,
                                struct pinctrl_dev *pctldev) {}


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
%struct.pinctrl_dev = type opaque
define void @pinmux_init_device_debugfs(%struct.dentry* %0, %struct.pinctrl_dev* %1) {
%3 = alloca %struct.dentry*
%4 = alloca %struct.pinctrl_dev*
store %struct.dentry* %0, %struct.dentry** %3
store %struct.pinctrl_dev* %1, %struct.pinctrl_dev** %4
ret void
}

LLVM IR (-O2):
%struct.dentry = type opaque
%struct.pinctrl_dev = type opaque
define void @pinmux_init_device_debugfs(%struct.dentry* nocapture %0, %struct.pinctrl_dev* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void h_u32_to_be(uint8_t *buf, int val) {
  buf[0] = (uint8_t)(val >> 24);
  buf[1] = (uint8_t)(val >> 16);
  buf[2] = (uint8_t)(val >> 8);
  buf[3] = (uint8_t)(val >> 0);
}


x86 assembly (clang, -O0):
<h_u32_to_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_u32_to_be>:
mov    %esi,%eax
sar    $0x18,%eax
cltq
mov    %rax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rdi)
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,0x10(%rdi)
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @h_u32_to_be(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = ashr i32 %1, 16
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
%8 = ashr i32 %1, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %9, i64* %10
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int atoi(char const *);
int month2num(char const *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void buildymd(const char *dia, const char *mes, const char *ano, char *wdata) {
  int nmes;
  nmes = month2num(mes);
  sprintf(wdata, "%04d%02d%02d", atoi(ano), nmes + 1, atoi(dia));
}


x86 assembly (clang, -O0):
<buildymd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <month2num@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    %eax,%r8d
lea    0xe72(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildymd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <month2num@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
add    $0x1,%ebp
mov    %r15,%rdi
call   1040 <atoi@plt>
lea    0xe9a(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%04d%02d%02d\00"
define void @buildymd(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %6
%11 = call i32 @month2num(i8* %10)
store i32 %11, i32* %9
%12 = load i8*, i8** %8
%13 = load i8*, i8** %7
%14 = call i32 @atoi(i8* %13)
%15 = load i32, i32* %9
%16 = add nsw i32 %15, 1
%17 = load i8*, i8** %5
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%04d%02d%02d\00"
define void @buildymd(i8* nocapture %0, i8* %1, i8* nocapture %2, i8* nocapture writeonly %3) {
%5 = tail call i32 @month2num(i8* %1)
%6 = tail call i32 @atoi(i8* %2)
%7 = add nsw i32 %5, 1
%8 = tail call i32 @atoi(i8* %0)
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret void
}
int symbolic_index2(int a) {
  int x[2] = {1, 2};
  if (a < 0) {
    return x[a];
  }
  return 0;
}


x86 assembly (clang, -O0):
<symbolic_index2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112c <symbolic_index2+0x2c>
movslq -0x8(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <symbolic_index2+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbolic_index2>:
xor    %eax,%eax
test   %edi,%edi
js     1107 <symbolic_index2+0x7>
ret
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.symbolic_index2.x = [2 x i32] [i32 1, i32 2]
define i32 @symbolic_index2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@__const.symbolic_index2.x = [2 x i32] [i32 1, i32 2]
define i32 @symbolic_index2(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [2 x i32], [2 x i32]* @__const.symbolic_index2.x, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
double fabs(double const);
double mag(const double _z) { return fabs(_z); }


x86 assembly (clang, -O0):
<mag>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mag(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @mag(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ timer;
struct itimerval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ memset(struct itimerval *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int setitimer(int /*<<< orphan*/, struct itimerval *, int /*<<< orphan*/ *);
void ncore_timer_disable(void) {
  struct itimerval timer;
  memset(&timer, 0, sizeof(timer));
  if (setitimer(ITIMER_REAL, &timer, NULL) == -1) {
    perror("error calling setitimer()");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<ncore_timer_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <setitimer@plt>
cmp    $0xffffffff,%eax
jne    118d <ncore_timer_disable+0x4d>
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncore_timer_disable>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <setitimer@plt>
cmp    $0xffffffff,%eax
je     1177 <ncore_timer_disable+0x37>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@ITIMER_REAL = global i32 0
@.str = [26 x i8] c"error calling setitimer()\00"
define void @ncore_timer_disable() {
%1 = alloca %struct.itimerval
%2 = call i32 @memset(%struct.itimerval* %1, i32 0, i32 4)
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @setitimer(i32 %3, %struct.itimerval* %1, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@ITIMER_REAL = global i32 0
@.str = [26 x i8] c"error calling setitimer()\00"
define void @ncore_timer_disable() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = call i32 @memset(%struct.itimerval* %1, i32 0, i32 4)
%4 = load i32, i32* @ITIMER_REAL
%5 = call i32 @setitimer(i32 %4, %struct.itimerval* %1, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
ret void
}
/* Variables and functions */
int estPremier(long);
long random_numberC(int);
long generePQ() {
  long p = random_numberC(100);
  int boolean = 1;
  while (boolean) {
    if (estPremier(p) == 1) {
      boolean = 0;
    } else {
      p = random_numberC(100);
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<generePQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <random_numberC@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1178 <generePQ+0x58>
mov    -0x8(%rbp),%rdi
call   1040 <estPremier@plt>
cmp    $0x1,%eax
jne    1165 <generePQ+0x45>
movl   $0x0,-0xc(%rbp)
jmp    1173 <generePQ+0x53>
mov    $0x64,%edi
call   1030 <random_numberC@plt>
mov    %rax,-0x8(%rbp)
jmp    113d <generePQ+0x1d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generePQ>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <random_numberC@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <estPremier@plt>
cmp    $0x1,%eax
jne    1130 <generePQ+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @generePQ() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @random_numberC(i32 100)
%3 = tail call i32 @estPremier(i64 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %1
5: ; preds = %1
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void writeString(FILE *output, char *string) {
  fwrite(string, strlen(string), 1, output);
}


x86 assembly (clang, -O0):
<writeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

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

LLVM IR (-O2):
define void @writeString(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fwrite(i8* %1, i32 %3, i32 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int main() {
  char str[10];
  snprintf(str, 10, "%s", "abc");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
mov    $0xa,%esi
lea    0xed8(%rip),%rdx
lea    0xed4(%rip),%rcx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ min_aspect;
};
typedef TYPE_2__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_min_aspect_x(void *_p, int _v) {
  ((XSizeHints *)_p)->min_aspect.x = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XSizeHints_min_aspect_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void gdk_flush() {}


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

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

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

LLVM IR (-O2):
define void @gdk_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void loop() {
  static int count = 10000000;
  if (count <= 0)
    exit(0);
  count--;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jg     1128 <loop+0x18>
xor    %edi,%edi
call   1030 <exit@plt>
mov    0x2efa(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ef1(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
jle    1126 <loop+0x16>
add    $0xffffffff,%eax
mov    %eax,0x2f04(%rip)
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@loop.count = internal global i32 10000000
define void @loop() {
%1 = load i32, i32* @loop.count
%2 = icmp sle i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = load i32, i32* @loop.count
%7 = add nsw i32 %6, -1
store i32 %7, i32* @loop.count
ret void
}

LLVM IR (-O2):
@loop.count = internal unnamed_addr global i32 10000000
define void @loop() {
%1 = load i32, i32* @loop.count
%2 = icmp slt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = add nsw i32 %1, -1
store i32 %6, i32* @loop.count
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_ASCIIDigitLED(unsigned short digit_three, unsigned short digit_two,
                          unsigned short digit_one, unsigned short digit_zero) {
  char data[] = {164, digit_three, digit_two, digit_one, digit_zero};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_ASCIIDigitLED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movb   $0xa4,-0xd(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0xc(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0xb(%rbp)
mov    -0x6(%rbp),%ax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%ax
mov    %al,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_ASCIIDigitLED>:
push   %rax
movb   $0xa4,0x3(%rsp)
mov    %dil,0x4(%rsp)
mov    %sil,0x5(%rsp)
mov    %dl,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x3(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_ASCIIDigitLED(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca [5 x i8]
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
store i8 -92, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i16, i16* %5
%13 = trunc i16 %12 to i8
store i8 %13, i8* %11
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i16, i16* %6
%16 = trunc i16 %15 to i8
store i8 %16, i8* %14
%17 = getelementptr inbounds i8, i8* %14, i64 1
%18 = load i16, i16* %7
%19 = trunc i16 %18 to i8
store i8 %19, i8* %17
%20 = getelementptr inbounds i8, i8* %17, i64 1
%21 = load i16, i16* %8
%22 = trunc i16 %21 to i8
store i8 %22, i8* %20
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%24 = call i32 @SerialWriteString(i8* %23)
ret void
}

LLVM IR (-O2):
define void @iRobot_ASCIIDigitLED(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8 -92, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%8 = trunc i16 %0 to i8
store i8 %8, i8* %7
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
%10 = trunc i16 %1 to i8
store i8 %10, i8* %9
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
%12 = trunc i16 %2 to i8
store i8 %12, i8* %11
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
%14 = trunc i16 %3 to i8
store i8 %14, i8* %13
%15 = call i32 @SerialWriteString(i8* %6)
ret void
}
char address_register(int index) {
  switch (index) {
  case 0:
    return 'x';
  case 1:
    return 'y';
  case 2:
    return 'z';
  case 3:
    return 'w';
  default:
    break;
  }
  return '!';
}


x86 assembly (clang, -O0):
<address_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1150 <address_register+0x50>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x78,-0x1(%rbp)
jmp    1159 <address_register+0x59>
movb   $0x79,-0x1(%rbp)
jmp    1159 <address_register+0x59>
movb   $0x7a,-0x1(%rbp)
jmp    1159 <address_register+0x59>
movb   $0x77,-0x1(%rbp)
jmp    1159 <address_register+0x59>
jmp    1155 <address_register+0x55>
movb   $0x21,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<address_register>:
lea    0x0(,%rdi,8),%ecx
mov    $0x777a7978,%edx
shr    %cl,%edx
cmp    $0x4,%edi
mov    $0x21,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @address_register(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8 120, i8* %2
br label %11
6: ; preds = %1
store i8 121, i8* %2
br label %11
7: ; preds = %1
store i8 122, i8* %2
br label %11
8: ; preds = %1
store i8 119, i8* %2
br label %11
9: ; preds = %1
br label %10
10: ; preds = %9
store i8 33, i8* %2
br label %11
11: ; preds = %10, %8, %7, %6, %5
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @address_register(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = shl i32 %0, 3
%4 = lshr i32 2004515192, %3
%5 = trunc i32 %4 to i8
%6 = select i1 %2, i8 %5, i8 33
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void DefDriverProcedure(int32_t func) {}


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

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

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

LLVM IR (-O2):
define void @DefDriverProcedure(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __madvise(void *addr, size_t len, int advice) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__madvise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__madvise>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__madvise(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__madvise(i8* nocapture readnone %0, i64 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void test_fail(int rc) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @test_fail(i32 %0) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
void yy_1_SignatureChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_SignatureChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void utrace_print(void) { fprintf(stderr, "Backtrace is not available.\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Backtrace is not available.\0A\00"
define void @utrace_print() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Backtrace is not available.\0A\00"
define void @utrace_print() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, int);
double square(double x) { return pow(x, 2); }


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

x86 assembly (clang, -O2):
<square>:
mov    $0x2,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @square(double %0) {
%2 = tail call double @pow(double %0, i32 2)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Serial1Init(unsigned long, int);
int OpenCOM(int portnum, char *port_zstr) {
  unsigned long baud = 9600;
  portnum;
  port_zstr;
  Serial1Init(baud, 1);
  return 1;
}


x86 assembly (clang, -O0):
<OpenCOM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x2580,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <Serial1Init@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenCOM>:
push   %rax
mov    $0x2580,%edi
mov    $0x1,%esi
call   1030 <Serial1Init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OpenCOM(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
store i64 9600, i64* %5
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i32 @Serial1Init(i64 %8, i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @OpenCOM(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @Serial1Init(i64 9600, i32 1)
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int *, int /*<<< orphan*/ *, int);
void minipack_pack_float(void *ptr, float value, size_t *sz) {
  *sz = 5;
  uint8_t *buffer = ptr;
  uint32_t *value_ptr = (uint32_t *)&value;
  uint32_t bytes = htonl(*value_ptr);
  buffer[0] = 0xCA;
  buffer = buffer + 1;
  memcpy(buffer, &bytes, 4);
}


x86 assembly (clang, -O0):
<minipack_pack_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
movl   $0xca,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_float>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x5,(%rsi)
movd   %xmm0,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
movl   $0xca,(%rbx)
add    $0x4,%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @minipack_pack_float(i8* %0, float %1, i64* %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca i64*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %4
store float %1, float* %5
store i64* %2, i64** %6
%10 = load i64*, i64** %6
store i64 5, i64* %10
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %7
%13 = bitcast float* %5 to i32*
store i32* %13, i32** %8
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = call i32 @htonl(i32 %15)
store i32 %16, i32* %9
%17 = load i32*, i32** %7
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 202, i32* %18
%19 = load i32*, i32** %7
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32* %20, i32** %7
%21 = load i32*, i32** %7
%22 = call i32 @memcpy(i32* %21, i32* %9, i32 4)
ret void
}

LLVM IR (-O2):
define void @minipack_pack_float(i8* %0, float %1, i64* nocapture writeonly %2) {
%4 = alloca i32
store i64 5, i64* %2
%5 = bitcast i8* %0 to i32*
%6 = bitcast i32* %4 to i8*
%7 = bitcast float %1 to i32
%8 = tail call i32 @htonl(i32 %7)
store i32 %8, i32* %4
store i32 202, i32* %5
%9 = getelementptr inbounds i8, i8* %0, i64 4
%10 = bitcast i8* %9 to i32*
%11 = call i32 @memcpy(i32* %10, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "ls", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf_internal(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  return vsnprintf_internal(buf, size, fmt, args);
}


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

x86 assembly (clang, -O2):
<vsnprintf>:
jmp    1030 <vsnprintf_internal@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @vsnprintf_internal(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
unsigned rotate_left(unsigned x, int n) {
  int z_mask = -!n;
  unsigned left = x << n;
  unsigned right = x >> ((sizeof(unsigned) << 3) - n);
  return (z_mask & x) | (~z_mask & (left | right));
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
mov    -0x10(%rbp),%edx
or     -0x14(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = sub nsw i32 0, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = sub i64 32, %18
%20 = trunc i64 %19 to i32
%21 = lshr i32 %16, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = and i32 %22, %23
%25 = load i32, i32* %5
%26 = xor i32 %25, -1
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = or i32 %27, %28
%30 = and i32 %26, %29
%31 = or i32 %24, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
long atol(char const *);
long c_atol(const char *arg0) { return atol(arg0); }


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

x86 assembly (clang, -O2):
<c_atol>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i64 @c_atol(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi32_2(__m128i A, int B) { return _mm_srli_epi32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi32_2>:
jmp    1030 <_mm_srli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi32_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srli_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ soap_set_logfile(struct soap *, int, char const *);
void soap_set_test_logfile(struct soap *soap, const char *logfile) {
  soap_set_logfile(soap, 2, logfile);
}


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

x86 assembly (clang, -O2):
<soap_set_test_logfile>:
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <soap_set_logfile@plt>

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

LLVM IR (-O2):
%struct.soap = type { i32 }
define void @soap_set_test_logfile(%struct.soap* %0, i8* %1) {
%3 = tail call i32 @soap_set_logfile(%struct.soap* %0, i32 2, i8* %1)
ret void
}
void payloadDestructorNOP(void *payload) { return; }


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

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

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

LLVM IR (-O2):
define void @payloadDestructorNOP(i8* nocapture %0) {
ret void
}
void asc_socket_core_init(void) { (void)0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send(int /*<<< orphan*/);
void send_block(const uint8_t *data, const uint32_t size) {
  uint32_t cnt = size;
  while (cnt--)
    send(*(data++));
}


x86 assembly (clang, -O0):
<send_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1154 <send_block+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <send@plt>
jmp    1125 <send_block+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_block>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1142 <send_block+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <send@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <send_block+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @send_block(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 @send(i32 %9)
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
int add(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int openme_init(char *, char *, char *, int);
extern int OPENME_INIT_F(char *env_use, char *env_plugins, char *plugin_names,
                         int force_use) {
  return openme_init(env_use, env_plugins, plugin_names, force_use);
}


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

x86 assembly (clang, -O2):
<OPENME_INIT_F>:
jmp    1030 <openme_init@plt>

LLVM IR (-O0):
define i32 @OPENME_INIT_F(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @openme_init(i8* %9, i8* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @OPENME_INIT_F(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @openme_init(i8* %0, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x = 1, y = 0, z = 5;
  int a = x && y && z++;
  printf("%d", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     115f <main+0x4f>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     115f <main+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void SSIIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ulInt = (ulBase == 0x40008000) ? 23 : 50;
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<SSIIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x32,%eax
mov    $0x17,%ecx
cmp    $0x40008000,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntRegister>:
push   %rbx
cmp    $0x40008000,%rdi
mov    $0x17,%eax
mov    $0x32,%ebx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @SSIIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1073774592
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 23, i32 50
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load void ()*, void ()** %4
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i64 %11, void (...)* %13)
%15 = load i64, i64* %5
%16 = call i32 @IntEnable(i64 %15)
ret void
}

LLVM IR (-O2):
define void @SSIIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1073774592
%4 = select i1 %3, i64 23, i64 50
%5 = bitcast void ()* %1 to void (...)*
%6 = tail call i32 @IntRegister(i64 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i64 %4)
ret void
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ memset(char *, char, int);
size_t strlen(char *);
int test14(void) {
  char *p = alloca(100);
  size_t ret;
  memset(p, 'a', 100);
  p[100 - 1] = 0;
  ret = strlen(p);
  ;
  return ret;
}


x86 assembly (clang, -O0):
<test14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x61,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0x63(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test14>:
push   %rbx
mov    $0x64,%edi
call   1050 <alloca@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x61,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x0,0x63(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @test14() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* @alloca(i32 100)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @memset(i8* %4, i8 signext 97, i32 100)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 99
store i8 0, i8* %7
%8 = load i8*, i8** %1
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test14() {
%1 = tail call i8* @alloca(i32 100)
%2 = tail call i32 @memset(i8* %1, i8 signext 97, i32 100)
%3 = getelementptr inbounds i8, i8* %1, i64 99
store i8 0, i8* %3
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = trunc i64 %4 to i32
ret i32 %5
}