Skip to content

Instantly share code, notes, and snippets.

@Themaister
Created March 20, 2011 14:27
Show Gist options
  • Save Themaister/878348 to your computer and use it in GitHub Desktop.
Save Themaister/878348 to your computer and use it in GitHub Desktop.
test.o: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
//clang-fails.c:
#include <stdio.h>
int main (void) {
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 28 sub $0x28,%esp
6: b8 c0 bd f0 ff mov $0xfff0bdc0,%eax
b: f2 0f 2a c0 cvtsi2sd %eax,%xmm0
f: b8 00 b8 17 fe mov $0xfe17b800,%eax
14: f3 0f 2a c8 cvtsi2ss %eax,%xmm1
18: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
float q = -32e6;
1f: f3 0f 11 4d f8 movss %xmm1,-0x8(%ebp)
printf("before.\n");
24: 89 e0 mov %esp,%eax
26: c7 00 00 00 00 00 movl $0x0,(%eax)
2c: f2 0f 11 45 f0 movsd %xmm0,-0x10(%ebp)
31: e8 fc ff ff ff call 32 <main+0x32>
if ( q > -1e6 ) {
36: f3 0f 10 45 f8 movss -0x8(%ebp),%xmm0
3b: f3 0f 5a c0 cvtss2sd %xmm0,%xmm0
3f: f2 0f 10 4d f0 movsd -0x10(%ebp),%xmm1
44: 66 0f 2e c1 ucomisd %xmm1,%xmm0
48: 89 45 ec mov %eax,-0x14(%ebp)
4b: 76 12 jbe 5f <main+0x5f>
printf("q > -1e6 is true\n");
4d: 89 e0 mov %esp,%eax
4f: c7 00 00 00 00 00 movl $0x0,(%eax)
55: e8 fc ff ff ff call 56 <main+0x56>
} else {
5a: 89 45 e8 mov %eax,-0x18(%ebp)
5d: eb 10 jmp 6f <main+0x6f>
printf("q > -1e6 is false\n");
5f: 89 e0 mov %esp,%eax
61: c7 00 20 00 00 00 movl $0x20,(%eax)
67: e8 fc ff ff ff call 68 <main+0x68>
6c: 89 45 e4 mov %eax,-0x1c(%ebp)
}
printf("after\n");
6f: 89 e0 mov %esp,%eax
71: c7 00 09 00 00 00 movl $0x9,(%eax)
77: e8 fc ff ff ff call 78 <main+0x78>
}
7c: 89 45 e0 mov %eax,-0x20(%ebp)
7f: 8b 45 fc mov -0x4(%ebp),%eax
82: 83 c4 28 add $0x28,%esp
85: 5d pop %ebp
86: c3 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment