xunge/DecIR huggingface dataset:
/* Variables and functions */
int decrement(int);
int increment(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  puts("Inserisci un numero: ");
  scanf("%d", &n);
  n = decrement(increment(increment(n)));
  printf("Risultato: %d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <increment@plt>
mov    %eax,%edi
call   1040 <increment@plt>
mov    %eax,%edi
call   1050 <decrement@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <increment@plt>
mov    %eax,%edi
call   1040 <increment@plt>
mov    %eax,%edi
call   1050 <decrement@plt>
mov    %eax,0x4(%rsp)
lea    0xe89(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Inserisci un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Risultato: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @increment(i32 %5)
%7 = call i32 @increment(i32 %6)
%8 = call i32 @decrement(i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Inserisci un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Risultato: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @increment(i32 %5)
%7 = call i32 @increment(i32 %6)
%8 = call i32 @decrement(i32 %7)
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
double test_scalbn(double x, int y) { return __builtin_scalbn(x, y); }


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

x86 assembly (clang, -O2):
<test_scalbn>:
jmp    1030 <scalbn@plt>

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

LLVM IR (-O2):
define double @test_scalbn(double %0, i32 %1) {
%3 = tail call double @scalbn(double %0, i32 %1)
ret double %3
}
void on_sigchld(int sig) {}


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

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

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

LLVM IR (-O2):
define void @on_sigchld(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void copy64(uint32_t *dst, uint32_t *src) {
  dst[0] = src[0];
  dst[1] = src[1];
}


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

x86 assembly (clang, -O2):
<copy64>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @copy64(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @copy64(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
void Atm128AlarmAsyncP$0$Compare$start(void) {
  HplAtm128Timer0AsyncP$Compare$start();
}


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

x86 assembly (clang, -O2):
<Atm128AlarmAsyncP$0$Compare$start>:
xor    %eax,%eax
jmp    1030 <HplAtm128Timer0AsyncP$Compare$start@plt>

LLVM IR (-O0):
define void @"Atm128AlarmAsyncP$0$Compare$start"() {
%1 = call i32 (...) @"HplAtm128Timer0AsyncP$Compare$start"()
ret void
}

LLVM IR (-O2):
define void @"Atm128AlarmAsyncP$0$Compare$start"() {
%1 = tail call i32 (...) @"HplAtm128Timer0AsyncP$Compare$start"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
int main() {
  uart_puts("Hello world!\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <uart_puts@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void dummy_proc_6(int a0, int a1, int a2, int a3, int a4, int a5) { return; }


x86 assembly (clang, -O0):
<dummy_proc_6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dummy_proc_6(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
signed short t7(signed short x) { return --x; }


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @t7(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = add i16 %3, -1
store i16 %4, i16* %2
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @t7(i16 signext %0) {
%2 = add i16 %0, -1
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ TransformAlarmC__1__AlarmFrom__stop();
void TransformAlarmC__1__Alarm__stop(void) {
  TransformAlarmC__1__AlarmFrom__stop();
}


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

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

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

LLVM IR (-O2):
define void @TransformAlarmC__1__Alarm__stop() {
%1 = tail call i32 (...) @TransformAlarmC__1__AlarmFrom__stop()
ret void
}
int f2(int x, int y) {
  return (~x & (-0x7fffffff - 1)) == (~y & (-0x7fffffff - 1));
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0x80000000,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0x80000000,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = xor i32 %5, -1
%7 = and i32 %6, -2147483648
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = and i32 %9, -2147483648
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ nasm_error(int, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *nasm_strdup(const char *s) {
  char *p;
  int size = strlen(s) + 1;
  p = malloc(size);
  if (!p)
    nasm_error(0x00000002 | 0x00000010, "out of memory");
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<nasm_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1183 <nasm_strdup+0x43>
mov    $0x12,%edi
lea    0xe82(%rip),%rsi
call   1060 <nasm_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116d <nasm_strdup+0x2d>
lea    0xe9d(%rip),%rsi
mov    $0x12,%edi
call   1060 <nasm_error@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @nasm_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @nasm_error(i32 18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ NID_commonName;
int /*<<< orphan*/ NID_pkcs9_emailAddress;
int set_cn(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/, char *, int /*<<< orphan*/);
int set_email_and_cn(X509 *crt, const char *name) {
  return set_cn(crt, NID_pkcs9_emailAddress, name, NID_commonName,
                "www.example.org", 0);
}


x86 assembly (clang, -O0):
<set_email_and_cn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    0x2ea0(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%r8
xor    %r9d,%r9d
call   1030 <set_cn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_email_and_cn>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
lea    0xed4(%rip),%r8
xor    %r9d,%r9d
jmp    1030 <set_cn@plt>

LLVM IR (-O0):
@NID_pkcs9_emailAddress = global i32 0
@NID_commonName = global i32 0
@.str = [16 x i8] c"www.example.org\00"
define i32 @set_email_and_cn(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @NID_pkcs9_emailAddress
%7 = load i8*, i8** %4
%8 = load i32, i32* @NID_commonName
%9 = call i32 @set_cn(i32* %5, i32 %6, i8* %7, i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %9
}

LLVM IR (-O2):
@NID_pkcs9_emailAddress = global i32 0
@NID_commonName = global i32 0
@.str = [16 x i8] c"www.example.org\00"
define i32 @set_email_and_cn(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_pkcs9_emailAddress
%4 = load i32, i32* @NID_commonName
%5 = tail call i32 @set_cn(i32* %0, i32 %3, i8* %1, i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ I2C_IF_ReadFrom(int, unsigned char *, int, unsigned char *, int);
int /*<<< orphan*/ Report(char *);
int GetRegisterValue(unsigned char ucRegAddr, unsigned char *pucRegValue) {
  if (I2C_IF_ReadFrom(0x18, &ucRegAddr, 1, pucRegValue, 1) != 0) {
    Report("I2C readfrom failed\n\r");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetRegisterValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x18,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%r8d
mov    %r8d,%edx
call   1030 <I2C_IF_ReadFrom@plt>
cmp    $0x0,%rax
je     116f <GetRegisterValue+0x4f>
lea    0xea2(%rip),%rdi
call   1040 <Report@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <GetRegisterValue+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRegisterValue>:
push   %rax
mov    %rsi,%rcx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x18,%edi
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <I2C_IF_ReadFrom@plt>
test   %rax,%rax
je     115b <GetRegisterValue+0x3b>
lea    0xeb1(%rip),%rdi
call   1040 <Report@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"I2C readfrom failed\0A\0D\00"
define i32 @GetRegisterValue(i8 zeroext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @I2C_IF_ReadFrom(i32 24, i8* %4, i32 1, i8* %6, i32 1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @Report(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [22 x i8] c"I2C readfrom failed\0A\0D\00"
define i32 @GetRegisterValue(i8 zeroext %0, i8* %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i64 @I2C_IF_ReadFrom(i32 24, i8* %3, i32 1, i8* %1, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @Report(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct tcphdr {
  int /*<<< orphan*/ ack_seq;
};

/* Variables and functions */
uint32_t tcphdr_ack_seq(struct tcphdr *h) { return h->ack_seq; }


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

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

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

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_ack_seq(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
signed int default_hash(void *ptr, signed int size) {
  return ((signed int)ptr % size);
}


x86 assembly (clang, -O0):
<default_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_hash>:
mov    %rdi,%rax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @default_hash(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 = ptrtoint i8* %5 to i32
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @default_hash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = srem i32 %4, %1
ret i32 %5
}
int test_imm_9Fuint16_mem(unsigned short *val) {
  return ((*val) & (0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fuint16_mem>:
testb  $0x9f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 159
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ some_other_func();
int main() {
  some_other_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @some_other_func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_immediate(void) { output_with_tab("ld hl,"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"ld hl,\00"
define void @gen_immediate() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld hl,\00"
define void @gen_immediate() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "\x1b[33m"
                  "Usage: "
                  "\x1b[0m");
  fprintf(stdout, "%s [options] input file\n\n", "jsoncat");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee0(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"\1B[33mUsage: \1B[0m\00"
@.str.1 = [26 x i8] c"%s [options] input file\0A\0A\00"
@.str.2 = [8 x i8] c"jsoncat\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"\1B[33mUsage: \1B[0m\00"
@.str.1 = [26 x i8] c"%s [options] input file\0A\0A\00"
@.str.2 = [8 x i8] c"jsoncat\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_imm_CDuint16_mem(unsigned short *val) {
  return ((*val) & (0xCD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CDuint16_mem>:
testb  $0xcd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 205
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int conditiontest(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int data1 = 10;
  int data2 = 30;
  printf("The result is %d\n", conditiontest(data1, data2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <conditiontest@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x1e,%esi
call   1040 <conditiontest@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 30, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @conditiontest(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @conditiontest(i32 10, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float frexpf(float x, int *exp) { return 0.0; }


x86 assembly (clang, -O0):
<frexpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @frexpf(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @frexpf(float %0, i32* nocapture readnone %1) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void ExitProgram(char message[255]) {
  endwin();
  printf("%s\n", message);
  exit(0);
}


x86 assembly (clang, -O0):
<ExitProgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <endwin@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ExitProgram>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @ExitProgram(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @endwin()
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ExitProgram(i8* %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float INFINITY;
bool is_negative_zerof(float x) { return (x == 0.0f && 1.0f / x == -INFINITY); }


x86 assembly (clang, -O0):
<is_negative_zerof>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    1158 <is_negative_zerof+0x58>
jp     1158 <is_negative_zerof+0x58>
movss  0xed3(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
movss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_negative_zerof>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1135 <is_negative_zerof+0x35>
jp     1135 <is_negative_zerof+0x35>
movss  0xeee(%rip),%xmm1
mov    0x2ecf(%rip),%rax
movss  (%rax),%xmm2
xorps  0xeec(%rip),%xmm2
divss  %xmm0,%xmm1
cmpeqss %xmm1,%xmm2
movd   %xmm2,%eax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
define i32 @is_negative_zerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load float, float* %2
%7 = fdiv float 1.000000e+00, %6
%8 = load float, float* @INFINITY
%9 = fneg float %8
%10 = fcmp oeq float %7, %9
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
define i32 @is_negative_zerof(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fdiv float 1.000000e+00, %0
%5 = load float, float* @INFINITY
%6 = fneg float %5
%7 = fcmp oeq float %4, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
int get_num_trailing_zeros_in_factorial_v3(int num) {
  int num_trailing_zeros, multiple_five_index;
  if (num <= 0) {
    return (0);
  }
  num_trailing_zeros = 0;
  multiple_five_index = 5;
  while (multiple_five_index <= num) {
    num_trailing_zeros += (num / multiple_five_index);
    multiple_five_index *= 5;
  }
  return (num_trailing_zeros);
}


x86 assembly (clang, -O0):
<get_num_trailing_zeros_in_factorial_v3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <get_num_trailing_zeros_in_factorial_v3+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1156 <get_num_trailing_zeros_in_factorial_v3+0x56>
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1150 <get_num_trailing_zeros_in_factorial_v3+0x50>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x5,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <get_num_trailing_zeros_in_factorial_v3+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_trailing_zeros_in_factorial_v3>:
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     111e <get_num_trailing_zeros_in_factorial_v3+0x1e>
xor    %ecx,%ecx
mov    $0x5,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
add    %eax,%ecx
lea    (%rsi,%rsi,4),%esi
cmp    %edi,%esi
jle    1110 <get_num_trailing_zeros_in_factorial_v3+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_num_trailing_zeros_in_factorial_v3(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 5, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %0, %4
%7 = add nsw i32 %6, %5
%8 = mul nsw i32 %4, 5
%9 = icmp sgt i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num, digit;
  scanf("%d", &num);
  scanf("%d", &digit);
  printf("%d", num | (1 << digit));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%al
bts    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = shl nuw i32 1, %8
%10 = or i32 %9, %7
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
int add(int n, int m) {
  int r;
  r = n + m;
  return r;
}


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
mov    %eax,-0xc(%rbp)
mov    -0xc(%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
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned long get_milliseconds();
void update() { unsigned long nowMsec = get_milliseconds(); }


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

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

LLVM IR (-O0):
define void @update() {
%1 = alloca i64
%2 = call i64 (...) @get_milliseconds()
store i64 %2, i64* %1
ret void
}

LLVM IR (-O2):
define void @update() {
%1 = tail call i64 (...) @get_milliseconds()
ret void
}
int _test_tune_request(void *buffer) {
  return ((unsigned char *)buffer)[0] == 0xf6;
}


x86 assembly (clang, -O0):
<_test_tune_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xf6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_tune_request>:
xor    %eax,%eax
cmpb   $0xf6,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @_test_tune_request(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 246
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_test_tune_request(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PIC_remap(int, int);
void platform_intr_init(void) { PIC_remap(32, 40); }


x86 assembly (clang, -O0):
<platform_intr_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x28,%esi
call   1030 <PIC_remap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_intr_init>:
mov    $0x20,%edi
mov    $0x28,%esi
jmp    1030 <PIC_remap@plt>

LLVM IR (-O0):
define void @platform_intr_init() {
%1 = call i32 @PIC_remap(i32 32, i32 40)
ret void
}

LLVM IR (-O2):
define void @platform_intr_init() {
%1 = tail call i32 @PIC_remap(i32 32, i32 40)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Secret_Key_Packet(int);
extern void Secret_Subkey_Packet(int len) { Secret_Key_Packet(len); }


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

x86 assembly (clang, -O2):
<Secret_Subkey_Packet>:
jmp    1030 <Secret_Key_Packet@plt>

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

LLVM IR (-O2):
define void @Secret_Subkey_Packet(i32 %0) {
%2 = tail call i32 @Secret_Key_Packet(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ui_init_corecmds();
int /*<<< orphan*/ ui_init_cpu1cmds();
int /*<<< orphan*/ ui_init_resetcmds();
int /*<<< orphan*/ ui_init_soccmds();
int /*<<< orphan*/ ui_init_swarmcmds();
int /*<<< orphan*/ ui_init_tempsensorcmds();
int /*<<< orphan*/ ui_init_testcmds();
int /*<<< orphan*/ ui_init_toyclockcmds();
void board_final_init(void) {
  ui_init_cpu1cmds();
  ui_init_swarmcmds();
  ui_init_corecmds();
  ui_init_soccmds();
  ui_init_testcmds();
  ui_init_resetcmds();
  ui_init_tempsensorcmds();
  ui_init_toyclockcmds();
}


x86 assembly (clang, -O0):
<board_final_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ui_init_cpu1cmds@plt>
mov    $0x0,%al
call   1060 <ui_init_swarmcmds@plt>
mov    $0x0,%al
call   1050 <ui_init_corecmds@plt>
mov    $0x0,%al
call   1080 <ui_init_soccmds@plt>
mov    $0x0,%al
call   1070 <ui_init_testcmds@plt>
mov    $0x0,%al
call   10a0 <ui_init_resetcmds@plt>
mov    $0x0,%al
call   1030 <ui_init_tempsensorcmds@plt>
mov    $0x0,%al
call   1090 <ui_init_toyclockcmds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_final_init>:
push   %rax
xor    %eax,%eax
call   1040 <ui_init_cpu1cmds@plt>
xor    %eax,%eax
call   1060 <ui_init_swarmcmds@plt>
xor    %eax,%eax
call   1050 <ui_init_corecmds@plt>
xor    %eax,%eax
call   1080 <ui_init_soccmds@plt>
xor    %eax,%eax
call   1070 <ui_init_testcmds@plt>
xor    %eax,%eax
call   10a0 <ui_init_resetcmds@plt>
xor    %eax,%eax
call   1030 <ui_init_tempsensorcmds@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <ui_init_toyclockcmds@plt>

LLVM IR (-O0):
define void @board_final_init() {
%1 = call i32 (...) @ui_init_cpu1cmds()
%2 = call i32 (...) @ui_init_swarmcmds()
%3 = call i32 (...) @ui_init_corecmds()
%4 = call i32 (...) @ui_init_soccmds()
%5 = call i32 (...) @ui_init_testcmds()
%6 = call i32 (...) @ui_init_resetcmds()
%7 = call i32 (...) @ui_init_tempsensorcmds()
%8 = call i32 (...) @ui_init_toyclockcmds()
ret void
}

LLVM IR (-O2):
define void @board_final_init() {
%1 = tail call i32 (...) @ui_init_cpu1cmds()
%2 = tail call i32 (...) @ui_init_swarmcmds()
%3 = tail call i32 (...) @ui_init_corecmds()
%4 = tail call i32 (...) @ui_init_soccmds()
%5 = tail call i32 (...) @ui_init_testcmds()
%6 = tail call i32 (...) @ui_init_resetcmds()
%7 = tail call i32 (...) @ui_init_tempsensorcmds()
%8 = tail call i32 (...) @ui_init_toyclockcmds()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ h();
void g(int a) {
  f();
  h();
}


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

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

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

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @h()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigalrm(int signo) { printf("SIGALRM received\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"SIGALRM received\0A\00"
define void @sigalrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"SIGALRM received\00"
define void @sigalrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void sounder(int onOrOff, int msec) {}


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

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

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

LLVM IR (-O2):
define void @sounder(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("The number you entered was %s", number % 2 == 0 ? "even" : "odd");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xedc(%rip),%rsi
lea    0xed0(%rip),%rax
cmp    $0x0,%edx
cmove  %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xee3(%rip),%rax
lea    0xee1(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"The number you entered was %s\00"
@.str.2 = [5 x i8] c"even\00"
@.str.3 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"The number you entered was %s\00"
@.str.2 = [5 x i8] c"even\00"
@.str.3 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_CARDINAL;
int x_get_property_nr(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int, unsigned long *, int);
int x_get_cardinal_property_nr(Window window, Atom property,
                               unsigned long *prop_ret, int nr) {
  return x_get_property_nr(window, XA_CARDINAL, property, sizeof(unsigned long),
                           prop_ret, nr);
}


x86 assembly (clang, -O0):
<x_get_cardinal_property_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x8,%ecx
call   1030 <x_get_property_nr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_get_cardinal_property_nr>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%ecx
jmp    1030 <x_get_property_nr@plt>

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

LLVM IR (-O2):
@XA_CARDINAL = global i32 0
define i32 @x_get_cardinal_property_nr(i32 %0, i32 %1, i64* %2, i32 %3) {
%5 = load i32, i32* @XA_CARDINAL
%6 = tail call i32 @x_get_property_nr(i32 %0, i32 %5, i32 %1, i32 8, i64* %2, i32 %3)
ret i32 %6
}
void pwd() {}


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

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

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

LLVM IR (-O2):
define void @pwd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void logging_close(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @logging_close() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ L_trans(int /*<<< orphan*/);
int /*<<< orphan*/ s_substitute(int /*<<< orphan*/);
uint32_t T_trans(uint32_t x) { return (L_trans(s_substitute(x))); }


x86 assembly (clang, -O0):
<T_trans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <s_substitute@plt>
mov    %eax,%edi
call   1030 <L_trans@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @T_trans(i32 %0) {
%2 = tail call i32 @s_substitute(i32 %0)
%3 = tail call i32 @L_trans(i32 %2)
ret i32 %3
}